Пример #1
0
static void win_antcnt_save_setting(void)
{
	SYSTEM_DATA* sys_data;
	MULTISEL* msel;
	UINT32 antenna_connect_type,tuner_lnb_type[2],i,n;
	S_NODE s_node;
	UINT8 back_saved;
	win_popup_choice_t choice;
	
	sys_data = sys_data_get();

	/* Antenna connect */
	msel = antcnt_msels[0];
	antenna_connect_type = msel->nSel;
	
	/* LNB1 */
	msel = antcnt_msels[1];
	tuner_lnb_type[0] = msel->nSel;
		
	/* LNB2 */
	msel = antcnt_msels[2];
	tuner_lnb_type[1] = msel->nSel;

#if 0
	if(sys_data->antenna_connect_type != antenna_connect_type
		&& ( antenna_connect_type == ANTENNA_CONNECT_SINGLE
			|| sys_data->antenna_connect_type == ANTENNA_CONNECT_SINGLE) )
	{
		win_compopup_init(WIN_POPUP_TYPE_OKNO);
		win_compopup_set_msg("This change will delete all channels, continue?",NULL,0);
		choice = win_compopup_open_ext(&back_saved);		
		if(choice != WIN_POP_CHOICE_YES)
			return;
		
		n = get_sat_num(VIEW_ALL);
		recreate_sat_view(VIEW_ALL,0);
		for(i=0;i<n;i++)
		{ 
			get_sat_at(i,VIEW_ALL,&s_node);
			if(s_node.tuner1_valid != 0 || s_node.tuner2_valid!=0)
			{
				s_node.tuner1_valid = s_node.tuner2_valid = 0;
				modify_sat(s_node.sat_id,&s_node);
			} 		
		}
		update_data();

		recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE ,0);
		for(i=0;i<n;i++)
		{ 
			get_sat_at(i,VIEW_ALL,&s_node);
			del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
		}
		update_data();
		
		sys_data_check_channel_groups();
	}
#endif

	sys_data->antenna_connect_type = antenna_connect_type;	
    UINT32 lnb_type,lnb_freq1,lnb_freq2;

    get_lnb_type_setting((get_universal_lnb_index()+1),&lnb_type,&lnb_freq1,&lnb_freq2);
    for(i=0;i<2;i++)
    {
        if(sys_data->tuner_lnb_type[i] != tuner_lnb_type[i])
        {
            sys_data->tuner_lnb_type[i] = tuner_lnb_type[i];
            sys_data->tuner_lnb_antenna[i].motor_type = LNB_MOTOR_DISEQC12;
            sys_data->tuner_lnb_antenna[i].lnb_type = lnb_type;
            sys_data->tuner_lnb_antenna[i].lnb_low  = lnb_freq1;
            sys_data->tuner_lnb_antenna[i].lnb_high = lnb_freq2;            
        }
    }

	sys_data->tuner_lnb_type[0] = tuner_lnb_type[0];
	sys_data->tuner_lnb_type[1] = tuner_lnb_type[1];	

	set_chchg_local_postion();//lib_nimng_init(antenna_connect_type);

}
Пример #2
0
static PRESULT atnsetm_item_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 i,n;
	S_NODE s_node;
	POBJECT_HEAD submenu;
	BOOL b;
	
	bID = OSD_GetObjID(pObj);
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			if(bID == MOTORSET_ID || bID == LIMIT_SETUP)
			{
				b = win_atnsetm_check_save_motor_antenna_setting();
				if(!b)
				{
					win_compopup_init(WIN_POPUP_TYPE_OK);
					win_compopup_set_msg(NULL, NULL, RS_MSG_OUT_RANGE);
					win_compopup_open_ext(&back_saved);
					ret = PROC_LOOP;
					break;
				}
			}
			
				
			if(bID == RESETPOS_ID)
			{
				win_compopup_init(WIN_POPUP_TYPE_OKNO);
				win_compopup_set_msg("Are you sure to clear set satellite positions of this tuner? ", NULL, 0);
				//choice = win_compopup_open_ext(&back_saved);
				choice = win_compopup_open_enh((POBJECT_HEAD)&g_win_antenna_set_motor, 1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);

				if(choice != WIN_POP_CHOICE_YES)
					break;

				/* Reset all satellite's position of current tuner to 0*/				
				n = get_sat_num(VIEW_ALL);
				recreate_sat_view(VIEW_ALL,0);
				for(i=0;i<n;i++)
				{ 
					get_sat_at(i,VIEW_ALL,&s_node);

					if( (antset_cur_tuner == 0 && s_node.position!= 0)
						|| (antset_cur_tuner == 10 && s_node.tuner2_antena.position!= 0) )
					{
						if(antset_cur_tuner == 0)
							s_node.position = 0;
						else
							s_node.tuner2_antena.position = 0;	
						modify_sat(s_node.sat_id,&s_node);							
					}
				}
				update_data();
			}
			else if(bID == MOTORSET_ID)
			{
				submenu = (POBJECT_HEAD)&g_win_motorset;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
					
			}
			else if(bID == LIMIT_SETUP)
			{
				submenu = (POBJECT_HEAD)&g_win_motor_limitsetup;
				if(OSD_ObjOpen(submenu, MENU_OPEN_TYPE_MENU | bID) != PROC_LEAVE)
					menu_stack_push(submenu);					
			}
		}
	}

	return ret;
}
Пример #3
0
static void
remove_data(grn_id record_id, unsigned int section, const gchar *name)
{
    update_data(record_id, section, name, NULL);
}
Пример #4
0
static PRESULT atnsetf_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT32 sel;
	UINT8 bID;
 	char str[30];
    UINT16 * Uni_str;
    UINT8* pstr;
	SYSTEM_DATA* sys_data;
	POBJECT_HEAD other_antset_menu,item;
	S_NODE s_node;
	UINT16 cur_idx;
	COM_POP_LIST_TYPE_T list_type;
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;
    MULTISEL* msel;

	sys_data = sys_data_get();

	bID = OSD_GetObjID(pObj);

	switch(event)
	{
	case EVN_PRE_CHANGE:
		sel = *((UINT32*)param1);
		if(bID == TUNER_ID)
		{
			if(TUNER_CNT < 2)
				break;
			
			/* Check tuner : sel has selected satellite or not.*/
			if(get_tuner_sat_cnt(sel)  == 0)
			{
				UINT8 back_saved;
				win_compopup_init(WIN_POPUP_TYPE_OK);
				win_compopup_set_msg(NULL,NULL, RS_TUNER_HAS_NO_SATE_SEL);
				win_compopup_open_ext(&back_saved);
				antset_cur_tuner = (sel == 0)? 1: 0;
				win_atnsetf_load_sat_cnt(FALSE);
				ret = PROC_LOOP;
			}
			else
			{
				antset_cur_tuner = sel;
				cur_tuner_idx = antset_cur_tuner;
			}
		}		
		break;
	case EVN_POST_CHANGE:
		sel = param1;
		if(bID == LNB_ID)
		{
          	win_atnsetf_load_22k_action(TRUE);
            #ifdef SUPPORT_UNICABLE
            if(win_unicable_setting_open(LNB_IDX))
                OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_fixed, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);           
            #endif 
        }
		if(bID == TUNER_ID)
		{
			if(sys_data->tuner_lnb_type[sel] != LNB_FIXED)
			{
				/* Need to change : Motor antenna setting menu. */
				other_antset_menu = (POBJECT_HEAD)&g_win_antenna_set_motor;
				if(OSD_ObjOpen(other_antset_menu, MENU_OPEN_TYPE_MENU + bID) != PROC_LEAVE)
				{
					win_signal_close();
					menu_stack_pop();
					menu_stack_push(other_antset_menu);
				}
				ret = PROC_LOOP;
			}
			else
			{
				win_atnsetf_load_sat_cnt(TRUE);
				win_atnsetf_load_sat_setting(0,TRUE);
			}

		}
		else if(bID == SAT_ID)
			win_atnsetf_load_sat_setting(sel,TRUE);
		else if(bID != TP_ID)
		{
			win_atnsetf_modify_sat_setting(SAT_IDX);
        }

		if(ret != PROC_LOOP)
		{
            api_stop_timer(&set_frontend);
            set_frontend = api_start_timer("SETANT",600,(OSAL_T_TIMER_FUNC_PTR)atnsetf_set_frontend_handler);
        }
		break;
	case EVN_REQUEST_STRING:
		sel = param1;
		Uni_str= (UINT16*)param2;
		if(bID == SAT_ID)
		{
			get_tuner_sat_name(antset_cur_tuner,sel,Uni_str);
			sys_data_set_cur_satidx(sel);
		}
		else if(bID == TP_ID)
		{
			get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node);
			get_tp_name(s_node.sat_id,sel,Uni_str);

#ifdef SUPPORT_SELECT_SAME_SAT
			s_node.reserve_1 = antset_cur_tuner;

			modify_sat(s_node.sat_id, &s_node);
			update_data();
