君隆网站建设桂林哪里做网站

diannao/2026/1/17 5:35:01/文章来源:
君隆网站建设,桂林哪里做网站,建设局的证件在哪个网站查,网站做好了怎么做后台管理此篇是1-4 《半导体》的会和处啦#xff0c;我们有了协议库#xff0c;也有了通讯库#xff0c;这不得快乐的玩一把~ 一、先创建一个从站#xff0c;也就是我们的Equipment端 QT - guiCONFIG c11 console CONFIG - app_bundle CONFIG no_debug_release # 不会生…此篇是1-4 《半导体》的会和处啦我们有了协议库也有了通讯库这不得快乐的玩一把~ 一、先创建一个从站也就是我们的Equipment端 QT - guiCONFIG c11 console CONFIG - app_bundle CONFIG no_debug_release # 不会生成debug 和 release 文件目录DESTDIR $${PWD}/../../deploy/bin OBJECTS_DIR $${PWD}/../../build/sample/Equipment/tmp/obj MOC_DIR $${PWD}/../../build/sample/Equipment/tmp/obj UI_DIR $${PWD}/../../build/sample/Equipment/tmp/obj# The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES QT_DISABLE_DEPRECATED_BEFORE0x060000 # disables all the APIs deprecated before Qt 6.0.0SOURCES \main.cpp# Default rules for deployment. qnx: target.path /tmp/$${TARGET}/bin else: unix:!android: target.path /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS targetwin32:CONFIG(release, debug|release){win32: LIBS -L$$PWD/../../deploy/lib/Release -lJC_Commucationwin32: LIBS -L$$PWD/../../deploy/lib/Release -lJcHsms } else:win32:CONFIG(debug, debug|release){win32: LIBS -L$$PWD/../../deploy/lib/Debug -lJC_Commucationwin32: LIBS -L$$PWD/../../deploy/lib/Debug -lJcHsms }INCLUDEPATH $$PWD/../../deploy/include DEPENDPATH $$PWD/../../deploy/include#include QCoreApplication #include QDebug #include iostream #include QByteArray #include string #include QTimer using namespace std;#include ../../SemiGeneralStandardLibrary/JcGemSecsLibrary/Commucation/commucation.h #include ../../SemiGeneralStandardLibrary/JcGemSecsLibrary/Driver/JcHsms/hsmsincludes.h/*** brief OnStateChanged 连接状态改变回调事件* param pComm* param nState 0: 连接 1:断开连接* param cSocket*/ void OnStateChanged(ICommucation* pComm, __int32 nState, void *cSocket) {SOCKET* c (SOCKET*) cSocket;std::string str nState 0 ? std::string( connected to ) : std::string( disconnected from );std::cout [OnStateChanged Event] : c str (void*)pComm std::endl; }/// 无符号字节数组转16进制字符串 std::string bytesToHexString(const char* bytes,const int length) {if (bytes NULL) return ;std::string buff;const int len length;for (int j 0; j len; j) {int high bytes[j]/16, low bytes[j]%16;buff (high10) ? (0 high) : (a high - 10);buff (low10) ? (0 low) : (a low - 10);buff ;}return buff; }/*!* \brief onMessageRecived 接收到消息的回调事件* \param pComm* \param recvedMsg* \param cSocket*/ void onMessageRecived(ICommucation* pComm, char* message,int iRecvSize, void * cSocket) {JcHsms ho(0,QString(JC Gem/Secs Test),QString(1.0.1));HsmsMessage hmsg ho.interpretMessage(QByteArray(message,iRecvSize));HsmsMessage rsp hmsg.dispatch();QByteArray responseByteArray rsp.toByteArray();QString smlString rsp.SmlString();string rHexString bytesToHexString(message,iRecvSize);// qDebug().noquote() recv message QString::fromStdString(rHexString);// qDebug().noquote() send message responseByteArray.toHex( );qDebug().noquote() QString(RECV S%1F%2 SystemBytes%3).arg(QString::number((int)hmsg.GetHeader().Getstream()),QString::number((int)hmsg.GetHeader().Getfunction()),QString::number(hmsg.GetHeader().GetSystemBytes()));qDebug().noquote() hmsg.SmlString();qDebug().noquote() QString(SEND S%1F%2 SystemBytes%3).arg(QString::number((int)rsp.GetHeader().Getstream()),QString::number((int)rsp.GetHeader().Getfunction()),QString::number( rsp.GetHeader().GetSystemBytes()));qDebug().noquote() rsp.SmlString();int slen responseByteArray.length();if(slen){int rslen pComm-SendData(*((SOCKET*) cSocket),responseByteArray.data(),responseByteArray.length());if(rslen 0) {qDebug() Send Reply Message failed.;}}}/*!* \brief OnAsyncMsgTimeout 消息超时* \param pComm* \param nTransfer 消息ID* \param pClientData*/ void OnAsyncMsgTimeout(ICommucation* pComm, __int32 nTransfer, void *pClientData) {}int main(int argc, char *argv[]) {QCoreApplication a(argc, argv);const char* comm_dll_version JC_CommDllVersion();qDebug() comm_dll_version;/// [1] 建立通讯连接以单个通讯连接对象为例CommucationParam setting;EthernetCommucationParam eParam {45000,10000,5000,10000,5000, /* timeout */0 /* PASSIVE */,5555, /* port */1 /* DEVID */,Device Host,127.0.0.1};SerialCommucationParam sParam {2,9600,N,8,1};setting.eParam eParam;setting.sParam sParam;/// 创建通讯对象ICommucation* o NULL;o JC_CreatCommObject(TcpServer,setting);/// 为通讯连接对象注册事件回调JC_SetEventCallBack(o,onMessageRecived,OnStateChanged,OnAsyncMsgTimeout);/// 启动监听JC_RunListenThread(o);/// 测试修改 Selected Equipment Status Data(SSD),线程安全float x[] {12.3025,55.12,56.478,63.54};QTimer timer;timer.setInterval(300);QObject::connect(timer,QTimer::timeout,[x](){static int i 0;HsmsDataManager::Instance().UpdateSsdMap(1022,HsmsDataManager::ESD{F4,QVariant(x[i%4])});});timer.start();QObject::connect(qApp,QCoreApplication::aboutToQuit,[o](){/// 释放通讯连接对象结束通讯连接JC_ReleaseCommObject(o);});return a.exec(); }二、创建一个主站也就是我们的Host端 QT core gui networkgreaterThan(QT_MAJOR_VERSION, 4): QT widgetsCONFIG c11DESTDIR $${PWD}/../../deploy/bin OBJECTS_DIR $${PWD}/../../build/sample/Host/tmp/obj MOC_DIR $${PWD}/../../build/sample/Host/tmp/obj UI_DIR $${PWD}/../../build/sample/Host/tmp/obj# The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES QT_DISABLE_DEPRECATED_BEFORE0x060000 # disables all the APIs deprecated before Qt 6.0.0SOURCES \main.cpp \mcwidget.cppHEADERS \mcwidget.h# Default rules for deployment. qnx: target.path /tmp/$${TARGET}/bin else: unix:!android: target.path /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS targetwin32:CONFIG(release, debug|release){win32: LIBS -L$$PWD/../../deploy/lib/Release -lJC_Commucationwin32: LIBS -L$$PWD/../../deploy/lib/Release -lJcHsms } else:win32:CONFIG(debug, debug|release){win32: LIBS -L$$PWD/../../deploy/lib/Debug -lJC_Commucationwin32: LIBS -L$$PWD/../../deploy/lib/Debug -lJcHsms }INCLUDEPATH $$PWD/../../deploy/include DEPENDPATH $$PWD/../../deploy/include // mcwidget.h #ifndef MCWIDGET_H #define MCWIDGET_H#include QWidget #include QTcpServer #include QLabel #include QHBoxLayout #include QTimer #include iostream #include QDebug #include string #include QByteArray #include QList #include ../../SemiGeneralStandardLibrary/JcGemSecsLibrary/Commucation/commucation.h #include ../../SemiGeneralStandardLibrary/JcGemSecsLibrary/Driver/JcHsms/hsmsincludes.hclass TransHelper: public QObject {Q_OBJECT public:TransHelper(){qRegisterMetaTypeHsmsMessage(qRegisterMetaType);//qRegisterMetaTypeHsmsMessage(qRegisterMetaType);}void RecivedMsgObject(HsmsMessage msg){emit RecivedMsgObjectSig(msg);} signals:void RecivedMsgObjectSig(HsmsMessage); };class MyLabel : public QWidget {Q_OBJECT public:MyLabel(QString labName,QString labval,QWidget* parent nullptr):m_labname(labName),m_labVal(labval),QWidget(parent){m_nameLab new QLabel(m_labname);m_valLab new QLabel(m_labVal);m_nameLab-setFixedWidth(200);m_valLab-setFixedWidth(100);QHBoxLayout* ly new QHBoxLayout;ly-addWidget(m_nameLab);ly-addWidget(m_valLab);ly-setContentsMargins(0,0,0,0);this-setContentsMargins(0,0,0,0);setLayout(ly);}void setValue(QString val){m_labVal val;m_valLab-setText(m_labVal);} private:QString m_labname;QString m_labVal;QLabel* m_nameLab;QLabel* m_valLab; };class McWidget : public QWidget {Q_OBJECTpublic:McWidget(QWidget *parent nullptr);~McWidget();void initUi();static TransHelper transhelper;private:ICommucation* o NULL;QTimer linktesttimer;QTimer s1f3Rqtimer;QListMyLabel* llabs; }; #endif // MCWIDGET_H// mcwidget.cpp#include mcwidget.h #include QDebug #include functional #include QVBoxLayoutTransHelper McWidget::transhelper;/*** brief OnStateChanged 连接状态改变回调事件* param pComm* param nState 0: 连接 1:断开连接* param cSocket*/ void OnStateChanged(ICommucation* pComm, __int32 nState, void *cSocket) {SOCKET* c (SOCKET*) cSocket;std::string str nState 0 ? std::string( connected to ) : std::string( disconnected from );std::cout [OnStateChanged ] : c str (void*)pComm str std::endl; }/*!* \brief onMessageRecived 接收到消息的回调事件* \param pComm* \param recvedMsg* \param cSocket*/ void onMessageRecived(ICommucation* pComm,char* recvedMsg, int iRecvsize,void * cSocket) {SOCKET* c (SOCKET*) cSocket;// std::cout [onMessageRecived ] : (void*)pComm -- c : // recvedMsg len iRecvsize std::endl;/// 通过gemsecs的协议进行解析和应答JcHsms ho(0,QString(JC Gem/Secs Test),QString(1.0.1));HsmsMessage hmsg ho.interpretMessage(QByteArray(recvedMsg,iRecvsize));if(hmsg.GetHeader().Getstream() 0x1 hmsg.GetHeader().Getfunction() 0x4){ // S1F4McWidget::transhelper.RecivedMsgObject(hmsg);} }/*!* \brief OnAsyncMsgTimeout 消息超时* \param pComm* \param nTransfer 消息ID* \param pClientData*/ void OnAsyncMsgTimeout(ICommucation* pComm, __int32 nTransfer, void *pClientData) {qDebug() QStringLiteral(同步发送请求消息超时); }McWidget::McWidget(QWidget *parent): QWidget(parent) {initUi();CommucationParam setting;EthernetCommucationParam eParam {45000,10000,5000,10000,5000, /* timeout */0 /* PASSIVE */,5555, /* port */1 /* DEVID */,Device Host,127.0.0.1};SerialCommucationParam sParam {2,9600,N,8,1};setting.eParam eParam;setting.sParam sParam;o JC_CreatCommObject(TcpClient,setting);/// 注册回调事件JC_SetEventCallBack(o,onMessageRecived,OnStateChanged,OnAsyncMsgTimeout);/// 启动监听JC_RunListenThread(o);/// 发送 select.req 请求JcHsms ho(0,QString(JC Gem/Secs Test),QString(1.0.1));HsmsMessage srmsg HsmsMessageDispatcher::selectReq(ho.unique_sessionID);QByteArray srbytes srmsg.toByteArray();std::string rbuf;bool ok o-SendSyncMessage(srbytes.toStdString(),true,rbuf,10);std::cout recv reply buf : rbuf std::endl;qDebug(send status:%s\n,ok ? success : failed);std::functionvoid() flinktest [](){HsmsMessage lktestMgr HsmsMessageDispatcher::linktestReq();QByteArray lktestBytes lktestMgr.toByteArray();#if 0 /// 同步发送/接收消息std::string rbuf;bool ok o-SendSyncMessage(lktestBytes.toStdString(),true,rbuf,10);std::cout recv reply buf : rbuf std::endl;qDebug(send status:%s\n,ok ? success : failed); #else/// 异步发送接收消息消息接收回调事件o-SendData(0,lktestBytes.constData(),lktestBytes.length()); #endif};/// 立即执行一次if(ok) flinktest();/// 定时触发linktesttimer.setInterval(10000);// 10sQObject::connect(linktesttimer,QTimer::timeout,flinktest);linktesttimer.start();/// 定时发送S1F3 请求最新SSDstd::functionvoid() fs1f3Rq [,ho](){HsmsMessage s1f3ReqtMgr HsmsMessageDispatcher::S1F3(ho.unique_sessionID);QByteArray s1f3ReqBytes s1f3ReqtMgr.toByteArray();#if 0 /// 同步发送/接收消息std::string rbuf;bool ok o-SendSyncMessage(lktestBytes.toStdString(),true,rbuf,10);std::cout recv reply buf : rbuf std::endl;qDebug(send status:%s\n,ok ? success : failed); #else/// 异步发送接收消息消息接收回调事件o-SendData(0,s1f3ReqBytes.constData(),s1f3ReqBytes.length()); #endif};s1f3Rqtimer.setInterval(30);QObject::connect(s1f3Rqtimer,QTimer::timeout,fs1f3Rq);s1f3Rqtimer.start();/// S1F4 Recivedconnect(transhelper,TransHelper::RecivedMsgObjectSig,[](HsmsMessage hm){Secs2Item item hm.GetItem();QVectorSecs2Item v item.GetItems();if(v.isEmpty() || v.length() ! 23 ) return;llabs[0]-setValue(QString::number( v[0].toInt32().first()));for(int i 1;i3;i){ // boolllabs[i]-setValue(QString::number(v[i].toBoolean().first()));}for(int i 4;i20;i){ // int32llabs[i]-setValue(QString::number(v[i].toInt32().first()));}for(int i 21;i 22;i){ // floatllabs[i]-setValue(QString::number(v[i].toFloat().first()));}});}McWidget::~McWidget() {}void McWidget::initUi() {llabs.clear();QVBoxLayout* vly new QVBoxLayout;for(int i 1001;i 1023; i){MyLabel* labptr new MyLabel(QString::number(i),QString(0));llabs.append(labptr);labptr-setFixedHeight(30);labptr-setFixedWidth(300);vly-addWidget(labptr);}setLayout(vly); }// main.cpp#include mcwidget.h #include QApplicationint main(int argc, char *argv[]) {QApplication a(argc, argv);McWidget w;w.show();return a.exec(); }三、演示结果 perfect

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/90968.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站服务器自己搭建网页设计入门基础知识

