diff --git a/Module/Module.pro b/Module/Module.pro index 713d79af..cb4d830a 100644 --- a/Module/Module.pro +++ b/Module/Module.pro @@ -1,6 +1,3 @@ -# Module.pro -# 模块总工程文件 - TEMPLATE = subdirs isEmpty(TARGET_APP) { @@ -24,7 +21,7 @@ isEmpty(TARGET_APP) { ModbusTCPServer \ AuthModule - contains(TARGET_APP, "^(BagThreadPosition|HoleDetection|StatorPosition|WorkpieceHole)$") { + contains(TARGET_APP, "^(BagThreadPosition|HoleDetection|StatorPosition|WorkpieceHole|ParkingSpaceGuide)$") { SUBDIRS += ModbusTCPClient } @@ -45,11 +42,6 @@ isEmpty(TARGET_APP) { } } -# 设置依赖关系 -# 注意:SUBDIRS 必须用短名(目录名)注册,qmake 会自动查找 子目录/同名.pro, -# 这样 .depends 才能生效。若写成 "WDRemoteReceiver/WDRemoteReceiver.pro" 路径形式, -# 该依赖不会被 qmake 关联,make -j 并行编译时会出现 "cannot find -lZeroMQClient"。 -# WDRemoteReceiver 是动态库,链接 ZeroMQClient / ZeroMQPubSub 静态库,必须先构建它们。 contains(SUBDIRS, WDRemoteReceiver) { WDRemoteReceiver.depends = ZeroMQClient ZeroMQPubSub AuthModule } diff --git a/Module/WDRemoteReceiver/Inc/IWDRemoteReceiver.h b/Module/WDRemoteReceiver/Inc/IWDRemoteReceiver.h index e70bc28e..7d875ddc 100644 --- a/Module/WDRemoteReceiver/Inc/IWDRemoteReceiver.h +++ b/Module/WDRemoteReceiver/Inc/IWDRemoteReceiver.h @@ -53,9 +53,9 @@ public: struct ConnectConfig { std::string serverIp{"127.0.0.1"}; - int controlPort{5555}; // ZMQ REQ-REP 控制 - int resultPort{5556}; // ZMQ PUB 检测结果 - int rawImagePort{5557}; // ZMQ PUB 原始图像,0 表示不启用 + int controlPort{15555}; // ZMQ REQ-REP 控制 + int resultPort{15556}; // ZMQ PUB 检测结果 + int rawImagePort{15557}; // ZMQ PUB 原始图像,0 表示不启用 }; // 回调类型 diff --git a/Module/WDRemoteReceiver/Inc/WDRemoteDataTypes.h b/Module/WDRemoteReceiver/Inc/WDRemoteDataTypes.h index c542a27c..8e5fbbd1 100644 --- a/Module/WDRemoteReceiver/Inc/WDRemoteDataTypes.h +++ b/Module/WDRemoteReceiver/Inc/WDRemoteDataTypes.h @@ -202,9 +202,9 @@ struct WDRemoteDeviceInfo std::string clientMachineCode; std::string serverIp; std::string deviceName; - int controlPort{5555}; - int resultPort{5556}; - int rawImagePort{5557}; + int controlPort{15555}; + int resultPort{15556}; + int rawImagePort{15557}; std::string rtspUrl; double detectFps{0.0}; double streamFps{0.0}; diff --git a/Module/WDRemoteReceiver/Src/WDRemoteReceiver.cpp b/Module/WDRemoteReceiver/Src/WDRemoteReceiver.cpp index 336360ba..f3fcebd5 100644 --- a/Module/WDRemoteReceiver/Src/WDRemoteReceiver.cpp +++ b/Module/WDRemoteReceiver/Src/WDRemoteReceiver.cpp @@ -32,6 +32,10 @@ using namespace VA; // 项目内 jsoncpp 包在 VA 命名空间内 namespace { +constexpr int kDefaultZmqControlPort = 15555; +constexpr int kDefaultZmqResultPort = 15556; +constexpr int kDefaultZmqRawImagePort = 15557; + std::string logPreview(const std::string& text, size_t maxLen = 512) { if (text.size() <= maxLen) @@ -443,9 +447,9 @@ bool WDRemoteReceiver::parseDeviceInfoJson(const std::string& jsonStr, ? root.get("serverIp", "").asString() : serverIp; outDevice.deviceName = root.get("deviceName", "DroneScrewServer").asString(); - outDevice.controlPort = root.get("controlPort", 5555).asInt(); - outDevice.resultPort = root.get("resultPort", 5556).asInt(); - outDevice.rawImagePort = root.get("rawImagePort", 5557).asInt(); + outDevice.controlPort = root.get("controlPort", kDefaultZmqControlPort).asInt(); + outDevice.resultPort = root.get("resultPort", kDefaultZmqResultPort).asInt(); + outDevice.rawImagePort = root.get("rawImagePort", kDefaultZmqRawImagePort).asInt(); outDevice.rtspUrl = root.get("rtsp", "").asString(); fillRuntimeFields(root, outDevice); outDevice.rawJson = jsonStr;