# HumanBodyComposition **Repository Path**: codeceo_net/human-body-composition ## Basic Information - **Project Name**: HumanBodyComposition - **Description**: demo - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-10 - **Last Updated**: 2026-07-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README HumanBodyComposition/ ├─ app/ # 应用入口、全局初始化 │ ├─ main.cpp │ ├─ application.h │ └─ application.cpp │ ├─ ui/ # 界面层,只负责显示和用户交互 │ ├─ windows/ # 主窗口、独立窗口 │ │ ├─ MainWindow.h │ │ ├─ MainWindow.cpp │ │ └─ MainWindow.ui │ │ │ ├─ pages/ # 页面级界面 │ │ ├─ HomePage.h │ │ ├─ MeasurePage.h │ │ ├─ ReportPage.h │ │ └─ SettingsPage.h │ │ │ ├─ dialogs/ # 弹窗 │ │ ├─ LoginDialog.h │ │ ├─ PatientEditDialog.h │ │ └─ ConfirmDialog.h │ │ │ ├─ widgets/ # 可复用控件 │ │ ├─ ChartWidget.h │ │ ├─ NumericInputWidget.h │ │ └─ StatusBarWidget.h │ │ │ └─ delegates/ # Qt Model/View 委托 │ └─ TableButtonDelegate.h │ ├─ services/ # 业务服务层,组织业务流程 │ ├─ PatientService.h │ ├─ PatientService.cpp │ ├─ MeasurementService.h │ ├─ MeasurementService.cpp │ ├─ ReportService.h │ ├─ ReportService.cpp │ ├─ AuthService.h │ └─ AuthService.cpp │ ├─ database/ # 数据库访问层 │ ├─ DatabaseManager.h # 数据库连接、初始化、事务 │ ├─ DatabaseManager.cpp │ ├─ migrations/ # 建表、升级 SQL │ │ ├─ 001_init.sql │ │ └─ 002_add_measurement.sql │ ├─ dao/ # DAO,只做数据库 CRUD / 负责数据库的增删改查(CRUD)。 │ │ ├─ PatientDao.h │ │ ├─ PatientDao.cpp │ │ ├─ MeasurementDao.h │ │ └─ MeasurementDao.cpp │ └─ entity/ # 数据库实体结构 │ ├─ PatientEntity.h │ └─ MeasurementEntity.h │ ├─ models/ # 领域模型 / Qt Model │ ├─ domain/ # 业务对象 │ │ ├─ Patient.h │ │ ├─ MeasurementResult.h │ │ └─ BodyComposition.h │ │ │ └─ table/ # QAbstractTableModel 等 │ ├─ PatientTableModel.h │ ├─ PatientTableModel.cpp │ ├─ MeasurementTableModel.h │ └─ MeasurementTableModel.cpp │ ├─ devices/ # 外设、串口、蓝牙、测量设备 │ ├─ SerialPortManager.h │ ├─ SerialPortManager.cpp │ ├─ BodyCompositionDevice.h │ ├─ BodyCompositionDevice.cpp │ └─ protocol/ │ ├─ DeviceProtocol.h │ ├─ DeviceProtocol.cpp │ ├─ PacketParser.h │ └─ PacketParser.cpp │ ├─ utils/ # 通用工具类,无业务状态 │ ├─ DateTimeUtils.h │ ├─ FileUtils.h │ ├─ StringUtils.h │ ├─ ValidationUtils.h │ └─ Logger.h │ ├─ config/ # 配置读写 │ ├─ AppConfig.h │ ├─ AppConfig.cpp │ ├─ DatabaseConfig.h │ └─ DeviceConfig.h │ ├─ reports/ # 报告生成、打印、导出 │ ├─ ReportGenerator.h │ ├─ ReportGenerator.cpp │ ├─ PdfExporter.h │ ├─ PdfExporter.cpp │ └─ templates/ │ └─ body_report.html │ ├─ resources/ # Qt 资源文件和静态资源 │ ├─ qrc/ │ │ └─ humanbodycomposition.qrc │ ├─ icons/ │ ├─ images/ │ ├─ styles/ │ │ ├─ app.qss │ │ └─ dark.qss │ └─ translations/ │ ├─ zh_CN.ts │ └─ en_US.ts │ ├─ common/ # 公共定义 │ ├─ Constants.h │ ├─ Enums.h │ ├─ Types.h │ └─ ErrorCode.h │ ├─ tests/ # 单元测试 / 集成测试 │ ├─ service_tests/ │ ├─ database_tests/ │ └─ device_tests/ │ ├─ docs/ # 项目文档 │ ├─ architecture.md │ ├─ database.md │ └─ protocol.md │ ├─ third_party/ # 第三方库 │ ├─ build/ # 构建输出,建议 git 忽略 │ ├─ HumanBodyComposition.sln ├─ HumanBodyComposition.vcxproj └─ README.md ui -> 界面,只处理显示、按钮点击、信号槽 services -> 业务流程,例如保存测量结果、生成报告 database -> 数据库连接和 CRUD models -> 业务数据结构、Qt 表格模型 devices -> 串口、设备协议、测量仪通信 utils -> 通用工具 config -> 配置管理 resources -> 图标、样式、翻译、qrc foreach(resource_file IN LISTS APP_RESOURCE_FILES) set(resource_alias "${resource_file}") string(REGEX REPLACE "^resources/" "" resource_alias "${resource_alias}") set_source_files_properties("${resource_file}" PROPERTIES QT_RESOURCE_ALIAS "${resource_alias}" ) endforeach() | 原始路径 | QT_RESOURCE_ALIAS | | --------------------------------- | ----------------------- | | resources/images/login_bg.png | images/login_bg.png | | resources/images/default_head.png | images/default_head.png | qt_add_qml_module( RESOURCES ${APP_RESOURCE_FILES} ) | 原始路径 | 最终 qrc 路径 | | --------------------------------- | ----------------------------------- | | resources/images/login_bg.png | qrc:/qt/qml/images/login_bg.png | | resources/images/default_head.png | qrc:/qt/qml/images/default_head.png |