feat: add VCU status feedback and map DEBUG safety inputs

This commit is contained in:
shenlefengnai-rgb
2026-10-03 21:52:14 +08:00
parent dbbda5624a
commit 1e7b2e7f96
305 changed files with 32906 additions and 68 deletions
+11
View File
@@ -0,0 +1,11 @@
//以下代码只在上电时运行一次,一般用于全局变量定义和上电初始化数据
int sys0=0,sys1=0,sys2=0 //全局变量定义目前仅支持4字节有符号整形(int),不支持其他类型的全局变量声明,如需使用字符串类型可以在页面中使用变量控件来实现
int pending_task=0,current_task=7
int lock_state=0,ebs_state=0
int shown_task=-1,shown_lock=-1,shown_ebs=-1
int d0=0,d1=0,d2=0,d3=0,d4=0,d5=0,d6=0,d7=0,d8=0,d9=0,d10=0,d11=0,d12=0,d13=0,d14=0,d15=0
baud=9600//配置波特率
dim=100//配置屏幕背光
recmod=0//串口协议模式:0-字符串指令协议;1-主动解析协议
printh 00 00 00 ff ff ff 88 ff ff ff//输出上电信息到串口
page 0 //上电刷新第0页
+29
View File
@@ -0,0 +1,29 @@
if(pending_task>=1&&pending_task<=6)
{
if(pending_task==1)
{
printh AA 55 01 01 0D 0A
}
if(pending_task==2)
{
printh AA 55 01 02 0D 0A
}
if(pending_task==3)
{
printh AA 55 01 03 0D 0A
}
if(pending_task==4)
{
printh AA 55 01 04 0D 0A
}
if(pending_task==5)
{
printh AA 55 01 05 0D 0A
}
if(pending_task==6)
{
printh AA 55 01 06 0D 0A
}
pending_task=0
page dash
}
+107
View File
@@ -0,0 +1,107 @@
shown_task=-1
shown_lock=-1
shown_ebs=-1
if(current_task!=shown_task)
{
rw.txt="未知"
rw.pco=33840
if(current_task==0)
{
rw.txt="无"
rw.pco=63488
}
if(current_task>=1&&current_task<=6)
{
rw.pco=2016
}
if(current_task==1)
{
rw.txt="八字绕环"
}
if(current_task==2)
{
rw.txt="直线加速"
}
if(current_task==3)
{
rw.txt="高速循迹"
}
if(current_task==4)
{
rw.txt="车检测试"
}
if(current_task==5)
{
rw.txt="EBS测试"
}
if(current_task==6)
{
rw.txt="手动驾驶"
}
bt0.val=0
if(current_task==1)
{
bt0.val=1
}
bt1.val=0
if(current_task==2)
{
bt1.val=1
}
bt2.val=0
if(current_task==3)
{
bt2.val=1
}
bt3.val=0
if(current_task==4)
{
bt3.val=1
}
bt4.val=0
if(current_task==5)
{
bt4.val=1
}
bt5.val=0
if(current_task==6)
{
bt5.val=1
}
shown_task=current_task
}
if(lock_state!=shown_lock)
{
sd.txt="锁定未知"
sd.pco=33840
if(lock_state==1)
{
sd.txt="已锁定"
sd.pco=2016
}
if(lock_state==2)
{
sd.txt="已解锁"
sd.pco=63488
}
shown_lock=lock_state
}
if(ebs_state!=shown_ebs)
{
EBS.txt="EBS 未知"
EBS.pco=33840
EBS.bco=0
if(ebs_state==1)
{
EBS.txt="EBS 正常"
EBS.pco=65535
EBS.bco=2016
}
if(ebs_state==2)
{
EBS.txt="EBS 故障"
EBS.pco=65535
EBS.bco=63488
}
shown_ebs=ebs_state
}
+104
View File
@@ -0,0 +1,104 @@
if(current_task!=shown_task)
{
rw.txt="未知"
rw.pco=33840
if(current_task==0)
{
rw.txt="无"
rw.pco=63488
}
if(current_task>=1&&current_task<=6)
{
rw.pco=2016
}
if(current_task==1)
{
rw.txt="八字绕环"
}
if(current_task==2)
{
rw.txt="直线加速"
}
if(current_task==3)
{
rw.txt="高速循迹"
}
if(current_task==4)
{
rw.txt="车检测试"
}
if(current_task==5)
{
rw.txt="EBS测试"
}
if(current_task==6)
{
rw.txt="手动驾驶"
}
bt0.val=0
if(current_task==1)
{
bt0.val=1
}
bt1.val=0
if(current_task==2)
{
bt1.val=1
}
bt2.val=0
if(current_task==3)
{
bt2.val=1
}
bt3.val=0
if(current_task==4)
{
bt3.val=1
}
bt4.val=0
if(current_task==5)
{
bt4.val=1
}
bt5.val=0
if(current_task==6)
{
bt5.val=1
}
shown_task=current_task
}
if(lock_state!=shown_lock)
{
sd.txt="锁定未知"
sd.pco=33840
if(lock_state==1)
{
sd.txt="已锁定"
sd.pco=2016
}
if(lock_state==2)
{
sd.txt="已解锁"
sd.pco=63488
}
shown_lock=lock_state
}
if(ebs_state!=shown_ebs)
{
EBS.txt="EBS 未知"
EBS.pco=33840
EBS.bco=0
if(ebs_state==1)
{
EBS.txt="EBS 正常"
EBS.pco=65535
EBS.bco=2016
}
if(ebs_state==2)
{
EBS.txt="EBS 故障"
EBS.pco=65535
EBS.bco=63488
}
shown_ebs=ebs_state
}
+316
View File
@@ -0,0 +1,316 @@
xstr 8,2,160,24,0,2047,0,1,1,1,"DEBUG 安全回路"
xstr 170,2,235,24,0,33840,0,1,1,1,"灰未知 绿正常 红故障"
draw 8,34,111,79,10565
xstr 9,36,102,18,0,65535,0,1,1,1,"配电箱"
draw 128,34,231,79,10565
xstr 129,36,102,18,0,65535,0,1,1,1,"左电机互锁"
draw 248,34,351,79,10565
xstr 249,36,102,18,0,65535,0,1,1,1,"左急停"
draw 368,34,471,79,10565
xstr 369,36,102,18,0,65535,0,1,1,1,"电池箱"
draw 128,84,231,129,10565
xstr 129,86,102,18,0,65535,0,1,1,1,"回路末端"
draw 248,84,351,129,10565
xstr 249,86,102,18,0,65535,0,1,1,1,"驾舱/右急停"
draw 368,84,471,129,10565
xstr 369,86,102,18,0,65535,0,1,1,1,"行程/惯性"
line 112,56,128,56,2047
line 124,53,128,56,2047
line 124,59,128,56,2047
line 232,56,248,56,2047
line 244,53,248,56,2047
line 244,59,248,56,2047
line 352,56,368,56,2047
line 364,53,368,56,2047
line 364,59,368,56,2047
line 472,56,478,56,2047
line 478,56,478,106,2047
line 478,106,472,106,2047
line 352,106,368,106,2047
line 356,103,352,106,2047
line 356,109,352,106,2047
line 232,106,248,106,2047
line 236,103,232,106,2047
line 236,109,232,106,2047
draw 8,137,231,182,10565
xstr 9,139,222,19,0,50712,0,1,1,1,"RES"
draw 248,137,471,182,10565
xstr 249,139,222,19,0,50712,0,1,1,1,"主控盒"
draw 8,188,111,229,10565
xstr 9,190,102,19,0,2047,0,1,1,1,"EBS 舵机"
draw 128,188,231,229,10565
xstr 129,190,102,19,0,2047,0,1,1,1,"EBS 电磁阀"
draw 248,188,351,229,10565
xstr 249,190,102,19,0,2047,0,1,1,1,"EBS 气压"
draw 368,188,471,229,10565
xstr 369,190,102,19,0,2047,0,1,1,1,"EBS 油压"
draw 8,232,111,271,10565
xstr 9,234,102,19,0,2047,0,1,1,1,"无人驾驶惯导"
draw 128,232,231,271,10565
xstr 129,234,102,19,0,2047,0,1,1,1,"无人驾驶轮速"
draw 248,232,351,271,10565
xstr 249,234,102,19,0,2047,0,1,1,1,"无人驾驶相机"
draw 368,232,471,271,10565
xstr 369,234,102,19,0,2047,0,1,1,1,"主控盒12V"
if(d0==1)
{
t0.txt="正常"
t0.pco=2016
}else
{
if(d0==2)
{
t0.txt="故障"
t0.pco=63488
}else
{
t0.txt="未知"
t0.pco=33840
}
}
if(d1==1)
{
t1.txt="正常"
t1.pco=2016
t3.txt="正常"
t3.pco=2016
}else
{
if(d1==2)
{
t1.txt="故障"
t1.pco=63488
t3.txt="故障"
t3.pco=63488
}else
{
t1.txt="未知"
t1.pco=33840
t3.txt="未知"
t3.pco=33840
}
}
if(d2==1)
{
t2.txt="正常"
t2.pco=2016
}else
{
if(d2==2)
{
t2.txt="故障"
t2.pco=63488
}else
{
t2.txt="未知"
t2.pco=33840
}
}
if(d3==1)
{
t4.txt="正常"
t4.pco=2016
}else
{
if(d3==2)
{
t4.txt="故障"
t4.pco=63488
}else
{
t4.txt="未知"
t4.pco=33840
}
}
if(d4==1)
{
t5.txt="正常"
t5.pco=2016
}else
{
if(d4==2)
{
t5.txt="故障"
t5.pco=63488
}else
{
t5.txt="未知"
t5.pco=33840
}
}
if(d5==1)
{
t6.txt="正常"
t6.pco=2016
}else
{
if(d5==2)
{
t6.txt="故障"
t6.pco=63488
}else
{
t6.txt="未知"
t6.pco=33840
}
}
if(d6==1)
{
t7.txt="正常"
t7.pco=2016
}else
{
if(d6==2)
{
t7.txt="故障"
t7.pco=63488
}else
{
t7.txt="未知"
t7.pco=33840
}
}
if(d7==1)
{
t8.txt="正常"
t8.pco=2016
}else
{
if(d7==2)
{
t8.txt="故障"
t8.pco=63488
}else
{
t8.txt="未知"
t8.pco=33840
}
}
if(d8==1)
{
t9.txt="正常"
t9.pco=2016
}else
{
if(d8==2)
{
t9.txt="故障"
t9.pco=63488
}else
{
t9.txt="未知"
t9.pco=33840
}
}
if(d9==1)
{
t10.txt="正常"
t10.pco=2016
}else
{
if(d9==2)
{
t10.txt="故障"
t10.pco=63488
}else
{
t10.txt="未知"
t10.pco=33840
}
}
if(d10==1)
{
t11.txt="正常"
t11.pco=2016
}else
{
if(d10==2)
{
t11.txt="故障"
t11.pco=63488
}else
{
t11.txt="未知"
t11.pco=33840
}
}
if(d11==1)
{
t12.txt="正常"
t12.pco=2016
}else
{
if(d11==2)
{
t12.txt="故障"
t12.pco=63488
}else
{
t12.txt="未知"
t12.pco=33840
}
}
if(d12==1)
{
t13.txt="正常"
t13.pco=2016
}else
{
if(d12==2)
{
t13.txt="故障"
t13.pco=63488
}else
{
t13.txt="未知"
t13.pco=33840
}
}
if(d13==1)
{
t14.txt="正常"
t14.pco=2016
}else
{
if(d13==2)
{
t14.txt="故障"
t14.pco=63488
}else
{
t14.txt="未知"
t14.pco=33840
}
}
if(d14==1)
{
t15.txt="正常"
t15.pco=2016
}else
{
if(d14==2)
{
t15.txt="故障"
t15.pco=63488
}else
{
t15.txt="未知"
t15.pco=33840
}
}
if(d15==1)
{
t16.txt="正常"
t16.pco=2016
}else
{
if(d15==2)
{
t16.txt="故障"
t16.pco=63488
}else
{
t16.txt="未知"
t16.pco=33840
}
}