#include "jundge.h"
#define SEND_MAX_LEN 120//6+x*15+9
uint8_t My_Queue[256]={0};
QUEUE8_t Queue_Date;
ext_draw_crosshair_t Draw_CH;
ex_draw_char Draw_Char;
uint16_t cmd_id;
int Juseat=0;
uint8_t Analysis[256]={0};
Jundge_Power_Heat_Data_t jundge_power_heat_data_t={0};
Jundge_Gawme_Robot_Status_t	jundge_game_robot_status_t={0};

void Jundge_Analysis()
{	Juseat=sizeof(ext_power_heat_data_t);
	static uint32_t length=0;
	length=QUEUE_PacketOut(&Queue_Date,Analysis,QUEUE_PacketLengthGet(&Queue_Date));
					for(int i=0;i<length;i++)
				if(Analysis[i]==0xa5)
						if(verify_crc8((uint8_t*)&Analysis[i],5))//byte
	{									
								cmd_id=(Analysis[i+6]<<8|Analysis[i+5]);
							switch(cmd_id)
			{	/*CRCsum=	5+2+buff_lenth+2*/
					/*实际功率热量数据*/								
				case power_heat_data:	if(verify_crc16(	(uint8_t*)&Analysis[i],9+sizeof(ext_power_heat_data_t)	))	
										for(int j=0;j<16;j++) jundge_power_heat_data_t.save[j]=Analysis[i+7+j];

					/*比赛状态*/
				case game_robot_status:	if(verify_crc16(	(uint8_t*)&Analysis[i],9+sizeof(ext_game_robot_status_t)	))	
										for(int j=0;j<29;j++) jundge_game_robot_status_t.save[j]=Analysis[i+7+j];

									
			}
	}
}

