|
|
@@ -1149,7 +1149,7 @@ void Hk_Take_io(void)
|
|
|
|
|
|
void calorstat(uint16_t heat_time)
|
|
|
{
|
|
|
- //uint8_t heat_up_cnt = 0;
|
|
|
+ uint8_t heat_up_cnt = 0;
|
|
|
uint16_t n = 0;
|
|
|
uint16_t delay_heat = 60;
|
|
|
FlagStatus heat_flg = RESET;
|
|
|
@@ -1167,6 +1167,7 @@ void calorstat(uint16_t heat_time)
|
|
|
{
|
|
|
delay_heat --;
|
|
|
rt_kprintf("正在恒温加热!!!:%d",delay_heat);
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"正在恒温加热!!!:%d\"",delay_heat);
|
|
|
rt_thread_delay(1000);
|
|
|
}
|
|
|
delay_heat = 60;
|
|
|
@@ -1175,24 +1176,24 @@ void calorstat(uint16_t heat_time)
|
|
|
}
|
|
|
if(device_status.heattem < (device_status.heatvalue - 5)&&heat_flg == SET)
|
|
|
{
|
|
|
- //heat_up_cnt = 0;
|
|
|
+ heat_up_cnt = 0;
|
|
|
ctr_Heat(ON);
|
|
|
}
|
|
|
- else if (device_status.heattem>device_status.heatvalue&&heat_flg==SET)
|
|
|
+ else if (device_status.heattem>=device_status.heatvalue&&heat_flg==SET)
|
|
|
{
|
|
|
-// if(heat_up_cnt==0)
|
|
|
-// {
|
|
|
-// UpLoad_Data(); //加热到设定温度的数据
|
|
|
-// heat_up_cnt = 1;
|
|
|
-// }
|
|
|
+ if(heat_up_cnt==0)
|
|
|
+ {
|
|
|
+ UpLoad_Data(); //加热到设定温度的数据
|
|
|
+ heat_up_cnt = 1;
|
|
|
+ }
|
|
|
ctr_Heat(OFF);
|
|
|
}
|
|
|
if((n % 60)==0)
|
|
|
{
|
|
|
device_status.heat_time_min = device_status.heat_time_min + 1;
|
|
|
-// if(device_status.heat_time_min % 2 == 0)
|
|
|
+// if(device_status.heat_time_min % 5 == 0)
|
|
|
// {
|
|
|
-// UpLoad_Data(); //从加热开始每两分钟上传的数据
|
|
|
+// UpLoad_Data(); //从加热开始每5分钟上传的数据
|
|
|
// }
|
|
|
}
|
|
|
//如果触发异常退出加热
|
|
|
@@ -1215,6 +1216,7 @@ void calorstat(uint16_t heat_time)
|
|
|
}
|
|
|
rt_thread_delay(1000);
|
|
|
rt_kprintf("=======正在加热======:%d-%d\n",n,heat_time);
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"正在加热!!!:%d-%d\"",n,heat_time);
|
|
|
}
|
|
|
ctr_Heat(OFF);
|
|
|
//UpLoad_Data(); //加热结束的数据
|
|
|
@@ -1841,6 +1843,7 @@ void WorkTask(void)
|
|
|
ctr_Fan_PUT(OFF);
|
|
|
#endif
|
|
|
rt_kprintf("正在收集.....剩余时间:%d分-%d秒\n",device_status.clt_time,clt_time);
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"正在收集.....剩余时间:%d分-%d秒\"",device_status.clt_time,clt_time);
|
|
|
//如果触发异常
|
|
|
if(device_status.bat_status == 1 || device_status.temp_status == 1|| device_status.rain_status==1)
|
|
|
{
|
|
|
@@ -1853,6 +1856,7 @@ void WorkTask(void)
|
|
|
ctr_Fan_IN(OFF);
|
|
|
#endif
|
|
|
rt_kprintf("异常退出!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"异常退出\"");
|
|
|
break;
|
|
|
}
|
|
|
if(device_status.timeSwitch==0&&device_status.sun_status==1)
|
|
|
@@ -1866,6 +1870,7 @@ void WorkTask(void)
|
|
|
ctr_Fan_IN(OFF);
|
|
|
#endif
|
|
|
rt_kprintf("异常退出!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"异常退出\"");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -1881,6 +1886,7 @@ void WorkTask(void)
|
|
|
ctr_Fan_IN(OFF);
|
|
|
#endif
|
|
|
rt_kprintf("异常退出!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"异常退出\"");
|
|
|
break;
|
|
|
}
|
|
|
if(device_status.timeSwitch==0&&device_status.sun_status==1)
|
|
|
@@ -1894,6 +1900,7 @@ void WorkTask(void)
|
|
|
ctr_Fan_IN(OFF);
|
|
|
#endif
|
|
|
rt_kprintf("异常退出!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"异常退出\"");
|
|
|
break;
|
|
|
}
|
|
|
#if LAMP_EN == 0
|
|
|
@@ -1902,6 +1909,7 @@ void WorkTask(void)
|
|
|
//4.关闭上仓门
|
|
|
device_status.ctr_up_motor = 2;
|
|
|
rt_kprintf("关闭上仓门!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"关闭上仓门!\"");
|
|
|
// while(device_status.ctr_up_motor!=0)
|
|
|
// {
|
|
|
// rt_thread_delay(100);
|
|
|
@@ -1935,24 +1943,28 @@ void WorkTask(void)
|
|
|
{
|
|
|
rt_thread_delay(100);
|
|
|
rt_kprintf("等待下仓门打开!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"等待下仓门打开!\"");
|
|
|
}
|
|
|
rt_thread_delay(3000);
|
|
|
//关闭下仓门
|
|
|
device_status.ctr_down_motor = 2;
|
|
|
- //2022-04-12add:
|
|
|
- rt_kprintf("打开上仓门!!!\n");
|
|
|
- device_status.ctr_up_motor = 1;
|
|
|
while(device_status.ctr_down_motor!=0)
|
|
|
{
|
|
|
rt_thread_delay(100);
|
|
|
rt_kprintf("等待下仓门关闭!!!\n");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"等待下仓门关闭!\"");
|
|
|
}
|
|
|
+ //2022-04-12add:
|
|
|
+ LOG_I("打开上仓门!!!");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"打开上仓门!\"");
|
|
|
+ device_status.ctr_up_motor = 1;
|
|
|
if(device_status.version_type==4||device_status.version_type==41)
|
|
|
{
|
|
|
//震动
|
|
|
ctr_shake(ON, 1);
|
|
|
//补光&&拍照
|
|
|
- rt_kprintf("拍照!!!\n");
|
|
|
+ LOG_I("拍照!!!");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"拍照!\"");
|
|
|
HK_TakePhoto();
|
|
|
//清扫
|
|
|
device_status.clear_status=1;
|
|
|
@@ -1989,9 +2001,9 @@ void WorkTask(void)
|
|
|
if(device_status.work_done==0&&device_status.work_status==0)
|
|
|
{
|
|
|
DTU_Write("workdone");
|
|
|
+ HMI_WRITE("workSta.g0.txt=\"工作任务已完成!\"");
|
|
|
ResetInit();
|
|
|
}
|
|
|
-
|
|
|
rt_kprintf("***not work-device status:%d\n",device_status.ds);
|
|
|
}
|
|
|
/* 入口函数-工作状态检测 */
|