⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 privacy.c

📁 keil c open
💻 C
字号:
#include "extern.h"
void	f_key_operation_start(void)
{
	if((function==0x37)&&(function1==99))
	{
    		f_key_clear_flag();
		menu_set_flag=1;
        	recieve_ok=0;
	}
	 if((direction==0)&&(recieve_ok==1))
	 {
	   	 recieve_ok=0;
		if(menu_set_flag==1)
                {
			f_key_main_menu();
                }
		if(set_date_flag==1)
		{
			f_key_set_date();
		}
		if(set_camera_flag==1)
		{
                	f_key_set_camera();
		}
        	if(set_camera_display_flag==1)
		{
			f_key_set_camera_display();
		}
		if(set_pan_display_flag==1)
		{
			f_key_set_pan_display();
		}
        	if(set_add_menu_flag==1)
        	{
	        	 f_key_set_add_menu();
        	}
		if(menu_3_white_balance_flag)
		{
			OS_Key_Menu3_Operation();
		}
		if(set_privacy_display_flag==1)
		{
			f_key_set_privacy();
		}
 }
}
void	f_show_mygb(void)
{

	if(gb_brush_flag==1)
	{
		f_show_gb_fun();
		gb_brush_flag=0;
	}
	if(func_brush_flag==1)
	{
		func_brush_flag=0;
		if(menu_set_flag==1)
			{	f_show_jiantou();}
		if(set_date_flag==1)
			{f_show_time_display_offset20();}
		if(set_camera_flag==1)
			{f_show_flag_flag_set_camera();}
		if(set_camera_display_flag==1)
			{f_show_flag_set_camera_display();}
		if(set_pan_display_flag==1)
			{f_show_flag_flag_set_pan();}

	    	if(set_add_menu_flag==1)
	    	{
	    	 	f_show_flag_offset20();
	    	}
		if(menu_3_white_balance_flag==1)
		{
	            OS_show_Menu3_Offset20();
		}
		if(set_privacy_display_flag==1)
		{
			f_show_set_privacy_offset20();	
		}

	}
}
void	f_show_menu_much(void)
{
	if(menu_set_flag==1)
	{	
		f_show_main_menu();
	}
	if(set_date_flag==1)
	{
		f_display_set_time_date_picture();
	}
	if(set_camera_flag==1)
	{
		f_show_set_camera();
	}
	if(set_camera_display_flag==1)
	{
		f_show_set_camera_display();
	}
	if(set_pan_display_flag==1)
	{
		f_show_set_pan_display();
	}
    	if(set_add_menu_flag==1)
    	{
        	f_show_add_menu();
    	}
	if(menu_3_white_balance_flag1==1)
    	{   
	    	menu_3_white_balance_flag1=0;
	        OS_Show_Menu3_Display();
    	}
    	if(set_privacy_display_flag==1)
    	{
    		f_show_set_privacy_display();	
    	}
}
void	f_key_clear_flag(void)
{
	set_date_flag=0;
	menu_3_white_balance_flag=0;
	set_camera_flag=0;
	set_camera_display_flag=0;
	set_pan_display_flag=0;
	menu_set_flag=0;
    	h_position=4;
    	set_add_menu_flag=0;
 	menu_brush_flag=1;
	menu_3_white_balance_flag1=0;
	set_privacy_display_flag=0;
 	f_brush_gb();
}
void f_show_set_camera_display(void)
{
	EA=0;
	f_showbuff(2,1,flit_2);
	f_showbuff(2,3,set_camera_display);
	f_showbuff(2,21,flit_2);
	f_showbuff(4,3,focus);
	f_showbuff(5,3,cam_title);
	f_showbuff(7,3,set_mark_id);
	f_showbuff(6,3,set_camera_grid);
	f_showbuff(10,3,wide_code1);
	f_showbuff(10,18,tele_code);
	f_show_flag_set_camera_display();
	f_show_gb_fun();
}
void	f_key_camera_display_add(void)
{
	gb_brush_flag=1;
	++h_position;
	if(h_position>=8)
	{
		h_position=4;
	}
}
void	f_key_camera_display_sub(void)
{
	gb_brush_flag=1;
	--h_position;
	if(h_position<=3)
	{
		h_position=7;
	}
}