项目应用场景 面向自动驾驶场景的车道线检测场景,项目的特点是能够达到实时的车道线检测 项目效果: 项目细节 > 具体参见项目 README.md (1) 安装依赖 pip3 install -r requirements.txt (2) 测试图片 python tools/test_lanenet.py --weights_pat…

网站news怎么做旅游网页设计说明书

使用System.out.println()来调试.但是用这种方式开发项目部署到生产环境,会因为众多的控制台输出降低应用的性能.这时候Log4J就成为可平衡开发和部署应用的利器了. 使用指定的类XXX初始化日志对象,方便在日志输出的时候,可以打印出日志信息所属的类。 …

网站改域名备案通河县机场建设网站

​ ​ ​在遥感技术的应用中,图像处理是不可或缺的关键步骤。从消除各种辐射畸变和几何畸变,到利用增强技术突出景物的光谱和空间特征,再到进一步理解、分析和判别处理后的图像,这一过程为我们呈现了一幅幅更为真实、清晰的…

网站设计价钱网站美工

路径规划中的曲线插值是一种数学方法,它通过一系列离散的点生成一条平滑的曲线,这条曲线可以用于机器人导航、自动车辆驾驶、动画制作等领域。以下是一些常见的曲线插值方法: 线性插值: 线性插值是最简单的插值方法,它…

山西长治做网站公司有哪些北京网站制作济南

这篇博文是接着这个系列前面的博文,来讲如何实现医学图像三视图同步视图。我想到的一个思路是用Scrollbar来控制切面的改变,还有一个想法是在三维图像上取点,然后以这个点为切面中心更新三维视图。这篇博文主要介绍的就是第二个想法的三维图像…

天津 公司网站建设360社区app

算术编码 是一种无损数据压缩方法,也是一种熵编码的方法。和其它熵编码方法不同的地方在于,其他的熵编码方法通常是把输入的消息分割为符号,然后对每个符号进行编码,而算术编码是直接把整个输入的消息编码为一个数,一个…

专门做奢侈品的网站有哪些深入浅出wordpress pdf

Zabbix6.4 监控系统 密码忘记怎么办? 如下图 本次主要介绍在Zabbix6.4中重置用户密码的步骤。 步骤 如果您忘记了Zabbix密码并且无法登录,请向Zabbix管理员求助。 超级管理员用户可以在用户配置表单中更改所有用户的密码。 如果超级用户忘记了密码&a…

有道翻译网站 做翻译上杭县住房和城乡建设局网站

MySQL的体系架构 一、MySQL简介二、MySQL的体系架构三、MySQL的内存结构四、MySQL的文件结构 一、MySQL简介 MySQL是一个开源的关系型数据库管理系统(RDBMS),由瑞典MySQL AB公司开发,后被Sun公司收购,Sun公司被Oracle…

