异常判定在出错时才打印,检测时通信异常蜂鸣器响一声

取消一些通信日志打印
This commit is contained in:
ranchuan
2024-01-06 09:59:58 +08:00
parent 307eb513ef
commit b76c04d072
11 changed files with 29 additions and 16 deletions

View File

@@ -36,7 +36,7 @@ void prot_m4::send_data_slot(myarray data)
send_list.append(send);
if(wait==0){
wait+=2;
qDebug("send m4:%s",data.data());
// qDebug("send m4:%s",data.data());
if_->write(send_list.takeFirst());
}
}

View File

@@ -41,7 +41,7 @@ void ProtPc::init()
int pack_len=0;
while(pack_len=codec_->packCheck(recv_data),pack_len>0){
int cmd,src,dst;
qDebug("host recv:%s",recv_data.toHex(' ').data());
// qDebug("host recv:%s",recv_data.toHex(' ').data());
myarray data=codec_->decode(src,dst,cmd,recv_data);
recv_data.remove(0,pack_len);
// qDebug("host recv removed:%s",recv_data.toHex(' ').data());

View File

@@ -254,31 +254,31 @@ protected:
timeout_start_cb(ms);
}
void timeout_start_cb(int ms){
qDebug("handle_board:start timeout");
// qDebug("handle_board:start timeout");
timer_->setInterval(ms);
timer_->start();
}
void timeout_start_retry_cb(int ms){
qDebug("handle_board:start retry");
// qDebug("handle_board:start retry");
timer_retry_->setInterval(ms);
timer_retry_->start();
}
// 停止超时计时器,此方法同时停止重发计时器
void timeout_stop(){
qDebug("handle_board:stop timeout");
// qDebug("handle_board:stop timeout");
emit timeout_stop_signal();
timeout_stop_retry();
}
// 停止数据回复超时重试计时器
void timeout_stop_retry(){
qDebug("handle_board:stop retry");
// qDebug("handle_board:stop retry");
emit timeout_stop_retry_signal();
times_retry=0;
}
private:
// 重试回调
void timeout_retry(){
qDebug("in retry.");
// qDebug("in retry.");
if(times_retry>0){
times_retry--;
myarray s;