void	f_key_camera_display_true(void)
{
	uchar	x;
        func_brush_flag=1;
	switch(h_position)
	{
		case	4:	focus_flag=1;
					
					wren_cmd();
					x=byte_read(21);
					x=x|0x01;
					wren_cmd();
					byte_write(x,21);
					sendtwo=0x1b;
					sendthree=0;
                                        _nop_();_nop_();
					f_sendbytes();
                                        _nop_();_nop_();_nop_();
					break;
		case	5:	cam_title_flag=1;
					wren_cmd();
					x=byte_read(21);
					x=x|0x20;
					wren_cmd();
					byte_write(x,21);
					break;
		case	7:	
				if(mark_id<=23)	mark_id++;
				break;
		case	6:	
				camera_grid_flag=1;
				sendtwo=0x84;
				sendthree=0x01;
				sendfour=0x00;
				f_sendbytes();
					break;
		default:	h_position=4;
	 				break;
	}
}
void	f_key_camera_display_false(void)
{
	uchar	x;

	func_brush_flag=1;
	switch(h_position)
	{
		case	4:	focus_flag=0;
						//cam_title_flag=0;
				wren_cmd();
				x=byte_read(21);
				x=x&0xdf;
				wren_cmd();
				byte_write(x,21);
				sendtwo=0x1b;
                                sendthree=1;f_sendbytes();
                                _nop_();_nop_();_nop_();break;
		case	5:		cam_title_flag=0;
						//	cam_title_flag=1;
					wren_cmd();
					x=byte_read(21);
					x=x&0xdf;
					wren_cmd();
					byte_write(x,21);
					break;;
		case	7:	
				if(mark_id>=2)	mark_id--;
				break;
		case	6:	
			camera_grid_flag=0;
			sendtwo=0x84;
			sendthree=0x00;
			sendfour=0x00;
			f_sendbytes();
			break;
		default: h_position=4;  	
		break;
	}
}
void	f_key_camera_display_enter(void)
{       
	 switch(h_position)
		{

			case	4:    	break;
			case	5:    	break;
			case	7:    	
				f_key_clear_flag();	
				set_privacy_display_flag=1;
				sendtwo=0x84;
				sendthree=mark_id;
				sendfour=0x01;
				f_sendbytes();
				mark_length=10;
				mark_width=10;
				mark_trans=1;
				mark_color=0;
				mark_clear_flag=1;
				break;
			case	6:	break;
			default:    h_position=4;	break;
		}
}
void	f_key_camera_display_shot(void)
{
	switch(h_position)
		{

			case	7:    	
				mark_id=function1;
				break;
			
			default:
				break;
		}
}
void	f_show_flag_set_camera_display(void)
{
        uchar num_char[3],i;
        EA=0;
	f_clear_flag_fun();
	if(focus_flag==1)
	{
		f_showbuff(4,20,on);
	}
	else
	{
		f_showbuff(4,20,off);
	}
	if(cam_title_flag==1)
	{
		f_showbuff(5,20,on);
	}
	else
	{
		f_showbuff(5,20,off);
	}
	if(camera_grid_flag==1)
	{
		f_showbuff(6,20,on);
	}
	else
	{
		f_showbuff(6,20,off);
	}
	f_trans_num_to_char(num_char,mark_id);
	f_character_position(7,20);
	cs_to_6453=1;
      	cs_to_6453=0;
    	f_input_6453(0xce);
	for(i=0;i<3;i++)
	{
		f_input_6453(num_char[i]);
	}
	cs_to_6453=1;
}
//------
void f_show_set_privacy_display(void)
{
	EA=0;
	f_showbuff(2,1,flit_6);
	f_showbuff(2,7,set_privacy);
	f_showbuff(2,18,flit_6);
//	f_showbuff(4,3,set_mark_id);
	f_showbuff(4,3,clear_mark);
	f_showbuff(5,3,set_mark_length);
	f_showbuff(6,3,set_mark_width);
	f_showbuff(7,3,set_mark_color);
	f_showbuff(8,3,set_mark_trans);
	f_showbuff(10,18,tele_code);
	f_show_set_privacy_offset20();
	f_show_gb_fun();
}
//--------------------------------------------
void	f_key_set_privacy(void)
{
	switch(function)
	{
		case	ADD:		f_key_set_privacy_add();break;
		case	SUB:		f_key_set_privacy_sub();break;
		case	TRUE:		f_key_set_privacy_true();break;
		case	FALSE:		f_key_set_privacy_false();break;
		case	ENTER:		f_key_set_privacy_enter();break;
		case	CANCE:		f_key_set_privacy_cance();break;
		case	0x3A:		f_key_set_privacy_shot();break;
		default:	break;
	}
}
void	f_key_set_privacy_add(void)
{
	gb_brush_flag=1;
	++h_position;
	if(h_position>=9)
	{
		h_position=4;
	}
}

