91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2.85M
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2024-04-18
  • 語言: C/C++
  • 標簽: 串口??TCP/IP??

資源簡介

TCP/IP與串口調試

資源截圖

代碼片段和文件信息

#include?“common.h“
#include?
common::common(QWidget?*parent)?:?QTextEdit(parent)
{
????connect(this&QTextEdit::cursorPositionchangedthis&common::changePosSLOT);
}

QString?common::getCurrTime()
{
????return?QTime::currentTime().toString();
}

QByteArray?common::hexStrToByteArray(const?QString?&str)
{
????/*qDebug()<<“hexStrToByteArray::str=“<????QByteArray?senddata;
????int?hexdata?lowhexdata;
????int?hexdatalen?=?0;
????int?len?=?str.length();
????senddata.resize(len?/?2);
????char?lstr?hstr;

????for?(int?i?=?0;?i?????????hstr?=?str.at(i).toLatin1();

????????if?(hstr?==?‘?‘)?{
????????????i++;
????????????continue;
????????}
????????i++;
????????if?(i?>=?len)?{
????????????break;
????????}

????????lstr?=?str.at(i).toLatin1();
????????hexdata?=?convertHexChar(hstr);
????????lowhexdata?=?convertHexChar(lstr);
????????qDebug()<<“hexStrToByteArray::hexdata=“<????????qDebug()<<“hexStrToByteArray::lowhexdata=“<????????if?((hexdata?==?16)?||?(lowhexdata?==?16))?{
????????????break;
????????}?else?{
????????????hexdata?=?hexdata?*?16?+?lowhexdata;
????????}

????????i++;
????????qDebug()<<“hexStrToByteArray::data=“<<(char)hexdata;
????????senddata[hexdatalen]?=?(char)hexdata;
????????hexdatalen++;
????}

????senddata.resize(hexdatalen);
????*/
????????bool?ok;
????????QByteArray?ret;
????????QString?str1;
????????QStringList?sl;
????????QString?str2;
????????qDebug()<<“str.length=“<????????for(int?i=1;i<=str.length();i++)
????????{
????????????qDebug()<<“i=“<????????????str2.append(str.at(i-1));
????????????qDebug()<<“str2=“<????????????if(i%2==0)//每兩個字符放一起
????????????{
????????????????sl.append(str2);
????????????????str2.clear();
????????????}
????????}

????????foreach?(QString?s?sl)?{
????????????if(!s.isEmpty())
????????????{
????????????????//byte類型的數字要&0xff再賦值給int類型,其本質原因就是想保持二進制補碼的一致性。
????????????????char?c?=?s.toInt(&ok16)&0xFF;//任何一個數&0xFF都是它本身,這里為了保持補碼的一致性(由byte(8位)-》int(32位))
????????????????char?d=?10;
????????????????qDebug()<<“d=“<????????????????if(ok){
????????????????????ret.append(c);
????????????????}else{
????????????????????qDebug()<<“非法的16進制字符:“<????????????????}
????????????}
????????}
????return?ret;
}

/*char?common::convertHexChar(char?ch)
{
????if?((ch?>=?‘0‘)?&&?(ch?<=?‘9‘))?{
????????return?ch?-?0x30;
????}?else?if?((ch?>=?‘A‘)?&&?(ch?<=?‘F‘))?{
????????return?ch?-?‘A‘?+?10;
????}else?{
????????return?(-1);
????}
}*/

//只能輸入16進制數和回退符
void?common::keyPressEvent(QKeyEvent?*event)
{
????if(event->key()==Qt::Key_0||event->key()==Qt::Key_1||event->key()==Qt::Key_2||event->key()==Qt::Key_3||event->key()==Qt::Key_4||event->key()==Qt::Key_5||event->key()==Qt::Key_6||event->key()==Qt::Key_7||event->key()==Qt::Key_8||event->key()==Qt::Key_9||event->key()==Qt::Key_A||event->key()==Qt::Key_B||event->key()==Qt::Key_C||event->key()==Qt::Key_D||event->key()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????????68??2020-03-21?10:50??代碼\.gitattributes

?????文件???????4227??2020-05-30?22:59??代碼\common.cpp

?????文件????????571??2020-03-25?20:02??代碼\common.h

?????文件???????1238??2020-04-09?21:01??代碼\createtcpclient.cpp

?????文件????????454??2020-03-21?10:50??代碼\createtcpclient.h

?????文件???????2039??2020-03-21?10:50??代碼\createtcpclient.ui

?????文件????????985??2020-04-09?21:01??代碼\createtcpserver2.cpp

?????文件????????451??2020-03-21?10:50??代碼\createtcpserver2.h

?????文件???????1230??2020-03-21?10:50??代碼\createtcpserver2.ui

?????文件???????1211??2020-04-09?21:01??代碼\createudpclient.cpp

?????文件????????464??2020-03-21?10:50??代碼\createudpclient.h

?????文件???????1832??2020-03-21?10:50??代碼\createudpclient.ui

?????文件????????951??2020-04-09?21:01??代碼\createudpserver.cpp

?????文件????????441??2020-03-21?10:50??代碼\createudpserver.h

?????文件???????1223??2020-03-21?10:50??代碼\createudpserver.ui

?????文件???????2325??2020-04-11?09:18??代碼\graduation_project.pro

?????文件??????24948??2020-05-31?08:50??代碼\graduation_project.pro.user

?????文件????????229??2020-03-21?10:50??代碼\helpdialog.cpp

?????文件????????311??2020-03-21?10:50??代碼\helpdialog.h

?????文件???????5718??2020-03-26?20:03??代碼\helpdialog.ui

?????文件????1073074??2020-03-25?20:02??代碼\images\0123_3.png

?????文件?????521193??2020-03-25?20:02??代碼\images\0123_4.png

?????文件?????683544??2020-03-25?20:02??代碼\images\2.png

?????文件?????679330??2020-03-25?20:02??代碼\images\2_1.png

?????文件??????????3??2020-03-25?20:02??代碼\images\images.cpp

?????文件???????4286??2020-03-25?20:02??代碼\images\mFs.ico

?????文件????????255??2020-03-21?10:50??代碼\images.qrc

?????文件????????186??2020-03-21?10:50??代碼\main.cpp

?????文件??????95459??2020-05-29?11:12??代碼\mainwindow.cpp

?????文件???????2547??2020-04-09?21:01??代碼\mainwindow.h

............此處省略29個文件信息

評論

共有 條評論