|
|
@@ -1485,97 +1485,38 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
#endif
|
|
|
if(device_status.ctr_up_motor==1)
|
|
|
{
|
|
|
- #if 0
|
|
|
- if(num_up_open==200&&device_status.clear_status==0&&device_status.work_status==1)
|
|
|
- {
|
|
|
- motor_current = atoi(device_status.power);
|
|
|
- LOG_D("上仓门待机电流:%d",motor_current);
|
|
|
- }
|
|
|
- //打开上仓门
|
|
|
- if(num_up_open<200)
|
|
|
- #endif
|
|
|
ctr_cangmen_up(OPEN);
|
|
|
num_up_open--;
|
|
|
-// current_t[num_up_open] = atoi(device_status.power);
|
|
|
if (num_up_open == 0)
|
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
|
num_up_open = 200;
|
|
|
-// bubblesort(current_t, 200);
|
|
|
-// if(current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
-// {
|
|
|
-// LOG_E("上仓门打开电机电流不足:%d!!!",current_t[199]);
|
|
|
-// char * ctr_cm_up_warn = makeJson_Warn("电流不足,打开", "上仓门电机");
|
|
|
-// DTU_Write("%s",ctr_cm_up_warn);
|
|
|
-// rt_free(ctr_cm_up_warn);
|
|
|
-// }
|
|
|
}
|
|
|
-// else {
|
|
|
-// LOG_D("上仓门打开电流:%d",current_t[num_up_open]);
|
|
|
-// }
|
|
|
}
|
|
|
else if(device_status.ctr_up_motor==2)
|
|
|
{
|
|
|
-// if(num_up_close==200&&device_status.clear_status==0&&device_status.work_status==1)
|
|
|
-// {
|
|
|
-// motor_current = atoi(device_status.power);
|
|
|
-// LOG_D("上仓门待机电流:%d",motor_current);
|
|
|
-// }
|
|
|
-// if(num_up_close<200)
|
|
|
ctr_cangmen_up(CLOSE);
|
|
|
num_up_close --;
|
|
|
-// current_t[num_up_close] = atoi(device_status.power);
|
|
|
if (num_up_close == 0)
|
|
|
{
|
|
|
ctr_cangmen_up(OFF);
|
|
|
num_up_close= 200;
|
|
|
-// bubblesort(current_t, 200);
|
|
|
-// if(current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
-// {
|
|
|
-//
|
|
|
-// LOG_E("上仓门电机电流不足!!!-%d",current_t[199]);
|
|
|
-// char * ctr_cm_up_warn = makeJson_Warn("电流不足,关闭", "上仓门电机");
|
|
|
-// DTU_Write("%s",ctr_cm_up_warn);
|
|
|
-// rt_free(ctr_cm_up_warn);
|
|
|
-// }
|
|
|
}
|
|
|
- //LOG_D("上仓门关闭电流:%d",current_t[num_up_close]);
|
|
|
}
|
|
|
if (device_status.ctr_down_motor == 1)
|
|
|
{
|
|
|
-// if(num_down_open==200&&device_status.clear_status==0&&device_status.work_status==1)
|
|
|
-// {
|
|
|
-// motor_current = atoi(device_status.power);
|
|
|
-// LOG_D("下仓门待机电流:%d",motor_current);
|
|
|
-// }
|
|
|
-// if(num_down_open<200)
|
|
|
ctr_cangmen_down(OPEN);
|
|
|
num_down_open--;
|
|
|
-// current_t[num_down_open] = atoi(device_status.power);
|
|
|
//如果关闭仓门1S后检测不到电流增大,则判定为异常
|
|
|
if (num_down_open == 0)
|
|
|
{
|
|
|
ctr_cangmen_down(OFF);
|
|
|
num_down_open = 200;
|
|
|
-// bubblesort(current_t, 200);
|
|
|
-// if (current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
-// {
|
|
|
-// LOG_E("下仓门电机电流不足!!!-%d",current_t[199]);
|
|
|
-// char * ctr_cm_down_warn = makeJson_Warn("电流不足,打开", "下仓门电机");
|
|
|
-// DTU_Write("%s",ctr_cm_down_warn);
|
|
|
-// rt_free(ctr_cm_down_warn);
|
|
|
-// }
|
|
|
}
|
|
|
// LOG_D("下仓门打开电流:%d",current_t[num_down_open]);
|
|
|
}
|
|
|
else if (device_status.ctr_down_motor == 2)
|
|
|
{
|
|
|
-// if(num_down_close==200&&device_status.clear_status==0&&device_status.work_status==1)
|
|
|
-// {
|
|
|
-// motor_current = atoi(device_status.power);
|
|
|
-// LOG_D("下仓门待机电流:%d",motor_current);
|
|
|
-// }
|
|
|
-// if(num_down_close<200)
|
|
|
ctr_cangmen_down(CLOSE);
|
|
|
num_down_close--;
|
|
|
// current_t[num_down_close] = atoi(device_status.power);
|
|
|
@@ -1584,16 +1525,6 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
{
|
|
|
ctr_cangmen_down(OFF);
|
|
|
num_down_close = 200;
|
|
|
-// bubblesort(current_t, 200);
|
|
|
-// //如果关闭仓门5S后检测不到电流增大,则判定为异常
|
|
|
-// if (current_t[199]-motor_current<100&&device_status.clear_status==0&&device_status.work_status==1&&motor_current!=0&&motor_current<5000)
|
|
|
-// {
|
|
|
-// LOG_E("下仓门关闭电机电流不足!!!-%d",current_t[199]);
|
|
|
-// char * ctr_cm_down_warn = makeJson_Warn("电流不足,关闭", "下仓门电机");
|
|
|
-// DTU_Write("%s",ctr_cm_down_warn);
|
|
|
-// rt_free(ctr_cm_down_warn);
|
|
|
-//
|
|
|
-// }
|
|
|
}
|
|
|
// LOG_D("下仓门关闭电流:%d",current_t[num_down_close]);
|
|
|
}
|
|
|
@@ -1638,16 +1569,12 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
ctr_led(OFF);
|
|
|
photo_led_sec = 900;
|
|
|
device_status.photo_ws = 0;
|
|
|
+ if(device_status.work_status = 1){
|
|
|
+ device_status.clear_status = 1;
|
|
|
+ }
|
|
|
HMI_WRITE("sysTest.switchPhoto.val=0");
|
|
|
HMI_WRITE("sysTest.switchFill.val=0");
|
|
|
}
|
|
|
-// else if (photo_led_sec==0&&device_status.version_type!=48) {
|
|
|
-// ctr_led(OFF);
|
|
|
-// photo_led_sec = 900;
|
|
|
-// device_status.photo_ws = 0;
|
|
|
-// HMI_WRITE("sysTest.switchPhoto.val=0");
|
|
|
-// HMI_WRITE("sysTest.switchFill.val=0");
|
|
|
-// }
|
|
|
}else{
|
|
|
photo_led_sec = 900;
|
|
|
}
|