#endif
		}
		else if(bID == LNB_ID)
			get_lnb_name(sel,Uni_str);
		else if(bID == DISEQC11_ID)
			get_diseqc11_name(sel,Uni_str);
		else if(bID == IF_CHANNEL_ID)
			get_IF_channel_name(sel,Uni_str);
		else if(bID == CENTRE_FREQ_ID)
			get_centre_freqs_name(sel,Uni_str);
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);		
		if(unact ==  VACT_POP_UP)
		{
			OSD_SetRect2(&rect,&pObj->frame);
			/*Patch: For solve pop-up windows show bugs,for example: Universal(5150-10600) can not be all show*/
			OSD_SetRect(&rect, rect.uLeft, rect.uTop, (rect.uWidth + 10), rect.uHeight);
			param.selecttype = POP_LIST_SINGLESELECT;
			switch(bID)
			{
			case SAT_ID:
				rect.uLeft -= 40;
				rect.uWidth += 40;
				list_type = POP_LIST_TYPE_SAT;
				rect.uHeight = 300;
				param.id = antset_cur_tuner;
				param.cur = SAT_IDX;
				break;
			case LNB_ID:
				list_type = POP_LIST_TYPE_LNB;
				rect.uHeight = 300;
				param.cur = LNB_IDX;
				break;
			case TP_ID:
				list_type = POP_LIST_TYPE_TP;
				rect.uHeight = 340;
				get_tuner_sat(antset_cur_tuner,SAT_IDX,&s_node);
				param.id = s_node.sat_id;
				param.cur = TP_IDX;
				break;
			case DISEQC10_ID:
				list_type = POP_LIST_TYPE_DISEQC10;
				rect.uHeight = 280;
				param.cur = DISEQC10_IDX;
				break;
			case DISEQC11_ID:
				list_type = POP_LIST_TYPE_DISEQC11;
				rect.uHeight = 240;
				param.cur = DISEQC11_IDX;
				break;
			case IF_CHANNEL_ID:
				list_type = POP_LIST_TYPE_IF_CHANNEL;
				rect.uHeight = 200;
				param.cur = IF_CHANNEL_IDX;
				break;
			case CENTRE_FREQ_ID:
				list_type = POP_LIST_TYPE_CENTRE_FREQ;
				rect.uHeight = 200;
				param.cur = CENTRE_FREQ_IDX;
				break;     
			default:
				list_type = 0xFF;
				break;
			}

			if(list_type == 0xFF)
				break;

			cur_idx = win_com_open_sub_list(list_type,&rect,&param);
			if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur)
				break;

			item = anesetf_items[bID - 1];
            msel = anesetf_msels[bID - 1];										

			switch(bID)
			{
            case SAT_ID:
				SAT_IDX = cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);											
				win_atnsetf_load_sat_setting((UINT32)cur_idx, TRUE);
                break;
            case LNB_ID:
                LNB_IDX = cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
				win_atnsetf_load_22k_action(TRUE);
