commit 176dc22ad6e0aa83e66ea758cc42a2e2a766c62b Author: work-zym\zhangyiming <1131393555@qq.com> Date: Wed Oct 30 09:27:16 2024 +0800 tcp解析和无线脑电采集 diff --git a/testNetGUI/datatype.h b/testNetGUI/datatype.h new file mode 100644 index 0000000..855ec40 --- /dev/null +++ b/testNetGUI/datatype.h @@ -0,0 +1,103 @@ +#ifndef DATATYPE_H +#define DATATYPE_H +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct DataPacket +{ + quint8 frameHeader; // 帧头 (1 byte) + quint32 packetSeq; // 包序号 (4 bytes) + quint16 dataLength; // 数据块长度 (2 bytes) + quint8 batteryLevel; // 电量 (1 byte) + quint8 channelCount; // 通道数量 (1 byte) + qint16 pitchAngle; // 俯仰角 (2 bytes) + qint16 rollAngle; // 滚动角 (2 bytes) + qint16 yawAngle; // 偏航角 (2 bytes) + quint16 ecg; // 心电 (2 bytes) + quint16 spo2; // 血氧 (2 bytes) + quint8 reserved1; // 预留1 (1 byte) + quint8 reserved2; // 预留2 (1 byte) + quint8 reserved3; // 预留3 (1 byte) + quint8 reserved4; // 预留4 (1 byte) + + QByteArray dataBlock; // 数据块 (192 bytes 或 6 bytes) + quint8 syncSource; // 同步触发源 (1 byte) + quint8 syncSeq; // 同步触发序号 (1 byte) + quint8 checksum; // 校验和 (1 byte) + quint16 packetTail; // 包尾 (2 bytes) + + // 序列化头部 + void serializeHeader(QDataStream &out ) + { + out <(&buffer)); + bufferDevice.open(QIODevice::ReadOnly); + + QDataStream in(&bufferDevice); + in.setVersion(QDataStream::Qt_5_13); + + in >>frameHeader >> packetSeq >> dataLength >> batteryLevel >> channelCount + >> pitchAngle >> rollAngle >> yawAngle >> ecg >> spo2 + >> reserved1 >> reserved2 >> reserved3 >> reserved4; + + dataBlock.resize(dataLength); + in.readRawData(dataBlock.data(), dataLength); + + in >> syncSource >> syncSeq; + + in >> checksum; + + in >> packetTail; + + + } + + void deserializeHeader(const QByteArray &buffer) + { + QBuffer bufferDevice(const_cast(&buffer)); + bufferDevice.open(QIODevice::ReadOnly); + + QDataStream in(&bufferDevice); + in.setVersion(QDataStream::Qt_5_13); + + in >>frameHeader>> packetSeq >> dataLength >> batteryLevel >> channelCount + >> pitchAngle >> rollAngle >> yawAngle >> ecg >> spo2 + >> reserved1 >> reserved2 >> reserved3 >> reserved4; + } +}; + + + + +#endif // DATATYPE_H diff --git a/testNetGUI/main.cpp b/testNetGUI/main.cpp new file mode 100644 index 0000000..45e22ca --- /dev/null +++ b/testNetGUI/main.cpp @@ -0,0 +1,91 @@ + +#include "widget.h" +#include +#include "datatype.h" +QByteArray createAndSerializeDataPacket() { + DataPacket packet; + packet.frameHeader = 1; + packet.packetSeq = 2; + packet.dataLength = 3; // 64通道数据 + packet.batteryLevel = 4; + packet.channelCount = 5; + packet.pitchAngle = 6; + packet.rollAngle = 7; + packet.yawAngle = 8; + packet.ecg = 9; + packet.spo2 =10; + packet.reserved1 = 1; + packet.reserved2 = 2; + packet.reserved3 = 3; + packet.reserved4 = 4; + + // 填充数据块 + for (int i = 0; i < 192; ++i) { + packet.dataBlock.append(static_cast(i % 256)); + } + + packet.syncSource = 5; + packet.syncSeq = 6; + packet.packetTail = 8; + + // 序列化数据包 + QByteArray serializedPacket = packet.serialize(); + qDebug() << "Serialized Packet (Hex):" << serializedPacket.toHex(' '); + return serializedPacket; + +} +#include +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QTextCodec *codec = QTextCodec::codecForName("UTF-8"); + QTextCodec::setCodecForLocale(codec); + Widget w; + w.show(); + #if 0 + + QString data="aa0000b21403ca3d4000000000000000000692000000000000ffed4dffedddffedb6ffed56ffee1fffedadffee5affed90ffedd5ffed3cffee6bffed67ffed86ffedc7ffee1fffedb9ffee11ffedd3ffee1cffedc0ffee2cffed67ffeddfffedeeffedb9ffed5effedf1ffed8affee42ffedd7ffede9ffee43ffed2affed89ffed9bffee28ffed8fffee05ffeda8ffee3affed7cffedfaffed9fffed8cffee0fffedc0ffedb7ffee16ffed89ffedadffedecffee36ffee18ffedfaffee42ffedaaffed59ffedffffede3ffee54ffee0bffed26ffee7fffeeb80000ffed4fffede1ffedb2ffed57ffee1fffeda8ffee5effed8affeddaffed40ffee6bffed71ffed87ffedc7ffee27ffedbcffee13ffedcfffee17ffedbfffee28ffed6cffede0ffede8ffedbaffed5bffede8ffed82ffee48ffeddbffededffee44ffed2dffed88ffed96ffee24ffed8bffedffffedaaffee3cffed82ffedf8ffed9bffed93ffee11ffedbdffedb2ffee1fffed89ffedacffede8ffee36ffee16ffedf7ffee40ffeda4ffed5dffee06ffedd9ffee51ffee0cffed25ffee83ff00000000ffed55ffedddffedb1ffed54ffee22ffedafffee5cffed85ffedd9ffed40ffee72ffed6effed8affedcbffee25ffedbcffee0bffedceffee18ffedc2ffee24ffed6effede6ffededffedbbffed5cffedeeffed85ffee53ffedd6ffedf0ffee4cffed30ffed8cffed96ffee27ffed95ffee01ffedadffee39ffed82ffedf9ffed9dffed94ffee11ffedbdffedb2ffee1fffed87ffedacffede9ffee33ffee1fffedf7ffee40ffeda4ffed57ffee02ffeddeffee4cffee11ffed24ffee0000eebd0000ffed54ffeddcffedb6ffed59ffee1fffedb1ffee58ffed87ffedd4ffed46ffee6dffed70ffed86ffedcfffee22ffedb4ffee0effedd4ffee1cffedc0ffee1effed67ffede5ffedebffedbaffed5affedf2ffed88ffee4dffedd5ffedf0ffee42ffed33ffed8affeda0ffee1bffed93ffee06ffedafffee38ffed7bffedf7ffeda0ffed8fffee0effedbeffedb6ffee1fffed85ffeda8ffedf2ffee33ffee17ffedf4ffee3effeda6ffed5affedf9ffede3ffee4effee0cffed2300007dffeeb80000ffed56ffede1ffedb3ffed55ffee1effedafffee59ffed85ffedd0ffed42ffee69ffed69ffed84ffedc7ffee20ffedb6ffee18ffedcfffee1bffedbfffee25ffed64ffede1ffede9ffedbcffed58ffedf7ffed83ffee4bffedd5ffededffee45ffed2fffed8effed96ffee1affed8dffee08ffedafffee33ffed86ffedf7ffeda2ffed8fffee10ffedbaffedb4ffee1bffed8dffedaaffedf0ffee3bffee15ffedfaffee38ffeda6ffed57ffee02ffede4ffee4effee03ff0000ffee7cffeebe0000005555"; + DataPacket datapack; + datapack.deserialize(QByteArray( data.toStdString().c_str())); + + + qDebug()<<"包序号\n :"+QString::number(datapack.packetSeq)< +#include "datatype.h" +#include +TcpClient::TcpClient(QObject * parent):QObject (parent) +{ + connect(&m_TcpSocket,SIGNAL(readyRead()),this,SLOT(slotReadMessage())); + connect(&m_TcpSocket,SIGNAL(disconnected()),this,SLOT(slotDisconnected())); + // 设置接收缓冲区大小 + int receiveBufferSize = 1024 * 1024; // 1MB + m_TcpSocket.setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, receiveBufferSize); +} +TcpClient::~TcpClient() +{ + + disConnectServer(); + m_isConnected = false; + +} +bool TcpClient::disConnectServer() +{ + if (m_TcpSocket.state() == QAbstractSocket::ConnectedState || m_TcpSocket.state() == QAbstractSocket::ConnectingState) + { + qDebug() << "Disconnecting from server..."; + m_TcpSocket.disconnectFromHost(); + + } + else + { + qDebug() << "Already disconnected or not connected."; + + } + m_isConnected = false; + qDebug()<<"state"<totalSize) + return false; + + QByteArray smallBlock = data.mid(startIdx,length); + qint64 written = m_TcpSocket.write(smallBlock); + bool success = m_TcpSocket.waitForBytesWritten(); + + if(!success)//发送失败包时,停止发送 + { + return false; + } + + bytesWritten+=written; + bytesToWrite-=written; + } + m_TcpSocket.flush(); + + return true; + + +} + + QByteArray TcpClient::GetData() + { + + return QByteArray(); + } + void TcpClient::slotTestReadMessage() + { + + QByteArray temp_BtyeArray = m_TcpSocket.readAll(); + m_msgArray.append(temp_BtyeArray ); + //数据头大小为23个字节 + //数据块长度192或者6 + //剩余部分5 + while(!m_msgArray.isEmpty()) + { + qint32 allSize = m_msgArray.size(); + //数据头不够 + if (allSize < 23) + { + qDebug()<<"sizeRcre"<allSize ) + { + qDebug()<<"datalength:"<>frameHeader>>frameHeader >> packetSeq >> dataLength >> batteryLevel >> channelCount + >> pitchAngle >> rollAngle >> yawAngle >> ecg >> spo2 + >> reserved1 >> reserved2 >> reserved3 >> reserved4; + qDebug()<<"---:"<> syncSource >> syncSeq; + + in >> checksum; + + in >> packetTail; + qDebug()<<"getdataLength:"< +#include "datatype.h" +#include +TcpClient::TcpClient(QObject * parent):QObject (parent) +{ + connect(&m_TcpSocket,SIGNAL(readyRead()),this,SLOT(slotReadMessage())); + connect(&m_TcpSocket,SIGNAL(disconnected()),this,SLOT(slotDisconnected())); + // 设置接收缓冲区大小 + int receiveBufferSize = 1024 * 1024; // 1MB + m_TcpSocket.setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, receiveBufferSize); +} +TcpClient::~TcpClient() +{ + + disConnectServer(); + m_isConnected = false; + +} +bool TcpClient::disConnectServer() +{ + if (m_TcpSocket.state() == QAbstractSocket::ConnectedState || m_TcpSocket.state() == QAbstractSocket::ConnectingState) + { + qDebug() << "Disconnecting from server..."; + m_TcpSocket.disconnectFromHost(); + + } + else + { + qDebug() << "Already disconnected or not connected."; + + } + m_isConnected = false; + qDebug()<<"state"<totalSize) + return false; + + QByteArray smallBlock = data.mid(startIdx,length); + qint64 written = m_TcpSocket.write(smallBlock); + bool success = m_TcpSocket.waitForBytesWritten(); + + if(!success)//发送失败包时,停止发送 + { + return false; + } + + bytesWritten+=written; + bytesToWrite-=written; + } + m_TcpSocket.flush(); + + return true; + + +} + + QByteArray TcpClient::GetData() + { + + return QByteArray(); + } + void TcpClient::slotTestReadMessage() + { + + QByteArray temp_BtyeArray = m_TcpSocket.readAll(); + m_msgArray.append(temp_BtyeArray ); + //数据头大小为23个字节 + //数据块长度192或者6 + //剩余部分5 + while(!m_msgArray.isEmpty()) + { + qint32 allSize = m_msgArray.size(); + //数据头不够 + if (allSize < 23) + { + qDebug()<<"sizeRcre"<allSize ) + { + qDebug()<<"datalength:"<>frameHeader>>frameHeader >> packetSeq >> dataLength >> batteryLevel >> channelCount + >> pitchAngle >> rollAngle >> yawAngle >> ecg >> spo2 + >> reserved1 >> reserved2 >> reserved3 >> reserved4; + qDebug()<<"---:"<> syncSource >> syncSeq; + + in >> checksum; + + in >> packetTail; + qDebug()<<"getdataLength:"< +#include +#include +class TcpClient:public QObject +{ + Q_OBJECT +public: + TcpClient(QObject * parent = nullptr); + virtual ~TcpClient(); + /* + des: 连接服务端 + */ + bool connectServer(QString ip ,qint16 port); + /* + des: 获取数据 + */ + QByteArray GetData(); + + bool sendMessage(QByteArray & data); + /* + des: 断开连接 + */ + bool disConnectServer(); + +signals: + void SigRectMsg(QByteArray & dataPack); +private slots: + + void slotReadMessage(); + void slotTestReadMessage(); + void slotDisconnected(); + void slotSendMessage(QByteArray & data); + +private: + QTcpSocket m_TcpSocket; + bool m_isConnected; + QByteArray m_msgArray; +}; +#endif // TCPCLIENT_H diff --git a/testNetGUI/testNetGUI.pro b/testNetGUI/testNetGUI.pro new file mode 100644 index 0000000..911f24b --- /dev/null +++ b/testNetGUI/testNetGUI.pro @@ -0,0 +1,43 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2024-10-17T16:31:11 +# +#------------------------------------------------- + +QT += core gui network + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = testNetGUI +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as 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 you use 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_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + tcpclient.cpp \ + widget.cpp + +HEADERS += \ + datatype.h \ + tcpclient.h \ + widget.h + +FORMS += \ + widget.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/testNetGUI/testNetGUI.pro.user b/testNetGUI/testNetGUI.pro.user new file mode 100644 index 0000000..c59ca6a --- /dev/null +++ b/testNetGUI/testNetGUI.pro.user @@ -0,0 +1,598 @@ + + + + + + EnvironmentId + {91b91540-c58e-40b1-bd6c-1f09b812885d} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.13.0 MinGW 32-bit + Desktop Qt 5.13.0 MinGW 32-bit + qt.qt5.5130.win32_mingw73_kit + 0 + 0 + 0 + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_32_bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_32_bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_32_bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + testNetGUI + + Qt4ProjectManager.Qt4RunConfiguration:D:/project/qt-project/testNetGUI/testNetGUI.pro + + 3768 + false + true + true + false + false + true + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.13.0 MinGW 64-bit + Desktop Qt 5.13.0 MinGW 64-bit + qt.qt5.5130.win64_mingw73_kit + 0 + 0 + 0 + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_64_bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_64_bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + D:/project/qt-project/build-testNetGUI-Desktop_Qt_5_13_0_MinGW_64_bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + + 3768 + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 2 + + + ProjectExplorer.Project.Updater.FileVersion + 21 + + + Version + 21 + + diff --git a/testNetGUI/widget.cpp b/testNetGUI/widget.cpp new file mode 100644 index 0000000..09c568a --- /dev/null +++ b/testNetGUI/widget.cpp @@ -0,0 +1,84 @@ +//#pragma execution_character_set("utf-8") +#include "widget.h" +#include "ui_widget.h" +#include +Widget::Widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::Widget) +{ + ui->setupUi(this); + connect(ui->btnConn,SIGNAL(clicked()),this,SLOT(slotConnect())); + connect(ui->btnDis,SIGNAL(clicked()),this,SLOT(slotDisCon())); + connect(&m_TcpClent,SIGNAL(SigRectMsg(QByteArray & )),this,SLOT(slotRec(QByteArray &))); + ui->editIp->setText("192.168.1.11"); + ui->spnPort->setRange(1,1000000); + ui->spnPort->setValue(5086); +} + +Widget::~Widget() +{ + delete ui; +} + +void Widget::slotConnect() +{ + QString sIP = ui->editIp->text(); + int port = ui->spnPort->value(); + if( m_TcpClent.connectServer(sIP,port)) + { + QMessageBox::information(this,"succeed"," succeed"); + } + else + { + QMessageBox::warning(this,"failed"," failed"); + } + +} +void Widget::slotDisCon() +{ + + if( m_TcpClent.disConnectServer()) + { + QMessageBox::information(this,"succeed"," succeed"); + } + else + { + QMessageBox::warning(this,"failed"," failed"); + } +} +void Widget::slotSend() +{ + + +} +void Widget::slotRec(QByteArray & data) +{ + qDebug()<<"data---"< +#include "datatype.h" +#include "tcpclient.h" +namespace Ui { +class Widget; +} + +class Widget : public QWidget +{ + Q_OBJECT + +public: + explicit Widget(QWidget *parent = nullptr); + ~Widget(); +private slots: + void slotConnect(); + void slotDisCon(); + void slotSend(); + void slotRec(QByteArray &); +private: + Ui::Widget *ui; + TcpClient m_TcpClent; +}; + +#endif // WIDGET_H diff --git a/testNetGUI/widget.ui b/testNetGUI/widget.ui new file mode 100644 index 0000000..35a01a5 --- /dev/null +++ b/testNetGUI/widget.ui @@ -0,0 +1,66 @@ + + + Widget + + + + 0 + 0 + 852 + 427 + + + + Widget + + + + + 380 + 60 + 93 + 28 + + + + 连接 + + + + + + 520 + 60 + 93 + 28 + + + + 断开 + + + + + + 80 + 60 + 113 + 21 + + + + + + + 220 + 60 + 131 + 22 + + + + + + + + diff --git a/xyylMCWEACSystem/btngroupwidget.cpp b/xyylMCWEACSystem/btngroupwidget.cpp new file mode 100644 index 0000000..9aebd87 --- /dev/null +++ b/xyylMCWEACSystem/btngroupwidget.cpp @@ -0,0 +1,23 @@ +#include "btngroupwidget.h" + + BtnGroupWidget::BtnGroupWidget(QWidget * parent ) + { + + } +BtnGroupWidget::~BtnGroupWidget() +{ + +} +void BtnGroupWidget::init() +{ + +} +void BtnGroupWidget::initLay() +{ + +} +bool BtnGroupWidget::initConnect() +{ + bool bCon = true; + return bCon; +} diff --git a/xyylMCWEACSystem/btngroupwidget.h b/xyylMCWEACSystem/btngroupwidget.h new file mode 100644 index 0000000..99d0fa5 --- /dev/null +++ b/xyylMCWEACSystem/btngroupwidget.h @@ -0,0 +1,20 @@ +#ifndef BTNGROUPWIDGET_H +#define BTNGROUPWIDGET_H + +#include +#include +#include +#include + +class BtnGroupWidget:public QWidget +{ + Q_OBJECT +public: + explicit BtnGroupWidget(QWidget * parent = NULL); + virtual ~BtnGroupWidget(); + void init(); + void initLay(); + bool initConnect(); +private: +}; +#endif // BTNGROUPWIDGET_H diff --git a/xyylMCWEACSystem/curchatwidget.cpp b/xyylMCWEACSystem/curchatwidget.cpp new file mode 100644 index 0000000..0b52c66 --- /dev/null +++ b/xyylMCWEACSystem/curchatwidget.cpp @@ -0,0 +1,74 @@ +#include "curchatwidget.h" + +CurChatWidget::CurChatWidget(QWidget * parent ):QWidget(parent) +{ + +} + CurChatWidget::~CurChatWidget() + { + + } + +void CurChatWidget::painteXY(QPainter & painter) +{ + // 获取Widget的尺寸 + int width = this->width(); + int height = this->height(); + + // 绘制X轴 + int marDec = 20;//边距 + painter.drawLine(0+marDec, height-marDec, width-marDec, height-marDec); + + // 绘制Y轴 + painter.drawLine(0+marDec, height-marDec, 0+marDec, 0+marDec); + //横向分为五分 + for(int i =0;i< 5;i++) + { + //获取图形宽度 + int paWidth = width - marDec*2; + int paheight = height - marDec*2; + int perWidth = paWidth/5; + int xstart = marDec +perWidth* i; + int ystart = marDec ; + + int xend = marDec +perWidth* i; + int yend = paheight+marDec; + painter.setPen(Qt::lightGray); + painter.drawLine(xstart, ystart, xend, yend); + + //每份里面又分为五分,虚线 + for(int j= 1 ;j<5;j++) + { + int xstartSmall = xstart +perWidth/5* j; + int ystartSmall = marDec ; + + int xendSmall= xstart +perWidth/5* j; + int yendSmall = paheight + marDec; + QPen pen; + // QColor color(0xff,0,0); + QColor color( Qt::lightGray); + pen.setColor(color); + pen.setWidth(2); + pen.setCapStyle(Qt::RoundCap); + pen.setJoinStyle(Qt::BevelJoin); + pen.setStyle(Qt::DotLine); + + painter.setPen(pen); + painter.drawLine(xstartSmall, ystartSmall, xendSmall, yendSmall); + } + } +} + +void CurChatWidget::paintEvent(QPaintEvent *) +{ + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, true); + + // 设置画笔的颜色和样式 + painter.setPen(Qt::black); + painteXY(painter); + + + + + } diff --git a/xyylMCWEACSystem/curchatwidget.h b/xyylMCWEACSystem/curchatwidget.h new file mode 100644 index 0000000..11b8c03 --- /dev/null +++ b/xyylMCWEACSystem/curchatwidget.h @@ -0,0 +1,28 @@ +#ifndef CURCHATWIDGET_H +#define CURCHATWIDGET_H +#include +#include +#include +#include +#include + +/* + des: 趋势图 +*/ +class CurChatWidget: public QWidget +{ + Q_OBJECT +public: + explicit CurChatWidget(QWidget * parent =nullptr); + virtual ~CurChatWidget() ; + +private: + /* + des: 画xy轴 画虚线 + */ + void painteXY(QPainter & painter); + + void paintEvent(QPaintEvent *) override; + +}; +#endif // CURCHATWIDGET_H diff --git a/xyylMCWEACSystem/devconwidget.cpp b/xyylMCWEACSystem/devconwidget.cpp new file mode 100644 index 0000000..d9be4d8 --- /dev/null +++ b/xyylMCWEACSystem/devconwidget.cpp @@ -0,0 +1,65 @@ +#include "devconwidget.h" +#include +#include +#include +#include +DevConWidget::DevConWidget(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); + +} +DevConWidget::~DevConWidget() +{ + + +} +void DevConWidget::init() +{ + //多通道无线脑电采集系统 + m_labDes.setText(tr("Multi-channel wireless EEG acquisition system")); + + //正在连接设备,请稍作等待 + m_labConStatus.setText(tr("We are connecting the device. Please wait a moment...")); +} +void DevConWidget::initLay() +{ + +#if 0 + QHBoxLayout * hlayDes = new QHBoxLayout; + QHBoxLayout * hlayImage = new QHBoxLayout; + QHBoxLayout * hlayStatus = new QHBoxLayout; + QVBoxLayout * vlay = new QVBoxLayout; + + vlay->addLayout(hlayDes); + vlay->addLayout(hlayImage); + vlay->addLayout(hlayStatus); + + hlayDes->addStretch(); + hlayDes->addWidget(&m_labDes); + hlayDes->addStretch(); + + hlayImage->addStretch(); + hlayImage->addWidget(&m_LabImage); + hlayImage->addStretch(); + + hlayStatus->addStretch(); + hlayStatus->addWidget(&m_labConStatus); + hlayStatus->addStretch(); + + setLayout(vlay); +#endif + QHBoxLayout * hlayDes = new QHBoxLayout; + hlayDes->addStretch(); + hlayDes->addWidget(&m_labDes); + hlayDes->addWidget(&m_labConStatus); + hlayDes->addWidget(&m_LabImage); + hlayDes->addStretch(); + setLayout(hlayDes); +} +bool DevConWidget::initConnect() +{ + bool bCon = true; + return bCon; +} diff --git a/xyylMCWEACSystem/devconwidget.h b/xyylMCWEACSystem/devconwidget.h new file mode 100644 index 0000000..8f02e6f --- /dev/null +++ b/xyylMCWEACSystem/devconwidget.h @@ -0,0 +1,31 @@ +#ifndef DEVCONWIDGET_H +#define DEVCONWIDGET_H +/* + des: dev connect 设备连接窗口 + author:zhangyiming + +*/ +#include +#include +#include +#include + +class DevConWidget:public QWidget +{ + Q_OBJECT +public: + DevConWidget(QWidget * parent = nullptr); + virtual ~DevConWidget(); + void init(); + void initLay(); + bool initConnect(); +private: + //多听到无线脑电采集系统 + QLabel m_labDes; + //图片 + QLabel m_LabImage; + //正在连接设备,请稍作等待 + QLabel m_labConStatus; + +}; +#endif // DEVCONWIDGET_H diff --git a/xyylMCWEACSystem/egg.qrc b/xyylMCWEACSystem/egg.qrc new file mode 100644 index 0000000..daece78 --- /dev/null +++ b/xyylMCWEACSystem/egg.qrc @@ -0,0 +1,45 @@ + + + image/EEG_img_fre_checked.png + image/EEG_img_fre_regular.png + image/EEG_img_protocol_checked.png + image/EEG_img_protocol_regular.png + image/EGG_icon_amplify.png + image/EGG_icon_markLeft.png + image/EGG_icon_markRight.png + image/EGG_icon_moveLeft.png + image/EGG_icon_moveRight.png + image/EGG_icon_reduce.png + image/icon_amplify.png + image/icon_back.png + image/icon_exit.png + image/img_bg_login.png + image/img_EEG cap.png + image/img_EEG.png + image/img_lead.png + image/img_login.png + image/index_bg_data.png + image/index_bg_data_char.png + image/index_bg_EEG.png + image/index_bg_EEG_char.png + image/index_bg_setting.png + image/index_bg_setting_char.png + image/loading.png + image/setting_btn_firstPage.png + image/setting_btn_lastPage.png + image/setting_btn_left.png + image/setting_btn_right.png + image/setting_icon_calendar.png + image/setting_switch_off.png + image/setting_switch_on.png + image/index_bg_data_checked.png + image/index_bg_data_hover.png + image/index_bg_EEG_checked.png + image/index_bg_EEG_hover.png + image/index_bg_setting_checked.png + image/index_bg_setting_hover.png + image/sunnyou_logo.png + image/icon_exit_checked.png + image/icon_exit_hover.png + + diff --git a/xyylMCWEACSystem/hospitalinfo.cpp b/xyylMCWEACSystem/hospitalinfo.cpp new file mode 100644 index 0000000..db80ea9 --- /dev/null +++ b/xyylMCWEACSystem/hospitalinfo.cpp @@ -0,0 +1,90 @@ +#include "hospitalinfo.h" +#include +#include +#include +#include +HospitalInfo::HospitalInfo(QWidget * parent ):QWidget (parent) +{ + init(); + initLay(); + initConnect(); + +} +HospitalInfo::~HospitalInfo() +{ + +} +void HospitalInfo::init() +{ + //医院名称 + m_labHospitalName.setText(tr("HospitalName")); + + //科室 + m_labSection.setText(tr("Section")); + + //用户数 + m_labUserNum.setText(tr("UserNum"));; + + + //数据库 名称 + m_labDataBaseName.setText(tr("DataBaseName")); + + //用户名 + m_labUser.setText(tr("User")); + + m_labpasswd.setText(tr("Passwd")); + + + //确认 + m_btnOK.setText(tr("Confirm")); + + +} +void HospitalInfo::initLay() +{ + + QGridLayout * gridlaySearch = new QGridLayout; + QHBoxLayout * hlay = new QHBoxLayout; + QVBoxLayout * vlay = new QVBoxLayout; + vlay->addLayout(gridlaySearch); + vlay->addLayout(hlay); + + setLayout(vlay); + + int col = 0; + int row = 0; + gridlaySearch->addWidget(&m_labHospitalName,row,col); + gridlaySearch->addWidget(&m_editHospitalName,row,++col); + row ++; + col = 0; + gridlaySearch->addWidget(&m_labSection,row,col); + gridlaySearch->addWidget(&m_editSection,row,++col); + row ++; + col = 0; + gridlaySearch->addWidget(&m_labUserNum,row,col); + gridlaySearch->addWidget(&m_editUserNum,row,++col); + + row ++; + col = 0; + gridlaySearch->addWidget(&m_labDataBaseName,row,col); + gridlaySearch->addWidget(&m_editDataBaseName,row,++col); + + row ++; + col = 0; + gridlaySearch->addWidget(&m_labUser,row,col); + gridlaySearch->addWidget(&m_editUser,row,++col); + + row ++; + col = 0; + gridlaySearch->addWidget(&m_labpasswd,row,col); + gridlaySearch->addWidget(&m_editPasswd,row,++col); + + hlay->addStretch(); + hlay->addWidget(&m_btnOK); + hlay->addStretch(); + +} +bool HospitalInfo::initConnect() +{ + +} diff --git a/xyylMCWEACSystem/hospitalinfo.h b/xyylMCWEACSystem/hospitalinfo.h new file mode 100644 index 0000000..cbd3300 --- /dev/null +++ b/xyylMCWEACSystem/hospitalinfo.h @@ -0,0 +1,44 @@ +#ifndef HOSPITALINFO_H +#define HOSPITALINFO_H +/* + des: Hospital Info 医院信息 + date: 20241028 +*/ +#include +#include +#include +#include +class HospitalInfo:public QWidget +{ + Q_OBJECT +public: + explicit HospitalInfo(QWidget * parent = NULL); + virtual ~HospitalInfo(); + void init(); + void initLay(); + bool initConnect(); +private: + //医院名称 + QLabel m_labHospitalName; + QLineEdit m_editHospitalName; + //科室 + QLabel m_labSection; + QLineEdit m_editSection; + //用户数 + QLabel m_labUserNum; + QLineEdit m_editUserNum; + + //数据库 名称 + QLabel m_labDataBaseName; + QLineEdit m_editDataBaseName; + + //用户名 + QLabel m_labUser; + QLineEdit m_editUser; + + QLabel m_labpasswd; + QLineEdit m_editPasswd; + //确认 + QPushButton m_btnOK; +}; +#endif // HOSPITALINFO_H diff --git a/xyylMCWEACSystem/image/.DS_Store b/xyylMCWEACSystem/image/.DS_Store new file mode 100644 index 0000000..ec09f95 Binary files /dev/null and b/xyylMCWEACSystem/image/.DS_Store differ diff --git a/xyylMCWEACSystem/image/EEG_img_fre_checked.png b/xyylMCWEACSystem/image/EEG_img_fre_checked.png new file mode 100644 index 0000000..83b0e49 Binary files /dev/null and b/xyylMCWEACSystem/image/EEG_img_fre_checked.png differ diff --git a/xyylMCWEACSystem/image/EEG_img_fre_regular.png b/xyylMCWEACSystem/image/EEG_img_fre_regular.png new file mode 100644 index 0000000..1b821a7 Binary files /dev/null and b/xyylMCWEACSystem/image/EEG_img_fre_regular.png differ diff --git a/xyylMCWEACSystem/image/EEG_img_protocol_checked.png b/xyylMCWEACSystem/image/EEG_img_protocol_checked.png new file mode 100644 index 0000000..fd1e545 Binary files /dev/null and b/xyylMCWEACSystem/image/EEG_img_protocol_checked.png differ diff --git a/xyylMCWEACSystem/image/EEG_img_protocol_regular.png b/xyylMCWEACSystem/image/EEG_img_protocol_regular.png new file mode 100644 index 0000000..6e81d0b Binary files /dev/null and b/xyylMCWEACSystem/image/EEG_img_protocol_regular.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_amplify.png b/xyylMCWEACSystem/image/EGG_icon_amplify.png new file mode 100644 index 0000000..fb0e839 Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_amplify.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_markLeft.png b/xyylMCWEACSystem/image/EGG_icon_markLeft.png new file mode 100644 index 0000000..c238d5c Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_markLeft.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_markRight.png b/xyylMCWEACSystem/image/EGG_icon_markRight.png new file mode 100644 index 0000000..58e06a6 Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_markRight.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_moveLeft.png b/xyylMCWEACSystem/image/EGG_icon_moveLeft.png new file mode 100644 index 0000000..102df9d Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_moveLeft.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_moveRight.png b/xyylMCWEACSystem/image/EGG_icon_moveRight.png new file mode 100644 index 0000000..34ef793 Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_moveRight.png differ diff --git a/xyylMCWEACSystem/image/EGG_icon_reduce.png b/xyylMCWEACSystem/image/EGG_icon_reduce.png new file mode 100644 index 0000000..933ee13 Binary files /dev/null and b/xyylMCWEACSystem/image/EGG_icon_reduce.png differ diff --git a/xyylMCWEACSystem/image/icon_amplify.png b/xyylMCWEACSystem/image/icon_amplify.png new file mode 100644 index 0000000..fb0e839 Binary files /dev/null and b/xyylMCWEACSystem/image/icon_amplify.png differ diff --git a/xyylMCWEACSystem/image/icon_back.png b/xyylMCWEACSystem/image/icon_back.png new file mode 100644 index 0000000..7c664c7 Binary files /dev/null and b/xyylMCWEACSystem/image/icon_back.png differ diff --git a/xyylMCWEACSystem/image/icon_exit.png b/xyylMCWEACSystem/image/icon_exit.png new file mode 100644 index 0000000..6d21b67 Binary files /dev/null and b/xyylMCWEACSystem/image/icon_exit.png differ diff --git a/xyylMCWEACSystem/image/icon_exit_checked.png b/xyylMCWEACSystem/image/icon_exit_checked.png new file mode 100644 index 0000000..20758ae Binary files /dev/null and b/xyylMCWEACSystem/image/icon_exit_checked.png differ diff --git a/xyylMCWEACSystem/image/icon_exit_hover.png b/xyylMCWEACSystem/image/icon_exit_hover.png new file mode 100644 index 0000000..b769a7b Binary files /dev/null and b/xyylMCWEACSystem/image/icon_exit_hover.png differ diff --git a/xyylMCWEACSystem/image/icon_工作陷波.png b/xyylMCWEACSystem/image/icon_工作陷波.png new file mode 100644 index 0000000..e313a0d Binary files /dev/null and b/xyylMCWEACSystem/image/icon_工作陷波.png differ diff --git a/xyylMCWEACSystem/image/icon_时间常数.png b/xyylMCWEACSystem/image/icon_时间常数.png new file mode 100644 index 0000000..a353c2f Binary files /dev/null and b/xyylMCWEACSystem/image/icon_时间常数.png differ diff --git a/xyylMCWEACSystem/image/icon_波幅.png b/xyylMCWEACSystem/image/icon_波幅.png new file mode 100644 index 0000000..b634a84 Binary files /dev/null and b/xyylMCWEACSystem/image/icon_波幅.png differ diff --git a/xyylMCWEACSystem/image/icon_波速.png b/xyylMCWEACSystem/image/icon_波速.png new file mode 100644 index 0000000..55107ed Binary files /dev/null and b/xyylMCWEACSystem/image/icon_波速.png differ diff --git a/xyylMCWEACSystem/image/icon_高频滤波.png b/xyylMCWEACSystem/image/icon_高频滤波.png new file mode 100644 index 0000000..abd958f Binary files /dev/null and b/xyylMCWEACSystem/image/icon_高频滤波.png differ diff --git a/xyylMCWEACSystem/image/img_BEAM.png b/xyylMCWEACSystem/image/img_BEAM.png new file mode 100644 index 0000000..b05ab37 Binary files /dev/null and b/xyylMCWEACSystem/image/img_BEAM.png differ diff --git a/xyylMCWEACSystem/image/img_EEG cap.png b/xyylMCWEACSystem/image/img_EEG cap.png new file mode 100644 index 0000000..ee7cbaf Binary files /dev/null and b/xyylMCWEACSystem/image/img_EEG cap.png differ diff --git a/xyylMCWEACSystem/image/img_EEG.png b/xyylMCWEACSystem/image/img_EEG.png new file mode 100644 index 0000000..f86f7e2 Binary files /dev/null and b/xyylMCWEACSystem/image/img_EEG.png differ diff --git a/xyylMCWEACSystem/image/img_bg_login.png b/xyylMCWEACSystem/image/img_bg_login.png new file mode 100644 index 0000000..a84a7ee Binary files /dev/null and b/xyylMCWEACSystem/image/img_bg_login.png differ diff --git a/xyylMCWEACSystem/image/img_lead.png b/xyylMCWEACSystem/image/img_lead.png new file mode 100644 index 0000000..53378e3 Binary files /dev/null and b/xyylMCWEACSystem/image/img_lead.png differ diff --git a/xyylMCWEACSystem/image/img_login.png b/xyylMCWEACSystem/image/img_login.png new file mode 100644 index 0000000..737a007 Binary files /dev/null and b/xyylMCWEACSystem/image/img_login.png differ diff --git a/xyylMCWEACSystem/image/index_bg_EEG.png b/xyylMCWEACSystem/image/index_bg_EEG.png new file mode 100644 index 0000000..edecbbe Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_EEG.png differ diff --git a/xyylMCWEACSystem/image/index_bg_EEG_char.png b/xyylMCWEACSystem/image/index_bg_EEG_char.png new file mode 100644 index 0000000..a9ed575 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_EEG_char.png differ diff --git a/xyylMCWEACSystem/image/index_bg_EEG_checked.png b/xyylMCWEACSystem/image/index_bg_EEG_checked.png new file mode 100644 index 0000000..3eaee7e Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_EEG_checked.png differ diff --git a/xyylMCWEACSystem/image/index_bg_EEG_hover.png b/xyylMCWEACSystem/image/index_bg_EEG_hover.png new file mode 100644 index 0000000..2d302b4 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_EEG_hover.png differ diff --git a/xyylMCWEACSystem/image/index_bg_data.png b/xyylMCWEACSystem/image/index_bg_data.png new file mode 100644 index 0000000..78ba7d0 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_data.png differ diff --git a/xyylMCWEACSystem/image/index_bg_data_char.png b/xyylMCWEACSystem/image/index_bg_data_char.png new file mode 100644 index 0000000..6154871 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_data_char.png differ diff --git a/xyylMCWEACSystem/image/index_bg_data_checked.png b/xyylMCWEACSystem/image/index_bg_data_checked.png new file mode 100644 index 0000000..4ff53cc Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_data_checked.png differ diff --git a/xyylMCWEACSystem/image/index_bg_data_hover.png b/xyylMCWEACSystem/image/index_bg_data_hover.png new file mode 100644 index 0000000..a121142 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_data_hover.png differ diff --git a/xyylMCWEACSystem/image/index_bg_setting.png b/xyylMCWEACSystem/image/index_bg_setting.png new file mode 100644 index 0000000..2986c27 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_setting.png differ diff --git a/xyylMCWEACSystem/image/index_bg_setting_char.png b/xyylMCWEACSystem/image/index_bg_setting_char.png new file mode 100644 index 0000000..d77ca74 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_setting_char.png differ diff --git a/xyylMCWEACSystem/image/index_bg_setting_checked.png b/xyylMCWEACSystem/image/index_bg_setting_checked.png new file mode 100644 index 0000000..272faae Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_setting_checked.png differ diff --git a/xyylMCWEACSystem/image/index_bg_setting_hover.png b/xyylMCWEACSystem/image/index_bg_setting_hover.png new file mode 100644 index 0000000..e25fb53 Binary files /dev/null and b/xyylMCWEACSystem/image/index_bg_setting_hover.png differ diff --git a/xyylMCWEACSystem/image/loading.png b/xyylMCWEACSystem/image/loading.png new file mode 100644 index 0000000..ab25d06 Binary files /dev/null and b/xyylMCWEACSystem/image/loading.png differ diff --git a/xyylMCWEACSystem/image/setting_btn_firstPage.png b/xyylMCWEACSystem/image/setting_btn_firstPage.png new file mode 100644 index 0000000..84288f7 Binary files /dev/null and b/xyylMCWEACSystem/image/setting_btn_firstPage.png differ diff --git a/xyylMCWEACSystem/image/setting_btn_lastPage.png b/xyylMCWEACSystem/image/setting_btn_lastPage.png new file mode 100644 index 0000000..8ed946c Binary files /dev/null and b/xyylMCWEACSystem/image/setting_btn_lastPage.png differ diff --git a/xyylMCWEACSystem/image/setting_btn_left.png b/xyylMCWEACSystem/image/setting_btn_left.png new file mode 100644 index 0000000..9215efb Binary files /dev/null and b/xyylMCWEACSystem/image/setting_btn_left.png differ diff --git a/xyylMCWEACSystem/image/setting_btn_right.png b/xyylMCWEACSystem/image/setting_btn_right.png new file mode 100644 index 0000000..0140dd2 Binary files /dev/null and b/xyylMCWEACSystem/image/setting_btn_right.png differ diff --git a/xyylMCWEACSystem/image/setting_icon_calendar.png b/xyylMCWEACSystem/image/setting_icon_calendar.png new file mode 100644 index 0000000..2068ac5 Binary files /dev/null and b/xyylMCWEACSystem/image/setting_icon_calendar.png differ diff --git a/xyylMCWEACSystem/image/setting_switch_off.png b/xyylMCWEACSystem/image/setting_switch_off.png new file mode 100644 index 0000000..c85df83 Binary files /dev/null and b/xyylMCWEACSystem/image/setting_switch_off.png differ diff --git a/xyylMCWEACSystem/image/setting_switch_on.png b/xyylMCWEACSystem/image/setting_switch_on.png new file mode 100644 index 0000000..54348c1 Binary files /dev/null and b/xyylMCWEACSystem/image/setting_switch_on.png differ diff --git a/xyylMCWEACSystem/image/sunnyou_logo.png b/xyylMCWEACSystem/image/sunnyou_logo.png new file mode 100644 index 0000000..4fcc71d Binary files /dev/null and b/xyylMCWEACSystem/image/sunnyou_logo.png differ diff --git a/xyylMCWEACSystem/image/组件 39@1x.png b/xyylMCWEACSystem/image/组件 39@1x.png new file mode 100644 index 0000000..069b7a3 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 39@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 40@1x.png b/xyylMCWEACSystem/image/组件 40@1x.png new file mode 100644 index 0000000..45cd063 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 40@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 41@1x.png b/xyylMCWEACSystem/image/组件 41@1x.png new file mode 100644 index 0000000..1d95ba3 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 41@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 42@1x.png b/xyylMCWEACSystem/image/组件 42@1x.png new file mode 100644 index 0000000..f865420 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 42@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 43@1x.png b/xyylMCWEACSystem/image/组件 43@1x.png new file mode 100644 index 0000000..9becbe8 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 43@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 44@1x.png b/xyylMCWEACSystem/image/组件 44@1x.png new file mode 100644 index 0000000..7d1c095 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 44@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 51@1x.png b/xyylMCWEACSystem/image/组件 51@1x.png new file mode 100644 index 0000000..4ecfe25 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 51@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 52@1x.png b/xyylMCWEACSystem/image/组件 52@1x.png new file mode 100644 index 0000000..579a94c Binary files /dev/null and b/xyylMCWEACSystem/image/组件 52@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 53@1x.png b/xyylMCWEACSystem/image/组件 53@1x.png new file mode 100644 index 0000000..97a6d79 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 53@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 54@1x.png b/xyylMCWEACSystem/image/组件 54@1x.png new file mode 100644 index 0000000..62184de Binary files /dev/null and b/xyylMCWEACSystem/image/组件 54@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 55@1x.png b/xyylMCWEACSystem/image/组件 55@1x.png new file mode 100644 index 0000000..15de9a1 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 55@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 56@1x.png b/xyylMCWEACSystem/image/组件 56@1x.png new file mode 100644 index 0000000..bf23aac Binary files /dev/null and b/xyylMCWEACSystem/image/组件 56@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 58@1x.png b/xyylMCWEACSystem/image/组件 58@1x.png new file mode 100644 index 0000000..8574e0f Binary files /dev/null and b/xyylMCWEACSystem/image/组件 58@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 59@1x.png b/xyylMCWEACSystem/image/组件 59@1x.png new file mode 100644 index 0000000..be35d5c Binary files /dev/null and b/xyylMCWEACSystem/image/组件 59@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 60@1x.png b/xyylMCWEACSystem/image/组件 60@1x.png new file mode 100644 index 0000000..6d4b388 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 60@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 61@1x.png b/xyylMCWEACSystem/image/组件 61@1x.png new file mode 100644 index 0000000..a854803 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 61@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 66@1x.png b/xyylMCWEACSystem/image/组件 66@1x.png new file mode 100644 index 0000000..793ba39 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 66@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 67@1x.png b/xyylMCWEACSystem/image/组件 67@1x.png new file mode 100644 index 0000000..387abeb Binary files /dev/null and b/xyylMCWEACSystem/image/组件 67@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 68@1x.png b/xyylMCWEACSystem/image/组件 68@1x.png new file mode 100644 index 0000000..9e0fb05 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 68@1x.png differ diff --git a/xyylMCWEACSystem/image/组件 69@1x.png b/xyylMCWEACSystem/image/组件 69@1x.png new file mode 100644 index 0000000..4202c17 Binary files /dev/null and b/xyylMCWEACSystem/image/组件 69@1x.png differ diff --git a/xyylMCWEACSystem/loginwidget.cpp b/xyylMCWEACSystem/loginwidget.cpp new file mode 100644 index 0000000..b16b642 --- /dev/null +++ b/xyylMCWEACSystem/loginwidget.cpp @@ -0,0 +1,88 @@ +#include "loginwidget.h" +#include +#include +#include +#include +LoginWidget::LoginWidget(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); +} + LoginWidget::~LoginWidget( ) +{ + +} + void LoginWidget::init() + { + //多通道无线脑电采集系统 + m_labDes.setText(tr("Multi-channel wireless EEG acquisition system")); + //用户名 + m_labUser.setText(tr("user"));; + //密码 + m_labpasswd.setText(tr("passwd"));; + + m_btnLogin.setText(tr("login"));; ; + } + void LoginWidget::initLay() + { +#if 1 + QHBoxLayout * layhDes = new QHBoxLayout; + QHBoxLayout * layhImage = new QHBoxLayout; + QGridLayout * gridlay = new QGridLayout; + QHBoxLayout * layhUserPasswd = new QHBoxLayout; + QHBoxLayout * layhlogin = new QHBoxLayout; + + layhDes->addStretch(); + layhDes->addWidget(&m_labDes); + layhDes->addStretch(); + + layhImage->addStretch(); + layhImage->addWidget(&m_labImage); + layhImage->addStretch(); + + layhlogin->addStretch(); + layhlogin->addWidget(&m_btnLogin); + layhlogin->addStretch(); + + + int col = 0; + int row = 0; + gridlay->addWidget(&m_labUser,row,col); + gridlay->addWidget(&m_editUser,row,++col); + row ++; + col = 0; + gridlay->addWidget(&m_labpasswd,row,col); + gridlay->addWidget(&m_editpasswd,row,++col); + + layhUserPasswd->addStretch(); + layhUserPasswd->addLayout(gridlay); + layhUserPasswd->addStretch(); + + QVBoxLayout * layV = new QVBoxLayout; + layV->addLayout(layhDes); + layV->addLayout(layhImage); + layV->addLayout(layhUserPasswd); + layV->addLayout(layhlogin); + + setLayout(layV); +#else + +#endif + + } + bool LoginWidget::initConnect() + { + bool bCon = true; + bCon = connect(&m_btnLogin,SIGNAL(clicked(bool)),this,SLOT(slotlogIn())); + if(!bCon) + { + qDebug()<<"connect failed"< +#include +#include +#include +class LoginWidget:public QWidget +{ + Q_OBJECT +public: + explicit LoginWidget(QWidget * parent = NULL); + virtual ~LoginWidget( ); + void init(); + void initLay(); + bool initConnect(); +private slots: + void slotlogIn(); + +private: + //多通道无线脑电采集系统 + QLabel m_labDes; + QLabel m_labImage; + //用户名 + QLabel m_labUser; + QLineEdit m_editUser; + //密码 + QLabel m_labpasswd; + QLineEdit m_editpasswd; + + QPushButton m_btnLogin; +}; +#endif // LOGINWIDGET_H diff --git a/xyylMCWEACSystem/main.cpp b/xyylMCWEACSystem/main.cpp new file mode 100644 index 0000000..7a582c8 --- /dev/null +++ b/xyylMCWEACSystem/main.cpp @@ -0,0 +1,69 @@ +#include "widget.h" +#include +#include "regwidget.h" +#include "loginwidget.h" +#include "medicalrecordwidget.h" +#include "medicalrecordmanager.h" +#include "hospitalinfo.h" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include "curchatwidget.h" +#include "DevConWidget.h" +#include +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + CurChatWidget w; + w.show(); + RegWidget re; + re.show(); + MainWindow mainw; + mainw.resize(1000,800); + mainw.show(); + +#if 0 +DevConWidget de; +de.show(); + +HospitalInfo ho; +ho.show(); + +LoginWidget log; +log.show(); + +MedicalRecordManager me; +me.show(); + +MedicalRecordWidget mew; +mew.show(); + +RegWidget re; +re.show(); +#endif + + + + + return a.exec(); +} diff --git a/xyylMCWEACSystem/mainwindow.cpp b/xyylMCWEACSystem/mainwindow.cpp new file mode 100644 index 0000000..1b480b8 --- /dev/null +++ b/xyylMCWEACSystem/mainwindow.cpp @@ -0,0 +1,108 @@ +#include "mainwindow.h" +#include +#include +#include +#include + +MainWindow::MainWindow(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); +} +MainWindow::~MainWindow() +{ + +} + +void MainWindow::init() +{ + m_btnSystemSetting.setObjectName("SystemSetting"); + m_btnEEG.setObjectName("EEG"); + m_btnDataProcess.setObjectName("DataProcess"); +} +void MainWindow::initLay() +{ + + QHBoxLayout * hlay = new QHBoxLayout; + + m_btnSystemSetting.setStyleSheet("border-image:url(:/image/index_bg_setting_char.png);}"); + m_btnEEG.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}"); + m_btnDataProcess.setStyleSheet("border-image:url(:/image/index_bg_data_char.png);}"); + + m_btnSystemSetting.setStyleSheet("QPushButton{border-image:url(:/image/index_bg_setting_char.png);}" + "QPushButton:hover{border-image:url(:/image/index_bg_setting_hover.png);}" + "QPushButton:pressed{border-image:url(:/image/index_bg_setting_checked.png);}" + ); + + m_btnEEG.setStyleSheet("QPushButton{border-image:url(:/image/index_bg_EEG_char.png);}" + "QPushButton:hover{border-image:url(:/image/index_bg_EEG_hover.png);}" + "QPushButton:pressed{border-image:url(:/image/index_bg_EEG_checked.png);}" + ); + + m_btnDataProcess.setStyleSheet("QPushButton{border-image:url(:/image/index_bg_data_char.png);}" + "QPushButton:hover{border-image:url(:/image/index_bg_data_hover.png);}" + "QPushButton:pressed{border-image:url(:/image/index_bg_data_checked.png);}" + ); + m_btnSystemSetting.setMaximumSize(QSize(400,300)); + m_btnEEG.setMaximumSize(QSize(400,300)); + m_btnDataProcess.setMaximumSize(QSize(400,300)); + + m_btnSystemSetting.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_btnEEG.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_btnDataProcess.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + + + hlay->addWidget(&m_btnSystemSetting); + hlay->addSpacing(50); + hlay->addWidget(&m_btnEEG); + hlay->addSpacing(50); + hlay->addWidget(&m_btnDataProcess); + + + QVBoxLayout *vLay = new QVBoxLayout; + + m_titleWidget.setFixedHeight(100); + hlay->setContentsMargins(150,100,150,100); + hlay->setSpacing(1); + + vLay->addWidget(&m_titleWidget,1,Qt::AlignTop); + vLay->addSpacing(3); + vLay->addLayout(hlay,9); + setLayout(vLay); +} +bool MainWindow::initConnect() +{ + bool bCon = true; + bCon = connect(&m_btnEEG,SIGNAL(clicked(bool)),this,SLOT(slotBtn())); + if(!bCon) + { + qDebug()<<"connect failed"<(sender()); + if(send == nullptr) + { + return; + } + qDebug()<< send->objectName()< +#include +#include +#include +#include "titlewidget.h" +class MainWindow: public QWidget +{ + Q_OBJECT +public: + MainWindow(QWidget * parent = NULL); + virtual ~MainWindow(); + + void init(); + void initLay(); + bool initConnect(); +private slots: + void slotBtn(); +private: + TitleWidget m_titleWidget; + //系统设置 + QPushButton m_btnSystemSetting; + //脑电采集Electroencephalography + QPushButton m_btnEEG; + //数据处理Datarocessing + QPushButton m_btnDataProcess; +}; + + +#endif // MAINWINDOW_H diff --git a/xyylMCWEACSystem/medicalrecordmanager.cpp b/xyylMCWEACSystem/medicalrecordmanager.cpp new file mode 100644 index 0000000..9b12572 --- /dev/null +++ b/xyylMCWEACSystem/medicalrecordmanager.cpp @@ -0,0 +1,63 @@ +#include "medicalrecordmanager.h" +#include +#include +#include +#include + +MedicalRecordManager::MedicalRecordManager(QWidget * parent) +{ + init(); + initLay(); + initConnect(); + +} +MedicalRecordManager::~MedicalRecordManager() +{ + +} +void MedicalRecordManager::init() +{ + //搜索条件 + m_grpSearchConditionDes.setTitle(tr("SearchCondition")); + //检查号 + m_chCheckNum.setText(tr("CheckNum"));; + QLineEdit m_editCheckNum; + //姓名 + m_chName.setText(tr("Name"));;; + //检查日期 + m_chCheckDate.setText(tr("CheckDate")); + //搜索 + m_btnSearch.setText(tr("Search"));;; +} +void MedicalRecordManager::initLay() +{ + QGridLayout * gridlaySearch = new QGridLayout; + QHBoxLayout * hlaySearch = new QHBoxLayout; + QVBoxLayout * vlaySearch = new QVBoxLayout; + vlaySearch->addLayout(gridlaySearch); + vlaySearch->addLayout(hlaySearch); + m_grpSearchConditionDes.setLayout(vlaySearch); + + int col = 0; + int row = 0; + gridlaySearch->addWidget(&m_chCheckNum,row,col); + gridlaySearch->addWidget(&m_editCheckNum,row,++col); + row ++; + col = 0; + gridlaySearch->addWidget(&m_chName,row,col); + gridlaySearch->addWidget(&m_editName,row,++col); + row ++; + col = 0; + gridlaySearch->addWidget(&m_chCheckDate,row,col); + gridlaySearch->addWidget(&m_editDate,row,++col); + + hlaySearch->addStretch(); + hlaySearch->addWidget(&m_btnSearch); + + + +} +bool MedicalRecordManager::initConnect() +{ + +} diff --git a/xyylMCWEACSystem/medicalrecordmanager.h b/xyylMCWEACSystem/medicalrecordmanager.h new file mode 100644 index 0000000..5544e5f --- /dev/null +++ b/xyylMCWEACSystem/medicalrecordmanager.h @@ -0,0 +1,47 @@ +#ifndef MEDICALRECORDMANAGER_H +#define MEDICALRECORDMANAGER_H + +/* + des:病例管理--不部分完成 + date:20241028 +*/ +#include +#include +#include +#include +#include +#include +#include +class MedicalRecordManager:public QWidget +{ + Q_OBJECT +public: + explicit MedicalRecordManager(QWidget * parent =NULL); + virtual ~MedicalRecordManager(); + + void init(); + void initLay(); + bool initConnect(); + +private: + //搜索条件 + //QLabel m_labSearchConditionDes; + QGroupBox m_grpSearchConditionDes; + //检查号 + QCheckBox m_chCheckNum; + + QLineEdit m_editCheckNum; + //姓名 + QCheckBox m_chName; + + QLineEdit m_editName; + //检查日期 + QCheckBox m_chCheckDate; + QDateEdit m_editDate; + + //搜索 + QPushButton m_btnSearch; + +}; + +#endif // MEDICALRECORDMANAGER_H diff --git a/xyylMCWEACSystem/medicalrecordwidget.cpp b/xyylMCWEACSystem/medicalrecordwidget.cpp new file mode 100644 index 0000000..08330cc --- /dev/null +++ b/xyylMCWEACSystem/medicalrecordwidget.cpp @@ -0,0 +1,117 @@ +#include "medicalrecordwidget.h" +#include +#include +#include +#include +#include +MedicalRecordWidget::MedicalRecordWidget(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); +} +MedicalRecordWidget::~MedicalRecordWidget() +{ + +} +void MedicalRecordWidget::init() +{ + //检查号 + m_labCheckNum.setText(tr("CheckNum")); + + //住院 hospitalized + m_labHospitalized.setText(tr("hospitalized")); + + //门诊 + m_labOutpatient.setText(tr("Outpatient")); + + + //姓名 + m_labName.setText(tr("Name")); + + //性别 + m_labSex.setText(tr("Sex"));; + + + //左右利 + m_labLaterality.setText(tr("Laterality")); + + + //检查日期 + m_labDate_Of_inspection.setText(tr("DateInspection")); + + + //诊断病历 + m_labDiagnosticRecord.setText(tr("Record")); + + m_btnOk.setText(tr("ok")); + m_btnCancel.setText(tr("Cancel")); + + int iwidth = QFontMetrics(this->font()).width("Laterality"); + m_labCheckNum.setFixedWidth(iwidth); + m_labName.setFixedWidth(iwidth); + m_labLaterality.setFixedWidth(iwidth); + m_labDiagnosticRecord.setFixedWidth(iwidth); +} +void MedicalRecordWidget::initLay() +{ + +#if 1 + QHBoxLayout * hlayCheck = new QHBoxLayout; + QHBoxLayout * hlayName = new QHBoxLayout; + QHBoxLayout * hlayLaterality = new QHBoxLayout; + QHBoxLayout * hlayDiagnosticRecord = new QHBoxLayout; + QHBoxLayout * hlayokCancel = new QHBoxLayout; + + + QVBoxLayout * vlay = new QVBoxLayout; + vlay->addLayout(hlayCheck); + vlay->addLayout(hlayName); + vlay->addLayout(hlayLaterality); + vlay->addLayout(hlayDiagnosticRecord); + vlay->addWidget(&m_textDiagnosticRecord); + vlay->addLayout( hlayokCancel); + setLayout(vlay); + + hlayCheck->addWidget(&m_labCheckNum,0,Qt::AlignHCenter); + hlayCheck->addWidget(&m_editCheckNum); + hlayCheck->addWidget(&m_labHospitalized); + hlayCheck->addWidget(&m_chHospitalized); + hlayCheck->addWidget(&m_labOutpatient); + hlayCheck->addWidget(&m_chOutpatient); + hlayCheck->addStretch(); + + hlayName->addWidget(&m_labName,0,Qt::AlignHCenter); + hlayName->addWidget(&m_editName); + hlayName->addWidget(&m_labSex); + hlayName->addWidget(&m_cbSex); + hlayName->addStretch(); + + hlayLaterality->addWidget(&m_labLaterality,0,Qt::AlignHCenter); + hlayLaterality->addWidget(&m_cbLaterality); + hlayLaterality->addWidget(&m_labDate_Of_inspection); + hlayLaterality->addWidget(&m_dateInspection); + hlayLaterality->addStretch(); + + hlayDiagnosticRecord->addWidget(&m_labDiagnosticRecord,0,Qt::AlignHCenter); + hlayDiagnosticRecord->addStretch(); + + hlayokCancel->addStretch(); + hlayokCancel->addWidget(&m_btnOk); + hlayokCancel->addSpacing(30); + hlayokCancel->addWidget(&m_btnCancel); + hlayokCancel->addStretch(); + + +#else + +#endif + + + + +} +bool MedicalRecordWidget::initConnect() +{ + +} diff --git a/xyylMCWEACSystem/medicalrecordwidget.h b/xyylMCWEACSystem/medicalrecordwidget.h new file mode 100644 index 0000000..647c3e8 --- /dev/null +++ b/xyylMCWEACSystem/medicalrecordwidget.h @@ -0,0 +1,62 @@ +#ifndef MEDICALRECORDWIDGET_H +#define MEDICALRECORDWIDGET_H + +/* + des: MedicalRecordWidget 填写病历 + author:zhangyiming + +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +class MedicalRecordWidget:public QWidget +{ + Q_OBJECT +public: + explicit MedicalRecordWidget(QWidget * parent =nullptr); + virtual ~MedicalRecordWidget(); + void init(); + void initLay(); + bool initConnect(); +private: + //检查号 + QLabel m_labCheckNum; + QLineEdit m_editCheckNum; + + //住院 hospitalized + QLabel m_labHospitalized; + QCheckBox m_chHospitalized; + + //门诊 + QLabel m_labOutpatient; + QCheckBox m_chOutpatient; + + //姓名 + QLabel m_labName; + QLineEdit m_editName; + //性别 + QLabel m_labSex; + QComboBox m_cbSex; + + //左右利 + QLabel m_labLaterality; + QComboBox m_cbLaterality; + + //检查日期 + QLabel m_labDate_Of_inspection; + QDateEdit m_dateInspection; + + //诊断病历 + QLabel m_labDiagnosticRecord; + QTextEdit m_textDiagnosticRecord; + + QPushButton m_btnOk; + QPushButton m_btnCancel; +}; +#endif // MEDICALRECORDWIDGET_H diff --git a/xyylMCWEACSystem/regwidget.cpp b/xyylMCWEACSystem/regwidget.cpp new file mode 100644 index 0000000..8a49a79 --- /dev/null +++ b/xyylMCWEACSystem/regwidget.cpp @@ -0,0 +1,107 @@ + +#include "regwidget.h" +#include +#include +#include +#include +RegWidget::RegWidget(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); + +} +RegWidget::~RegWidget( ) +{ + +} +void RegWidget::init() +{ + //注册说明:请与我公司联系获取注册码,联系电话:0372-7775-555 + m_labRegDes.setText(tr("Registration Instructions: Please contact our company to \n" + "obtain the registration code, contact phone: 0372-7775-555")); + //安装序列号 + m_labInstallSerialNum.setText(tr("serial number")); + //安装注册码 + m_labInstallRegNum.setText(tr("registration code")); + //使用单位 + m_labCompany.setText(tr("Company")); + //联系电话 + m_labTelephoneNum.setText(tr("TelephoneNum")); + //注册确认 + m_btnOk.setText(tr("Registration confirmation")); + //试用 + m_btnCancel.setText(tr("Free Trial")); +} +void RegWidget::initLay() +{ + + + QHBoxLayout * layHDes = new QHBoxLayout; + QHBoxLayout * layHOkCancel = new QHBoxLayout; + QGridLayout * gridlayReg = new QGridLayout; + + + layHDes->addStretch(); + layHDes->addWidget(&m_labRegDes); + layHDes->addStretch(); + + layHOkCancel->addStretch(); + layHOkCancel->addWidget(&m_btnOk); + layHOkCancel->addWidget(&m_btnCancel); + layHOkCancel->addStretch(); + + int col = 0; + int row = 0; + gridlayReg->addWidget(&m_labInstallSerialNum,row,col); + gridlayReg->addWidget(&m_editInstallSerialNum,row,++col); + row ++; + col = 0; + gridlayReg->addWidget(&m_labInstallRegNum,row,col); + gridlayReg->addWidget(&m_editInstallRegNum,row,++col); + row ++; + col = 0; + gridlayReg->addWidget(&m_labCompany,row,col); + gridlayReg->addWidget(&m_editCompany,row,++col); + row ++; + col = 0; + gridlayReg->addWidget(&m_labTelephoneNum,row,col); + gridlayReg->addWidget(&m_editTelephoneNum,row,++col); + + QVBoxLayout * vlay =new QVBoxLayout(this); + vlay->addStretch(); + vlay->addLayout(layHDes); + vlay->addLayout(gridlayReg); + vlay->addLayout(layHOkCancel); + vlay->setContentsMargins(30,1,30,1); + vlay->setSpacing(1); + vlay->addStretch(); + setLayout(vlay); +} + bool RegWidget::initConnect() +{ + bool bCon = true; + bCon = connect(&m_btnOk,SIGNAL(clicked(bool)),this,SLOT(slotRegOk())); + if(!bCon) + { + qDebug()<<"connect failed"<= 1600) +# pragma execution_character_set("utf-8") +#endif +#ifndef REGWIDGET_H +#define REGWIDGET_H + +/* + des: Register Widget 注册窗口 + author:zhangyiming + +*/ +#include +#include +#include +#include +class RegWidget:public QWidget +{ + Q_OBJECT +public: + explicit RegWidget(QWidget * parent = NULL); + virtual ~RegWidget( ); + void init(); + void initLay(); + bool initConnect(); +private slots: + void slotRegOk(); + void slotTrial(); +private: + //注册说明 + QLabel m_labRegDes; + //安装序列号 + QLabel m_labInstallSerialNum; + QLineEdit m_editInstallSerialNum; + //安装注册码 + QLabel m_labInstallRegNum; + QLineEdit m_editInstallRegNum; + //使用单位 + QLabel m_labCompany; + QLineEdit m_editCompany; + //联系电话 + QLabel m_labTelephoneNum; + QLineEdit m_editTelephoneNum; + + QPushButton m_btnOk; + QPushButton m_btnCancel; + +}; +#endif // REGWIDGET_H diff --git a/xyylMCWEACSystem/titlewidget.cpp b/xyylMCWEACSystem/titlewidget.cpp new file mode 100644 index 0000000..7e77735 --- /dev/null +++ b/xyylMCWEACSystem/titlewidget.cpp @@ -0,0 +1,64 @@ +#include "titlewidget.h" +#include +#include +#include +#include +TitleWidget::TitleWidget(QWidget * parent ):QWidget(parent) +{ + init(); + initLay(); + initConnect(); +} +TitleWidget::~TitleWidget() +{ + +} + +void TitleWidget::init() +{ + m_labDes.setStyleSheet("border-image:url(:/image/sunnyou_logo.png);}"); + // m_labSystemName.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}"); + m_labSystemName.setText(tr("Multi-channel wireless EEG acquisition system")); + m_btnRet.setStyleSheet("background-image:url(:/image/icon_exit.png);}"); + + + + m_btnRet.setStyleSheet("QPushButton{border-image:url(:/image/icon_exit.png);}" + "QPushButton:hover{border-image:url(:/image/icon_exit_hover.png);}" + "QPushButton:pressed{border-image:url(:/image/icon_exit_checked.png);}" + ); + m_labDes.setMaximumSize(QSize(250,80)); + // m_labSystemName.setMaximumSize(QSize(100,300)); + m_btnRet.setMaximumSize(QSize(250,80)); + + //m_labDes.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + //m_labSystemName.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + //m_btnRet.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + +} +void TitleWidget::initLay() +{ +#if 0 + QHBoxLayout * hlay = new QHBoxLayout; + hlay->addWidget(&m_labDes,Qt::AlignLeft); + hlay->addWidget(&m_labSystemName,1,Qt::AlignHCenter); + //hlay->addStretch(); + hlay->addWidget(&m_btnRet,1,Qt::AlignRight); + setLayout(hlay); +#else + QGridLayout * hlay = new QGridLayout; + hlay->addWidget(&m_labDes,0,0 ); + hlay->addWidget(&m_labSystemName,0,1,Qt::AlignHCenter ); + //hlay->addStretch(); + hlay->addWidget(&m_btnRet,0,2 ); + hlay->setContentsMargins(1,1,1,1); + setLayout(hlay); +#endif + +} +bool TitleWidget::initConnect() +{ + + +} + diff --git a/xyylMCWEACSystem/titlewidget.h b/xyylMCWEACSystem/titlewidget.h new file mode 100644 index 0000000..6fb8ed1 --- /dev/null +++ b/xyylMCWEACSystem/titlewidget.h @@ -0,0 +1,24 @@ +#ifndef TITLEWIDGET_H +#define TITLEWIDGET_H +#include +#include +#include +#include + + +class TitleWidget:public QWidget +{ + Q_OBJECT +public: + TitleWidget(QWidget * parent = NULL); + virtual ~TitleWidget(); + + void init(); + void initLay(); + bool initConnect(); +private: + QLabel m_labDes; + QLabel m_labSystemName; + QPushButton m_btnRet; +}; +#endif // TITLEWIDGET_H diff --git a/xyylMCWEACSystem/widget.cpp b/xyylMCWEACSystem/widget.cpp new file mode 100644 index 0000000..de81017 --- /dev/null +++ b/xyylMCWEACSystem/widget.cpp @@ -0,0 +1,14 @@ +#include "widget.h" +#include "ui_widget.h" + +Widget::Widget(QWidget *parent) : + QWidget(parent), + ui(new Ui::Widget) +{ + ui->setupUi(this); +} + +Widget::~Widget() +{ + delete ui; +} diff --git a/xyylMCWEACSystem/widget.h b/xyylMCWEACSystem/widget.h new file mode 100644 index 0000000..db61d5a --- /dev/null +++ b/xyylMCWEACSystem/widget.h @@ -0,0 +1,87 @@ +#ifndef WIDGET_H +#define WIDGET_H + +#include + +namespace Ui { +class Widget; +} +#include +#include +#include +#include +#include +class Widget : public QWidget +{ + Q_OBJECT + +public: + explicit Widget(QWidget *parent = nullptr); + ~Widget(); + void paintEvent(QPaintEvent *) override { + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, true); + + // 设置画笔的颜色和样式 + painter.setPen(Qt::black); + + // 获取Widget的尺寸 + int width = this->width(); + int height = this->height(); + + // 定义坐标原点的位置 + int centerX = width / 2; + int centerY = height / 2; + + // 绘制X轴 + painter.drawLine(centerX, 0, centerX, height); + + // 绘制Y轴 + painter.drawLine(0, centerY, width, centerY); + + // 可选地,绘制网格线 + int step = 50; // 网格线之间的间隔 + painter.setPen(Qt::lightGray); + for (int i = step; i < width; i += step) { + painter.drawLine(i, 0, i, height); + painter.drawLine(-i + centerX * 2, 0, -i + centerX * 2, height); + } + for (int i = step; i < height; i += step) { + painter.drawLine(0, i, width, i); + painter.drawLine(0, -i + centerY * 2, width, -i + centerY * 2); + } + + // 绘制坐标轴上的刻度 + painter.setPen(Qt::darkGray); + QFontMetrics fm = fontMetrics(); + int textWidth = fm.horizontalAdvance(QString::number(step)); + int textHeight = fm.height(); + for (int i = step; i <= width / 2; i += step) { + painter.drawText(QPoint(centerX + i - textWidth / 2, centerY + textHeight), QString::number(i)); + painter.drawText(QPoint(centerX - i - textWidth / 2, centerY + textHeight), QString::number(-i)); + painter.drawText(QPoint(centerX - textWidth / 2, centerY - i), QString::number(-i)); + painter.drawText(QPoint(centerX - textWidth / 2, centerY + i), QString::number(i)); + } + // 绘制箭头指示坐标方向 + painter.setPen(Qt::black); + painter.drawLine(centerX - 5, centerY, centerX + 5, centerY); + painter.drawLine(centerX, centerY - 5, centerX, centerY + 5); + + } + + private: + QPoint calculateCenter(QPoint p1, QPoint p2, QPoint p3) { + // 这里需要实现计算圆心的逻辑 + return QPoint(100, 100); // 假设的圆心位置 + } + + int calculateRadius(QPoint center, QPoint point) { + // 计算半径 + return qSqrt(qPow(point.x() - center.x(), 2) + qPow(point.y() - center.y(), 2)); + } + +private: + Ui::Widget *ui; +}; + +#endif // WIDGET_H diff --git a/xyylMCWEACSystem/widget.ui b/xyylMCWEACSystem/widget.ui new file mode 100644 index 0000000..8541684 --- /dev/null +++ b/xyylMCWEACSystem/widget.ui @@ -0,0 +1,20 @@ + + Widget + + + + 0 + 0 + 400 + 300 + + + + Widget + + + + + + + diff --git a/xyylMCWEACSystem/xyylMCWEACSystem.pro b/xyylMCWEACSystem/xyylMCWEACSystem.pro new file mode 100644 index 0000000..b054b67 --- /dev/null +++ b/xyylMCWEACSystem/xyylMCWEACSystem.pro @@ -0,0 +1,64 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2024-10-24T13:12:15 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = xyylMCWEACSystem +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as 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 you use 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_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + btngroupwidget.cpp \ + curchatwidget.cpp \ + devconwidget.cpp \ + hospitalinfo.cpp \ + loginwidget.cpp \ + main.cpp \ + mainwindow.cpp \ + medicalrecordmanager.cpp \ + medicalrecordwidget.cpp \ + regwidget.cpp \ + titlewidget.cpp \ + widget.cpp + +HEADERS += \ + btngroupwidget.h \ + curchatwidget.h \ + devconwidget.h \ + hospitalinfo.h \ + loginwidget.h \ + mainwindow.h \ + medicalrecordmanager.h \ + medicalrecordwidget.h \ + mrmanagement.h \ + regwidget.h \ + titlewidget.h \ + widget.h + +FORMS += \ + widget.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + egg.qrc diff --git a/xyylMCWEACSystem/xyylMCWEACSystem.pro.user b/xyylMCWEACSystem/xyylMCWEACSystem.pro.user new file mode 100644 index 0000000..186586e --- /dev/null +++ b/xyylMCWEACSystem/xyylMCWEACSystem.pro.user @@ -0,0 +1,598 @@ + + + + + + EnvironmentId + {91b91540-c58e-40b1-bd6c-1f09b812885d} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.13.0 MinGW 32-bit + Desktop Qt 5.13.0 MinGW 32-bit + qt.qt5.5130.win32_mingw73_kit + 0 + 0 + 0 + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_32_bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_32_bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_32_bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + xyylMCWEACSystem + + Qt4ProjectManager.Qt4RunConfiguration:D:/project/qt-project/xyylMCWEACSystem/xyylMCWEACSystem.pro + + 3768 + false + true + true + false + false + true + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_32_bit-Debug + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.13.0 MinGW 64-bit + Desktop Qt 5.13.0 MinGW 64-bit + qt.qt5.5130.win64_mingw73_kit + 0 + 0 + 0 + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_64_bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_64_bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + D:/project/qt-project/build-xyylMCWEACSystem-Desktop_Qt_5_13_0_MinGW_64_bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + + 3768 + false + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.TargetCount + 2 + + + ProjectExplorer.Project.Updater.FileVersion + 21 + + + Version + 21 + +