添加测试代码

This commit is contained in:
kidneygood
2023-01-26 20:41:52 +08:00
parent dc68657c16
commit 9968393672
3 changed files with 159 additions and 128 deletions

View File

@@ -16,7 +16,7 @@
static Referee_Interactive_info_t Interactive_data; // 非裁判系统数据
static referee_info_t *referee_data; // 裁判系统相关数据
static robot_interactive_data_t *SendData={1,2,3,4,5};
static robot_interactive_data_t *SendData;
static void determine_ID(referee_info_t *_referee_info);
static void My_UI_init(referee_info_t *_referee_info);
@@ -25,7 +25,7 @@ static void Mode_Change_Check(Referee_Interactive_info_t *_Interactive_data); //
//syhtod 正式上车后需删除
static void robot_mode_change(Referee_Interactive_info_t *_Interactive_data); // 测试用函数,实现模式自动变化
static void UI_test_init(referee_info_t *_referee_info);//UI测试函数
void Referee_Interactive_init()
{
@@ -34,6 +34,12 @@ void Referee_Interactive_init()
;
determine_ID(referee_data);
My_UI_init(referee_data);
//UI_test_init(referee_data);
for (int i=0;i<Communicate_Data_LEN;i++)
{
SendData->data[i]=i+1;
}
referee_data->referee_id.Receiver_Robot_ID = RobotID_BEngineer; // 机器人车间通信时接收者的ID暂时发给蓝色2
Communicate_SendData(&referee_data->referee_id,SendData);
}
@@ -355,3 +361,27 @@ static void determine_ID(referee_info_t *_referee_info)
_referee_info->referee_id.Cilent_ID = 0x0100 + _referee_info->referee_id.Robot_ID; // 计算客户端ID
_referee_info->referee_id.Receiver_Robot_ID = 0;
}
/* 测试用函数 */
static void UI_test_init(referee_info_t *_referee_info)
{
Graph_Data_t graph[5];
Graph_Data_t num[2];
String_Data_t sdata[1];
UI_Delete(&_referee_info->referee_id, UI_Data_Del_ALL, 0);
Line_Draw(&graph[0],"s0",UI_Graph_ADD,0,UI_Color_White,3,710,540,1210,540);
Rectangle_Draw(&graph[1],"s1",UI_Graph_ADD,0,UI_Color_Yellow,4,600,200,800,500);
Circle_Draw(&graph[2],"s2",UI_Graph_ADD,0,UI_Color_Green,5,960,540,100);
Elliptical_Draw(&graph[3],"s3",UI_Graph_ADD,0,UI_Color_Orange,3,960,540,100,20);
Arc_Draw(&graph[4],"s4",UI_Graph_ADD,0,UI_Color_Purplish_red,30,160,3,1200,550,50,100);
Float_Draw(&num[0],"s5",UI_Graph_ADD,0,UI_Color_Pink,50,3,5,1050,660,1245545);
Integer_Draw(&num[1],"s6",UI_Graph_ADD,0,UI_Color_Cyan,50,5,1050,460,12345);
UI_ReFresh(&_referee_info->referee_id,7,graph[0],graph[1],graph[2],graph[3],graph[4],num[0],num[1]);
Char_Draw(&sdata[0],"s7",UI_Graph_ADD,0,UI_Color_Green,20,2,620,710);
Char_Write(&sdata[0],"number:%d",123);
Char_ReFresh(&_referee_info->referee_id,sdata[0]);
}