static uint8_t ClienTxBuffer[SEND_MAX_LEN];
void Draw_CrossHair_1(ext_draw_crosshair_t *draw,uint16_t cmd_id,uint16_t data_id,uint16_t tx_id,uint16_t rx_id)
{	
	static uint8_t seq=0;
	draw->txFrame_Header.sof = 0xa5;
	draw->txFrame_Header.data_length = sizeof(ext_student_interactive_header_data_t)+7*sizeof(graphic_data_struct_t);
	draw->txFrame_Header.seq = seq;
	
	memcpy(ClienTxBuffer,&draw->txFrame_Header,sizeof(Frame_Header_t));
	append_crc8(ClienTxBuffer,sizeof(Frame_Header_t));
	seq++;
	
	draw->CMD_ID = cmd_id;
	draw->Client_Custom_ID.data_cmd_id = data_id;
	draw->Client_Custom_ID.sender_ID = tx_id;
	draw->Client_Custom_ID.receiver_ID = rx_id;
	/*****绘制准心*****/	
	
	/*1~5图,辅助瞄准*/ /*中心坐标（960,540）*/
	
	if(seq%2==0){	
	draw->Graphic_Data[0].graphic_name[0] = 'h';
	draw->Graphic_Data[0].graphic_name[1] = 'h';
	draw->Graphic_Data[0].graphic_name[2] = 'h';
		draw->Graphic_Data[0].operate_tpye = 1;
	draw->Graphic_Data[0].graphic_tpye = 0;
	draw->Graphic_Data[0].layer = 0;
	draw->Graphic_Data[0].color = 2;
	draw->Graphic_Data[0].start_angle = 0;
	draw->Graphic_Data[0].end_angle = 0;
	draw->Graphic_Data[0].width = 5;
	draw->Graphic_Data[0].start_x = 840;
	draw->Graphic_Data[0].start_y = 640;
	draw->Graphic_Data[0].radius = 0;
	draw->Graphic_Data[0].end_x = 1080;
	draw->Graphic_Data[0].end_y = 640;
	
		draw->Graphic_Data[1].operate_tpye = 1;
	draw->Graphic_Data[1].graphic_name[0] = 'b';
	draw->Graphic_Data[1].graphic_name[1] = 'b';
	draw->Graphic_Data[1].graphic_name[2] = 'b';
		draw->Graphic_Data[1].operate_tpye = 1;
	draw->Graphic_Data[1].graphic_tpye = 0;
	draw->Graphic_Data[1].layer = 0;
	draw->Graphic_Data[1].color = 2;
	draw->Graphic_Data[1].start_angle = 0;
	draw->Graphic_Data[1].end_angle = 0;
	draw->Graphic_Data[1].width = 3;
	draw->Graphic_Data[1].start_x = 860;
	draw->Graphic_Data[1].start_y = 410;
	draw->Graphic_Data[1].radius = 0;
	draw->Graphic_Data[1].end_x = 1060;
	draw->Graphic_Data[1].end_y = 410;

		draw->Graphic_Data[2].graphic_name[0] = 'c';
	draw->Graphic_Data[2].graphic_name[1] = 'c';
	draw->Graphic_Data[2].graphic_name[2] = 'c';
		draw->Graphic_Data[2].operate_tpye = 1;
	draw->Graphic_Data[2].graphic_tpye = 0;
	draw->Graphic_Data[2].layer = 0;
	draw->Graphic_Data[2].color = 2;
	draw->Graphic_Data[2].start_angle = 0;
	draw->Graphic_Data[2].end_angle = 0;
	draw->Graphic_Data[2].width = 3;
	draw->Graphic_Data[2].start_x = 880;
	draw->Graphic_Data[2].start_y = 360;
	draw->Graphic_Data[2].radius = 0;
	draw->Graphic_Data[2].end_x = 1040;
	draw->Graphic_Data[2].end_y = 360;
	
			draw->Graphic_Data[3].graphic_name[0] = 'd';
	draw->Graphic_Data[3].graphic_name[1] = 'd';
	draw->Graphic_Data[3].graphic_name[2] = 'd';
		draw->Graphic_Data[3].operate_tpye = 1;
	draw->Graphic_Data[3].graphic_tpye = 0;
	draw->Graphic_Data[3].layer = 0;
	draw->Graphic_Data[3].color = 2;
	draw->Graphic_Data[3].start_angle = 0;
	draw->Graphic_Data[3].end_angle = 0;
	draw->Graphic_Data[3].width = 3;
	draw->Graphic_Data[3].start_x = 900;
	draw->Graphic_Data[3].start_y = 310;
	draw->Graphic_Data[3].radius = 0;
	draw->Graphic_Data[3].end_x = 1020;
	draw->Graphic_Data[3].end_y = 310;
	
			draw->Graphic_Data[4].graphic_name[0] = 'e';
	draw->Graphic_Data[4].graphic_name[1] = 'e';
	draw->Graphic_Data[4].graphic_name[2] = 'e';
		draw->Graphic_Data[4].operate_tpye = 1;
	draw->Graphic_Data[4].graphic_tpye = 0;
	draw->Graphic_Data[4].layer = 0;
	draw->Graphic_Data[4].color = 2;
	draw->Graphic_Data[4].start_angle = 0;
	draw->Graphic_Data[4].end_angle = 0;
	draw->Graphic_Data[4].width = 3;
	draw->Graphic_Data[4].start_x = 920;
	draw->Graphic_Data[4].start_y = 260;
	draw->Graphic_Data[4].radius = 0;
	draw->Graphic_Data[4].end_x = 1000;
	draw->Graphic_Data[4].end_y = 260;
	
						/*纵线*/
		draw->Graphic_Data[5].graphic_name[0] = 'f';
	draw->Graphic_Data[5].graphic_name[1] = 'f';
	draw->Graphic_Data[5].graphic_name[2] = 'f';
//	if(seq<=5)
//		draw->Graphic_Data[5].operate_tpye = 1;
//	else 
		draw->Graphic_Data[5].operate_tpye = 1;
	draw->Graphic_Data[5].graphic_tpye = 0;
	draw->Graphic_Data[5].layer = 0;
	draw->Graphic_Data[5].color = 1;
	draw->Graphic_Data[5].start_angle = 0;
	draw->Graphic_Data[5].end_angle = 0;
	draw->Graphic_Data[5].width = 3;
	draw->Graphic_Data[5].start_x = 960;
	draw->Graphic_Data[5].start_y = 700;
	draw->Graphic_Data[5].radius = 0;
	draw->Graphic_Data[5].end_x = 960;
	draw->Graphic_Data[5].end_y = 260;
	
						/* 圆 */
		draw->Graphic_Data[6].graphic_name[0] = 'g';
	draw->Graphic_Data[6].graphic_name[1] = 'g';
	draw->Graphic_Data[6].graphic_name[2] = 'g';

		draw->Graphic_Data[6].operate_tpye = 1;
	draw->Graphic_Data[6].graphic_tpye = 2;
	draw->Graphic_Data[6].layer = 0;
	draw->Graphic_Data[6].color = 5;
	draw->Graphic_Data[6].start_angle = 0;
	draw->Graphic_Data[6].end_angle = 0;
	draw->Graphic_Data[6].width = 4;
	draw->Graphic_Data[6].start_x = 960;
	draw->Graphic_Data[6].start_y = 540;
	draw->Graphic_Data[6].radius = 30;
	draw->Graphic_Data[6].end_x = 960;
	draw->Graphic_Data[6].end_y = 540;
	}
	
	//车道线
	if(seq%2!=0)
	{
		draw->Graphic_Data[0].graphic_name[0] = 'c';
	draw->Graphic_Data[0].graphic_name[1] = 'a';
	draw->Graphic_Data[0].graphic_name[2] = 'a';
		draw->Graphic_Data[0].operate_tpye = 1;
	draw->Graphic_Data[0].graphic_tpye = 0;
	draw->Graphic_Data[0].layer = 1;
	draw->Graphic_Data[0].color = 2;
	draw->Graphic_Data[0].start_angle = 0;
	draw->Graphic_Data[0].end_angle = 0;
	draw->Graphic_Data[0].width = 5;
	draw->Graphic_Data[0].start_x = 690-100;
	draw->Graphic_Data[0].start_y = 1080-865-100-65+10;
	draw->Graphic_Data[0].radius = 0;
	draw->Graphic_Data[0].end_x = 1230+100;
	draw->Graphic_Data[0].end_y = 1080-865-100-65+10;
	
		draw->Graphic_Data[1].operate_tpye = 1;
	draw->Graphic_Data[1].graphic_name[0] = 'c';
	draw->Graphic_Data[1].graphic_name[1] = 'b';
	draw->Graphic_Data[1].graphic_name[2] = 'b';
		draw->Graphic_Data[1].operate_tpye = 1;
	draw->Graphic_Data[1].graphic_tpye = 0;
	draw->Graphic_Data[1].layer = 1;
	draw->Graphic_Data[1].color = 2;
	draw->Graphic_Data[1].start_angle = 0;
	draw->Graphic_Data[1].end_angle = 45;
	draw->Graphic_Data[1].width = 3;
	draw->Graphic_Data[1].start_x = 630-100;
	draw->Graphic_Data[1].start_y = 10;
	draw->Graphic_Data[1].radius = 0;
	draw->Graphic_Data[1].end_x = 690-100;
	draw->Graphic_Data[1].end_y = 1080-865-100-65+10;

		draw->Graphic_Data[2].graphic_name[0] = 'c';
	draw->Graphic_Data[2].graphic_name[1] = 'd';
	draw->Graphic_Data[2].graphic_name[2] = 'd';
		draw->Graphic_Data[2].operate_tpye = 1;
	draw->Graphic_Data[2].graphic_tpye = 0;
	draw->Graphic_Data[2].layer = 1;
	draw->Graphic_Data[2].color = 2;
	draw->Graphic_Data[2].start_angle = 0;
	draw->Graphic_Data[2].end_angle = 360-45;
	draw->Graphic_Data[2].width = 3;
	draw->Graphic_Data[2].start_x = 1230+100;
	draw->Graphic_Data[2].start_y = 1080-865-100-65+10;
	draw->Graphic_Data[2].radius = 0;
	draw->Graphic_Data[2].end_x = 1280+100;
	draw->Graphic_Data[2].end_y = 10;
	
			draw->Graphic_Data[3].graphic_name[0] = 'c';
	draw->Graphic_Data[3].graphic_name[1] = 'e';
	draw->Graphic_Data[3].graphic_name[2] = 'e';
		draw->Graphic_Data[3].operate_tpye = 1;
	draw->Graphic_Data[3].graphic_tpye = 0;
	draw->Graphic_Data[3].layer = 1;
	draw->Graphic_Data[3].color = 2;
	draw->Graphic_Data[3].start_angle = 0;
	draw->Graphic_Data[3].end_angle = 0;
	draw->Graphic_Data[3].width = 3;
	draw->Graphic_Data[3].start_x = 960+300;
	draw->Graphic_Data[3].start_y = 540-120;
	draw->Graphic_Data[3].radius = 0;
	draw->Graphic_Data[3].end_x = 960+300;
	draw->Graphic_Data[3].end_y = 540+150;
	
			draw->Graphic_Data[4].graphic_name[0] = 'c';
	draw->Graphic_Data[4].graphic_name[1] = 'f';
	draw->Graphic_Data[4].graphic_name[2] = 'f';
		draw->Graphic_Data[4].operate_tpye = 1;
	draw->Graphic_Data[4].graphic_tpye = 0;
	draw->Graphic_Data[4].layer = 1;
	draw->Graphic_Data[4].color = 2;
	draw->Graphic_Data[4].start_angle = 0;
	draw->Graphic_Data[4].end_angle = 0;
	draw->Graphic_Data[4].width = 3;
	draw->Graphic_Data[4].start_x = 960-300;
	draw->Graphic_Data[4].start_y = 540-120;
	draw->Graphic_Data[4].radius = 0;
	draw->Graphic_Data[4].end_x = 960-300;
	draw->Graphic_Data[4].end_y = 540+150;
	
						/*纵线*/
		draw->Graphic_Data[5].graphic_name[0] = 'c';
	draw->Graphic_Data[5].graphic_name[1] = 'g';
	draw->Graphic_Data[5].graphic_name[2] = 'g';
		draw->Graphic_Data[5].operate_tpye = 1;
	draw->Graphic_Data[5].graphic_tpye = 0;
	draw->Graphic_Data[5].layer = 1;
	draw->Graphic_Data[5].color = 1;
	draw->Graphic_Data[5].start_angle = 0;
	draw->Graphic_Data[5].end_angle = 0;
	draw->Graphic_Data[5].width = 3;
	draw->Graphic_Data[5].start_x = 960;
	draw->Graphic_Data[5].start_y = 700;
	draw->Graphic_Data[5].radius = 0;
	draw->Graphic_Data[5].end_x = 960;
	draw->Graphic_Data[5].end_y = 260;
	
						/* 圆 */
		draw->Graphic_Data[6].graphic_name[0] = 'c';
	draw->Graphic_Data[6].graphic_name[1] = 'h';
	draw->Graphic_Data[6].graphic_name[2] = 'h';	
		draw->Graphic_Data[6].operate_tpye = 1;
	draw->Graphic_Data[6].graphic_tpye = 2;
	draw->Graphic_Data[6].layer = 1;
	draw->Graphic_Data[6].color = 5;
	draw->Graphic_Data[6].start_angle = 0;
	draw->Graphic_Data[6].end_angle = 0;
	draw->Graphic_Data[6].width = 4;
	draw->Graphic_Data[6].start_x = 960;
	draw->Graphic_Data[6].start_y = 540;
	draw->Graphic_Data[6].radius = 30;
	draw->Graphic_Data[6].end_x = 960;
	draw->Graphic_Data[6].end_y = 540;
	}
	memcpy(&ClienTxBuffer[5],(uint8_t*)&draw->CMD_ID,(sizeof(ext_student_interactive_header_data_t)+7*sizeof(graphic_data_struct_t)+2*sizeof(uint16_t)));
	append_crc16(ClienTxBuffer,sizeof(ext_draw_crosshair_t));	
	for(int i=0;i<sizeof(ext_draw_crosshair_t);i++)
	{	
		while(USART_GetFlagStatus(USART3,USART_FLAG_TXE)==RESET);
		USART_SendData(USART3,(uint8_t)ClienTxBuffer[i]);
		while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET);
	}
}



int Char_sizeof=0;
char Dr_Char_1[]={" \nyaw\npit\n"};
char Dr_Char_2[30]={0};
static uint8_t Clien_character[60];
void Draw_Static_Char(ex_draw_char *draw,uint16_t cmd_id,uint16_t data_id,uint16_t tx_id,uint16_t rx_id)
{	 
	Char_sizeof=sizeof(Dr_Char_1);
	static uint8_t seq_char=0;
	draw->txFrame_Header.sof = 0xa5;
	draw->txFrame_Header.data_length =sizeof(ext_student_interactive_header_data_t)+45;;
	draw->txFrame_Header.seq = seq_char;
	memcpy(Clien_character,&draw->txFrame_Header,sizeof(Frame_Header_t));
	append_crc8(Clien_character,sizeof(Frame_Header_t));
	seq_char++;
	
	draw->CMD_ID = cmd_id;
	draw->Client_Custom_ID.data_cmd_id = data_id;
	draw->Client_Custom_ID.sender_ID = tx_id;
	draw->Client_Custom_ID.receiver_ID = rx_id;
	for(int i=0;i<29;i++)
	draw->data[i]=0;
	 //字母
	if(seq_char%2==1)
	{draw->grapic_data_struct.graphic_name[1] = 'm';
	draw->grapic_data_struct.graphic_name[1] = 'm';
	draw->grapic_data_struct.graphic_name[2] = 'm';
		draw->grapic_data_struct.operate_tpye = 1;
	draw->grapic_data_struct.graphic_tpye = 7;
	draw->grapic_data_struct.layer = 1;
	draw->grapic_data_struct.color = 3;
	draw->grapic_data_struct.start_angle = 20;//字体大小
	draw->grapic_data_struct.end_angle = 30;//字长
	draw->grapic_data_struct.width = 2;
	draw->grapic_data_struct.start_x = 480-200;
	draw->grapic_data_struct.start_y = 540-100;
	draw->grapic_data_struct.radius = 0;
	draw->grapic_data_struct.end_x = 0;
	draw->grapic_data_struct.end_y = 0;
	for(int i=0;i<sizeof(Dr_Char_1);i++)
	draw->data[i]=Dr_Char_1[i];
	}
	
	//数字
	else if(seq_char%2!=1)
	{
		draw->grapic_data_struct.graphic_name[1] = 'm';
	draw->grapic_data_struct.graphic_name[1] = 'a';
	draw->grapic_data_struct.graphic_name[2] = 'a';
		draw->grapic_data_struct.operate_tpye = 1;
	draw->grapic_data_struct.graphic_tpye = 7;
	draw->grapic_data_struct.layer = 1;
	draw->grapic_data_struct.color = 2;
	draw->grapic_data_struct.start_angle = 20;//字体大小
	draw->grapic_data_struct.end_angle = 30;//字长
	draw->grapic_data_struct.width = 2;
	draw->grapic_data_struct.start_x = 480-200;
	draw->grapic_data_struct.start_y = 540-100;
	draw->grapic_data_struct.radius = 0;
	draw->grapic_data_struct.end_x = 0;
	draw->grapic_data_struct.end_y = 0;
	}
	
	memcpy(&Clien_character[5],(uint8_t*)&draw->CMD_ID,(sizeof(ext_student_interactive_header_data_t)+45+2*sizeof(uint16_t)));
	append_crc16(Clien_character,sizeof(ex_draw_char));	
	for(int i=0;i<sizeof(ext_draw_crosshair_t);i++)
	{
		while(USART_GetFlagStatus(USART3,USART_FLAG_TXE)==RESET);
		USART_SendData(USART3,(uint8_t)Clien_character[i]);
		while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET);
	}
}

