void win_timerset_timerservice_change(BOOL update) { UINT8 action; TEXT_FIELD *txt; MULTISEL *msel; UINT16 ch_idx, ch_cnt; TIMER_SET_CONTENT *settimer; P_NODE p_node; settimer = &timer_set; if (TIMER_MODE == TIMER_MODE_OFF) action = C_ATTR_INACTIVE; else { if (TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) action = C_ATTR_INACTIVE; else action = C_ATTR_ACTIVE; } /* TIMER service information: message or channel */ txt = &timer_txt_serviceinfo; msel = &timer_msel_serviceinfo; if (TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) { /* TIMER_SERVICE_SMG */ OSD_SetMultiselSelType(msel, STRING_ID); OSD_SetMultiselCount(msel, 3); OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id); if (settimer->wakeup_message >= 3) settimer->wakeup_message = 0; OSD_SetMultiselSel(msel, settimer->wakeup_message); } else { //modified by Robin if (get_prog_by_id(settimer->wakeup_channel, &p_node) == DB_SUCCES) ch_idx = get_prog_pos(settimer->wakeup_channel); else ch_idx = sys_data_get_cur_group_cur_mode_channel(); ch_cnt = get_prog_num(VIEW_ALL | settimer->wakeup_chan_mode, 0); OSD_SetMultiselSelType(msel, STRING_PROC); OSD_SetMultiselCount(msel, ch_cnt); OSD_SetMultiselSel(msel, ch_idx); } OSD_SetTextFieldContent(txt, STRING_ID, (UINT32)TimerServiceTxtStr_id[TIMER_SERVICE_TYPE]); if (update) OSD_DrawObject((POBJECT_HEAD) &timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL); set_container_active(&timer_con_duration, action); if (update) OSD_DrawObject((POBJECT_HEAD) &timer_con_duration, C_UPDATE_ALL); }
void win_timerset_timerserviceinfo_change(BOOL update,UINT16 sel) { MULTISEL *msel; TIMER_SET_CONTENT* settimer; P_NODE p_node; UINT16 ch_idx,ch_cnt; settimer = &timer_set; msel = &timer_msel_serviceinfo; if(TIMER_SERVICE_TYPE == TIMER_SERVICE_MESSAGE) { OSD_SetMultiselSelType(msel,STRING_ID); OSD_SetMultiselCount(msel,3); OSD_SetMultiselSelTable(msel, (void*)WakeupMessageStr_id); if(sel >=3) sel = 0; settimer->wakeup_message = sel; OSD_SetMultiselSel(msel,settimer->wakeup_message); } else { if(get_prog_at(sel,&p_node) == DB_SUCCES) ch_idx = sel; else { ch_idx = sel = 0; get_prog_at(sel,&p_node); } settimer->wakeup_channel = p_node.prog_id; ch_cnt = get_prog_num(VIEW_ALL | settimer->wakeup_chan_mode, 0); OSD_SetMultiselSelType(msel,STRING_PROC); OSD_SetMultiselCount(msel,ch_cnt); OSD_SetMultiselSel(msel, ch_idx); } if(update) OSD_DrawObject((POBJECT_HEAD)&timer_con_serviceinfo, C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL); }
static void win_pvod_load_prog_info() { UINT16 prog_count; UINT8 i; char string[MAX_STRING_LEN]; FILE *pFileSrc=NULL; char *buf=NULL; int FileLen; SchduleProg prog; int ret; if(pvod_prog_name != NULL) { FREE(pvod_prog_name); } #if 0 pFileSrc = fopen(xml_path,"rb"); if(pFileSrc==NULL) { OSD_SetMultiselSelType(&pvod_sel_prog_name,STRING_PROC); return; } fseek( pFileSrc, 0, SEEK_END ); FileLen = ftell( pFileSrc ); buf = (char*)MALLOC(FileLen*sizeof(char)); if(buf==NULL) { ASSERT(0); } fseek( pFileSrc, 0, SEEK_SET); fread(buf, 1, FileLen,pFileSrc); if(parse_xml_for_CTI(buf,FileLen)==RET_FAILURE) { return; } Set_first_Prog_for_CTI(); prog_count = Get_Prog_Count_for_CTI(); pvod_prog_name = (char**)MALLOC(sizeof(char*)*prog_count); Get_Prog_Attributes_for_CTI(&prog); for(i=0; i<prog_count; i++) { pvod_prog_name[i] = (char*)MALLOC(MAX_STRING_LEN*sizeof(char)); if(pvod_prog_name[i] == NULL) ASSERT(0); } for(i=0; i<prog_count; i++) { Get_Prog_Attributes_for_CTI(&prog); pvod_prog_name[i] = (char*)MALLOC(MAX_STRING_LEN*sizeof(char)); STRCPY(pvod_prog_name[i],prog.progGID); Set_next_Prog_for_CTI(); //sprintf(string,"123-test-prog-%d",i+1); //STRCPY(pvod_prog_name[i],string);//test } #endif pvod_prog_name = (char**)MALLOC(sizeof(char*)*1); pvod_prog_name[0] = MALLOC(MAX_STRING_LEN*sizeof(char)); STRCPY(pvod_prog_name[0],"322-121-PvodV1.0"); OSD_SetMultiselSelType(&pvod_sel_prog_name,STRING_ANSI); OSD_SetMultiselSelTable(&pvod_sel_prog_name,pvod_prog_name); OSD_SetMultiselCount(&pvod_sel_prog_name, 1); OSD_SetMultiselSel(&pvod_sel_prog_name,0); return; }