#ifdef SUPPORT_UNICABLE
				if(win_unicable_setting_open(LNB_IDX))
					OSD_TrackObject((POBJECT_HEAD)&g_win_antenna_set_fixed, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
#endif
                break;
/*            case TP_ID:
				TP_IDX = cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
                break;
            case DISEQC10_ID:
				DISEQC10_IDX = cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
                break;
            case DISEQC11_ID:
				DISEQC11_IDX = cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
                break;
            case IF_CHANNEL_ID:
                IF_CHANNEL_IDX= cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
                break;
            case CENTRE_FREQ_ID:
                CENTRE_FREQ_IDX= cur_idx;
				OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
                break;
*/            default:            
                msel->nSel = cur_idx;
			    OSD_TrackObject(item, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);	
                break;
            }

			if(bID != SAT_ID && bID != TP_ID)
				win_atnsetf_modify_sat_setting(SAT_IDX);			

			api_stop_timer(&set_frontend);
            set_frontend = api_start_timer("SETANT",500,(OSAL_T_TIMER_FUNC_PTR)atnsetf_set_frontend_handler);
		}
		
		break;
	}

	return ret;	
}
Пример #5
0
static PRESULT atnsetf_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 level,quality,lock;
	UINT16 default_satidx;
	UINT32 sat_cnt;
	static UINT8 tone_voice_init;
	SYSTEM_DATA* sys_data;
	static UINT32 interval;
	MULTISEL* msel;
	VACTION unact;

	sys_data = sys_data_get();
	switch(event)
	{
	case EVN_PRE_OPEN:
		if(sys_data_get_cur_satidx() == (UINT16)(~0))
		{//sat_idx have been modified in other page
			default_satidx = win_load_default_satidx();
		}
		else
		{//do not modified yet,load default playing programme satellite
			default_satidx = sys_data_get_cur_satidx();
		}
		recreate_sat_view(VIEW_ALL, 0);
		win_atnsetf_load_tuner_configuration();
		sat_cnt = win_atnsetf_load_sat_cnt(FALSE);
		if(sat_cnt == 0)
		{
			ret = PROC_LEAVE;
		}
		else
		{
			/*Sat Name*/
			if(default_satidx >= sat_cnt)
				default_satidx = 0;
			msel = anesetf_msels[SAT_ID - 1];
			OSD_SetMultiselCount(msel, sat_cnt);
			OSD_SetMultiselSel(msel,default_satidx);
			win_atnsetf_load_sat_setting(default_satidx,FALSE);
		}
		
		if(ret != PROC_LEAVE)
			wincom_open_subtitle(pObj,RS_INSTALLATION_ANTENNA_SETUP,0);
		break;
	case EVN_POST_OPEN:
		tone_voice_init = 0;
		//win_signal_open(pObj);
#if 1//def SUPPORT_TWO_TUNER
		win_signal_open_ex(pObj,pObj->frame.uLeft+20,pObj->frame.uTop + 7 * (CON_H + CON_GAP) + 50);
#else
		win_signal_open_ex(pObj,pObj->frame.uLeft+20,pObj->frame.uTop + 6 * (CON_H + CON_GAP) + 50);
#endif
              wincom_open_help(pObj,antenna_setup_helpinfo , HELP_CNT);
		win_atnsetf_tuner_frontend();
		win_signal_refresh();
		//win_signal_update();
		break;
	case EVN_PRE_CLOSE:
		if(check_node_modified(TYPE_SAT_NODE) )
		{
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(500);
			win_compopup_smsg_restoreback();
		}
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		win_signal_close();
		sys_data_save(1);
		wincom_close_help();
		wincom_close_subtitle();
		OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
#ifdef ANTENNA_INSTALL_BEEP	
		if(sys_data->install_beep)
		{
		#if(defined(DVBT_BEE_TONE) && ANTENNA_INSTALL_BEEP == 1)
			api_audio_stop_tonevoice();
		#elif (defined(AUDIO_SPECIAL_EFFECT) && ANTENNA_INSTALL_BEEP == 2)
			api_audio_beep_stop();
		#endif
		}
#endif
		break;
	case EVN_MSG_GOT:
		if(param1 == CTRL_MSG_SUBTYPE_STATUS_SIGNAL)
		{
			win_signal_refresh();
			//win_signal_update();		

#ifdef ANTENNA_INSTALL_BEEP				
			if(sys_data->install_beep)
			{
				level   = (UINT8)(param2>>16);
				quality = (UINT8)(param2>>8);
				lock    = (UINT8)(param2>>0);
			#if(defined(DVBT_BEE_TONE) && ANTENNA_INSTALL_BEEP == 1)	
				if(quality<20)
	              level = 0;
	            else if(quality<40)
	                level = 1;
	            else if(quality<55)
	                level = 3;
	            else if(quality <70)
	                level = 5;
	            else
	                level = 7;
				api_audio_gen_tonevoice(level, tone_voice_init);				
			#elif (defined(AUDIO_SPECIAL_EFFECT) && ANTENNA_INSTALL_BEEP == 2)
				if(lock)
					level = 100;//100/quality;
				else
					level = 1;//100/quality;				
				if(!tone_voice_init || level!=interval)
				{
					if(!tone_voice_init)
						api_audio_beep_start(beep_bin_array,beep_bin_array_size);
					interval = level;
					api_audio_beep_set_interval(interval);					
				}
			#endif
				tone_voice_init = 1;
			}
#endif			
		}
Пример #6
0
static PRESULT satsrch_item_sel_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT32 sel;
	UINT8 bID;
 	char str[10];
    UINT16 * Uni_str;
    UINT8* pstr;
	UINT16 cur_idx;
	COM_POP_LIST_TYPE_T list_type;
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;
	UINT16 i,n = 0;
	S_NODE s_node;
	UINT32 flag;

	bID = OSD_GetObjID(pObj);

	switch(event)
	{
	case EVN_PRE_CHANGE:
		sel = *((UINT32*)param1);
		break;
	case EVN_POST_CHANGE:
		sel = param1;
		if(bID == MODE_ID)
			win_satsrch_set_nitactive(TRUE);
        if(bID == SAT_ID)
        {
			get_sat_at(sel,SET_SELECTED,&s_node);		
		#ifdef SUPPORT_TWO_TUNER  //guop modify
		#ifdef SUPPORT_SELECT_SAME_SAT
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0) ? RS_LNB1 : RS_LNB2));
		#else
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2));
		#endif
		
			OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL);
		#endif
        }

		
		break;
	case EVN_REQUEST_STRING:
		sel = param1;
		Uni_str= (UINT16*)param2;
		if(bID == SAT_ID)
		{
			get_tuner_sat_name(2,sel,Uni_str);
			sys_data_set_cur_satidx(sel);
		}	
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);		
		if(unact ==  VACT_POP_UP)
		{
			OSD_SetRect2(&rect,&pObj->frame);
			switch(bID)
			{
			case SAT_ID:
				rect.uLeft -= 80;
				rect.uWidth += 80;
				list_type 	= POP_LIST_TYPE_SAT;
				rect.uHeight = 300;
				param.id 	= TUNER_EITHER;
				param.cur 	= SATSRCH_SAT_IDX;
				if(single_multi_srch_flag == 0)
					param.selecttype = POP_LIST_SINGLESELECT;
				else
				{
					MEMSET(sat_select,0,sizeof(sat_select));
					n = get_tuner_sat_cnt(TUNER_EITHER);
					if(n == 0)
					{
						list_type = 0xFF;
						break;
					}

					for(i=0;i<n;i++)
					{
						get_tuner_sat(TUNER_EITHER,i,&s_node);
						if(s_node.selected_flag)
							sat_select[i] = 1;							
					}
#if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY))
					param.selecttype = POP_LIST_MULTISELECT;
#else
					param.selecttype = POP_LIST_SINGLESELECT;
#endif
					param.select_array = sat_select;					
				}
				break;
			default:
				list_type = 0xFF;							
			}
			
			if(list_type == 0xFF)
				break;

			cur_idx = win_com_open_sub_list(list_type,&rect,&param);   /*sky.bi 20101228*/


			if(single_multi_srch_flag == 0)
			{
				if(cur_idx == LIST_INVALID_SEL_IDX || cur_idx == param.cur)
					break;
			}
			else
			{
				/* Check the select satellite */

#if (defined(SUPPORT_TWO_TUNER) || !defined(SELECT_SAT_ONLY))				
				for(i=0;i<n;i++)
				{
					if(win_comlist_ext_check_item_sel(i))
						flag = 1;
					else
						flag = 0;
					get_tuner_sat(TUNER_EITHER,i,&s_node);
					if(s_node.selected_flag != flag)
					{
						s_node.selected_flag = flag;
						modify_sat(s_node.sat_id, &s_node);						
					}
				}
				update_data(TYPE_SAT_NODE);
#endif				
			}

			if(single_multi_srch_flag == 0)
			{
				SATSRCH_SAT_IDX = cur_idx;
			}
			get_sat_at(cur_idx,SET_SELECTED,&s_node);	

	//		FIXED_PRINTF("cur_idx:%d !********\n",cur_idx);
#ifdef SUPPORT_SELECT_SAME_SAT
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, ((s_node.reserve_1 == 0) ? RS_LNB1 : RS_LNB2));
#else
			OSD_SetTextFieldContent(&satsrch_txt6_note , STRING_ID, (s_node.tuner1_valid ? RS_LNB1 : RS_LNB2));
#endif
			OSD_DrawObject((POBJECT_HEAD)&satsrch_txt6_note, C_UPDATE_ALL);
			OSD_TrackObject((POBJECT_HEAD)&satsrch_item1, C_DRAW_SIGN_EVN_FLG | C_UPDATE_ALL);
			if(single_multi_srch_flag)
			{
				/* TODO :
					Draw the select satellites name  */

			//	FIXED_PRINTF("single_multi_srch_flag : %d\n",single_multi_srch_flag);
					win_satsrch_set_drawselectsats();
			}
	
	
		}
		break;
	}

	return ret;
	
}
static GtkWidget *
progress_widget_new (NautilusProgressInfo *info)
{
	ProgressWidgetData *data;
	GtkWidget *label, *bar, *hbox, *vbox, *button, *image;

	data = g_new0 (ProgressWidgetData, 1);
	data->info = g_object_ref (info);
	
	hbox = gtk_hbox_new (FALSE, 0);
	data->widget = hbox;
	g_object_set_data_full (G_OBJECT (data->widget),
				"data", data, (GDestroyNotify)progress_widget_data_free);

	vbox = gtk_vbox_new (FALSE, 0);
	gtk_box_pack_start (GTK_BOX (hbox),
			    vbox,
			    FALSE, FALSE,
			    2);
	gtk_widget_show (vbox);
	
	label = gtk_label_new ("details");
	gtk_widget_set_size_request (label,
				     400, -1);
	data->status = GTK_LABEL (label);
	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
	gtk_widget_show (label);
	gtk_box_pack_start (GTK_BOX (vbox),
			    label,
			    FALSE, FALSE,
			    2);
	
	bar = gtk_progress_bar_new ();
	data->progress_bar = GTK_PROGRESS_BAR (bar);
	gtk_progress_bar_set_pulse_step (data->progress_bar, 0.05);
	
	gtk_widget_show (bar);
	gtk_box_pack_start (GTK_BOX (vbox),
			    bar,
			    FALSE, FALSE,
			    2);
	
	label = gtk_label_new ("status");
	gtk_widget_set_size_request (label,
				     400, -1);
	data->details = GTK_LABEL (label);
	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
	gtk_widget_show (label);
	gtk_box_pack_start (GTK_BOX (vbox),
			    label,
			    FALSE, FALSE,
			    0);


	vbox = gtk_vbox_new (FALSE, 0);
	gtk_box_pack_start (GTK_BOX (hbox),
			    vbox,
			    FALSE, FALSE,
			    0);
	gtk_widget_show (vbox);

	image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON);
	gtk_widget_show (image);
	button = gtk_button_new ();
	gtk_container_add (GTK_CONTAINER (button), image);
	gtk_widget_show (button);
	gtk_box_pack_start (GTK_BOX (vbox),
			    button,
			    TRUE, FALSE,
			    0);

	g_signal_connect (button, "clicked", (GCallback)cancel_clicked, data);

	
	update_data (data);
	update_progress (data);

	g_signal_connect_swapped (data->info, "changed", (GCallback)update_data, data);
	g_signal_connect_swapped (data->info, "progress_changed", (GCallback)update_progress, data);
	g_signal_connect_swapped (data->info, "finished", (GCallback)op_finished, data);
	
	gtk_widget_show (data->widget);

	return data->widget;
}
Пример #8
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);
				sat_pos = antset_cur_tuner==0? s_node.position : s_node.tuner2_antena.position;

				if(sat_pos == 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();
				}
                else
                {
    				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,sat_pos,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;
}
Пример #9
0
static PRESULT factoryset_btn_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;	
	VACTION unact;
	UINT8 bID,back_saved;
	UINT32 chunk_id, default_db_addr, default_db_len;
	S_NODE  s_node;
	bID = OSD_GetObjID(pObj);
	INT16 	i,n;
	UINT8 back_saved1;
	UINT16 sat_id;//-a by wangyang 2011-11-03 for factory set del sat program
	win_popup_choice_t choice;
	
	switch(event)
	{
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(unact == VACT_ENTER)
		{
			switch(bID)
			{
				case IDC_CON1:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						chunk_id = 0x03FC0100;
						api_get_chuck_addlen(chunk_id, &default_db_addr, &default_db_len);
						set_default_value(DEFAULT_ALL_PROG,default_db_addr + 16);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
						if(GetMuteState())
							SetMuteOnOff(FALSE);
						if(GetPauseState())
							SetPauseOnOff(FALSE);
						win_compopup_smsg_restoreback();
/*				
	#ifdef LOGO_IN_RAM
						api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                           	 	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
*/
						power_off_process();
						power_on_process();
					}
					break;
				case IDC_CON2:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_TV_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON3:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
 						osal_task_sleep(1500);

						si_monitor_off(0xFFFFFFFF);
						n = get_sat_num(VIEW_ALL);
					
						recreate_prog_view(VIEW_ALL | PROG_RADIO_MODE,0);
						for(i=0;i<n;i++)
						{
							get_sat_at(i, VIEW_ALL,&s_node);
							del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						}
					
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
                        		break;
				case IDC_CON4:
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);

						sys_data_factroy_init(); 
						sys_data_set_cur_chan_mode(TV_CHAN);
						sys_data_save(TRUE);
						sys_data_load();
			        		win_compopup_smsg_restoreback();
/*
					#ifdef LOGO_IN_RAM
				   		api_show_Test_logo_2(MM_tool3,get_logo_h_file_size(3));
                              	#endif
						OSD_TrackObject( (POBJECT_HEAD) &g_win_mainmenu, C_UPDATE_ALL);
						wincom_open_subtitle((POBJECT_HEAD)&win_factoryset_con,RS_TOOLS_FACTORY_SETTING, 0);
						OSD_TrackObject( (POBJECT_HEAD) &win_factoryset_con, C_UPDATE_ALL);

						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
*/
						power_off_process();
						power_on_process();
					}
                    			break;
