当前位置:网站首页>QT serial and CAN dynamic real-time display the log data
QT serial and CAN dynamic real-time display the log data
2022-07-30 07:13:00 【transparent light】
Foreword
From November 20th to December 10th, it took 20 days to write the host computer display program of QT serial port and CAN communication.After the whole project, I feel that I have a certain understanding of software, especially object-oriented programming, and also understand the difference between object-oriented programming and logic-oriented programming.Overall, the programming process is not very different: object-oriented programming also requires logic programming, and logic programming does not include object programming.As for the difference between serial port and CAN, it is only the difference between the underlying hardware. For upper-level programming, the difference is not very big.
Part 1: Object Programming and Logic Programming
(1) Language usage is not used: QT is based on c++, and single-chip microcomputer is based on C.The former is based on classes, while the latter uses structures at most.Relatively speaking, it is easy to get started with logic programming, and difficult to advance;
(2) The ideas are different: QT is based on signals and slots, real-time execution, and MCU is based on loops and interrupts.
(3) For different objects: QT only produces upper-level software, which belongs to peripheral equipment, that is, the sending or receiving end; the single-chip microcomputer is supported by hardware, and the peripheral can be a switch, a communication interface, or a peripheral display and signal produced by QT.Enter (communication).
(4) The logic is different: QT issues commands through the communication protocol, and the commands are realized by virtual buttons or logic.The microcontroller initializes the hardware interface, and its code is completed through a large loop + interrupt.
The location of the two is roughly as shown:

Part II: The difference between serial port and CAN in QT
(1) The source of the function is different: the function of the serial port in QT and the function of CAN require the dll file provided by the manufacturer.
(2) The effect of the receiving function is different: the serial port receiving function recvData = mSerial.readAll() puts the received data in the recvData array, the array is continuous, that is, if 100 are received, the data is placed in the array 0 to 99;CAN receive function ReceiveNum = VCI_Receive(nDeviceType,nDeviceInd,nCANInd,Receive,100,400) is placed in the Receive array, the array is only 8, no matter how many are received, it is placed in the array 0 to 7.
(3) Different effects: Excluding internal logic and peripheral logic problems, the reliability of serial port receiving data and drawing is lower than CAN receiving data and drawing.In the same case, serial port reception will lose points, but CAN reception will not (observe the waveform).In the case of a small number of plots, there is no obvious difference between the two.
The following figure shows the serial port receiving data and drawing:

The following picture shows CAN receiving data and drawing

Overall, there is no essential difference between the two in the dynamic real-time display of data, and only have their own characteristics in the underlying transmission and processing.
Part III: Summary
Data display: The upper software production of serial port and CAN has come to an end.The overall feeling is that it is not too difficult to just make a program that displays the interface, but it is more difficult to get started with the program.It is tentatively estimated that such projects will not be designed in a short period of time, and the code written will also be archived. If you need to use the serial port or CAN QT program, you can leave your own mailbox, and it will be packaged and sent.
Note: Since the time when the small partners need the source code is different, it is too troublesome to log in to the mailbox interface, so a subscription number has been established. If you have any questions or need the source code, you can add a subscription number. After leaving a message, the source code will be sent or anyQuestions can be left in the comments, and we will actively solve the problems raised.

边栏推荐
- 【青岛站】SWAT模型高阶应用暨无资料地区建模、不确定分析与气候变化、土地利用对面源污染影响模型改进及案例分析研讨
- 2021-09-16 集成学习上--task1机器学习数学基础
- jvm之方法区
- 关于map对key自定义排序
- Simulation of Future Air Pollution Changes Based on Global Model Comparison Program CMIP6 and Regional Climate-Chemistry Coupling Model WRF-Chem
- 1.03 original Acegi security mechanism
- 八、Kotlin基础学习:1、数据类;2、单例;3、伴生对象;4、密封类;
- 基于QT的CAN通讯数据实时波形显示(连载八)====“子函数或新类调用ui控件”
- 【江科大自化协stm32F103c8t6】笔记之【入门32单片机及利用TIM输出比较配置PWM】
- User password encryption using Bcrypt instead of MD5, SHA1 and SHA256
猜你喜欢

MySQL data types and footprint

抽象工厂模式(Swift 实现)

Self-augmented Unpaired Image Dehazing via Density and Depth Decomposition program running record

为什么会出现梯度爆炸和梯度消失现象?怎么缓解这种现象的发生?

基于PyTorch深度学习无人机遥感影像目标检测、地物分类及语义分割

QT串口动态实时显示大量数据波形曲线(五)========“最终完美解决版”

十六、Kotlin进阶学习:协程详细学习。

昆仑通态屏幕制作(连载5)---基础篇(串口接收,文本与灯显示)

高交会重要活动之一|2020中国硬件创新大赛全国总决赛

单例模式:Swift 实现
随机推荐
jvm之方法区
无人机生态环境监测、图像处理与GIS数据分析
三种内核结构---宏内核、微内核、混合内核
CPU缓存一致性问题
Machine Learning, Deep Learning Based on MATLAB 2021b
十四、Kotlin进阶学习:一、内联函数 inline;二、泛型;三、泛型约束;四、子类与子类型;
边境的悍匪—机器学习实战:第一章 机器学习的基础知识
ipconfig命令指南
Pytorch(一):动态图机制以及框架结构
迪文串口屏幕制作(连载一)=====准备工作
常用损失函数(一):Focal Loss
目标检测中的知识蒸馏方法
Massive remote sensing data processing and application of GEE cloud computing technology [basic, advanced]
Based on R language geographic weighted regression, principal component analysis, discriminant analysis and other spatial heterogeneity data analysis
联影医疗一面
How does MATLAB display nii file slice information in the image?
Map making of environmental impact assessment based on remote sensing interpretation and GIS technology (the latest guidelines)
十、Kotlin基础学习:1、延迟加载;2、异常处理;3、使用 throw 主动抛出异常;4、自定义异常;
边境的悍匪—机器学习实战:第三章 分类
基于MATLAB 2021b的机器学习、深度学习