- 博客(5)
- 收藏
- 关注
原创 基于C++11封装的windows平台下的ModbusRtu通讯库
使用方法#include <iostream>#include "Modbus.h"int main(){ try { Modbus modbus("COM6", SERIALBUS_CONST::BaudRate::BR_115200); modbus.ReadRegister(1, 1, 2); } catch (std::string errMsg) { std::cout << errMsg
2022-02-17 16:48:10
1346
1
原创 Linux后台运行程序
不输出任何信息test@test:~$ sudo nohup ./test>/dev/null 2>&1 &[1] 20973test@test:~$ ps -ef|grep testroot 20973 12198 0 13:54 pts/1 00:00:00 sudo nohup ./testroot 20974 20973 16 13:54 pts/1 00:00:00 ./testtest 21056 12198 0
2022-02-08 13:57:44
810
原创 C++程序计时方法
方法一: clock_gettime介绍说明函数"clock_gettime"是基于Linux C语言的时间函数,他可以用于计算精度和纳秒函数介绍#include <ctime>int clock_gettime(clockid_t clk_id, struct timespec *tp);参数clk_id : 检索和设置的clk_id指定的时钟时间。CLOCK_REALTIME:系统实时时间,随系统实时时间改变而改变,即从UTC1970-1-1 0..
2021-11-16 17:51:19
5609
原创 QML调用C++方法
方法一:1. 使用QQmlContext (setContextProperty)注册#include <QObject>// 必须继承QObjectclass MainModel : public QObject{ Q_OBJECTpublic: // 需提供此构造方法 MainModel(QObject *parent = nullptr); // 可供调用的方法 Q_INVOKABLE void test();};in
2021-11-16 09:12:13
1132
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人