//-a by wangyang 2011-11-03 for factory set del sat program{{
				case IDC_CON5:

				if(OSD_GetMultiselCount(&factoryset_sel5)==0)
				{
					win_compopup_init(WIN_POPUP_TYPE_SMSG);
					win_compopup_set_msg(NULL,NULL, RS_MSG_NO_CHANNELS);
					win_compopup_open_ext(&back_saved1);
					osal_task_sleep(1000);
					win_compopup_smsg_restoreback();
				}
				else
				{
					sat_id=OSD_GetMultiselSel(&factoryset_sel5);
					win_compopup_init(WIN_POPUP_TYPE_OKNO);
					win_compopup_set_msg(NULL, NULL, RS_DISPLAY_SURE_TO_DELETE);
					win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
					choice = win_compopup_open_ext(&back_saved1);
					if(choice == WIN_POP_CHOICE_YES)
					{
						if(api_is_playing_tv()  || api_is_playing_radio())
						{
							api_stop_play(1);
						}
						win_compopup_init(WIN_POPUP_TYPE_SMSG);
						win_compopup_set_msg(NULL,NULL, RS_MSG_SAVING_DATA);
						win_compopup_open_ext(&back_saved);
						osal_task_sleep(1500);
						si_monitor_off(0xFFFFFFFF);
						
						recreate_prog_view(VIEW_ALL | PROG_TVRADIO_MODE,0);

						get_sat_at(sat_id, SET_SELECTED,&s_node);
						del_child_prog(TYPE_SAT_NODE, s_node.sat_id);
						
						update_data();
						sys_data_check_channel_groups();	
						win_compopup_smsg_restoreback();
						// Restart the unit after Factory Default in any case
						osal_task_sleep(1200);
						power_off_process();
						power_on_process();
					}
				}
                        		break;
//-a by wangyang 2011-11-03 for factory set del sat program}}				
				default:
					break;
				}
			
		}
		break;
	}

	return ret;
}
Пример #10
0
static PRESULT win_an_set_unkown_act_proc(VACTION act)
{
//	PRESULT  ret = PROC_PASS;   /* sky.bi 20110114 */

    switch(act)
	{

           case VACT_SINGLE_SEARCH:
		   	single_multi_srch_flag = 0;
		  	if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(500);
			win_compopup_smsg_restoreback();
		   }
			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_sat_srchset, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push((POBJECT_HEAD)&g_win_sat_srchset);
			wincom_close_help();
	             break;
	      case VACT_MULTI_SEARCH:
		   	single_multi_srch_flag = 1;
		  	if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(500);
			win_compopup_smsg_restoreback();
		   }
			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_sat_srchset, 0xFFFFFFFF) != PROC_LEAVE)
				menu_stack_push((POBJECT_HEAD)&g_win_sat_srchset);
			wincom_close_help();
	             break;
				 
	      case VACT_TP_SEARCH:
		  	if(check_node_modified(TYPE_SAT_NODE) )
		   {
			UINT8	back_saved;
			win_compopup_init(WIN_POPUP_TYPE_SMSG);
			win_compopup_set_msg(NULL, NULL, RS_MSG_SAVING_DATA);
			win_compopup_open_ext(&back_saved);
			update_data(TYPE_SAT_NODE);
			osal_task_sleep(500);
			win_compopup_smsg_restoreback();
		   }

			if(OSD_ObjOpen((POBJECT_HEAD)&g_win_tplist, 0xFFFFFFFF) != PROC_LEAVE)
			{
				menu_stack_push((POBJECT_HEAD)&g_win_tplist);
				

//				FIXED_PRINTF("menu_count :%d\n",menu_stack_get_menu_count());
				
			}
	             break;
		/*sky.bi 20110112*/
