更改了本地删除设备
This commit is contained in:
parent
ea04ecf547
commit
f5cd347fdd
|
|
@ -130,8 +130,8 @@ void DWIN_ParseFrame(uint8_t c)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
// 触摸按键返回
|
// 触摸按键返回
|
||||||
if(readData.Addr == 0x5000 || readData.Addr == 0x5012 || readData.Addr == 0x5030
|
if(readData.Addr == 0x5000 || readData.Addr == 0x5012 || readData.Addr == 0x5030|| readData.Addr == 0x9100
|
||||||
|| readData.Addr == 0x5022 || readData.Addr == 0x502C || readData.Addr == 0x502E
|
|| readData.Addr == 0x5022 || readData.Addr == 0x502C || readData.Addr == 0x502E|| readData.Addr == 0x5038
|
||||||
|| readData.Addr == 0x5032|| readData.Addr == 0x5034|| readData.Addr == 0x5036|| readData.Addr == 0x6F00)
|
|| readData.Addr == 0x5032|| readData.Addr == 0x5034|| readData.Addr == 0x5036|| readData.Addr == 0x6F00)
|
||||||
{
|
{
|
||||||
LoopBuff_PutItem(&Form_KeyM, (uint8_t *) &readData);
|
LoopBuff_PutItem(&Form_KeyM, (uint8_t *) &readData);
|
||||||
|
|
@ -719,7 +719,7 @@ void Form_Task(void *p_arg)
|
||||||
data.oper = DWIN_OPER_WRITE;
|
data.oper = DWIN_OPER_WRITE;
|
||||||
data.Addr = 0x6590;
|
data.Addr = 0x6590;
|
||||||
if(dcBuff.configDisplay.ch_en)
|
if(dcBuff.configDisplay.ch_en)
|
||||||
strcpy(data.str, "pressure-%");
|
strcpy(data.str, "pres-MPa");
|
||||||
else
|
else
|
||||||
strcpy(data.str, "压力-MPa");
|
strcpy(data.str, "压力-MPa");
|
||||||
data.count = strlen(data.str);
|
data.count = strlen(data.str);
|
||||||
|
|
@ -738,7 +738,7 @@ void Form_Task(void *p_arg)
|
||||||
data.oper = DWIN_OPER_WRITE;
|
data.oper = DWIN_OPER_WRITE;
|
||||||
data.Addr = 0x65A0;
|
data.Addr = 0x65A0;
|
||||||
if(dcBuff.configDisplay.ch_en)
|
if(dcBuff.configDisplay.ch_en)
|
||||||
strcpy(data.str, "Temperature-%");
|
strcpy(data.str, "Temp-℃%");
|
||||||
else
|
else
|
||||||
strcpy(data.str, "温度-℃");
|
strcpy(data.str, "温度-℃");
|
||||||
data.count = strlen(data.str);
|
data.count = strlen(data.str);
|
||||||
|
|
@ -1677,8 +1677,8 @@ uint8_t Form_PreQuery()
|
||||||
if(formQuery.func == 1)
|
if(formQuery.func == 1)
|
||||||
{
|
{
|
||||||
if(dcBuff.configDisplay.ch_en)
|
if(dcBuff.configDisplay.ch_en)
|
||||||
sprintf(formData.str, " %4s %11s %6s %9s %8s %4s %4s %4s %13s %5s %5s %7s",
|
sprintf(formData.str, " %4s %11s %6s %10s %5s %6s %4s%8s %12s %5s %5s %7s",
|
||||||
"Num", " Box_number ", "Percentage", "Press(MPa)", "Temp(¡æ)", "Alarm", "Err", "Offline", " PSN ", "Date", "Time", "Vol(v)");
|
"Num", "Box_number", "Per.", "Press(MPa)", "Temp", "Alarm", "Err", "Offline", "PSN ", "Date", "Time", "Vol(v)");
|
||||||
|
|
||||||
else
|
else
|
||||||
sprintf(formData.str, " %4s %11s %6s %9s %8s %4s %4s %4s %13s %5s %5s %7s",
|
sprintf(formData.str, " %4s %11s %6s %9s %8s %4s %4s %4s %13s %5s %5s %7s",
|
||||||
|
|
@ -1687,8 +1687,8 @@ uint8_t Form_PreQuery()
|
||||||
else if(formQuery.func == 2)
|
else if(formQuery.func == 2)
|
||||||
{
|
{
|
||||||
if(dcBuff.configDisplay.ch_en)
|
if(dcBuff.configDisplay.ch_en)
|
||||||
sprintf(formData.str, " %5s %5s %11s %10s %8s %6s %9s %8s %4s %4s %13s",
|
sprintf(formData.str, " %5s %5s %10s %7s %6s %8s %11s %5s %6s %4s %13s",
|
||||||
"Data", "Time", " Box_number ", "Level(mmWC)", "m(kg)", "Percent", "Press(MPa)", "Temp(¡æ)", "Alarm", "Err", " PSN ");
|
"Data", "Time", "Box_number", "Level", "m(kg)", "Percent", "Press(MPa)", "Temp", "Alarm", "Err", " PSN ");
|
||||||
|
|
||||||
else
|
else
|
||||||
sprintf(formData.str, " %5s %5s %11s %10s %8s %6s %9s %8s %4s %4s %13s",
|
sprintf(formData.str, " %5s %5s %11s %10s %8s %6s %9s %8s %4s %4s %13s",
|
||||||
|
|
@ -1719,6 +1719,9 @@ uint8_t Form_PreQuery()
|
||||||
|
|
||||||
// 切换页面
|
// 切换页面
|
||||||
Form_ClearGrid(&gridQuery);
|
Form_ClearGrid(&gridQuery);
|
||||||
|
if(dcBuff.configDisplay.ch_en)
|
||||||
|
Form_SwitchPage(67 + (formQuery.func - 1));
|
||||||
|
else
|
||||||
Form_SwitchPage(17 + (formQuery.func - 1));
|
Form_SwitchPage(17 + (formQuery.func - 1));
|
||||||
// 用于翻页的序号
|
// 用于翻页的序号
|
||||||
gridQuery.topPtr = -1;
|
gridQuery.topPtr = -1;
|
||||||
|
|
@ -2648,7 +2651,7 @@ void Key_Task(void *p_arg)
|
||||||
Form_En_About(); // 显示关于信息
|
Form_En_About(); // 显示关于信息
|
||||||
Config_SaveConfig();
|
Config_SaveConfig();
|
||||||
}
|
}
|
||||||
else if(val == 0x06) // chu¹Þ
|
else if((val == 0x06)||(val == 0x16)) // chu罐
|
||||||
{
|
{
|
||||||
Form_BOX_PSN();
|
Form_BOX_PSN();
|
||||||
}
|
}
|
||||||
|
|
@ -2663,6 +2666,11 @@ void Key_Task(void *p_arg)
|
||||||
{
|
{
|
||||||
Form_BOX_PSN_D0WN();
|
Form_BOX_PSN_D0WN();
|
||||||
}
|
}
|
||||||
|
else if(key.Addr == 0x5038) // chu罐
|
||||||
|
{
|
||||||
|
Form_DispMessage("请输入密码!", DWIN_COLOR_GREEN);
|
||||||
|
DWIN_Touch(1265, 105);
|
||||||
|
}
|
||||||
else if(key.Addr == 0x5012) // 设置
|
else if(key.Addr == 0x5012) // 设置
|
||||||
{
|
{
|
||||||
if(val == 1) // 保存参数
|
if(val == 1) // 保存参数
|
||||||
|
|
@ -2793,6 +2801,43 @@ void Key_Task(void *p_arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(key.Addr == 0x9100) // PSN输入
|
||||||
|
{
|
||||||
|
// if(!Form_ModifyPSN(&key, msg))
|
||||||
|
// Form_DispMessage(msg, DWIN_COLOR_RED);
|
||||||
|
// else
|
||||||
|
if(ntohs(key.dword[0]) == atoi(dcBuff.configDisplay.pwd1))
|
||||||
|
{
|
||||||
|
bottleCnt.count = 0;
|
||||||
|
FRAM_SaveInfo(0, 0, FRAM_SIZE);
|
||||||
|
if(dcBuff.configDisplay.ch_en)
|
||||||
|
{
|
||||||
|
|
||||||
|
Form_DispMessage("Successfully deleted.", DWIN_COLOR_GREEN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Form_DispMessage("删除成功!", DWIN_COLOR_GREEN);
|
||||||
|
}
|
||||||
|
osDelay(1000);
|
||||||
|
HAL_NVIC_SystemReset();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(dcBuff.configDisplay.ch_en)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
Form_DispMessage("password error!", DWIN_COLOR_GREEN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
Form_DispMessage("密码错误!", DWIN_COLOR_GREEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,16 +143,16 @@ void Modbus_Task(void *p_arg)
|
||||||
// RS485_SendDataByte(Heart_sendBuff, i);
|
// RS485_SendDataByte(Heart_sendBuff, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(LoopBuff_GetCount(&Modbus_SendM))
|
// if(LoopBuff_GetCount(&Modbus_SendM))
|
||||||
{
|
// {
|
||||||
// // 取数据
|
//// // 取数据
|
||||||
memmove(&Gprs, LoopBuff_GetDataPtr(&Modbus_SendM, Modbus_SendM.info.rdPtr), sizeof(ext_data_t));
|
// memmove(&Gprs, LoopBuff_GetDataPtr(&Modbus_SendM, Modbus_SendM.info.rdPtr), sizeof(ext_data_t));
|
||||||
LoopBuff_RemoveItems(&Modbus_SendM, 1);
|
// LoopBuff_RemoveItems(&Modbus_SendM, 1);
|
||||||
// i = pack_modbus_tran_data(&Gprs);
|
//// i = pack_modbus_tran_data(&Gprs);
|
||||||
|
|
||||||
// // TODO: 发送数据到上位机,不等待返回
|
//// // TODO: 发送数据到上位机,不等待返回
|
||||||
// RS485_SendDataByte(Modbus_sendBuff, i);
|
//// RS485_SendDataByte(Modbus_sendBuff, i);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,21 +219,6 @@ void MODBUS_RTU_CMD(modbus_request_t *req)
|
||||||
bottleRec.lastData = -1;
|
bottleRec.lastData = -1;
|
||||||
FRAM_BufferWrite(FRAM_BOTTLE_DATA_BASE + sizeof(ext_bottle_t) * count, (uint8_t *) &bottleRec, sizeof(ext_bottle_t));
|
FRAM_BufferWrite(FRAM_BOTTLE_DATA_BASE + sizeof(ext_bottle_t) * count, (uint8_t *) &bottleRec, sizeof(ext_bottle_t));
|
||||||
|
|
||||||
// strcpy(boxTGGU[count].TGGU, boxRec.TGGU);
|
|
||||||
// memmove(boxTGGU[count].PSN, boxRec.PSN, 6);
|
|
||||||
// boxTGGU[count].recNo = count;
|
|
||||||
// strcpy(boxPSN[count].TGGU, boxRec.TGGU);
|
|
||||||
// memmove(boxPSN[count].PSN, boxRec.PSN, 6);
|
|
||||||
// boxPSN[count].recNo = count;
|
|
||||||
|
|
||||||
if(req->index==req->all)
|
|
||||||
{
|
|
||||||
boxCnt.count=req->all;
|
|
||||||
bottleCnt.count = req->all;
|
|
||||||
FRAM_SaveInfo(FRAM_BOX_INFO_BASE, (uint8_t *) &boxCnt, sizeof(ext_count_t));
|
|
||||||
FRAM_SaveInfo(FRAM_BOTTLE_INFO_BASE, (uint8_t *) &bottleCnt, sizeof(ext_count_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(BUFF2, 0, sizeof(BUFF2));
|
memset(BUFF2, 0, sizeof(BUFF2));
|
||||||
BUFF2[len++]='L';
|
BUFF2[len++]='L';
|
||||||
BUFF2[len++]='S';
|
BUFF2[len++]='S';
|
||||||
|
|
@ -250,6 +235,17 @@ void MODBUS_RTU_CMD(modbus_request_t *req)
|
||||||
memmove(BUFF2 + len, &crc, 2);
|
memmove(BUFF2 + len, &crc, 2);
|
||||||
len += 2;
|
len += 2;
|
||||||
RS485_SendDataByte(BUFF2, len);
|
RS485_SendDataByte(BUFF2, len);
|
||||||
|
|
||||||
|
if(req->index==req->all)
|
||||||
|
{
|
||||||
|
boxCnt.count=req->all;
|
||||||
|
bottleCnt.count = req->all;
|
||||||
|
FRAM_SaveInfo(FRAM_BOX_INFO_BASE, (uint8_t *) &boxCnt, sizeof(ext_count_t));
|
||||||
|
FRAM_SaveInfo(FRAM_BOTTLE_INFO_BASE, (uint8_t *) &bottleCnt, sizeof(ext_count_t));
|
||||||
|
osDelay(500);
|
||||||
|
HAL_NVIC_SystemReset();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(req->cmd == 0x05)
|
else if(req->cmd == 0x05)
|
||||||
{
|
{
|
||||||
|
|
@ -318,6 +314,7 @@ void ReadModbus_Task(uint8_t c)
|
||||||
case 3:
|
case 3:
|
||||||
BUFF[len]=c;
|
BUFF[len]=c;
|
||||||
if(c==2) len++;
|
if(c==2) len++;
|
||||||
|
else if(c==5)len+=2;
|
||||||
else len=0;
|
else len=0;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
|
@ -345,6 +342,7 @@ void ReadModbus_Task(uint8_t c)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
len=0;
|
len=0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if((len==0)&&(data_len2>1))
|
if((len==0)&&(data_len2>1))
|
||||||
{
|
{
|
||||||
|
|
@ -355,4 +353,9 @@ void ReadModbus_Task(uint8_t c)
|
||||||
}
|
}
|
||||||
data_len2=0;
|
data_len2=0;
|
||||||
}
|
}
|
||||||
|
else if(BUFF[3]==5)
|
||||||
|
{
|
||||||
|
MODBUS_RTU_CMD((modbus_request_t *) BUFF);
|
||||||
|
data_len2=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,8 @@ void Ethernet_Config()
|
||||||
if(RF_APP == RF_APP_AJH)
|
if(RF_APP == RF_APP_AJH)
|
||||||
{
|
{
|
||||||
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,171.88.5.52,8061", "+OK", "+ERR")) // 公司路由器
|
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,171.88.5.52,8061", "+OK", "+ERR")) // 公司路由器
|
||||||
if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,extra.cd-ls.cn,8061", "+OK", "+ERR"))
|
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,extra.cd-ls.cn,8061", "+OK", "+ERR"))
|
||||||
|
if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,121.89.205.240,41001", "+OK", "+ERR"))
|
||||||
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,data.ajhiot.com,8088", "+OK", "+ERR"))
|
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,data.ajhiot.com,8088", "+OK", "+ERR"))
|
||||||
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,114.55.209.85,8088", "+OK", "+ERR")) // data.ajhiot.com
|
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,114.55.209.85,8088", "+OK", "+ERR")) // data.ajhiot.com
|
||||||
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,192.168.0.2,8061", "+OK", "+ERR")) // 直连电脑
|
// if(!Ethernet_ATCmd("AT+SOCKA1=TCPC,192.168.0.2,8061", "+OK", "+ERR")) // 直连电脑
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ void RF_GatewayTask(void *p_arg)
|
||||||
if(RTC_offsetSeconds == 0)
|
if(RTC_offsetSeconds == 0)
|
||||||
{
|
{
|
||||||
printf("\nRTC_offsetSeconds = 0, ignored ...\n");
|
printf("\nRTC_offsetSeconds = 0, ignored ...\n");
|
||||||
//apex continue;
|
// continue;//apex
|
||||||
}
|
}
|
||||||
|
|
||||||
// ´¦ÀíÖ¡
|
// ´¦ÀíÖ¡
|
||||||
|
|
@ -905,7 +905,7 @@ void RF_TranTask(void *p_arg)
|
||||||
Ethernet_Config();
|
Ethernet_Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 掉电有效,如果未获取到UTC时间,不转发
|
// 掉电有效,如果未获取到UTC时间,不转发 //apex
|
||||||
if(RTC_offsetSeconds > 0 && LoopBuff_GetCount(&RF_TranM) > 0 && Ethernet_connected)
|
if(RTC_offsetSeconds > 0 && LoopBuff_GetCount(&RF_TranM) > 0 && Ethernet_connected)
|
||||||
{
|
{
|
||||||
if(!SFlash_LoadInfo(LoopBuff_GetDataPos(&RF_TranM, RF_TranM.info.rdPtr), (uint8_t *) &Ext_Data_Rec1, sizeof(ext_data_t)))
|
if(!SFlash_LoadInfo(LoopBuff_GetDataPos(&RF_TranM, RF_TranM.info.rdPtr), (uint8_t *) &Ext_Data_Rec1, sizeof(ext_data_t)))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue