摘要:二功能特点一软件模块视频监控模块,各种停靠小窗体子模块,包括设备列表图文警情窗口信息云台控制预置位巡航设置设备控制悬浮地图网页浏览等。视频监控面板窗体中任意通道支持拖曳交换,瞬间响应。支持各种国产系统中标麒麟银河麒麟等嵌入式等系统。
数据调试模块,用于显示通信串口的数据,自定义不同颜色显示,可以勾选过滤某个串口进行数据查看,也可以选择所有数据,还可以勾选暂停显示复选框用来暂停打印显示信息。数据调试可以很方便的查看串口收发数据,以便查证数据通信是否正确,特别是可以规避一些扯皮的问题,比如上位机下位机双方都是按照数据约定来编写程序,但是联调的时候突然发现没有按照约定的流程走下去,此时就可以打开数据调试模块,看下收发的数据是否符合规约,有时候也许下位机就是按照规约来编写的,但是中间有电平干扰导致数据发生了突变,都是有可能的,比如本人有一次就发现下位机数据错的一塌糊涂,但是下位机程序是正确的,后面才查到原来硬件没有做电源隔离,导致有一个电瓶车放在同一个供电的插线板上,导致了干扰数据发生异变,妹的,当时就想把那个电瓶车车主拉出来暴打一顿先,嘿嘿。
其实数据调试模块也不仅仅是本系统用得上,我做过的大部分项目都有这个模块,非常有用,不同的收发数据可以不同颜色显示,甚至还可以指定关键字过滤,一旦检测到对应的关键字可以突出颜色显示,因为一般数据收发速度都是非常快的,眼睛有的时候看不过来,但是又不能暂停显示,只是想抓住一个关键的数据而已。光打印收发数据还是不不够的,此时一般需要在发送数据和收到数据的编码位置,同时输出对应的中文解释含义,更加方便理解和过滤,比如发完一条轮询状态命令,除了要把轮询状态这条数据信号的形式发出来打印,还要发出一条中文解析信号。当最终系统调试运行无误以后,可以关闭这种打印,提升程序运行效率。
#include "frmrobotdebug2.h"#include "ui_frmrobotdebug2.h"#include "quihelper.h"#include "devicerobot.h"#include "devicerobot2.h"frmRobotDebug2::frmRobotDebug2(QWidget *parent) : QWidget(parent), ui(new Ui::frmRobotDebug2){ ui->setupUi(this); this->initForm();}frmRobotDebug2::~frmRobotDebug2(){ delete ui;}void frmRobotDebug2::initForm(){ //字体放大 具体要多大可以自己改 QFont font; font.setPixelSize(QUIConfig::FontSize + 8); ui->txtMain->setFont(font); //关联机器人数据收发 connect(DeviceRobot::Instance(), SIGNAL(sendData(QString, QByteArray)), this, SLOT(sendData(QString, QByteArray))); connect(DeviceRobot::Instance(), SIGNAL(receiveData(QString, QByteArray)), this, SLOT(receiveData(QString, QByteArray))); connect(DeviceRobot2::Instance(), SIGNAL(sendData(QString, QByteArray)), this, SLOT(sendData(QString, QByteArray))); connect(DeviceRobot2::Instance(), SIGNAL(receiveData(QString, QByteArray)), this, SLOT(receiveData(QString, QByteArray))); //测试数据 QByteArray data = QUIHelper::hexStrToByteArray("11 22 66 88"); sendData(AppConfig::PortNameA, data); sendData(AppConfig::PortNameB, data); sendData(AppConfig::PortNameC, data); sendData(AppConfig::PortNameD, data); receiveData(AppConfig::PortNameA, data); receiveData(AppConfig::PortNameB, data); receiveData(AppConfig::PortNameC, data); receiveData(AppConfig::PortNameD, data);}void frmRobotDebug2::append(int type, const QString &data, bool clear){ static int currentCount = 0; static int maxCount = 100; //执行清空数据命令 if (clear) { ui->txtMain->clear(); currentCount = 0; return; } //执行条数到了清空数据 if (currentCount >= maxCount) { ui->txtMain->clear(); currentCount = 0; } //暂停显示 if (ui->ckPause->isChecked()) { return; } //过滤回车换行符 QString strData = data; strData.replace("/r", ""); strData.replace("/n", ""); //不同类型不同颜色显示 QString strType; if (type == 0) { strType = "发送"; ui->txtMain->setTextColor(QColor("#00B17D")); } else if (type == 1) { strType = "发送"; ui->txtMain->setTextColor(QColor("#47A4E9")); } else if (type == 2) { strType = "发送"; ui->txtMain->setTextColor(QColor("#22A3A9")); } else if (type == 3) { strType = "发送"; ui->txtMain->setTextColor(QColor("#56BEC1")); } else if (type == 4) { strType = "接收"; ui->txtMain->setTextColor(QColor("#D64D54")); } else if (type == 5) { strType = "接收"; ui->txtMain->setTextColor(QColor("#A279C5")); } else if (type == 6) { strType = "接收"; ui->txtMain->setTextColor(QColor("#FD8B28")); } else if (type == 7) { strType = "接收"; ui->txtMain->setTextColor(QColor("#D98078")); } strData = QString("%1 [%2]: %3").arg(TIMEMS).arg(strType).arg(strData); ui->txtMain->append(strData); currentCount++;}bool frmRobotDebug2::checkNotPrint(const QString &portName, int &type, QString &flag){ type = 0; flag = QString("串口A"); if (portName == AppConfig::PortNameB) { type = 1; flag = QString("串口B"); } else if (portName == AppConfig::PortNameC) { type = 2; flag = QString("串口C"); } else if (portName == AppConfig::PortNameD) { type = 3; flag = QString("串口D"); } //没有选中的串口不用打印 QString port = ui->cboxPort->currentText(); bool notPrintA = (portName == AppConfig::PortNameA && flag != port); bool notPrintB = (portName == AppConfig::PortNameB && flag != port); bool notPrintC = (portName == AppConfig::PortNameC && flag != port); bool notPrintD = (portName == AppConfig::PortNameD && flag != port); if (port == "所有串口") { notPrintA = notPrintB = notPrintC = notPrintD = false; } return (notPrintA || notPrintB || notPrintC || notPrintD);}void frmRobotDebug2::sendData(const QString &portName, const QByteArray &data){ int type; QString flag; if (checkNotPrint(portName, type, flag)) { return; } QString info = QString("%1 %2").arg(flag).arg(QUIHelper::byteArrayToHexStr(data)); append(0 + type, info);}void frmRobotDebug2::receiveData(const QString &portName, const QByteArray &data){ int type; QString flag; if (checkNotPrint(portName, type, flag)) { return; } QString info = QString("%1 %2").arg(flag).arg(QUIHelper::byteArrayToHexStr(data)); append(4 + type, info);}
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/119533.html
摘要:基于大数据技术的安防数据预警研判分析,搭建去中心结构化数据汇聚平台,实现每年约亿条视频图片结构化数据的存储分析。以服务运营系统为抓手,协助大数据中心,对其云服务商的服务过程与产出云使用单位的云资源使用,执行统一监管。UCloud 2021年上半年营收同比增长65.20%,连续10个季度强劲增长。2021年,数字化转型正不断从宏观概念向产业价值链中的各个场景、各个微观模块加速渗透;驱动生产方式...
摘要:为纠正这个问题,需要将包含以太坊共享库的文件添加到环境变量为安装依赖警告应用没有在上尝试过。在写本文档时,这些交叉建立二进制已经成功地使用在以下设备上待办的有下一篇文章我们将会介绍以太坊连载九客户端的安装与定制三感谢朝夕 从源安装客户端 概览cpp-ethereum 代码库在几个Git库中传播,库在Git上被分组为webthree-umbrella库下的子模块。 我们用一般的CMake...
本设计的时候,应用YOLO目标检测算法、Openpose姿势检测算法、deepsort跟踪算法、MSCNN群体密度估计技术实现了火灾监测、抽烟数据监测、行为表现安全监控、人群密度数据监测、防护口罩率数据监测、人员定位系统数据监测六个基本要素,对Python完成旅游景点安防监控系统感兴趣的小伙伴一起了解一下吧 本设计的时候,应用YOLO目标检测算法、Openpose姿势检测算法、deepsor...
摘要:了解华为海思的方案海思的前身是华为的半导体部门,主要产品线包括智能手机处理器麒麟系列,视频采集和编解码处理器系列,无线通信方向芯片等。 目录 一、视频行业1、视频...
阅读 1052·2021-11-22 09:34
阅读 1931·2021-10-08 10:18
阅读 1543·2021-09-29 09:35
阅读 1840·2021-09-24 09:48
阅读 507·2021-09-08 09:36
阅读 2248·2019-08-29 17:20
阅读 1971·2019-08-29 15:36
阅读 3241·2019-08-29 13:52