コード例 #1
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void disp_signal()
{  
	InfoState infoState; 
	const char *IMAGE_POINT[] = { IMAGE_0, IMAGE_1, IMAGE_2, IMAGE_3, IMAGE_4, IMAGE_5, IMAGE_6, IMAGE_7, IMAGE_8, IMAGE_9 };
	uint8 signal;

    if(!get_state_info(&infoState)){ 
		post_trace("get state false");  	
	}else{post_trace("get state ok");} 
	signal = get_signal(&infoState);
	power_screen(true);
    show_picture(7, 10, IMAGE_POINT[(signal/ 10) % 10]);
    show_picture(33, 10, IMAGE_POINT[signal % 10]);	
}
コード例 #2
0
ファイル: main.c プロジェクト: VWarlock/zx-evo
void main(void)
{
	static u8 i,joy,joyprev,image;

	image=0;
	joyprev=0;

	show_picture(image,0,1);

	while(1)
	{
		i=joystick();
		joy=i^joyprev&i;
		joyprev=i;

		if(joy&JOY_LEFT)
		{
			--image;
			if(image>4) image=4;

			show_picture(image,0,1);
		}

		if(joy&JOY_RIGHT)
		{
			++image;
			if(image>4) image=0;

			show_picture(image,1,1);
		}

		if(joy&JOY_UP)
		{
			--image;
			if(image>4) image=4;

			show_picture(image,0,0);
		}

		if(joy&JOY_DOWN)
		{
			++image;
			if(image>4) image=0;

			show_picture(image,0,0);
		}
	}
}
コード例 #3
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void mobile_test_task(void *p)
{	
	power_screen(true);
	display_clear();
	show_picture(15, 30, IMAGE_LOGO);
	while(1) {
		if(KEY_Pressed(KEY_State(), key_right)) {		 			
			while(KEY_Pressed(KEY_State(), key_right));	 		
			mobile_state();
		}	else if(KEY_Pressed(KEY_State(), key_left)) {	
			while(KEY_Pressed(KEY_State(), key_left));	 	
		//	POWER_Control(dev_mobile, pt_wakeup);
			mobile_wakeup_time();		
		}else if(KEY_Pressed(KEY_State(), key_service)) {
			while(KEY_Pressed(KEY_State(), key_service));	
		    mobile_on_time();
		 // POWER_Control(dev_mobile, pt_on); 
 		}else if(KEY_Pressed(KEY_State(), key_alarm)) {			
			while(KEY_Pressed(KEY_State(), key_alarm));	 
			mobile_off_time();
		//	POWER_Control(dev_mobile, pt_off); 
		}else if(KEY_Pressed(KEY_State(), key_broadcast)) {
 			while(KEY_Pressed(KEY_State(), key_broadcast));
			POWER_Control(dev_mobile, pt_hibernation); 
		} else if(KEY_PowerOff()) {
			POWER_Off();			
			return;			
		}	
	}
} 
コード例 #4
0
myPicture::myPicture(QWidget *parent)
:QLabel(parent)
{
    k = 0;
    listlen = 0;
    valchanged = 0;
    file_list();
    label_pic_dis = new QLabel(parent);
    label_pic_dis->setGeometry(569, 139, 240, 261);
    show_picture();
    QTimer *timer1 = new QTimer(parent);
    QObject::connect(timer1,SIGNAL(timeout()),this,SLOT(show_picture()));

    timer1->stop();
    timer1->start(2000);
}
コード例 #5
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void picture_task(void *pvParam)
{
    const char *PIC_PATH[] = { IMAGE_LOGO, IMAGE_TITLE, IMAGE_ALARM, IMAGE_SERVICE, IMAGE_GRADE1, IMAGE_GRADE2, IMAGE_GRADE3, IMAGE_GRADE4, IMAGE_GRADE5, IMAGE_ALERT, IMAGE_BT_NO, IMAGE_BT_OK, IMAGE_CHARGE, IMAGE_COMMUNICATION, IMAGE_GPS_NO, IMAGE_GPS_OK, IMAGE_QUANTITY0, IMAGE_QUANTITY1, IMAGE_QUANTITY2, IMAGE_QUANTITY3, IMAGE_SIGNAL0, IMAGE_SIGNAL1, IMAGE_SIGNAL2, IMAGE_SIGNAL3, IMAGE_SIGNAL4, IMAGE_SIGNAL5, IMAGE_SIGNAL6, IMAGE_SIM_NO, IMAGE_SIM_ERR, IMAGE_SUPERVISE, IMAGE_A_OK, IMAGE_A_ERROR, IMAGE_B_OK, IMAGE_B_ERROR, IMAGE_C_OK, IMAGE_C_ERROR, IMAGE_D_OK, IMAGE_D_ERROR, IMAGE_E_OK, IMAGE_E_ERROR, IMAGE_F_OK, IMAGE_F_ERROR, IMAGE_G_OK, IMAGE_G_ERROR, IMAGE_H_OK, IMAGE_H_ERROR, IMAGE_I_OK, IMAGE_I_ERROR, IMAGE_J_OK, IMAGE_J_ERROR, IMAGE_K_OK, IMAGE_K_ERROR, IMAGE_L_OK, IMAGE_L_ERROR, IMAGE_M_OK, IMAGE_M_ERROR, IMAGE_N_OK, IMAGE_N_ERROR, IMAGE_O_OK, IMAGE_O_ERROR, IMAGE_P_OK, IMAGE_P_ERROR, IMAGE_0, IMAGE_1, IMAGE_2, IMAGE_3, IMAGE_4, IMAGE_5, IMAGE_6, IMAGE_7, IMAGE_8, IMAGE_9 };
    const uint8 PIC_COUNT = 72;
    uint8 i;

    power_screen(true);
    for(i = 0; i < PIC_COUNT; ++i) {
        display_clear();
        show_picture(0, 0, PIC_PATH[i]);
        delay_ms(1000);
    }
    while(1);
}
コード例 #6
0
int myPicture::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QLabel::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: show_picture(); break;
        default: ;
        }
        _id -= 1;
    }
    return _id;
}
コード例 #7
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void prepare_data( RTC_Clock clock)
{	 
	power_screen(true);
	display_clear();
	show_picture(15, 30, IMAGE_LOGO);
//	get_up_config();
	get_down_config();
//	get_gen_config();
	get_relation();
	get_base();
	get_act();
	get_step();
	get_position();
	get_event();		
}
コード例 #8
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void logic_test_task(void *p)
{
	char buff[200]="您昨天走了2650步,主要的活动时间集中在上午,共睡眠了7个小时,其中5个小时的深度睡眠、起夜共2次,您总体的活动量适中,睡眠质量不错,希望您能坚持午睡。";
	RTC_Clock clock=GetTime();
	power_screen(true);
	prepare_mobile(false);
	show_picture(9,18,IMAGE_LOGO);
	if(!write_file("rep/fit1",buff,200)){
		post_trace("write fit false");
	}
	if(!write_file("temp",buff,200)){
		post_trace("write temp false");
	}
	post_trace("write ok");
 //	prepare_data(clock);
	post_trace(buff);
//	power_device(ED_SWITCH, EP_OFF);	
}
コード例 #9
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void message_reply_task(void *p)
{
	post_trace("start");
	power_screen(true);
	display_clear();
	show_picture(15, 30, IMAGE_LOGO);
	prepare_mobile(false);
		while(1) {
		if(KEY_Pressed(KEY_State(), key_service)) {			
			while(KEY_Pressed(KEY_State(), key_service));	 
		    send_same_message();
		}else if(KEY_Pressed(KEY_State(), key_broadcast)) {
 			while(KEY_Pressed(KEY_State(), key_broadcast));
		  	send_differ_message();
		} else if(KEY_PowerOff()) {
			POWER_Off();			
			return;		
		}	
	}
	
}
コード例 #10
0
ファイル: test.c プロジェクト: xiaoyeqiannian/SWITCH433
void tf_show(void *p)
{
    int i=0;
	bool bRet = true;
	initialize();
	power_screen(true);

	while(true){
		for	( i=0; i<55; i++){
			bRet = show_picture(9, 9, SHOW_PIC_PATH[i]);
			if(!bRet){
				break;
			}
			display_clear();		
		}
		if(!bRet){
			break;	
		}		
	}
	while(true){
		sprintf(watcher_data->temp_path, "RES=%d", Res);
		post_trace(watcher_data->temp_path);
	}
}
コード例 #11
0
ファイル: lcd.c プロジェクト: hulongchuan/hulongchuan
/*******************************************************************************
* Function Name  : test
* Description    : test programm
* author         :hulongchuan
* Input          : - file: pointer to the source file name
*                  - line: assert_param error line source number
* Output         : None
* Return         : None
*******************************************************************************/
void test(void)
{
	switch(num)
	{
		case 0:	dis_juanxing();
				show_picture(gImage_2222);
				lp0 : while(num == 0);
				break;
		case 1:	dis_zhongkai();
				lp1 : while(num == 1);
				break;
		case 2:	dis_baiye();
				lp2 : while(num == 2);
				break;	
		default: break;
	}
	if(flag == 1)
	{
		flag = 0;
		dis_circle();
		while(1)
		{
			 dis_zhongkai(); 			  
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);			 
			 if(flag == 1 || num == 0 || num == 1 || num == 2)
			 {
				 flag = 0; 
				 num = 0;
				 goto lp0;
			 }
			 dis_baiye();
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 if(flag == 1 || num == 0 || num == 1 || num == 2)
			 {
				 flag = 0;
				 num = 1;
				 goto lp1; 
			 }
			 dis_juanxing();
			 show_picture(gImage_2222);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 Delay(0xaffff);
			 if(flag == 1 || num == 0 || num == 1 || num == 2)
			 {
				 flag = 0;
				 num = 2;
				 goto lp2; 
			 }
		}
	} 
	
}