void	f_key_set_privacy_sub(void)
{
	gb_brush_flag=1;
	--h_position;
	if(h_position<=3)
	{
		h_position=8;
	}
}
void	f_key_set_privacy_true(void)
{
        func_brush_flag=1;
	switch(h_position)
	{/*
		case	4:
			if(mark_id<=23)	mark_id++;
			sendtwo=0x84;
			sendthree=mark_id;
			sendfour=0x01;
			f_sendbytes();
			break;
			*/
		case	4:
			mark_clear_flag=1;
			sendtwo=0x84;
			sendthree=mark_clear_flag;
			sendfour=0x02;
			f_sendbytes();
			break;
		case	5:
			if(mark_length<=159)	mark_length++;
			sendtwo=0x84;
			sendthree=mark_length;
			sendfour=0x03;
			f_sendbytes();
			break;
		case	6:
			if(mark_width<=119)	mark_width++;
			sendtwo=0x84;
			sendthree=mark_width;
			sendfour=0x04;
			f_sendbytes();
			break;
		case	7:
			mark_color=1;
			sendtwo=0x84;
			sendthree=mark_color;
			sendfour=0x05;
			f_sendbytes();
			break;
		case	8:
			if(mark_trans<=12)	mark_trans++;
			sendtwo=0x84;
			sendthree=mark_trans;
			sendfour=0x06;
			f_sendbytes();
			break;
		
		default:	h_position=4;
	 				break;
	}
}

void	f_key_set_privacy_false(void)
{
		func_brush_flag=1;
		switch(h_position)

		{/*
		case	4:
			if(mark_id>=2)	mark_id--;
			sendtwo=0x84;
			sendthree=mark_id;
			sendfour=0x01;
			f_sendbytes();
			break;*/
		case	4:
			mark_clear_flag=0;
			sendtwo=0x84;
			sendthree=mark_clear_flag;
			sendfour=0x02;
			f_sendbytes();
			break;
		case	5:
			if(mark_length>=1)	mark_length--;
			sendtwo=0x84;
			sendthree=mark_length;
			sendfour=0x03;
			f_sendbytes();
			break;
		case	6:
			if(mark_width>=1)	mark_width--;
			sendtwo=0x84;
			sendthree=mark_width;
			sendfour=0x04;
			f_sendbytes();
			break;
		case	7:
			mark_color=0;
			sendtwo=0x84;
			sendthree=mark_color;
			sendfour=0x05;
			f_sendbytes();
			break;
		case	8:
			if(mark_trans>=2)	mark_trans--;
			sendtwo=0x84;
			sendthree=mark_trans;
			sendfour=0x06;
			f_sendbytes();
			break;
		
		default:	h_position=4;
	 				break;
	}
}

void	f_key_set_privacy_enter(void)
{       
	
}
void	f_key_set_privacy_cance(void)
{
	 f_key_clear_flag();
         _nop_();
	 set_camera_display_flag=1;
         h_position=3;
         mark_clear_flag=0;
	sendtwo=0x84;
	sendthree=0x00;
	sendfour=0x00;
	f_sendbytes();
	h_position=7;
}

void	f_key_set_privacy_shot(void)
{
	func_brush_flag=1;
	gb_brush_flag=1;
	switch(h_position)
	{
		/*
		case	4:
			mark_id=function1;
			if(mark_id>=24)	mark_id=24;
			sendtwo=0x84;
			sendthree=mark_id;
			sendfour=0x01;
			f_sendbytes();
			h_position+=2;
			break;
			*/
		case	4:
			break;
		case	5:
			mark_length=function1;
			if(mark_length>=160)	mark_id=160;
			sendtwo=0x84;
			sendthree=mark_length;
			sendfour=0x03;
			f_sendbytes();
			h_position++;
			break;
		case	6:
			mark_width=function1;
			if(mark_width>=120)	mark_id=120;
			sendtwo=0x84;
			sendthree=mark_width;
			sendfour=0x04;
			f_sendbytes();
			h_position+=2;
			break;
		case	7:
			break;
		case	8:
			mark_trans=function1;
			if(mark_trans>=13)	mark_id=13;
			sendtwo=0x84;
			sendthree=mark_trans;
			sendfour=0x06;
			f_sendbytes();
			h_position++;
			break;
		
		default:	h_position=4;
	 				break;
	}
}
f_trans_num_to_char(uchar *num_char,uchar trans_num)
{
	uchar	i;
	for(i=0;i<3;i++)
	{
		num_char[i]=0xff;
	}
	if(trans_num<10)
	{
		num_char[0]=trans_num;			
		num_char[1]=0xef;
		num_char[2]=0xef;		
		return ;
	}
	if(trans_num<100)
	{
		num_char[0]=trans_num/10;
		num_char[1]=trans_num%10;
		num_char[2]=0xef;		
	return ;
	}
	else
	{
		num_char[0]=trans_num/100;
		i=trans_num%100;
		num_char[1]=i/10;
		num_char[2]=i%10;
	}
}
void    f_show_set_privacy_offset20(void)
{
	uchar num_char[3],i;
	EA=0;
        f_clear_flag_fun();	
	
      	cs_to_6453=0;
    	f_input_6453(0xce);
	if(mark_clear_flag==1)
	{
		f_showbuff(4,20,on);	
	}
	else
	{
		f_showbuff(4,20,off);	
	}
	cs_to_6453=1;
	
	f_trans_num_to_char(num_char,mark_length);
	f_character_position(5,20);
	cs_to_6453=1;
      	cs_to_6453=0;
    	f_input_6453(0xce);
	for(i=0;i<3;i++)
	{
		f_input_6453(num_char[i]);
	}
	cs_to_6453=1;
	
	f_trans_num_to_char(num_char,mark_width);
	f_character_position(6,20);
	cs_to_6453=1;
      	cs_to_6453=0;
    	f_input_6453(0xce);
	for(i=0;i<3;i++)
	{
		f_input_6453(num_char[i]);
	}
	cs_to_6453=1;
	
      	cs_to_6453=0;
    	f_input_6453(0xce);
	if(mark_color==1)
	{
		f_showbuff(7,20,red_code);	
	}
	else
	{
		f_showbuff(7,20,blue_code);	
	}
	cs_to_6453=1;
	
	f_trans_num_to_char(num_char,mark_trans);
	f_character_position(8,20);
	cs_to_6453=1;
      	cs_to_6453=0;
    	f_input_6453(0xce);
	for(i=0;i<3;i++)
	{
		f_input_6453(num_char[i]);
	}
	cs_to_6453=1;
}

//----------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -