diff --git a/App/GCS_zh_CN.ts b/App/GCS_zh_CN.ts index f3aef13..0bc8bfd 100644 --- a/App/GCS_zh_CN.ts +++ b/App/GCS_zh_CN.ts @@ -350,12 +350,12 @@ 界面 - + 切换无人机 - + 切换航点 @@ -1735,11 +1735,6 @@ 数据链 - - - 大气机 - - 右升降 @@ -1816,6 +1811,11 @@ 设备 + + + 空速管加热 + + 内置惯导 @@ -1939,12 +1939,12 @@ 界面 - + - - - + 1 1 @@ -1959,22 +1959,22 @@ 8 - + 6 6 - + 0 0 - + . . - + 4 4 @@ -1984,12 +1984,12 @@ 删除 - + 5 5 - + 2 2 @@ -2009,14 +2009,13 @@ 确定 - + cancel 取消 - nan - nan + nan @@ -2159,36 +2158,36 @@ 参数 - - + + Communication Lost 通讯丢失 - - + + Communication Regain 通讯已恢复 - + R:%1 / T:%2 收:%1/发:%2 - - - + + + 未定位 - + %1D[%2颗] %1D[%2颗] - + fix[%1颗] %1D Fix 差分[%1颗] @@ -2206,193 +2205,193 @@ GPS错误 - + float[%1颗] 浮点[%1颗] - + err[%1颗] 错误[%1颗] - + ARM 解锁 - + DISARM 上锁 - + MANUAL 手动 - + ALTCTL 定高 - + POSCTL 定点 - + AUTO 自主 - + ACRO - + OFFBOARD - + STABILIZED 增稳 - + RATTITUDE 速率 - + STANDBY 待机 - + BIT 测试 - + AUTO_READY 就绪 - + AUTO_TAKEOFF 起飞 - + AUTO_LOITER 盘旋 - + AUTO_MISSION 任务 - + AUTO_RTL 返航 - + AUTO_LAND 着陆 - + AUTO_RTGS RTGS - + AUTO_FOLLOW_TARGET 目标跟随 - + 开加力 - + 半加力 - + 全加力 - - + + 关加力 - + 伞舱开 - + 伞舱关 - + INS解算正常 - + INS星数不足 - + INS内部错误 - + INS速度超限 - + SBG解算正常 - + SBG星数不足 - + SBG内部错误 - + SBG速度超限 - + 安控区内 - + 安控区外 @@ -2401,60 +2400,60 @@ 航线切换,当前航线为 %1 - + VERT_OFF OFF 纵向制导关闭 - + VNAV2THT 消除纵向偏差 - + HDOT2THT 控制升降速率 - + GAMMA2THT 控制航迹角 - + AS2THT 俯仰控制速度 - + H2THT 控制绝对高度 - + AGL2THT 控制相对高度 - + LAT_OFF 横向制导关闭 - + LNAV2PHI 滚转消除侧偏 - + PSI2PHI 滚转控制航向 - - - + + + @@ -2463,156 +2462,156 @@ 未定位 - - + + 未初始化 - - + + 垂直陀螺 - - + + AHRS - - + + 速度导航 - - + + 位置导航 - - - - - - - - + + + + + + + + 正常 - - - - - - - - - - + + + + + + + + + + 无效 - - - - 解算正常 - - - - - - 卫星数不足 - - - - - - 内部错误 - - - - - - 速度超限 - - - - - - - - 未知 - - - - - - 多普勒 - - - 微分 + 解算正常 - - - 单点 + + + 卫星数不足 - - - 伪距差分 + + + 内部错误 - - - SBAS广域差分 + + + 速度超限 - - - 广域差分 + + + + + 未知 - - - RTK_FLOAT - - - - - - RTK_INT - - - - - - PPP_FLOAT + + + 多普勒 + 微分 + + + + + + 单点 + + + + + + 伪距差分 + + + + + + SBAS广域差分 + + + + + + 广域差分 + + + + + + RTK_FLOAT + + + + + + RTK_INT + + + + + + PPP_FLOAT + + + + + PPP_INT - - + + FIXED @@ -2621,17 +2620,17 @@ 未支持 - + flight mode 飞行模式 - + 连接内置惯导 - + 连接SBG @@ -3466,71 +3465,72 @@ Circle(radius) - P3t出口总压传感器 - - - - - 电源 - - - - - T5排气温度传感器 - - - - - N1转速传感器 - - - - - 核心机主油泵输出 + N2转速传感器 + P3t出口总压传感器 - P1t进口总压传感器 - - - - - 加力点火油泵输出 - - - - - N2转速传感器 - - - - - P5t涡轮后压力感器 - - - - - 加力主油泵输出 + 电源 + T5排气温度传感器 + + + + + N1转速传感器 + + + + + 核心机主油泵输出 + + + + + P1t进口总压传感器 + + + + + 加力点火油泵输出 + + + + + N2转速传感器 + + + + + P5t涡轮后压力感器 + + + + + 加力主油泵输出 + + + + T1t进口总温传感器 - + CPU - + 舵机位移传感器 - + 舵机控制器 @@ -3985,97 +3985,97 @@ Circle(radius) 伺服界面 - + 舵机 - - - - - + + + + + 上电自检 - + 左副翼 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + 0 0 - - - - - + + + + + 指令位 - - - - - + + + + + 地面自检 - - - - - + + + + + 当前位 - - - - - + + + + + 找零 - + 右升降 - + 右副翼 - + 左升降 @@ -4334,7 +4334,7 @@ Circle(radius) - + 方向舵 @@ -4390,11 +4390,13 @@ Circle(radius) - 发射曳光管 + 点亮曳光管 + 发射曳光管 + 曳光管 @@ -4404,48 +4406,48 @@ Circle(radius) - + 版本信息 - + 飞控固件版本号: - + HIL模式状态: - + 电源 - + 28V剩余电量(%) - + 56V模块温度(℃) - + 机载28V电压(V) 机载28V电压 - + 56V剩余电量(%) - + 28V模块温度(℃) @@ -4455,7 +4457,7 @@ Circle(radius) - + 28V电源 @@ -4476,27 +4478,27 @@ Circle(radius) 5803A - + 机载电源 - + 机载56V电压(V) - + 机载56V电流(A) - + 机载28V电流(A) - + 56V电源 @@ -4512,158 +4514,158 @@ Circle(radius) 伺服系统 - - - + + + time: %1 s 加热时间: %1 秒 - + time: %1 s,time out,if uav is on ground,please turn off heat 加热时间: %1,如果无人机在地面,请关闭空速管加热,防止损坏空速管 - + 飞控软件版本信息:%1 - + %1,%2 accepted and executed %1,%2 发送成功 - + %1,%2 rejected %1,%2 拒绝执行 - + %1,%2 permanently denied %1,%2 永久拒绝 - + %1,%2 unsupported %1,%2 不支持 - + %1,%2 failed %1,%2 发送失败 - + %1,%2 being executed %1,%2 正在执行 - + %1,%2 time out %1,%2 发送超时 - + Please do not operate too fast, the last instruction has not been sent 请不要操作过快,上一个指令未发送完成 - + please set command first ,command :%1 请设置指令,当前指令号为 %1 - + 发送指令 - + 修改参数 - - - - - - - - + + + + + + + + 警告 - - + + 请选择测试项和测试点 - + 请设定给定转速 - - - - + + + + 请设定目标 - + 设定舵机 %1 %2 - + 请设定 - + 设定舵机归零 %1 - + %1 %2kg - - - - + - - - - + + + + + + + 设定 %1 - + airspeed head warning 空速管加热警告 - + airspeed head can only support 30s since it opening,so it must be turn off after 30s 空速管在地面只能加热不超过30秒,在地面加热超过30秒后请立即关闭加热功能,避免空速管损坏 - + ok 确定 - + cancel 取消 diff --git a/App/mainwindow.cpp b/App/mainwindow.cpp index ab32592..c1178b8 100644 --- a/App/mainwindow.cpp +++ b/App/mainwindow.cpp @@ -246,6 +246,8 @@ MainWindow::MainWindow(QWidget *parent) this,SLOT(dlinkCount(int,int))); + connect(dlink->mavlinknode,SIGNAL(heartbeatTimeStamp(quint32)), + copk,SLOT(setHeartBeatTime(quint32))); diff --git a/Cockpit/COCKPIT_zh_CN.qm b/Cockpit/COCKPIT_zh_CN.qm new file mode 100644 index 0000000..55252b8 Binary files /dev/null and b/Cockpit/COCKPIT_zh_CN.qm differ diff --git a/Cockpit/COCKPIT_zh_CN.ts b/Cockpit/COCKPIT_zh_CN.ts new file mode 100644 index 0000000..0a771c7 --- /dev/null +++ b/Cockpit/COCKPIT_zh_CN.ts @@ -0,0 +1,32 @@ + + + + + Cockpit + + + 绝对 + + + + + 相对 + + + + + 气压 + + + + + - + - + + + + heart: + 心跳: + + + diff --git a/Cockpit/Cockpit.cpp b/Cockpit/Cockpit.cpp index bea19e2..0f6853c 100644 --- a/Cockpit/Cockpit.cpp +++ b/Cockpit/Cockpit.cpp @@ -813,6 +813,29 @@ void Cockpit::setLed(QColor LED) m_Target.isUpdate = true; } +void Cockpit::setHeartBeatTime(quint32 Value) +{ +#ifdef unix + +#else + #ifdef __MINGW32__ + + #else + /* + if(isnan(Value)) + { + return; + } + */ + #endif +#endif + + m_State.heartBeatTime = Value; + m_Target.isUpdate = true; + update(); +} + + void Cockpit::paintEvent(QPaintEvent *) { @@ -845,6 +868,7 @@ void Cockpit::paintEvent(QPaintEvent *) drawVRate(&painter); drawYawScale(&painter); drawTopStatuts(&painter); + drawHeartBeat(&painter); } else//简单显示 { @@ -2365,3 +2389,38 @@ void Cockpit::drawTopStatuts(QPainter *painter) painter->restore();//所有结束 } + +void Cockpit::drawHeartBeat(QPainter *painter) +{ + //画状态开始 + painter->save(); + + QPen ePen; + QFont font; + + painter->translate(0,-900); + + //画底层 + + + //画状态 + painter->save(); + + //画大字 + ePen.setColor(m_Color.StatusColor); + ePen.setWidth(12); + font.setPixelSize(90); + font.setWeight(QFont::Bold); + font.setFamily(font_family);//非衬线 + + painter->setPen(ePen); + painter->setFont(font); + + painter->drawText(QRect(750,0,500,150),Qt::AlignLeft|Qt::AlignVCenter,tr("heart:") + QString::number(m_State.heartBeatTime)); + + painter->restore();//画状态结束 + + painter->restore();//所有结束 +} + + diff --git a/Cockpit/Cockpit.h b/Cockpit/Cockpit.h index 6afec9c..d2bc21e 100644 --- a/Cockpit/Cockpit.h +++ b/Cockpit/Cockpit.h @@ -87,6 +87,7 @@ typedef struct { quint8 AirspeedFlag = 0; quint8 AltitudeFlag = 0; + qreal heartBeatTime = 0; @@ -133,7 +134,7 @@ Q_SIGNALS: void showMessage(const QString &message,int TimeOut = 0); -public Q_SLOTS: +public slots: bool NormalSize() { @@ -194,6 +195,8 @@ public Q_SLOTS: void setWP_dist(double value); void setAlt_err(double value); + void setHeartBeatTime(quint32 Value); + protected: void mouseMoveEvent(QMouseEvent *e); @@ -221,6 +224,7 @@ protected: void drawRightScale(QPainter *painter); void drawTopStatuts(QPainter *painter); + void drawHeartBeat(QPainter *painter); private slots: diff --git a/Cockpit/Cockpit.pro b/Cockpit/Cockpit.pro index 055fabb..23fee1f 100644 --- a/Cockpit/Cockpit.pro +++ b/Cockpit/Cockpit.pro @@ -81,6 +81,6 @@ unix { } - +TRANSLATIONS += COCKPIT_zh_CN.ts diff --git a/MavLinkNode/MAVLINKNODE_zh_CN.ts b/MavLinkNode/MAVLINKNODE_zh_CN.ts index cbaf4ff..3df4f6a 100644 --- a/MavLinkNode/MAVLINKNODE_zh_CN.ts +++ b/MavLinkNode/MAVLINKNODE_zh_CN.ts @@ -4,7 +4,7 @@ MavLinkNode - + 出现新的设备,识别号为 %1 diff --git a/MavLinkNode/mavlinknode.cpp b/MavLinkNode/mavlinknode.cpp index 6eb4d5c..40aba91 100644 --- a/MavLinkNode/mavlinknode.cpp +++ b/MavLinkNode/mavlinknode.cpp @@ -624,7 +624,7 @@ void MavLinkNode::process()//线程函数 if(isSendHeartBeat == true) { - if((QTime::currentTime().msecsSinceStartOfDay() - HeartBeatTime) > (1000.0/heartbeatFrq)) + if((QTime::currentTime().msecsSinceStartOfDay() - HeartBeatTime) >= (1000.0/heartbeatFrq)) { heartbeat(m_heartbeat.custom_mode, m_heartbeat.type, @@ -632,6 +632,11 @@ void MavLinkNode::process()//线程函数 m_heartbeat.base_mode, m_heartbeat.system_status, m_heartbeat.mavlink_version); + + emit heartbeatTimeStamp(QTime::currentTime().msecsSinceStartOfDay() - HeartBeatTime); + + //qDebug() << "time:" << QTime::currentTime().msecsSinceStartOfDay() - HeartBeatTime; + HeartBeatTime = QTime::currentTime().msecsSinceStartOfDay(); } } diff --git a/MavLinkNode/mavlinknode.h b/MavLinkNode/mavlinknode.h index 1fff545..60bdae4 100644 --- a/MavLinkNode/mavlinknode.h +++ b/MavLinkNode/mavlinknode.h @@ -207,6 +207,8 @@ signals: void Recieve(QString msg); + void heartbeatTimeStamp(quint32 time); + public slots: //线程对外接口 void CreateCSV(void); diff --git a/dlink/dlink.cpp b/dlink/dlink.cpp index 9e9326e..6a7f4b4 100644 --- a/dlink/dlink.cpp +++ b/dlink/dlink.cpp @@ -57,7 +57,7 @@ void DLink::timeout() qint64 time = QDateTime::currentMSecsSinceEpoch() - last; - if(time >= 3000) + if(time >= 2000) { Byte_Out_per = (double)Byte_Out_ALL / (time * 0.001); diff --git a/opmap/MAP_zh_CN.ts b/opmap/MAP_zh_CN.ts index b632493..efd7e00 100644 --- a/opmap/MAP_zh_CN.ts +++ b/opmap/MAP_zh_CN.ts @@ -83,82 +83,82 @@ Please first select the area of the map to rip with <CTRL>+Left mouse clic - + start rip map 开始缓存地图 - + stop rip map 停止缓存地图 - + Load Geo Fence File :%1 导入围栏文件:%1 - + Load Mission File:Group %1,%2 导入航线文件:第%1组航线,%2 - + Save Fence File:%1 保存围栏文件:%1 - + Save Mission File:Group %1,%2 保存航线文件:第%1组航线,%2 - + please load fence first 请先导入围栏 - + start upload fence,total:%1 开始上传围栏,总数%1 - + please load mission first 请先导入航线 - + start upload mission %1,total %2 开始上传航线%1,总数%2 - + upload Mission 上传航点 - + upload fail %1 上传失败 %1 - + recieve fence polygon inclusion: %1 接收到多边形安控区 :%1 - + recieve fence polygon exclusion: %1 接收到多边形禁飞区 :%1 - + recieve fence circle inclusion: %1 接收到圆形安控区 :%1 - + recieve fence circle exclusion: %1 接收到圆形禁飞区 :%1 @@ -167,7 +167,7 @@ Please first select the area of the map to rip with <CTRL>+Left mouse clic 围栏 - + recieve way point group:%1 seq:%2 收到航点:第%1组,第%2点 @@ -214,94 +214,94 @@ Ma:%2 航点 - + return 返航 - + landing 降落 - + takeoff 起飞 - + unknow 未知类型 - + hold 保持 - + cas 表速 - - - - - + + + + + Ma: %1 马赫:%1 - + Vz 快升 - + onAB 开加力 - + offAB 关加力 - + unknow 未知指令 - + - - - - - + + + + + Speed: %1m/s 速度:%1m/s - + Height: %1m %2 高度:%1m