螺杆的本地仿真功能

This commit is contained in:
杰仔 2026-07-11 15:47:55 +08:00
parent 23f11960ac
commit 8bbc5c396b
4 changed files with 14 additions and 18 deletions

View File

@ -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
}

View File

@ -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 表示不启用
};
// 回调类型

View File

@ -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};

View File

@ -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;