#if   0 //defined(ORDER_GZ1011006)
		case VACT_ANTENNA_MENU:
		{
				g_enter_antenna_menu_flag = 1;
//				FIXED_PRINTF("VACT_ANTENNA_MENU  OSD_ObjOpen menu_count 0:%d\n",menu_stack_get_menu_count());
				if(OSD_ObjOpen((POBJECT_HEAD)&g_win_antenna_connect, MENU_OPEN_TYPE_MENU) != PROC_LEAVE)
				{
					win_signal_close();

//					FIXED_PRINTF("VACT_ANTENNA_MENU  OSD_ObjOpen menu_count 1:%d\n",menu_stack_get_menu_count());
					menu_stack_pop();

					menu_stack_push((POBJECT_HEAD)&g_win_antenna_connect);

//					FIXED_PRINTF("VACT_ANTENNA_MENU  OSD_ObjOpen menu_count 2:%d\n",menu_stack_get_menu_count());
				}

			//	ret  = VACT_CLOSE;    //sky.bi 20110114
			break;
		}
	#endif

    }

//	return ret;   //sky.bi 20110114
}
Пример #11
0
double DS18B20::get_value()
{
  update_data();
  return get_data();
}
void FormEfficiencyCalibration::on_doubleEpsilonE_editingFinished()
{
  update_data();
}
void FormEfficiencyCalibration::isotope_chosen() {
  update_data();
}
FormEfficiencyCalibration::FormEfficiencyCalibration(QSettings &settings, XMLableDB<Qpx::Detector>& newDetDB, QWidget *parent) :
  QWidget(parent),
  ui(new Ui::FormEfficiencyCalibration),
  detectors_(newDetDB),
  settings_(settings)
{
  ui->setupUi(this);
  this->setWindowTitle("Efficiency calib");

  loadSettings();

  style_fit.default_pen = QPen(Qt::blue, 0);
  style_pts.themes["selected"] = QPen(Qt::black, 7);

  ui->PlotCalib->setLabels("channel", "energy");

  ui->tablePeaks->verticalHeader()->hide();
  ui->tablePeaks->setColumnCount(4);
  ui->tablePeaks->setHorizontalHeaderLabels({"chan", "energy", "cps", QString(QChar(0x03B5)) + "-rel"});
  ui->tablePeaks->setSelectionBehavior(QAbstractItemView::SelectRows);
  ui->tablePeaks->setSelectionMode(QAbstractItemView::ExtendedSelection);
  ui->tablePeaks->setEditTriggers(QAbstractItemView::NoEditTriggers);
  ui->tablePeaks->horizontalHeader()->setStretchLastSection(true);
  ui->tablePeaks->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
  ui->tablePeaks->show();
  connect(ui->tablePeaks, SIGNAL(itemSelectionChanged()), this, SLOT(selection_changed_in_table()));

  connect(ui->PlotCalib, SIGNAL(selection_changed()), this, SLOT(selection_changed_in_calib_plot()));
  ui->PlotCalib->set_scale_type_x("Logarithmic");
  ui->PlotCalib->set_scale_type_y("Logarithmic");

  ui->isotopes->show();
  connect(ui->isotopes, SIGNAL(isotopeSelected()), this, SLOT(isotope_chosen()));

  QShortcut* shortcut = new QShortcut(QKeySequence(QKeySequence::Delete), ui->tablePeaks);
  connect(shortcut, SIGNAL(activated()), this, SLOT(on_pushMarkerRemove_clicked()));



  ui->isotopes->set_editable(false);



  //file formats for opening mca spectra
  std::vector<std::string> spectypes = Qpx::Spectrum::Factory::getInstance().types();
  QStringList filetypes;
  for (auto &q : spectypes) {
    Qpx::Spectrum::Template* type_template = Qpx::Spectrum::Factory::getInstance().create_template("1D");
    if (!type_template->input_types.empty())
      filetypes.push_back("Spectrum " + QString::fromStdString(q) + "(" + catExtensions(type_template->input_types) + ")");
    delete type_template;
  }
  mca_load_formats_ = catFileTypes(filetypes);

  ui->plotSpectrum->setFit(&fit_data_);


  connect(ui->plotSpectrum, SIGNAL(selection_changed(std::set<double>)), this, SLOT(update_selection(std::set<double>)));
  connect(ui->plotSpectrum, SIGNAL(data_changed()), this, SLOT(update_data()));

  connect(ui->spectrumSelector, SIGNAL(itemSelected(SelectorItem)), this, SLOT(spectrumDetails(SelectorItem)));
  connect(ui->spectrumSelector, SIGNAL(itemToggled(SelectorItem)), this, SLOT(spectrumLooksChanged(SelectorItem)));
}