2017 BUPT 软件工程大作业
工程代码及相关文档 基于 MIT 协议 发行
- 语言:C++ 14 / Qt (GUI Only)
- 系统:
- Windows 10
- Ubuntu 16.04
- 依赖:
- 编译器:
- gcc/clang(命令行 Linux)
- Visual Studio 2017 - MSVC 15(命令行 Windows)
- Qt 5(图形化)
- 数据库:
- sqlite 3(由 ORM-Lite 提供)
- makefile/
- server-cli(命令行 主控机 Linux)
- client-cli(命令行 从控机 Linux)
- vs-proj/
- Air-Conditioner.sln
- Air-Conditioner-Server/
- Air-Conditioner-Server.vcxproj(命令行 主控机 Windows)
- Air-Conditioner-Client/
- Air-Conditioner-Client.vcxproj(命令行 从控机 Windows)
- qt-proj/
- Air-Conditioner-Server/
- Air-Conditioner-Server.pro(图形化 主控机)
- Air-Conditioner-Client/
- Air-Conditioner-Client.pro(图形化 从控机)
- Air-Conditioner-Server/
编译前,需要解压第三方库的源文件:
- src/common/
- common-model.h(共享 模型)
- common-protocol.h(共享 协议)
- json/json.hpp(json 库)
- bot-socket.h(socket 库)
- bot-cs.h(基于 socket 的服务器/客户端框架)
- common-view.h(共享 视图库)
- cli-helper.h(共享 命令行库)
- src/server/
- ormlite/(ORM Lite 库)
- ui/(Qt UI 文件)
- server.cpp(主控机 主函数)
- server-model.h(主控机 模型)
- server-service.h(主控机 服务模块)
- server-protocol.h(主控机 协议模块)
- server-protocol-controller.h(主控机 网络层 控制器)
- server-view-controller.h(主控机 视图层 控制器)
- server-view.h(主控机 视图 / 视图管理器)
- server-view-cli.h(主控机 命令行视图)
- server-view-manager-cli.cpp(主控机 命令行视图管理器)
- server-view-gui.h(主控机 图形化视图)
- server-view-manager-gui.cpp(主控机 图形化视图管理器)
- server-view-gui-qt.h(主控机 Qt 图形化接口)
- server-view-gui-qt.cpp(主控机 Qt 图形化实现)
- log-helper.h(报表导出模块)
- time-helper.h(时间转换模块)
- src/client/
- ui/(Qt UI 文件)
- client.cpp(从控机 主函数)
- client-model.h(从控机 模型)
- client-protocol.h(从控机 协议模块)
- client-controller.h(从控机 控制器)
- client-view.h(从控机 视图 / 视图管理器)
- client-view-cli.h(从控机 命令行视图)
- client-view-manager-cli.cpp(从控机 命令行视图管理器)
- client-view-gui.h(从控机 图形化视图)
- client-view-manager-gui.cpp(从控机 图形化视图管理器)
- client-view-gui-qt.h(从控机 Qt 图形化接口)
- client-view-gui-qt.cpp(从控机 Qt 图形化实现)
2017 分布式温控系统 F 组 通信协议
PACKET = JSON_REQ | JSON_RES \0
传输的 socket 字符流以 空字符 '\0' 结束
JSON_REQ = {"request":ACTION, "param":PARAM}
ACTION = "auth" | "pulse"
1) ACTION = "auth"
PARAM = {"room":ROOM_ID, "guest":GUEST_ID}
2) ACTION = "pulse"
PARAM = {"room":ROOM_ID, "current":TEMP,
"target":TEMP, "wind":WIND}
ROOM_ID = [string]
GUEST_ID = [string]
TEMP = [double]
WIND = 1 | 2 | 3
JSON_RES = {"success":SUCCESS, "response":RESPONSE}
SUCCESS = true | false
1) SUCCESS = false
RESPONSE = ERR_MSG
2) SUCCESS = true
RESPONSE = {"hasWind":HAS_WIND, "energy":ENERGY, "cost":COST,
"on":SERVER_ON, "mode":MODE}
ERR_MSG = [string]
HAS_WIND = true | false
ENERGY = [double]
COST = [double]
SERVER_ON = true | false
MODE = 0 | 1