添加tcp心跳
添加升级小板程序、方案、jwt文件的进度条命令
This commit is contained in:
@@ -27,7 +27,7 @@ public:
|
||||
}
|
||||
}
|
||||
virtual int dolater(int cmd, myarray data) = 0;
|
||||
virtual void timeout()=0;
|
||||
virtual void timeout(){busy=0;}
|
||||
int busy;
|
||||
protected:
|
||||
void timeout_start(int ms){
|
||||
@@ -48,6 +48,40 @@ signals:
|
||||
void send_data_signal(int cmd, myarray data);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
||||
HandlePc 重载示例
|
||||
class ChildPc:public HandlePc
|
||||
{
|
||||
// 重载此函数用于接收上位机命令
|
||||
int dolater(int cmd, myarray data);
|
||||
// (可选)重载此函数处理超时的情况
|
||||
void timeout();
|
||||
// 此变量不为0则忙
|
||||
int busy;
|
||||
// 调用此函数开始超时计时
|
||||
void timeout_start(int ms);
|
||||
// 调用此函数停止超时计时
|
||||
void timeout_stop();
|
||||
// 调用此函数给上位机发送数据
|
||||
void send_data_signal(int cmd, myarray data);
|
||||
}
|
||||
|
||||
// .cpp 文件中做以下声明以启用
|
||||
static HandlePc *get_ChidlPc(){
|
||||
return new ChildPc();}
|
||||
protpc_export(0x30, get_ChidlPc);
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ProtPc : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -61,6 +95,7 @@ public:
|
||||
~ProtPc() {}
|
||||
void init();
|
||||
bool docmd(int cmd,myarray data);
|
||||
bool busy(){return ((handle_!=nullptr)&&(handle_->busy!=0));}
|
||||
public slots:
|
||||
void send_data_slot(int cmd, myarray data);
|
||||
|
||||
|
Reference in New Issue
Block a user