static uint8_t Clien_character[60];
void Draw_Dynamicr_Char(ex_draw_char *draw,uint16_t cmd_id,uint16_t data_id,uint16_t tx_id,uint16_t rx_id)
{	 
	Char_sizeof=sizeof(Dr_Char_1);
	static uint8_t seq_char=0;
	draw->txFrame_Header.sof = 0xa5;
	draw->txFrame_Header.data_length =sizeof(ext_student_interactive_header_data_t)+45;;
	draw->txFrame_Header.seq = seq_char;
	memcpy(Clien_character,&draw->txFrame_Header,sizeof(Frame_Header_t));
	append_crc8(Clien_character,sizeof(Frame_Header_t));
	seq_char++;
	
	draw->CMD_ID = cmd_id;
	draw->Client_Custom_ID.data_cmd_id = data_id;
	draw->Client_Custom_ID.sender_ID = tx_id;
	draw->Client_Custom_ID.receiver_ID = rx_id;
	
		for(int i=0;i<29;i++)
	draw->data[i]=0;
	//数字
		draw->grapic_data_struct.graphic_name[1] = 'm';
	draw->grapic_data_struct.graphic_name[1] = 'a';
	draw->grapic_data_struct.graphic_name[2] = 'a';
		draw->grapic_data_struct.operate_tpye = 2;
	draw->grapic_data_struct.graphic_tpye = 7;
	draw->grapic_data_struct.layer = 1;
	draw->grapic_data_struct.color = 2;
	draw->grapic_data_struct.start_angle = 30;//字体大小
	draw->grapic_data_struct.end_angle = 30;//字长
	draw->grapic_data_struct.width = 3;
	draw->grapic_data_struct.start_x = 480-200;
	draw->grapic_data_struct.start_y = 540-100;
	draw->grapic_data_struct.radius = 0;
	draw->grapic_data_struct.end_x = 0;
	draw->grapic_data_struct.end_y = 0;
	

		draw->data[0]='\n';
		draw->data[1]=' ';
		draw->data[2]=' ';
		draw->data[3]=' ';
		if(imu.pit>0) draw->data[4]=' ';
		else draw->data[4]='-';
	draw->data[5]=(int)fabs(imu.pit)/100+'0';
	draw->data[6]=(int)fabs(imu.pit)/10%10+'0';
	draw->data[7]=(int)fabs(imu.pit)%10+'0';
	draw->data[8]='.';
	draw->data[9]=(int)fabs(imu.pit*10)%10+'0';	
	draw->data[10]=' ';
	
	draw->data[11]='\n';
	draw->data[12]=' ';
	draw->data[13]=' ';
	draw->data[14]=' ';
	if(imu.yaw>0) draw->data[15]=' ';
		else draw->data[15]='-';
	draw->data[16]=(int)fabs(imu.yaw)/100+'0';
	draw->data[17]=(int)fabs(imu.yaw)/10%10+'0';
	draw->data[18]=(int)fabs(imu.yaw)%10+'0';
	draw->data[19]='.';
	draw->data[20]=(int)fabs(imu.yaw*10)%10+'0';
	
	memcpy(&Clien_character[5],(uint8_t*)&draw->CMD_ID,(sizeof(ext_student_interactive_header_data_t)+45+2*sizeof(uint16_t)));
	append_crc16(Clien_character,sizeof(ex_draw_char));	
	for(int i=0;i<sizeof(ext_draw_crosshair_t);i++)
	{
		while(USART_GetFlagStatus(USART3,USART_FLAG_TXE)==RESET);
		USART_SendData(USART3,(uint8_t)Clien_character[i]);
		while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET);
	}
}