做挂网站万网 安装wordpress

项目代码 https://github.com/yinhai1114/JavaWeb_LearningCode/tree/main/fileupdown 目录 文件上传 一、基本介绍 二、文件上传的基本原理 ​编辑 三、文件上传应用实例 四、文件上传的注意细节 1.解决中文乱码问题 2.分割文件夹 3.防止重名 4.百度WebUploader 5.空…

微网站制作平台哪个好wordpress php 采集器

在博问中(.net core怎么实现邮件发送)知道了MailKit无法使用阿里云邮件推送服务发送邮件的问题,自已实测也遇到同样的问题,而用自己搭建的邮件服务器没这个问题。 于是,向阿里云提交了工单。。。在提供了TCP抓包数据后…

爱站网关键词挖掘易营宝网站建设

四、(2)获取数据(补充urllib)(爬虫及数据可视化) urllibget请求post请求User-AgentResponse模拟真实信息在豆瓣spider中真实实现 urllib 此处的扩展,可以进行在主体的程序学习完成后&#xff0…

discuz建网站网站内容管理系统

🌈hello,你好鸭,我是Ethan,一名不断学习的码农,很高兴你能来阅读。 ✔️目前博客主要更新Java系列、项目案例、计算机必学四件套等。 🏃人生之义,在于追求,不在成败,勤通…

建站公司新闻资讯关于网站建设的知识

一、chown 的简介 chown 用于更改文件或目录的所有者(owner)身份。通过 chown 命令,可以将文件或目录的所有权转移给另一个用户或组,从而控制对该文件或目录的访问和权限。 二、chown 的参数说明 使用语法:chown [新所…

常平镇仿做网站贵州公明建设投资咨询有限公司官方网站

【26.4K⭐】ShareX:一款开源免费、功能强大且丰富的截屏录屏软件 在日常工作、学习和娱乐过程中,我们经常需要截取屏幕或者录制屏幕上特定区域中的内容并进行标记、编辑等操作。无论是为了记录重要的信息、分享有趣的内容,还是为了制作教程和…

济宁建设局网站招聘会现在哪个电商平台比较好做

开头 通常作为一个Android APP开发者,我们并不关心Android的源代码实现,不过随着Android开发者越来越多,企业在筛选Android程序员时越来越看中一个程序员对于Android底层的理解和思考,这里的底层主要就是Android Framewok中各个组…

代做毕业设计网站 道路桥梁wordpress热门文章代码

C中,我们一般可以以基类声明纯虚函数,然后让派生类继承并重写这个虚函数,用​override表示显示覆盖基类方法,但一直没有提供一种方法来阻止派生类继承基类的虚函数。 C11标准引入了final说明符,很好的解决了上面的问题…

湛江网站建设运营方案六安城市网怎么样

1.引入 在Servlet3.0以后的版本提供了Servlet注解配置&#xff0c;大大简化了代码编写。它可以替代xml文件的配置 2.代码实现 <1>注解开发代码如下&#xff1a; WebServlet(value "/servlet1", initParams {WebInitParam(name "charset", val…

网上的网站模板怎么下载网站建设公司有

4、流动布局(fluidgrid)“流动布局”的含义是&#xff0c;各个区块的位置都是浮动的&#xff0c;不是固定不变的。.main{float:right;width:70%;}.leftBar{float:left;width:25%;}float的好处是&#xff0c;如果宽度太小&#xff0c;放不下两个元素&#xff0c;后面的元素会自动…

自己做网站有哪些方法呢网站导航的分类有哪些

1 web开发 Spring boot web 开发非常简单&#xff0c;其中包括常用的 json输出、filters、property、log等 1.1 json接口开发 在以前的Spring 开发我么提供json 的做法&#xff1a; 添加jackjson 等相关jar包配置Spring controller扫描对接的方法添加ResponseBody 而在Spri…

推广网站多少钱wordpress画栏

嘿&#xff0c;大家好&#xff01;今天我们来聊一聊深度学习领域的一位“大明星”——Transformer模型。这个模型的提出可不得了&#xff0c;让自然语言处理领域焕发了新生。 在深度学习领域&#xff0c;Transformer模型架构的引入标志着一场革命&#xff0c;它改变了自然语言处…