/*
static uint8_t Clien_character[90];
void Draw_CrossHair_2(ext_draw_crosshair_t *draw,uint16_t cmd_id,uint16_t data_id,uint16_t tx_id,uint16_t rx_id)
{	
	static uint8_t seq=0;
	draw->txFrame_Header.sof = 0xa5;
	draw->txFrame_Header.data_length = sizeof(ext_student_interactive_header_data_t)+5*sizeof(graphic_data_struct_t);
	draw->txFrame_Header.seq = 0;
	draw->txFrame_Header.seq = seq++;

	memcpy(Clien_character,&draw->txFrame_Header,sizeof(Frame_Header_t));
	append_crc8(Clien_character,sizeof(Frame_Header_t));
	draw->CMD_ID = cmd_id;
	draw->Client_Custom_ID.data_cmd_id = data_id;
	draw->Client_Custom_ID.sender_ID = tx_id;
	draw->Client_Custom_ID.receiver_ID = rx_id;

	
	
	draw->Graphic_Data[0].graphic_name[0] = 'h';
	draw->Graphic_Data[0].graphic_name[1] = 'h';
	draw->Graphic_Data[0].graphic_name[2] = 'h';
	if(seq<=5)
		draw->Graphic_Data[0].operate_tpye = 1;
	else
		draw->Graphic_Data[0].operate_tpye = 0;
	draw->Graphic_Data[0].graphic_tpye = 5;
	draw->Graphic_Data[0].layer = 1;
	draw->Graphic_Data[0].color = 2;
	draw->Graphic_Data[0].start_angle = 20;
	draw->Graphic_Data[0].end_angle = 4;
	draw->Graphic_Data[0].width = 5;
	draw->Graphic_Data[0].start_x = 1080;
	draw->Graphic_Data[0].start_y = 640;
	draw->Graphic_Data[0].radius = imu.pit;
	draw->Graphic_Data[0].end_x = imu.pit;
	draw->Graphic_Data[0].end_y = imu.pit;
	
	if(seq<=5)
		draw->Graphic_Data[1].operate_tpye = 1;
	else
		draw->Graphic_Data[1].operate_tpye = 0;
	draw->Graphic_Data[1].graphic_name[0] = 'i';
	draw->Graphic_Data[1].graphic_name[1] = 'i';
	draw->Graphic_Data[1].graphic_name[2] = 'i';

		draw->Graphic_Data[1].operate_tpye = 1;

	draw->Graphic_Data[1].graphic_tpye = 0;
	draw->Graphic_Data[1].layer = 1;
	draw->Graphic_Data[1].color = 2;
	draw->Graphic_Data[1].start_angle = 0;
	draw->Graphic_Data[1].end_angle = 0;
	draw->Graphic_Data[1].width = 3;
	draw->Graphic_Data[1].start_x = 860;
	draw->Graphic_Data[1].start_y = 410;
	draw->Graphic_Data[1].radius = 0;
	draw->Graphic_Data[1].end_x = 1060;
	draw->Graphic_Data[1].end_y = 410;

		draw->Graphic_Data[2].graphic_name[0] = 'j';
	draw->Graphic_Data[2].graphic_name[1] = 'j';
	draw->Graphic_Data[2].graphic_name[2] = 'j';
	if(seq<=5)
		draw->Graphic_Data[2].operate_tpye = 1;
	else 
		draw->Graphic_Data[2].operate_tpye = 0;
	draw->Graphic_Data[2].graphic_tpye = 0;
	draw->Graphic_Data[2].layer = 1;
	draw->Graphic_Data[2].color = 2;
	draw->Graphic_Data[2].start_angle = 0;
	draw->Graphic_Data[2].end_angle = 0;
	draw->Graphic_Data[2].width = 3;
	draw->Graphic_Data[2].start_x = 880;
	draw->Graphic_Data[2].start_y = 360;
	draw->Graphic_Data[2].radius = 0;
	draw->Graphic_Data[2].end_x = 1040;
	draw->Graphic_Data[2].end_y = 360;
	
			draw->Graphic_Data[3].graphic_name[0] = 'k';
	draw->Graphic_Data[3].graphic_name[1] = 'k';
	draw->Graphic_Data[3].graphic_name[2] = 'k';
	if(seq<=5)
		draw->Graphic_Data[3].operate_tpye = 1;
	else 
		draw->Graphic_Data[3].operate_tpye = 0;
	draw->Graphic_Data[3].graphic_tpye = 0;
	draw->Graphic_Data[3].layer = 1;
	draw->Graphic_Data[3].color = 2;
	draw->Graphic_Data[3].start_angle = 0;
	draw->Graphic_Data[3].end_angle = 0;
	draw->Graphic_Data[3].width = 3;
	draw->Graphic_Data[3].start_x = 900;
	draw->Graphic_Data[3].start_y = 310;
	draw->Graphic_Data[3].radius = 0;
	draw->Graphic_Data[3].end_x = 1020;
	draw->Graphic_Data[3].end_y = 310;
	
			draw->Graphic_Data[4].graphic_name[0] = 'l';
	draw->Graphic_Data[4].graphic_name[1] = 'l';
	draw->Graphic_Data[4].graphic_name[2] = 'l';
	if(seq<=5)
		draw->Graphic_Data[4].operate_tpye = 1;
	else 
		draw->Graphic_Data[4].operate_tpye = 0;
	draw->Graphic_Data[4].graphic_tpye = 0;
	draw->Graphic_Data[4].layer = 1;
	draw->Graphic_Data[4].color = 2;
	draw->Graphic_Data[4].start_angle = 0;
	draw->Graphic_Data[4].end_angle = 0;
	draw->Graphic_Data[4].width = 3;
	draw->Graphic_Data[4].start_x = 920;
	draw->Graphic_Data[4].start_y = 260;
	draw->Graphic_Data[4].radius = 0;
	draw->Graphic_Data[4].end_x = 1000;
	draw->Graphic_Data[4].end_y = 260;
	
	
		draw->Graphic_Data[5].graphic_name[0] = 'm';
	draw->Graphic_Data[5].graphic_name[1] = 'm';
	draw->Graphic_Data[5].graphic_name[2] = 'm';
	if(seq<=5)
		draw->Graphic_Data[5].operate_tpye = 1;
	else 
		draw->Graphic_Data[5].operate_tpye = 0;
	draw->Graphic_Data[5].graphic_tpye = 0;
	draw->Graphic_Data[5].layer = 0;
	draw->Graphic_Data[5].color = 1;
	draw->Graphic_Data[5].start_angle = 0;
	draw->Graphic_Data[5].end_angle = 0;
	draw->Graphic_Data[5].width = 3;
	draw->Graphic_Data[5].start_x = 960;
	draw->Graphic_Data[5].start_y = 700;
	draw->Graphic_Data[5].radius = 0;
	draw->Graphic_Data[5].end_x = 960;
	draw->Graphic_Data[5].end_y = 260;
	
		draw->Graphic_Data[6].graphic_name[0] = 'n';
	draw->Graphic_Data[6].graphic_name[1] = 'n';
	draw->Graphic_Data[6].graphic_name[2] = 'n';
	if(seq<=5)
		draw->Graphic_Data[6].operate_tpye = 1;
	else 
		draw->Graphic_Data[6].operate_tpye = 0;
	draw->Graphic_Data[6].graphic_tpye = 2;
	draw->Graphic_Data[6].layer = 0;
	draw->Graphic_Data[6].color = 5;
	draw->Graphic_Data[6].start_angle = 0;
	draw->Graphic_Data[6].end_angle = 0;
	draw->Graphic_Data[6].width = 4;
	draw->Graphic_Data[6].start_x = 960;
	draw->Graphic_Data[6].start_y = 540;
	draw->Graphic_Data[6].radius = 30;
	draw->Graphic_Data[6].end_x = 960;
	draw->Graphic_Data[6].end_y = 540;

	memcpy(&Clien_character[5],(uint8_t*)&draw->CMD_ID,(sizeof(ext_student_interactive_header_data_t)+5*sizeof(graphic_data_struct_t)+2*sizeof(uint16_t)));
	append_crc16(Clien_character,sizeof(ext_draw_crosshair_t));	
	for(int i=0;i<sizeof(ext_draw_crosshair_t);i++)
	{
		USART_SendData(USART3,(uint8_t)Clien_character[i]);
		while(USART_GetFlagStatus(USART3,USART_FLAG_TC)==RESET);
	}
}
*/
