提交 d77937aa 作者: 崔世豪

.

上级 10473ed8
......@@ -136,8 +136,8 @@ void acquire_config::get_configuration_file()
qDebug() << "http_enable_cert:" << http_enable_cert;
qDebug() << "publish_control_frequency:" << publish_control_frequency;
qDebug() << "publish_status_frequency:" << publish_status_frequency;
qDebug() << "chair_sn:" << chair_sn;
qDebug() << "chair_name:" << chair_name;
qDebug() << "device_sn:" << device_sn;
qDebug() << "chair_host:" << chair_host;
qDebug() << "chair_to_device_port:" << chair_to_device_port;
......
#include "bulldozer_module.h"
#include "global_signal.h"
#include <QString>
#include <QStringList>
#include <QMap>
#include <iostream>
#include <QThread>
bulldozer_module::bulldozer_module(const QString& ip, quint16 port, QObject* parent)
: QObject(parent)
{
QThread* _pthread = new QThread(this);
_udp_thread = new udp_thread(ip, port, "bulldozer", this);
connect(_udp_thread, &udp_thread::udp_received_data, this, &bulldozer_module::no_udp_received_data);
connect(_pthread, &QThread::finished, this, &bulldozer_module::deleteLater);
connect(this, &bulldozer_module::destroyed, _pthread, &QThread::deleteLater);
this->moveToThread(_pthread);
_pthread->start();
_module_data = module_data::instance();//全局数据中转
_joy_thread = new joy_thread();//实例读座椅数据 解析类
connect(_joy_thread, &joy_thread::joy_received_button, this, &bulldozer_module::analyze_seat_button);
connect(_joy_thread, &joy_thread::joy_received_axis, this, &bulldozer_module::analyze_seat_axis);
qDebug() << "bulldozer_module thread ID: " << QThread::currentThreadId();
}
bulldozer_module::~bulldozer_module()
{
}
/*
* 左手柄joy2 向左0- -78
* 向前0- -90
* 向后0- 78
* 向右0- 90
* B 0 左按钮
* B 1 右按钮
* B 6 中间按钮
*
** 右手柄joy0 ax0向左0- -78
* ax1向前0- -90
* ax1 向后0- 78
* ax0 向右0- 90
* B 0 左按钮
* B 1 右按钮
* B 6 中间按钮
*右踏板 joy1 ax2 -100- 100
*
* 左 joy1 ax3 -100- 100
*/
int bulldozer_module::mapRange(double value, double fromMin, double fromMax, double toMin, double toMax) {
// 计算输入值在原始范围中的比例
double fromRange = fromMax - fromMin;
double toRange = toMax - toMin;
double scaledValue = (value - fromMin) / fromRange;
// 将比例映射到目标范围
double mappedValue = toMin + (scaledValue * toRange);
int intValue = static_cast<int>(mappedValue);
return intValue;
}
void bulldozer_module::no_udp_received_data(const QByteArray& data)
void bulldozer_module::analyze_seat_axis(int joyIndex, int axis, double value)
{
parseData(data);
if (joyIndex == 0) {//右手柄
if (axis == 0) {//左右
int is_value = 0;
is_value = mapRange(value, -78, 90, -100, 100);
_module_data->target_bulldozer_tilt_left_right = is_value;
//if (value < 0) {//左推土机左倾斜指令
// is_value = scale_value(qAbs(value), 0, qAbs(-78), 0, 100);
// _module_data->target_bulldozer_tilt_left = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-向左:") + QString::number(is_value, 10));
//}
//else if (value > 0) {//右推土机右倾斜指令
// is_value = scale_value(value, 0, 90, 0, 100);
// _module_data->target_bulldozer_tilt_right = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-向右:") + QString::number(is_value, 10));
//}
}
else if (axis == 1) {//前后
int is_value = 0;
is_value = mapRange(value, -90, 78, -100, 100);
_module_data->target_bulldozer_lift_lower = is_value;
//if (value < 0) {//前推土机提铲指令
// is_value = scale_value(qAbs(value), 0, qAbs(-90), 0, 100);
// _module_data->target_bulldozer_lift = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-向前:") + QString::number(is_value, 10));
//}
//else if (value > 0) {//后推土机降铲指令
// is_value = scale_value(value, 0, 78, 0, 100);
// _module_data->target_bulldozer_lower = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-向后:") + QString::number(is_value, 10));
//}
}
}
else if (joyIndex == 2) {//左手柄
if (axis == 0) {//左右
int is_value = 0;
is_value = mapRange(value, -78, 90, -100, 100);
_module_data->target_bulldozer_left_right = is_value;
//if (value < 0) {//左推土机左转指令
// is_value = scale_value(qAbs(value), 0, qAbs(-78), 0, 100);
// _module_data->target_bulldozer_left = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左手柄-向左:") + QString::number(is_value, 10));
//}
//else if (value > 0) {//右推土机右转指令
// is_value = scale_value(value, 0, 90, 0, 100);
// _module_data->target_bulldozer_right = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左手柄-向右:") + QString::number(is_value, 10));
//}
}
else if (axis == 1) {//前后
int is_value = 0;
is_value = mapRange(value, -90, 78, -100, 100);
_module_data->target_bulldozer_forward_backward = is_value;
//if (value < 0) {//前推土机前进指令
// is_value = scale_value(qAbs(value), 0, qAbs(-90), 0, 100);
// _module_data->target_bulldozer_forward = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左手柄-向前:") + QString::number(is_value, 10));
//}
//else if (value > 0) {//后推土机后退指令
// is_value = scale_value(value, 0, 78, 0, 100);
// _module_data->target_bulldozer_backward = is_value;
// global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左手柄-向后:") + QString::number(is_value, 10));
//}
}
}
else if (joyIndex == 1) {//脚踏板
int is_value = 0;
if (axis == 2) {//右推土机油门指令
is_value = (value + 100) / 2;
_module_data->target_bulldozer_throttle = is_value;
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右脚踏板:") + QString::number(is_value, 10));
}
else if (axis == 3) {//左
is_value = (value + 100) / 2;
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左脚踏板:") + QString::number(is_value, 10));
}
}
}
void bulldozer_module::analyze_seat_button(int joyIndex, int button, bool pressed)
{
if (joyIndex == 0) {//右手柄
if (button == 0) {
if (!pressed) {
if (_module_data->target_bulldozer_engine_speed < 10) {
_module_data->target_bulldozer_engine_speed++;
}
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-左按钮"));
}
}
else if (button == 1) {
if (!pressed) {
if (_module_data->target_bulldozer_engine_speed > 0) {
_module_data->target_bulldozer_engine_speed--;
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-右按钮"));
}
}
}
else if (button == 6) {
if (!pressed) {
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右手柄-中间按钮"));
}
}
}
else if (joyIndex == 2) {//左手柄
if (button == 0) {
_module_data->target_bulldozer_fall_gear = pressed;
//global_signal::instance()->PublishMsgToWinodw(QStringLiteral("降档"));
}
else if (button == 1) {
_module_data->target_bulldozer_rise_gear = pressed;
//global_signal::instance()->PublishMsgToWinodw(QStringLiteral("升档"));
}
else if (button == 6) {
if (!pressed) {
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左手柄-中间按钮"));
}
}
}
}
void bulldozer_module::parseData(const QString& data)
//#include <QString>
//#include <QStringList>
//#include <QMap>
//#include <iostream>
//#include <QThread>
//#include <QByteArray>
//#include <QDebug>
//#include <QVector>
//bulldozer_module::bulldozer_module(const QString& ip, quint16 port, QObject* parent)
// : QObject(parent)
//{
// QThread* _pthread = new QThread(this);
// _udp_thread = new udp_thread(ip, port, "bulldozer", this);
//
// connect(_udp_thread, &udp_thread::udp_received_data, this, &bulldozer_module::no_udp_received_data);
// connect(_pthread, &QThread::finished, this, &bulldozer_module::deleteLater);
// connect(this, &bulldozer_module::destroyed, _pthread, &QThread::deleteLater);
// this->moveToThread(_pthread);
// _pthread->start();
// qDebug() << "bulldozer_module thread ID: " << QThread::currentThreadId();
//
//}
//
//bulldozer_module::~bulldozer_module()
//{
//
//}
//
//void bulldozer_module::no_udp_received_data(const QByteArray& data)
//{
// parseData(data);
//}
//
//
//void bulldozer_module::parseData(const QString& data)
//{
// // 将数据字符串按 "#" 分割成字符串列表
// QStringList dataList = data.split("#");
// // 创建一个键值对的映射表
// QMap<QString, QString> values;
// // 遍历数据列表中的每个条目
// foreach(const QString & entry, dataList)
// {
// // 将每个条目按 "=" 分割成键和值
// QStringList keyValue = entry.split("=");
//
// if (keyValue.size() == 2)
// {
// // 如果键值对的数量为2,则将键和值存储到映射表中
// QString key = keyValue[0];
// QString value = keyValue[1];
// values[key] = value;
// }
// }
//
// // 读取解析后的值
// // 将映射表中的值转换为相应的数据类型
// int left = values.value("left").toInt();
// int right = values.value("right").toInt();
// QStringList joy1Values = values.value("joy1_f_b_l_r").split("_");
// QStringList joy2Values = values.value("joy2_f_b_l_r").split("_");
// int joy1_f = joy1Values.value(0).toInt();
// int joy1_b = joy1Values.value(1).toInt();
// int joy1_l = joy1Values.value(2).toInt();
// int joy1_r = joy1Values.value(3).toInt();
// int joy2_f = joy2Values.value(0).toInt();
// int joy2_b = joy2Values.value(1).toInt();
// int joy2_l = joy2Values.value(2).toInt();
// int joy2_r = joy2Values.value(3).toInt();
//
// // 检查按钮状态
// // 检查映射表中是否包含特定的键
// bool bt1_down = data.contains("bt1_down");
// bool bt2_down = data.contains("bt2_down");
//
// // 执行其他处理逻辑
// left = handleControlData(left);
// // 增加帧计数
// // 输出解析结果
// std::cout << "left: " << left << std::endl;
// std::cout << "right: " << right << std::endl;
// std::cout << "joy1_f: " << joy1_f << std::endl;
// std::cout << "joy1_b: " << joy1_b << std::endl;
// std::cout << "joy1_l: " << joy1_l << std::endl;
// std::cout << "joy1_r: " << joy1_r << std::endl;
// std::cout << "joy2_f: " << joy2_f << std::endl;
// std::cout << "joy2_b: " << joy2_b << std::endl;
// std::cout << "joy2_l: " << joy2_l << std::endl;
// std::cout << "joy2_r: " << joy2_r << std::endl;
// std::cout << "bt1_down: " << (bt1_down ? "true" : "false") << std::endl;
// std::cout << "bt2_down: " << (bt2_down ? "true" : "false") << std::endl;
//}
//
//int bulldozer_module::handleControlData(const int currentLeftValue)
//{
// static int previousLeftValue = 0;
// static int frameCount = 0;
//
// // 检查是否需要丢弃当前帧的值
// if (frameCount > 0 && qAbs(previousLeftValue - currentLeftValue) > 20) {
// global_signal::instance()->PublishMsgToWinodw("Dropping frame - Left value jump detected!");
// }
// else {
// previousLeftValue = currentLeftValue;
// }
//
// // 更新上一帧的左侧值
//
// // 执行其他处理逻辑
//
// // 增加帧计数
// frameCount = 1;
// return previousLeftValue;
//}
/*
* 左手柄joy2 向左0- -78
* 向前0- -90
* 向后0- 78
* 向右0- 90
* B 0 左按钮
* B 1 右按钮
* B 6 中间按钮
*
** 左手柄joy0 ax0向左0- -78
* ax1向前0- -90
* ax1 向后0- 78
* ax 0 向右0- 90
* B 0 左按钮
* B 1 右按钮
* B 6 中间按钮
*右踏板 joy1 ax2 -100- 100
*
* 左 joy1 ax3 -100- 100
*
int bulldozer_module::handleControlData(const double currentLeftValue)
{
QStringList dataList = data.split("#");
QMap<QString, QString> values;
foreach(const QString & entry, dataList)
{
QStringList keyValue = entry.split("=");
if (keyValue.size() == 2)
{
QString key = keyValue[0];
QString value = keyValue[1];
values[key] = value;
}
else if (entry.endsWith("bt1_down#"))
{
QString key = "bt1_down";
values[key] = "";
}
else if (entry.endsWith("bt2_down#"))
{
QString key = "bt2_down";
values[key] = "";
}
}
// 读取解析后的值
int left = values.value("left").toInt();
int right = values.value("right").toInt();
QStringList joy1Values = values.value("joy1_f_b_l_r").split("_");
QStringList joy2Values = values.value("joy2_f_b_l_r").split("_");
int joy1_f = joy1Values.value(0).toInt();
int joy1_b = joy1Values.value(1).toInt();
int joy1_l = joy1Values.value(2).toInt();
int joy1_r = joy1Values.value(3).toInt();
int joy2_f = joy2Values.value(0).toInt();
int joy2_b = joy2Values.value(1).toInt();
int joy2_l = joy2Values.value(2).toInt();
int joy2_r = joy2Values.value(3).toInt();
// 检查按钮状态
bool bt1_down = values.contains("bt1_down");
bool bt2_down = values.contains("bt2_down");
// 输出解析结果
std::cout << "left: " << left << std::endl;
std::cout << "right: " << right << std::endl;
std::cout << "joy1_f: " << joy1_f << std::endl;
std::cout << "joy1_b: " << joy1_b << std::endl;
std::cout << "joy1_l: " << joy1_l << std::endl;
std::cout << "joy1_r: " << joy1_r << std::endl;
std::cout << "joy2_f: " << joy2_f << std::endl;
std::cout << "joy2_b: " << joy2_b << std::endl;
std::cout << "joy2_l: " << joy2_l << std::endl;
std::cout << "joy2_r: " << joy2_r << std::endl;
std::cout << "bt1_down: " << (bt1_down ? "true" : "false") << std::endl;
std::cout << "bt2_down: " << (bt2_down ? "true" : "false") << std::endl;
static double previousLeftValue = 0;
static double frameCount = 0;
static const int frameThreshold = 3; // 设置帧数阈值
// 检查是否需要丢弃当前帧的值
if (frameCount > frameThreshold && qAbs(previousLeftValue - currentLeftValue) > 30.0) {
qDebug() << "Dropping frame - Left value jump detected!";
return 0;
}
// 更新上一帧的左侧值
previousLeftValue = currentLeftValue;
// 执行其他处理逻辑
// 增加帧计数
frameCount++;
if (frameCount > frameThreshold) {
frameCount = frameThreshold; // 限制帧数不超过阈值
}
}
*/
\ No newline at end of file
#pragma once
#include <QObject>
#include "udp_thread.h"
#include "module_data.h"
#include "joy_thread.h"
//#include "udp_thread.h"
class bulldozer_module : public QObject
{
......@@ -11,10 +13,18 @@ public:
explicit bulldozer_module(const QString& ip, quint16 port, QObject* parent = nullptr);
~bulldozer_module();
int mapRange(double value, double fromMin, double fromMax, double toMin, double toMax);
public slots:
void no_udp_received_data(const QByteArray& data);
private:
void parseData(const QString& data);
void analyze_seat_axis(int joyIndex, int axis, double value);
void analyze_seat_button(int joyIndex, int button, bool pressed);
//public slots:
// void no_udp_received_data(const QByteArray& data);
//private:
// void parseData(const QString& data);
// int handleControlData(const int currentLeftValue);
private:
udp_thread* _udp_thread = nullptr;
//udp_thread* _udp_thread = nullptr;
joy_thread* _joy_thread = nullptr;
std::shared_ptr<module_data> _module_data = nullptr;
};
......@@ -15,13 +15,16 @@ chair_code::chair_code(QWidget* parent)
_network_module = new network_module();//开启网联模块
_control_module = new control_module();//读取座椅指令
_remote_module = new remote_module();//读取座椅指令
_control_module = new control_module();//开启下发控制
qDebug() << "chair_code thread ID: " << QThread::currentThreadId();
}
chair_code::~chair_code()
{
_module_data->joy_enable = false;//关闭jou使能
logger_module::release();//释放log记录
acquire_config::release();//释放获取配置
feedback_data::release();//释放车铲反馈数据
......@@ -51,6 +54,8 @@ void chair_code::initialize_main_window()//初始化界面
connect(global_signal::instance(), &global_signal::error_logger, this, &chair_code::record_error_logger_clicked);
connect(global_signal::instance(), &global_signal::info_logger, this, &chair_code::record_info_logger_clicked);
//
if (_module_data->chair_type == _SHOVEL) {
}
......
#pragma once
#pragma once
#include <QtWidgets/QMainWindow>
#include <QTimer>
......@@ -7,13 +7,14 @@
#include "acquire_config.h"
#include "logger_module.h"
#include "network_module.h"
#include "control_module.h"
#include "remote_module.h"
#include "grpc_module.h"
#include "module_data.h"
#include "feedback_data.h"
#include "control_module.h"
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")// 该指令仅支持VS环境
#pragma execution_character_set("utf-8")// 该指令仅支持VS环境
#endif
class chair_code : public QMainWindow
......@@ -22,15 +23,15 @@ class chair_code : public QMainWindow
public:
explicit chair_code(QWidget *parent = nullptr);
explicit chair_code(QWidget* parent = nullptr);
~chair_code();
private:
void initialize_main_window();//始化界面
void initialize_car_chair_gui();//初始化车座椅界面。
void refresh_car_status_gui();//刷新车界面的显示状态。
void show_car_chair_status_list();//显示车座椅状态列表。
void initialize_main_window();//初始化界面
void initialize_car_chair_gui();//初始化车座椅界面。
void refresh_car_status_gui();//刷新车界面的显示状态。
void show_car_chair_status_list();//显示车座椅状态列表。
private slots:
......@@ -45,16 +46,17 @@ private slots:
private:
Ui::chair_codeClass* ui;
QTimer* _refresh_reveal_timer = nullptr;
//QTimer* _refresh_reveal_timer;//刷新界面显示定时器
//QTimer* _refresh_reveal_timer;//刷新界面显示定时器
grpc_module* _grpc_module = nullptr;
network_module* _network_module = nullptr;
remote_module* _remote_module = nullptr;
control_module* _control_module = nullptr;
//std::unique_ptr<QTimer> _refresh_reveal_timer;
//std::unique_ptr<grpc_module> _grpc_module;
//std::unique_ptr<network_module> _network_module;
//std::unique_ptr<control_module> _control_module;
//单例类
//单例类
std::shared_ptr<acquire_config> _acquire_config = nullptr;
std::shared_ptr<module_data> _module_data = nullptr;
std::shared_ptr<feedback_data> _feedback_data = nullptr;
......
......@@ -102,6 +102,7 @@
<ClCompile Include="car_chair.grpc.pb.cc" />
<ClCompile Include="car_chair.pb.cc" />
<ClCompile Include="control_module.cpp" />
<ClCompile Include="remote_module.cpp" />
<ClCompile Include="feedback_data.cpp" />
<ClCompile Include="feishi_module.cpp" />
<ClCompile Include="grpc_module.cpp" />
......@@ -141,8 +142,9 @@
<QtMoc Include="joy_thread.h" />
<QtMoc Include="moza_module.h" />
<QtMoc Include="gzy_module.h" />
<QtMoc Include="control_module.h" />
<QtMoc Include="remote_module.h" />
<QtMoc Include="feishi_module.h" />
<QtMoc Include="control_module.h" />
<ClInclude Include="shovel_chair.grpc.pb.h" />
<ClInclude Include="shovel_chair.pb.h" />
<ClInclude Include="shovel_server_impl.h" />
......
......@@ -91,7 +91,7 @@
<ClCompile Include="gzy_module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="control_module.cpp">
<ClCompile Include="remote_module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="feishi_module.cpp">
......@@ -100,6 +100,9 @@
<ClCompile Include="bulldozer_module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="control_module.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="shovel_server_impl.h">
......@@ -176,7 +179,7 @@
<QtMoc Include="gzy_module.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="control_module.h">
<QtMoc Include="remote_module.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="feishi_module.h">
......@@ -185,5 +188,8 @@
<QtMoc Include="bulldozer_module.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="control_module.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -2,9 +2,9 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2023-12-04T03:03:49.9005770Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-12-05T01:42:00.7679855Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2023-12-04T08:03:26.9085734Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-12-05T01:42:00.9065592Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -27,14 +27,14 @@ hardware_host=192.168.9.53;//蝖砌辣摨扳P 鈭摨扳誘 敶
hardware_to_chair_port=18855;//硬件座椅端口 用于接收座椅指令数据
[Car]
chair_name=bulldozer;//gzy:湖州的白色座椅 bulldozer:挖机
chair_name=moza;//gzy:湖州的白色座椅 bulldozer:挖机
chair_sn=car_chair_shihao;//本座椅的sn
device_sn=;//默认所控的sn
chair_host=192.168.9.198;//座椅程序IP
chair_port=8801;//座椅程序端口
chair_port=8805;//座椅程序端口
chair_to_device_port=8801;//座椅程序下发控制指令的端口
grpc_to_chair_port=50052;//pad到座椅的指令端口,grpc server ip
hardware_host=192.168.9.53;//硬件座椅IP 用于接收座椅指令数据 当与座椅进行tcp 通信时需要
hardware_to_chair_port=18855;//硬件座椅端口 用于接收座椅指令数据
hardware_host=192.168.9.120;//硬件座椅IP 用于接收座椅指令数据 当与座椅进行tcp 通信时需要
hardware_to_chair_port=11888;//硬件座椅端口 用于接收座椅指令数据
brake_ignore=20.0;//刹车忽略值
steering_ignore=1.0;//方向盘忽略值
\ No newline at end of file
#include "control_module.h"
#include "global_signal.h"
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QDateTime>
#include <QTimer>
control_module::control_module(QObject* parent)
: QObject(parent)
{
_module_data = module_data::instance();//全局数据中转
QTimer* _send_cmd_timer = new QTimer(this);
_udp_thread = new udp_thread(_module_data->chair_host, _module_data->chair_port, "control_module");
connect(_send_cmd_timer, &QTimer::timeout, this, &control_module::on_send_cmd_timer);
connect(_udp_thread, &udp_thread::udp_received_data, this, &control_module::no_udp_received_data);
_send_cmd_timer->setTimerType(Qt::PreciseTimer);
_send_cmd_timer->start(100);
if (_module_data->chair_name == "moza") {
_moza_module = new moza_module();//实例moza 解析类
}
else if (_module_data->chair_name == "feishi") {
_feishi_module = new feishi_module(_module_data->hardware_host, _module_data->hardware_to_chair_port);
}
else if (_module_data->chair_name == "gzy") {//湖州的白色座椅
_gzy_module = new gzy_module();//实例moza 解析类
//_joy_thread = new joy_thread();//实例读座椅数据 解析类
//connect(_joy_thread, &joy_thread::joy_received_button, _gzy_module, &gzy_module::analyze_seat_button);
//connect(_joy_thread, &joy_thread::joy_received_axis, _gzy_module, &gzy_module::analyze_seat_axis);
}
else if (_module_data->chair_name == "bulldozer") {//临时兼容推土机ID3
_bulldozer_module = new bulldozer_module("", _module_data->hardware_to_chair_port);
}
//_udp_thread = new udp_thread(_module_data->chair_host, _module_data->chair_to_device_port, "car");
//_udp_thread->udp_write_date("qwertyuiop", "192.168.1.3", 23456);
//_joy_thread = new joy_thread();
qDebug() << "control_module thread ID: " << QThread::currentThreadId();
}
control_module::~control_module()
{
}
void control_module::on_send_cmd_timer()
{
QByteArray dataarray = bulldozer_generate_realtime_control_message();
_udp_thread->udp_write_date(dataarray, _module_data->hardware_host, _module_data->hardware_to_chair_port);
}
void control_module::no_udp_received_data(const QByteArray& data)
{
global_signal::instance()->PublishMsgToWinodw(data);
}
QByteArray control_module::bulldozer_generate_realtime_control_message()
{
QJsonObject JparamsObject;
JparamsObject.insert("sn", _module_data->chair_sn);
JparamsObject.insert("unlock", _module_data->target_bulldozer_unlock);
JparamsObject.insert("drive_mode", _module_data->target_bulldozer_mode_switch);
JparamsObject.insert("horn", _module_data->target_bulldozer_horn);
JparamsObject.insert("light", _module_data->target_bulldozer_light);
JparamsObject.insert("forward_backward", _module_data->target_bulldozer_forward_backward);
/*JparamsObject.insert("forward", _module_data->target_bulldozer_forward);
JparamsObject.insert("backward", _module_data->target_bulldozer_backward);*/
JparamsObject.insert("left_right", _module_data->target_bulldozer_left_right);
/*JparamsObject.insert("left", _module_data->target_bulldozer_left);
JparamsObject.insert("right", _module_data->target_bulldozer_right);*/
JparamsObject.insert("throttle", _module_data->target_bulldozer_throttle);
JparamsObject.insert("rise_gear", _module_data->target_bulldozer_rise_gear);
JparamsObject.insert("fall_gear", _module_data->target_bulldozer_fall_gear);
JparamsObject.insert("lift_lower", _module_data->target_bulldozer_lift_lower);
/*JparamsObject.insert("lift", _module_data->target_bulldozer_lift);
JparamsObject.insert("lower", _module_data->target_bulldozer_lower);*/
JparamsObject.insert("tilt_left_right", _module_data->target_bulldozer_tilt_left_right);
/*JparamsObject.insert("tilt_left", _module_data->target_bulldozer_tilt_left);
JparamsObject.insert("tilt_right", _module_data->target_bulldozer_tilt_right);*/
JparamsObject.insert("engine_speed", _module_data->target_bulldozer_engine_speed);
JparamsObject.insert("timestamp", QString::number(QDateTime::currentMSecsSinceEpoch() / 1000));
QJsonDocument document;
document.setObject(JparamsObject);
QByteArray JparamsObjectarray = document.toJson(QJsonDocument::Compact);
QJsonObject JdataObject;
JdataObject.insert("method", _module_data->remote_chair_control_message + _module_data->chair_sn);
JdataObject.insert("params", JparamsObjectarray.data());
document.setObject(JdataObject);
QByteArray dataarray = "1@" + document.toJson(QJsonDocument::Compact);
return dataarray;
}
#pragma once
#include <QObject>
#include "udp_thread.h"
#include "module_data.h"
#include "gzy_module.h"
#include "moza_module.h"
#include "feishi_module.h"
#include "bulldozer_module.h"
class control_module : public QObject
{
......@@ -18,15 +12,14 @@ public:
explicit control_module(QObject* parent = nullptr);
~control_module();
private:
//单例类
std::shared_ptr<module_data> _module_data = nullptr;
QByteArray bulldozer_generate_realtime_control_message();
moza_module* _moza_module = nullptr;
gzy_module* _gzy_module = nullptr;
feishi_module* _feishi_module = nullptr;
bulldozer_module* _bulldozer_module = nullptr;
public slots:
void no_udp_received_data(const QByteArray& data);
private slots:
void on_send_cmd_timer();
private:
udp_thread* _udp_thread = nullptr;
joy_thread* _joy_thread = nullptr;
std::shared_ptr<module_data> _module_data = nullptr;
};
#include "gzy_module.h"
#include "gzy_module.h"
#include "global_signal.h"
#include <QTimer>
#include <QTime>
gzy_module::gzy_module(QObject *parent)
gzy_module::gzy_module(QObject* parent)
: QObject(parent)
{
_module_data = module_data::instance();//全局数据中转
_module_data = module_data::instance();//全局数据中转
QTimer* epb_timer = new QTimer(this);
connect(epb_timer, &QTimer::timeout, this, &gzy_module::analyze_seat_epb);
......@@ -19,7 +19,7 @@ gzy_module::~gzy_module()
}
void gzy_module::analyze_seat_axis(int axis, double value)
void gzy_module::analyze_seat_axis(int joyIndex, int axis, double value)
{
if (axis == 0) {
//_module_data->steering = -(value * 100) - _module_data->set_steering_val;
......@@ -46,84 +46,84 @@ void gzy_module::analyze_seat_axis(int axis, double value)
}
void gzy_module::analyze_seat_button(int button, bool pressed)
void gzy_module::analyze_seat_button(int joyIndex, int button, bool pressed)
{
button += 1;
static bool G_P = false; static bool G_R = false; static bool G_N = false; static bool G_D = false;
if (button == 1) {
if (!pressed) {
global_signal::instance()->record_info_logger("cmd", "电");
global_signal::instance()->record_info_logger("cmd", "下电");
}
else {
global_signal::instance()->record_info_logger("cmd", "电");
global_signal::instance()->record_info_logger("cmd", "上电");
}
}
else if (button == 2) {
if (pressed) {
_module_data->target_left_light = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左转灯开"));
_module_data->target_left_light = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左转灯开"));
}
else {
_module_data->target_left_light = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左转灯关"));
_module_data->target_left_light = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("左转灯关"));
}
}
else if (button == 3) {
if (pressed) {
_module_data->target_right_light = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右转灯开"));
_module_data->target_right_light = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右转灯开"));
}
else {
_module_data->target_right_light = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右转灯关"));
_module_data->target_right_light = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("右转灯关"));
}
}
else if (button == 4) {
if (pressed) {
_module_data->target_low_beam = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("光灯开"));
_module_data->target_low_beam = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("近光灯开"));
}
else {
_module_data->target_low_beam = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("光灯关"));
_module_data->target_low_beam = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("近光灯关"));
}
}
else if (button == 5) {
if (pressed) {
_module_data->target_high_beam = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("远光灯开"));
_module_data->target_high_beam = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("远光灯开"));
}
else {
_module_data->target_high_beam = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("远光灯关"));
_module_data->target_high_beam = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("远光灯关"));
}
}
else if (button == 6) {
if (pressed) {
global_signal::instance()->record_info_logger("cmd", "全带开");
global_signal::instance()->record_info_logger("cmd", "安全带开");
}
else {
global_signal::instance()->record_info_logger("cmd", "全带关");
global_signal::instance()->record_info_logger("cmd", "安全带关");
}
}
else if (button == 7) {
if (pressed) {
global_signal::instance()->record_info_logger("cmd", "宽开");
global_signal::instance()->record_info_logger("cmd", "示宽开");
}
else {
global_signal::instance()->record_info_logger("cmd", "宽关");
global_signal::instance()->record_info_logger("cmd", "示宽关");
}
}
else if (button == 8) {}
else if (((button == 9) || (button == 10) || (button == 11) || (button == 12)) && (!handbrake)) {
if (button == 9) {
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
}
if (button == 10) {
G_N = pressed;
}
if (button == 11) {
G_R = pressed;
_module_data->target_gear = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 R 档"));
_module_data->target_gear = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 R 档"));
}
if (button == 12) {
G_D = pressed; _module_data->target_gear = 3; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 D 档"));
G_D = pressed; _module_data->target_gear = 3; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 D 档"));
}
if (!G_P && !G_R && !G_D) {
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
}
}
......@@ -133,18 +133,18 @@ void gzy_module::analyze_seat_button(int button, bool pressed)
}
else if (button == 16) {
if (pressed) {
_module_data->target_emergency_stop = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("停关"));
_module_data->target_emergency_stop = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("急停关"));
}
else {
_module_data->target_emergency_stop = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("停开"));
_module_data->target_emergency_stop = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("急停开"));
}
}
else if (button == 17) {
if (pressed) {
_module_data->target_horn = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("叭开"));
_module_data->target_horn = 1; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("喇叭开"));
}
else {
_module_data->target_horn = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("叭关"));
_module_data->target_horn = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("喇叭关"));
}
}
}
......@@ -165,10 +165,10 @@ void gzy_module::analyze_seat_epb()
{
if (handbrake)
{
_module_data->target_gear = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 P 档"));
_module_data->target_gear = 0; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 P 档"));
}
else {
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
_module_data->target_gear = 2; global_signal::instance()->PublishMsgToWinodw(QStringLiteral("档位切换到 N 档"));
}
time = 0;
handbraketim = 0;
......
#pragma once
#pragma once
#include <QObject>
#include "module_data.h"
......@@ -12,13 +12,13 @@ public:
~gzy_module();
public slots:
void analyze_seat_axis(int axis, double value);
void analyze_seat_button(int button, bool pressed);
void analyze_seat_axis(int joyIndex, int axis, double value);
void analyze_seat_button(int joyIndex, int button, bool pressed);
private slots:
void analyze_seat_epb();
private:
//
//单例类
std::shared_ptr<module_data> _module_data = nullptr;
bool handbrakesta = false;
......
......@@ -4,6 +4,7 @@
joy_thread::joy_thread(QObject* parent)
: QObject(parent)
{
_module_data = module_data::instance();//全局数据中转
QFuture<void> future = QtConcurrent::run(this, &joy_thread::call_hardware_data);
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("开启 joy_thread ."));
}
......@@ -33,13 +34,101 @@ void joy_thread::call_hardware_data()
}
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("已经连接到座椅 %1.").arg(joyIndex));
detection[joyIndex] = true;
}
else {
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("没有检测到座椅 %1.").arg(joyIndex));
}
}
_module_data->joy_enable = true;
while (_module_data->joy_enable) {
for (int joyIndex = 0; joyIndex < joyCount; ++joyIndex) {
if (!detection[joyIndex]) {
continue;
}
sf::Joystick::update();
int buttonCount = sf::Joystick::getButtonCount(joyIndex);
if (buttonCount != previousButtonCount[joyIndex]) {
previousButtonCount[joyIndex] = buttonCount;
}
if (axisCount[joyIndex] != previousAxisCount[joyIndex]) {
previousAxisCount[joyIndex] = axisCount[joyIndex];
}
for (int button = 0; button < buttonCount; ++button) {
if (button < sf::Joystick::getButtonCount(joyIndex)) {
bool state = sf::Joystick::isButtonPressed(joyIndex, button);
if (state != previousButtonStates[joyIndex][button]) {
previousButtonStates[joyIndex][button] = state;
emit joy_received_button(joyIndex, button, state);
global_signal::instance()->record_debug_logger("joyIndex: " + QString::number(joyIndex) + " button: " + QString::number(button, 10) + " " + QString::number(state, 10));
}
}
}
for (int axis = 0; axis < axisCount[joyIndex]; ++axis) {
if (sf::Joystick::hasAxis(joyIndex, static_cast<sf::Joystick::Axis>(axis))) {
double position = sf::Joystick::getAxisPosition(joyIndex, static_cast<sf::Joystick::Axis>(axis));
emit joy_received_axis(joyIndex, axis, position);
global_signal::instance()->PublishMsgToWinodw("joyIndex: " + QString::number(joyIndex) + " axis: " + QString::number(axis, 10) + " " + QString::number(position, 'f'));
}
}
}
QThread::msleep(20);
}
}
/*#include "joy_thread.h" 可以获取唯一标识符
#include "global_signal.h"
joy_thread::joy_thread(QObject* parent)
: QObject(parent)
{
_module_data = module_data::instance();//全局数据中转
QFuture<void> future = QtConcurrent::run(this, &joy_thread::call_hardware_data);
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("开启 joy_thread ."));
}
joy_thread::~joy_thread()
{
}
void joy_thread::call_hardware_data()
{
const int joyCount = sf::Joystick::Count;
bool detection[joyCount] = { false };
int axisCount[joyCount] = { 0 };
int previousButtonCount[joyCount] = { 0 };
int previousAxisCount[joyCount] = { 0 };
bool previousButtonStates[joyCount][sf::Joystick::ButtonCount] = { false };
std::string joystickGuids[joyCount];
while (true) {
for (int joyIndex = 0; joyIndex < joyCount; ++joyIndex) {
sf::Joystick::update();
if (sf::Joystick::isConnected(joyIndex)) {
sf::Joystick::getButtonCount(joyIndex);
axisCount[joyIndex] = 0;
while (sf::Joystick::hasAxis(joyIndex, static_cast<sf::Joystick::Axis>(axisCount[joyIndex]))) {
axisCount[joyIndex]++;
}
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("已经连接到座椅 %1.").arg(joyIndex));
detection[joyIndex] = true;
// 获取手柄的唯一标识符(GUID)
joystickGuids[joyIndex] = sf::Joystick::getGuid(joyIndex);
}
else {
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("没有检测到座椅 %1.").arg(joyIndex));
}
}
_module_data->joy_enable = true;
while (_module_data->joy_enable) {
for (int joyIndex = 0; joyIndex < joyCount; ++joyIndex) {
if (!detection[joyIndex]) {
continue;
......@@ -62,8 +151,82 @@ void joy_thread::call_hardware_data()
bool state = sf::Joystick::isButtonPressed(joyIndex, button);
if (state != previousButtonStates[joyIndex][button]) {
previousButtonStates[joyIndex][button] = state;
emit joy_received_button(joyIndex, button, state);
global_signal::instance()->record_debug_logger("joyIndex: " + QString::number(joyIndex) + " button: " + QString::number(button, 10) + " " + QString::number(state, 10));
}
}
}
for (int axis = 0; axis < axisCount[joyIndex]; ++axis) {
if (sf::Joystick::hasAxis(joyIndex, static_cast<sf::Joystick::Axis>(axis))) {
double position = sf::Joystick::getAxisPosition(joyIndex, static_cast<sf::Joystick::Axis>(axis));
emit joy_received_axis(joyIndex, axis, position);
global_signal::instance()->PublishMsgToWinodw("joyIndex: " + QString::number(joyIndex) + " axis: " + QString::number(axis, 10) + " " + QString::number(position, 'f'));
}
}
// 打印手柄的唯一标识符(GUID)
global_signal::instance()->PublishMsgToWinodw("joyIndex: " + QString::number(joyIndex) + " GUID: " + QString::fromStdString(joystickGuids[joyIndex]));
}
QThread::msleep(20);
}
}
*/
/*#include "joy_thread.h"
#include "global_signal.h"
joy_thread::joy_thread(QObject* parent)
: QObject(parent)
{
QFuture<void> future = QtConcurrent::run(this, &joy_thread::call_hardware_data);
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("开启 joy_thread ."));
}
joy_thread::~joy_thread()
{
}
void joy_thread::call_hardware_data()
{
const int joyCount = sf::Joystick::Count;
bool detection[joyCount] = { false };
int axisCount[joyCount] = { 0 };
int previousButtonCount[joyCount] = { 0 };
int previousAxisCount[joyCount] = { 0 };
bool previousButtonStates[joyCount][sf::Joystick::ButtonCount] = { false };
while (true) {
for (int joyIndex = 0; joyIndex < joyCount; ++joyIndex) {
sf::Joystick::update();
if (sf::Joystick::isConnected(joyIndex)) {
if (!detection[joyIndex]) {
sf::Joystick::getButtonCount(joyIndex);
axisCount[joyIndex] = 0;
while (sf::Joystick::hasAxis(joyIndex, static_cast<sf::Joystick::Axis>(axisCount[joyIndex]))) {
axisCount[joyIndex]++;
}
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("已经连接到座椅 %1.").arg(joyIndex));
detection[joyIndex] = true;
}
int buttonCount = sf::Joystick::getButtonCount(joyIndex);
if (buttonCount != previousButtonCount[joyIndex]) {
previousButtonCount[joyIndex] = buttonCount;
}
if (axisCount[joyIndex] != previousAxisCount[joyIndex]) {
previousAxisCount[joyIndex] = axisCount[joyIndex];
}
for (int button = 0; button < buttonCount; ++button) {
if (button < sf::Joystick::getButtonCount(joyIndex)) {
bool state = sf::Joystick::isButtonPressed(joyIndex, button);
if (state != previousButtonStates[joyIndex][button]) {
previousButtonStates[joyIndex][button] = state;
emit joy_received_button(button, state);
//global_signal::instance()->record_debug_logger("joyIndex: " + QString::number(joyIndex) + " button: " + QString::number(button, 10) + " " + QString::number(state, 10));
global_signal::instance()->record_debug_logger("joyIndex: " + QString::number(joyIndex) + " button: " + QString::number(button, 10) + " " + QString::number(state, 10));
}
}
}
......@@ -72,13 +235,27 @@ void joy_thread::call_hardware_data()
if (sf::Joystick::hasAxis(joyIndex, static_cast<sf::Joystick::Axis>(axis))) {
double position = sf::Joystick::getAxisPosition(joyIndex, static_cast<sf::Joystick::Axis>(axis));
emit joy_received_axis(axis, position);
//global_signal::instance()->PublishMsgToWinodw("joyIndex: " + QString::number(joyIndex) + " axis: " + QString::number(axis, 10) + " " + QString::number(position, 'f'));
global_signal::instance()->PublishMsgToWinodw("joyIndex: " + QString::number(joyIndex) + " axis: " + QString::number(axis, 10) + " " + QString::number(position, 'f'));
}
}
}
else {
if (detection[joyIndex]) {
global_signal::instance()->PublishMsgToWinodw(QStringLiteral("座椅 %1 已断开连接.").arg(joyIndex));
detection[joyIndex] = false;
// 处理设备断开连接的情况,例如重置相关变量或发出信号通知其他模块
// 例如:
// emit joy_disconnected(joyIndex);
// reset_variables(joyIndex);
}
}
}
QThread::msleep(20);
}
}
*/
/*
#include "joy_thread.h"
......
#pragma once
#pragma once
#include <QtCore>
#include <SFML/Window.hpp>
......@@ -6,6 +6,7 @@
#include <QObject>
#include <QFuture>
#include <QtConcurrent>
#include "module_data.h"
class joy_thread : public QObject
{
......@@ -18,10 +19,10 @@ protected:
void call_hardware_data();
signals:
void joy_received_button(int button, bool pressed);
void joy_received_axis(int axis, double value);
void joy_received_button(int joyIndex, int button, bool pressed);
void joy_received_axis(int joyIndex, int axis, double value);
private:
std::shared_ptr<module_data> _module_data = nullptr;
};
\ No newline at end of file
......@@ -2,11 +2,9 @@
#include <QtWidgets/QApplication>
#include <QTextCodec>
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
chair_code w;
w.show();
return a.exec();
......
......@@ -56,6 +56,7 @@ public:
QString current_chair_device_sn = "";//当前座椅的sn
QString current_chair_device_name = "";//当前座椅的name
qint64 current_chair_device_id = 0;//当前座椅的id
//铲控制数据
int work_state = 0;//工作状态: 0其他 1装载中 2空闲
int emrg_stop = 0;//急停:0关闭 1开启
......@@ -129,6 +130,27 @@ public:
//double network_latency = 0.0;//数据延迟
int target_drywetroad_state = 0;//增加干湿路 0默认常态干路,1湿路
// 推土机控制指令
int target_bulldozer_forward_backward = 0; // 前进后退
int target_bulldozer_forward = 0; // 推土机前进指令
int target_bulldozer_backward = 0; // 推土机后退指令
int target_bulldozer_left_right = 0; //左转右转
int target_bulldozer_left = 0; // 推土机左转指令
int target_bulldozer_right = 0; // 推土机右转指令
int target_bulldozer_rise_gear = 0; // 推土机升档位指令
int target_bulldozer_fall_gear = 0; // 推土机降档位指令
int target_bulldozer_throttle = 0; // 推土机油门指令
int target_bulldozer_lift_lower = 0;//升降铲
int target_bulldozer_lift = 0; // 推土机提铲指令
int target_bulldozer_lower = 0; // 推土机降铲指令
int target_bulldozer_tilt_left_right = 0; //左右倾斜
int target_bulldozer_tilt_left = 0; // 推土机左倾斜指令
int target_bulldozer_tilt_right = 0; // 推土机右倾斜指令
int target_bulldozer_engine_speed = 0; // 推土机发动机调速指令
int target_bulldozer_unlock = 0; // 推土机解锁指令
int target_bulldozer_mode_switch = 0; // 推土机模式切换指令
int target_bulldozer_horn = 0; // 推土机喇叭指令
int target_bulldozer_light = 0; // 推土机灯光指令
//程序中转数据 QString all_canbind_device_json = "";
......@@ -178,7 +200,7 @@ public:
bool mqtt_enable_cert = false;//使能 mqtt ssl
bool grpc_enable_cert = false;//使能 grpc ssl
bool publish_control_sign = false;//使能下发控制数据
bool joy_enable = false;//开启joy使能
private:
......
......@@ -15,7 +15,7 @@ moza_module::~moza_module()
}
void moza_module::analyze_seat_axis(int axis, double value)
void moza_module::analyze_seat_axis(int joyIndex, int axis, double value)
{
double is_value = 0;
if (axis == 0) {
......@@ -44,7 +44,7 @@ void moza_module::analyze_seat_axis(int axis, double value)
}
}
void moza_module::analyze_seat_button(int button, bool pressed)
void moza_module::analyze_seat_button(int joyIndex, int button, bool pressed)
{
switch (button)
{
......
......@@ -12,8 +12,8 @@ public:
~moza_module();
public slots:
void analyze_seat_axis(int axis, double value);
void analyze_seat_button(int button, bool pressed);
void analyze_seat_axis(int joyIndex, int axis, double value);
void analyze_seat_button(int joyIndex, int button, bool pressed);
private:
//单例类
......
......@@ -48,3 +48,4 @@ network_module::~network_module()
{
}
#include "remote_module.h"
remote_module::remote_module(QObject* parent)
: QObject(parent)
{
_module_data = module_data::instance();//全局数据中转
if (_module_data->chair_name == "moza") {
_moza_module = new moza_module();//实例moza 解析类
}
else if (_module_data->chair_name == "feishi") {
_feishi_module = new feishi_module(_module_data->hardware_host, _module_data->hardware_to_chair_port);
}
else if (_module_data->chair_name == "gzy") {//湖州的白色座椅
_gzy_module = new gzy_module();//实例moza 解析类
//_joy_thread = new joy_thread();//实例读座椅数据 解析类
//connect(_joy_thread, &joy_thread::joy_received_button, _gzy_module, &gzy_module::analyze_seat_button);
//connect(_joy_thread, &joy_thread::joy_received_axis, _gzy_module, &gzy_module::analyze_seat_axis);
}
else if (_module_data->chair_name == "bulldozer") {//临时兼容推土机ID3
_bulldozer_module = new bulldozer_module("", _module_data->hardware_to_chair_port);
}
//_udp_thread = new udp_thread(_module_data->chair_host, _module_data->chair_to_device_port, "car");
//_udp_thread->udp_write_date("qwertyuiop", "192.168.1.3", 23456);
//_joy_thread = new joy_thread();
}
remote_module::~remote_module()
{
}
#pragma once
#include <QObject>
#include "module_data.h"
#include "gzy_module.h"
#include "moza_module.h"
#include "feishi_module.h"
#include "bulldozer_module.h"
class remote_module : public QObject
{
Q_OBJECT
public:
explicit remote_module(QObject* parent = nullptr);
~remote_module();
private:
//单例类
std::shared_ptr<module_data> _module_data = nullptr;
moza_module* _moza_module = nullptr;
gzy_module* _gzy_module = nullptr;
feishi_module* _feishi_module = nullptr;
bulldozer_module* _bulldozer_module = nullptr;
};
[2023-12-05 09:50:56.148] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 09:50:56.423] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 09:56:59.869] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 09:57:00.138] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 10:19:37.927] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 10:19:38.309] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 10:43:45.061] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 10:43:45.377] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 10:45:35.013] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 10:45:35.321] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 10:49:25.799] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 10:49:26.084] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 11:09:53.178] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 11:09:53.529] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 11:28:22.955] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 11:28:23.244] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 11:31:17.616] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 11:31:17.901] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 12:09:44.357] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 12:09:44.649] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 12:11:31.603] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 12:11:31.915] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 12:54:44.315] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 12:54:44.608] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 12:58:59.253] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 12:58:59.541] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 13:01:01.368] [logger4] [debug] [bulldozer]:_udp_socket port:18855
[2023-12-05 13:01:01.648] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:00:47.073] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:08:44.662] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:12:21.124] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:13:53.030] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:16:00.430] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:17:06.596] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-05 14:20:20.202] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 09:55:50.197] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 09:57:09.388] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:37:01.358] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:38:05.831] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:50:25.255] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:51:01.739] [logger4] [debug] [control_module]:_udp_socket port:8805
[2023-12-06 16:51:02.030] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:51:56.460] [logger4] [debug] [control_module]:_udp_socket port:8805
[2023-12-06 16:51:56.753] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:52:58.505] [logger4] [debug] [control_module]:_udp_socket port:8805
[2023-12-06 16:52:58.794] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-06 16:55:54.734] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-06 16:55:55.032] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-07 13:48:24.992] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-07 13:48:25.242] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-07 17:38:24.877] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-07 17:38:25.694] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 10:13:33.374] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-08 10:13:33.792] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 15:29:31.178] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-08 15:29:32.134] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 15:33:43.237] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-08 15:33:44.096] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 15:40:58.568] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-08 15:40:58.984] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 15:46:20.449] [logger4] [debug] [control_module]:_udp_socket port:8801
[2023-12-08 15:46:20.787] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 17:39:28.805] [logger4] [debug] [control_module]:_udp_socket port:8805
[2023-12-08 17:39:29.150] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
[2023-12-08 17:57:03.573] [logger4] [debug] [control_module]:_udp_socket port:8805
[2023-12-08 17:57:03.913] [logger4] [debug] Invalid IP address: 192.168.9.111:50052
......@@ -8,15 +8,14 @@ udp_thread::udp_thread(const QString& ip, quint16 port, const QString& type, QOb
connect_ip = ip;
connect_port = port;
connect_type = type;
_udp_socket = new QUdpSocket(this);
if (!_udp_socket->bind(connect_port, QUdpSocket::ShareAddress)) {
// 处理绑定失败的情况
global_signal::instance()->record_debug_logger("[" + connect_type + "]:_udp_socket bind failed");
return;
}
global_signal::instance()->record_debug_logger("[" + connect_type + "]:_udp_socket port:" + QString::number(connect_port, 10));
if (!connect(_udp_socket, &QUdpSocket::readyRead, this, &udp_thread::on_udp_readyread)) {
// 处理连接失败的情况
global_signal::instance()->record_debug_logger("[" + connect_type + "]:_udp_socket connect failed");
......@@ -41,6 +40,7 @@ void udp_thread::on_udp_readyread()
_udp_socket->readDatagram(receivedData.data(), receivedData.size(), &device_address, &device_port);
if (!receivedData.isEmpty())
{
qDebug() << device_address;
emit udp_received_data(receivedData);
}
}
......
d:\exploit\vsproject\chair\chair_code\x64\release\uic\ui_chair_code.h
d:\exploit\vsproject\chair\chair_code\x64\release\rcc\qrc_chair_code.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_chair_code.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_udp_thread.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_tcp_thread.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_feedback_data.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_logger_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_bulldozer_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_http_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_network_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_joy_thread.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_moza_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_gzy_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_control_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_feishi_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_module_data.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_grpc_module.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_global_signal.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc\moc_acquire_config.cpp
d:\exploit\vsproject\chair\x64\release\abseil_dll.dll
d:\exploit\vsproject\chair\x64\release\fmt.dll
d:\exploit\vsproject\chair\x64\release\libcrypto-3-x64.dll
d:\exploit\vsproject\chair\x64\release\libprotobuf-lite.dll
d:\exploit\vsproject\chair\x64\release\libprotobuf.dll
d:\exploit\vsproject\chair\x64\release\libssl-3-x64.dll
d:\exploit\vsproject\chair\x64\release\re2.dll
d:\exploit\vsproject\chair\x64\release\sfml-window-2.dll
d:\exploit\vsproject\chair\x64\release\sfml-system-2.dll
d:\exploit\vsproject\chair\x64\release\zlib1.dll
d:\exploit\vsproject\chair\x64\release\cares.dll
d:\vsproject\chair\chair_code\x64\release\uic\ui_chair_code.h
d:\vsproject\chair\chair_code\x64\release\rcc\qrc_chair_code.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_chair_code.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_udp_thread.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_tcp_thread.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_feedback_data.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_logger_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_bulldozer_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_http_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_network_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_joy_thread.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_moza_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_gzy_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_control_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_feishi_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_module_data.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_grpc_module.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_global_signal.cpp
d:\vsproject\chair\chair_code\x64\release\moc\moc_acquire_config.cpp
d:\exploit\vsproject\chair\chair_code\x64\release\moc_chair_code.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_tcp_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\qrc_chair_code.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_global_signal.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_acquire_config.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_http_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_feedback_data.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_logger_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_bulldozer_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_feishi_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_joy_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_network_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_gzy_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_module_data.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_control_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_moza_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_grpc_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moc_udp_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\module_data.obj
d:\exploit\vsproject\chair\chair_code\x64\release\udp_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\grpc_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\joy_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\acquire_config.obj
d:\exploit\vsproject\chair\chair_code\x64\release\gzy_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\chair_code.obj
d:\exploit\vsproject\chair\chair_code\x64\release\http_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\moza_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\tcp_thread.obj
d:\exploit\vsproject\chair\chair_code\x64\release\feedback_data.obj
d:\exploit\vsproject\chair\chair_code\x64\release\shovel_chair.pb.obj
d:\exploit\vsproject\chair\chair_code\x64\release\feishi_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\car_chair.pb.obj
d:\exploit\vsproject\chair\chair_code\x64\release\car_chair.grpc.pb.obj
d:\exploit\vsproject\chair\chair_code\x64\release\logger_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\control_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\shovel_chair.grpc.pb.obj
d:\exploit\vsproject\chair\chair_code\x64\release\bulldozer_module.obj
d:\exploit\vsproject\chair\chair_code\x64\release\main.obj
d:\exploit\vsproject\chair\chair_code\x64\release\network_module.obj
d:\vsproject\chair\chair_code\x64\release\http_module.obj
d:\vsproject\chair\chair_code\x64\release\network_module.obj
d:\vsproject\chair\chair_code\x64\release\shovel_chair.grpc.pb.obj
d:\vsproject\chair\chair_code\x64\release\gzy_module.obj
d:\vsproject\chair\chair_code\x64\release\tcp_thread.obj
d:\vsproject\chair\chair_code\x64\release\car_chair.pb.obj
d:\vsproject\chair\chair_code\x64\release\logger_module.obj
d:\vsproject\chair\chair_code\x64\release\feishi_module.obj
d:\vsproject\chair\chair_code\x64\release\feedback_data.obj
d:\vsproject\chair\chair_code\x64\release\shovel_chair.pb.obj
d:\vsproject\chair\chair_code\x64\release\bulldozer_module.obj
d:\vsproject\chair\chair_code\x64\release\grpc_module.obj
d:\vsproject\chair\chair_code\x64\release\moza_module.obj
d:\vsproject\chair\chair_code\x64\release\car_chair.grpc.pb.obj
d:\vsproject\chair\chair_code\x64\release\acquire_config.obj
d:\vsproject\chair\chair_code\x64\release\module_data.obj
d:\vsproject\chair\chair_code\x64\release\udp_thread.obj
d:\vsproject\chair\chair_code\x64\release\control_module.obj
d:\vsproject\chair\chair_code\x64\release\joy_thread.obj
d:\exploit\vsproject\chair\x64\release\chair_code.exe
d:\vsproject\chair\chair_code\x64\release\chair_code.obj
d:\vsproject\chair\chair_code\x64\release\main.obj
d:\vsproject\chair\chair_code\x64\release\moc_acquire_config.obj
d:\vsproject\chair\chair_code\x64\release\moc_bulldozer_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_chair_code.obj
d:\vsproject\chair\chair_code\x64\release\moc_control_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_feedback_data.obj
d:\vsproject\chair\chair_code\x64\release\moc_feishi_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_global_signal.obj
d:\vsproject\chair\chair_code\x64\release\moc_grpc_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_gzy_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_http_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_joy_thread.obj
d:\vsproject\chair\chair_code\x64\release\moc_logger_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_module_data.obj
d:\vsproject\chair\chair_code\x64\release\moc_moza_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_network_module.obj
d:\vsproject\chair\chair_code\x64\release\moc_tcp_thread.obj
d:\vsproject\chair\chair_code\x64\release\moc_udp_thread.obj
d:\vsproject\chair\chair_code\x64\release\qrc_chair_code.obj
d:\vsproject\chair\x64\release\chair_code.exe
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\chair_code.write.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\cl.10388.write.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\cl.command.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\cl.items.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\cl.read.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\link.command.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\link.read.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\link.write.1.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\moc.read.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\moc.write.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\rcc.read.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\rcc.write.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\uic.read.1u.tlog
d:\vsproject\chair\chair_code\x64\release\chair_code.tlog\uic.write.1u.tlog
 bulldozer_module.cpp
car_chair.grpc.pb.cc
 car_chair.grpc.pb.cc
car_chair.pb.cc
chair_code.cpp
grpc_module.cpp
main.cpp
shovel_chair.grpc.pb.cc
shovel_chair.pb.cc
udp_thread.cpp
D:\vsProject\chair\chair_code\module_data.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 grpc_module.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 car_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 shovel_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 grpc_module.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(449,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 car_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(286,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 shovel_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(700,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 shovel_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\module_data.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 main.cpp)
D:\vsProject\chair\chair_code\module_data.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 chair_code.cpp)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(286,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 shovel_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(449,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 car_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(700,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 shovel_chair.grpc.pb.cc)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(286,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 grpc_module.cpp)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(700,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 grpc_module.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 grpc_module.cpp)
......@@ -26,8 +26,8 @@ D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(700,1): warning C4819: 隸・
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(286,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 chair_code.cpp)
D:\vsProject\chair\chair_code\shovel_chair.grpc.pb.h(700,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 chair_code.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 main.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(449,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 main.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 chair_code.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(449,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 main.cpp)
D:\vsProject\chair\chair_code\car_chair.grpc.pb.h(449,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 (编译源文件 chair_code.cpp)
moc_chair_code.cpp
moc_grpc_module.cpp
......
......@@ -3,6 +3,7 @@ D:\vsProject\chair\chair_code\bulldozer_module.cpp;D:\vsProject\chair\chair_code
D:\vsProject\chair\chair_code\car_chair.grpc.pb.cc;D:\vsProject\chair\chair_code\x64\Release\car_chair.grpc.pb.obj
D:\vsProject\chair\chair_code\car_chair.pb.cc;D:\vsProject\chair\chair_code\x64\Release\car_chair.pb.obj
D:\vsProject\chair\chair_code\control_module.cpp;D:\vsProject\chair\chair_code\x64\Release\control_module.obj
D:\vsProject\chair\chair_code\remote_module.cpp;D:\vsProject\chair\chair_code\x64\Release\remote_module.obj
D:\vsProject\chair\chair_code\feedback_data.cpp;D:\vsProject\chair\chair_code\x64\Release\feedback_data.obj
D:\vsProject\chair\chair_code\feishi_module.cpp;D:\vsProject\chair\chair_code\x64\Release\feishi_module.obj
D:\vsProject\chair\chair_code\grpc_module.cpp;D:\vsProject\chair\chair_code\x64\Release\grpc_module.obj
......@@ -31,8 +32,9 @@ D:\vsProject\chair\chair_code\x64\Release\moc\moc_network_module.cpp;D:\vsProjec
D:\vsProject\chair\chair_code\x64\Release\moc\moc_joy_thread.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_joy_thread.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_moza_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_moza_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_gzy_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_gzy_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_control_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_control_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_remote_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_remote_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_feishi_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_feishi_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_control_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_control_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_module_data.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_module_data.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_grpc_module.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_grpc_module.obj
D:\vsProject\chair\chair_code\x64\Release\moc\moc_global_signal.cpp;D:\vsProject\chair\chair_code\x64\Release\moc_global_signal.obj
......
......@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_bulldozer_module_t {
QByteArrayData data[4];
char stringdata0[44];
QByteArrayData data[9];
char stringdata0[91];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
......@@ -33,13 +33,19 @@ struct qt_meta_stringdata_bulldozer_module_t {
static const qt_meta_stringdata_bulldozer_module_t qt_meta_stringdata_bulldozer_module = {
{
QT_MOC_LITERAL(0, 0, 16), // "bulldozer_module"
QT_MOC_LITERAL(1, 17, 20), // "no_udp_received_data"
QT_MOC_LITERAL(2, 38, 0), // ""
QT_MOC_LITERAL(3, 39, 4) // "data"
QT_MOC_LITERAL(1, 17, 17), // "analyze_seat_axis"
QT_MOC_LITERAL(2, 35, 0), // ""
QT_MOC_LITERAL(3, 36, 8), // "joyIndex"
QT_MOC_LITERAL(4, 45, 4), // "axis"
QT_MOC_LITERAL(5, 50, 5), // "value"
QT_MOC_LITERAL(6, 56, 19), // "analyze_seat_button"
QT_MOC_LITERAL(7, 76, 6), // "button"
QT_MOC_LITERAL(8, 83, 7) // "pressed"
},
"bulldozer_module\0no_udp_received_data\0"
"\0data"
"bulldozer_module\0analyze_seat_axis\0\0"
"joyIndex\0axis\0value\0analyze_seat_button\0"
"button\0pressed"
};
#undef QT_MOC_LITERAL
......@@ -49,7 +55,7 @@ static const uint qt_meta_data_bulldozer_module[] = {
8, // revision
0, // classname
0, 0, // classinfo
1, 14, // methods
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
......@@ -57,10 +63,12 @@ static const uint qt_meta_data_bulldozer_module[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 1, 19, 2, 0x0a /* Public */,
1, 3, 24, 2, 0x0a /* Public */,
6, 3, 31, 2, 0x0a /* Public */,
// slots: parameters
QMetaType::Void, QMetaType::QByteArray, 3,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Double, 3, 4, 5,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Bool, 3, 7, 8,
0 // eod
};
......@@ -71,7 +79,8 @@ void bulldozer_module::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int
auto *_t = static_cast<bulldozer_module *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->no_udp_received_data((*reinterpret_cast< const QByteArray(*)>(_a[1]))); break;
case 0: _t->analyze_seat_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
case 1: _t->analyze_seat_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3]))); break;
default: ;
}
}
......@@ -106,13 +115,13 @@ int bulldozer_module::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 1)
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 1;
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 1)
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 1;
_id -= 2;
}
return _id;
}
......
......@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_control_module_t {
QByteArrayData data[1];
char stringdata0[15];
QByteArrayData data[5];
char stringdata0[60];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
......@@ -32,10 +32,15 @@ struct qt_meta_stringdata_control_module_t {
)
static const qt_meta_stringdata_control_module_t qt_meta_stringdata_control_module = {
{
QT_MOC_LITERAL(0, 0, 14) // "control_module"
QT_MOC_LITERAL(0, 0, 14), // "control_module"
QT_MOC_LITERAL(1, 15, 20), // "no_udp_received_data"
QT_MOC_LITERAL(2, 36, 0), // ""
QT_MOC_LITERAL(3, 37, 4), // "data"
QT_MOC_LITERAL(4, 42, 17) // "on_send_cmd_timer"
},
"control_module"
"control_module\0no_udp_received_data\0"
"\0data\0on_send_cmd_timer"
};
#undef QT_MOC_LITERAL
......@@ -45,22 +50,35 @@ static const uint qt_meta_data_control_module[] = {
8, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x0a /* Public */,
4, 0, 27, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void, QMetaType::QByteArray, 3,
QMetaType::Void,
0 // eod
};
void control_module::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
if (_c == QMetaObject::InvokeMetaMethod) {
auto *_t = static_cast<control_module *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->no_udp_received_data((*reinterpret_cast< const QByteArray(*)>(_a[1]))); break;
case 1: _t->on_send_cmd_timer(); break;
default: ;
}
}
}
QT_INIT_METAOBJECT const QMetaObject control_module::staticMetaObject = { {
......@@ -89,6 +107,17 @@ void *control_module::qt_metacast(const char *_clname)
int control_module::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 2;
}
return _id;
}
QT_WARNING_POP
......
......@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_gzy_module_t {
QByteArrayData data[9];
char stringdata0[93];
QByteArrayData data[10];
char stringdata0[102];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
......@@ -35,16 +35,17 @@ static const qt_meta_stringdata_gzy_module_t qt_meta_stringdata_gzy_module = {
QT_MOC_LITERAL(0, 0, 10), // "gzy_module"
QT_MOC_LITERAL(1, 11, 17), // "analyze_seat_axis"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 4), // "axis"
QT_MOC_LITERAL(4, 35, 5), // "value"
QT_MOC_LITERAL(5, 41, 19), // "analyze_seat_button"
QT_MOC_LITERAL(6, 61, 6), // "button"
QT_MOC_LITERAL(7, 68, 7), // "pressed"
QT_MOC_LITERAL(8, 76, 16) // "analyze_seat_epb"
QT_MOC_LITERAL(3, 30, 8), // "joyIndex"
QT_MOC_LITERAL(4, 39, 4), // "axis"
QT_MOC_LITERAL(5, 44, 5), // "value"
QT_MOC_LITERAL(6, 50, 19), // "analyze_seat_button"
QT_MOC_LITERAL(7, 70, 6), // "button"
QT_MOC_LITERAL(8, 77, 7), // "pressed"
QT_MOC_LITERAL(9, 85, 16) // "analyze_seat_epb"
},
"gzy_module\0analyze_seat_axis\0\0axis\0"
"value\0analyze_seat_button\0button\0"
"gzy_module\0analyze_seat_axis\0\0joyIndex\0"
"axis\0value\0analyze_seat_button\0button\0"
"pressed\0analyze_seat_epb"
};
#undef QT_MOC_LITERAL
......@@ -63,13 +64,13 @@ static const uint qt_meta_data_gzy_module[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 2, 29, 2, 0x0a /* Public */,
5, 2, 34, 2, 0x0a /* Public */,
8, 0, 39, 2, 0x08 /* Private */,
1, 3, 29, 2, 0x0a /* Public */,
6, 3, 36, 2, 0x0a /* Public */,
9, 0, 43, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Double, 3, 4,
QMetaType::Void, QMetaType::Int, QMetaType::Bool, 6, 7,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Double, 3, 4, 5,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Bool, 3, 7, 8,
QMetaType::Void,
0 // eod
......@@ -81,8 +82,8 @@ void gzy_module::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
auto *_t = static_cast<gzy_module *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->analyze_seat_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< double(*)>(_a[2]))); break;
case 1: _t->analyze_seat_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
case 0: _t->analyze_seat_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
case 1: _t->analyze_seat_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3]))); break;
case 2: _t->analyze_seat_epb(); break;
default: ;
}
......
......@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_joy_thread_t {
QByteArrayData data[8];
char stringdata0[76];
QByteArrayData data[9];
char stringdata0[85];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
......@@ -35,15 +35,17 @@ static const qt_meta_stringdata_joy_thread_t qt_meta_stringdata_joy_thread = {
QT_MOC_LITERAL(0, 0, 10), // "joy_thread"
QT_MOC_LITERAL(1, 11, 19), // "joy_received_button"
QT_MOC_LITERAL(2, 31, 0), // ""
QT_MOC_LITERAL(3, 32, 6), // "button"
QT_MOC_LITERAL(4, 39, 7), // "pressed"
QT_MOC_LITERAL(5, 47, 17), // "joy_received_axis"
QT_MOC_LITERAL(6, 65, 4), // "axis"
QT_MOC_LITERAL(7, 70, 5) // "value"
QT_MOC_LITERAL(3, 32, 8), // "joyIndex"
QT_MOC_LITERAL(4, 41, 6), // "button"
QT_MOC_LITERAL(5, 48, 7), // "pressed"
QT_MOC_LITERAL(6, 56, 17), // "joy_received_axis"
QT_MOC_LITERAL(7, 74, 4), // "axis"
QT_MOC_LITERAL(8, 79, 5) // "value"
},
"joy_thread\0joy_received_button\0\0button\0"
"pressed\0joy_received_axis\0axis\0value"
"joy_thread\0joy_received_button\0\0"
"joyIndex\0button\0pressed\0joy_received_axis\0"
"axis\0value"
};
#undef QT_MOC_LITERAL
......@@ -61,12 +63,12 @@ static const uint qt_meta_data_joy_thread[] = {
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 2, 24, 2, 0x06 /* Public */,
5, 2, 29, 2, 0x06 /* Public */,
1, 3, 24, 2, 0x06 /* Public */,
6, 3, 31, 2, 0x06 /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Bool, 3, 4,
QMetaType::Void, QMetaType::Int, QMetaType::Double, 6, 7,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Bool, 3, 4, 5,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Double, 3, 7, 8,
0 // eod
};
......@@ -77,21 +79,21 @@ void joy_thread::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
auto *_t = static_cast<joy_thread *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->joy_received_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
case 1: _t->joy_received_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< double(*)>(_a[2]))); break;
case 0: _t->joy_received_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3]))); break;
case 1: _t->joy_received_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (joy_thread::*)(int , bool );
using _t = void (joy_thread::*)(int , int , bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&joy_thread::joy_received_button)) {
*result = 0;
return;
}
}
{
using _t = void (joy_thread::*)(int , double );
using _t = void (joy_thread::*)(int , int , double );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&joy_thread::joy_received_axis)) {
*result = 1;
return;
......@@ -141,16 +143,16 @@ int joy_thread::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
}
// SIGNAL 0
void joy_thread::joy_received_button(int _t1, bool _t2)
void joy_thread::joy_received_button(int _t1, int _t2, bool _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t2))) };
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t2))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t3))) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void joy_thread::joy_received_axis(int _t1, double _t2)
void joy_thread::joy_received_axis(int _t1, int _t2, double _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t2))) };
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t2))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t3))) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
QT_WARNING_POP
......
......@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_moza_module_t {
QByteArrayData data[8];
char stringdata0[77];
QByteArrayData data[9];
char stringdata0[86];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
......@@ -35,15 +35,16 @@ static const qt_meta_stringdata_moza_module_t qt_meta_stringdata_moza_module = {
QT_MOC_LITERAL(0, 0, 11), // "moza_module"
QT_MOC_LITERAL(1, 12, 17), // "analyze_seat_axis"
QT_MOC_LITERAL(2, 30, 0), // ""
QT_MOC_LITERAL(3, 31, 4), // "axis"
QT_MOC_LITERAL(4, 36, 5), // "value"
QT_MOC_LITERAL(5, 42, 19), // "analyze_seat_button"
QT_MOC_LITERAL(6, 62, 6), // "button"
QT_MOC_LITERAL(7, 69, 7) // "pressed"
QT_MOC_LITERAL(3, 31, 8), // "joyIndex"
QT_MOC_LITERAL(4, 40, 4), // "axis"
QT_MOC_LITERAL(5, 45, 5), // "value"
QT_MOC_LITERAL(6, 51, 19), // "analyze_seat_button"
QT_MOC_LITERAL(7, 71, 6), // "button"
QT_MOC_LITERAL(8, 78, 7) // "pressed"
},
"moza_module\0analyze_seat_axis\0\0axis\0"
"value\0analyze_seat_button\0button\0"
"moza_module\0analyze_seat_axis\0\0joyIndex\0"
"axis\0value\0analyze_seat_button\0button\0"
"pressed"
};
#undef QT_MOC_LITERAL
......@@ -62,12 +63,12 @@ static const uint qt_meta_data_moza_module[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 2, 24, 2, 0x0a /* Public */,
5, 2, 29, 2, 0x0a /* Public */,
1, 3, 24, 2, 0x0a /* Public */,
6, 3, 31, 2, 0x0a /* Public */,
// slots: parameters
QMetaType::Void, QMetaType::Int, QMetaType::Double, 3, 4,
QMetaType::Void, QMetaType::Int, QMetaType::Bool, 6, 7,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Double, 3, 4, 5,
QMetaType::Void, QMetaType::Int, QMetaType::Int, QMetaType::Bool, 3, 7, 8,
0 // eod
};
......@@ -78,8 +79,8 @@ void moza_module::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
auto *_t = static_cast<moza_module *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->analyze_seat_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< double(*)>(_a[2]))); break;
case 1: _t->analyze_seat_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
case 0: _t->analyze_seat_axis((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
case 1: _t->analyze_seat_button((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< bool(*)>(_a[3]))); break;
default: ;
}
}
......
/****************************************************************************
** Meta object code from reading C++ file 'remote_module.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.14.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include <memory>
#include "../../../remote_module.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'remote_module.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.14.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_remote_module_t {
QByteArrayData data[1];
char stringdata0[14];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_remote_module_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_remote_module_t qt_meta_stringdata_remote_module = {
{
QT_MOC_LITERAL(0, 0, 13) // "remote_module"
},
"remote_module"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_remote_module[] = {
// content:
8, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void remote_module::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
QT_INIT_METAOBJECT const QMetaObject remote_module::staticMetaObject = { {
QMetaObject::SuperData::link<QObject::staticMetaObject>(),
qt_meta_stringdata_remote_module.data,
qt_meta_data_remote_module,
qt_static_metacall,
nullptr,
nullptr
} };
const QMetaObject *remote_module::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *remote_module::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_remote_module.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int remote_module::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;NDEBUG;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB</Qt_DEFINES_>
<Qt_INCLUDEPATH_>C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_INCLUDEPATH_>C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus</Qt_CL_OPTIONS_>
......
......@@ -5,3 +5,23 @@ QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_MSC_VER \
QMAKE_MSC_FULL_VER
QMAKE_CXX.INCDIRS = \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\include" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\atlmfc\\include" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include" \
"D:\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\UnitTest\\include" \
"D:\\Windows Kits\\10\\Include\\10.0.22621.0\\um" \
"D:\\Windows Kits\\10\\Include\\10.0.22621.0\\shared" \
"D:\\Windows Kits\\10\\Include\\10.0.22621.0\\winrt" \
"D:\\Windows Kits\\10\\Include\\10.0.22621.0\\cppwinrt" \
Include\\um \
D:\\gitpak\\vcpkg\\installed\\x64-windows\\include
QMAKE_CXX.LIBDIRS = \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\lib\\x64" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\atlmfc\\lib\\x64" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\lib\\x64" \
"D:\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64" \
"D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\UnitTest\\lib" \
"D:\\Windows Kits\\10\\lib\\10.0.22621.0\\um\\x64" \
lib\\um\\x64
Info: creating stash file C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1\.qmake.stash
Info: creating stash file C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj\.qmake.stash
Broken filename passed to function
......@@ -34,7 +34,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Release|x64&apos;">
<ClCompile>
<AdditionalIncludeDirectories>C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>.\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Qt_DEFINES_>_WINDOWS;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;NDEBUG;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;QT_CONCURRENT_LIB;QT_CORE_LIB</Qt_DEFINES_>
<Qt_INCLUDEPATH_>C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\xpmk4a0f.dx1;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_INCLUDEPATH_>C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtWidgets;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtGui;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtANGLE;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtNetwork;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtSerialPort;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtConcurrent;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\include\QtCore;C:\Users\boonray\AppData\Local\Temp\oae3wvi2.krj;/include;C:\Qt\Qt5.14.0\5.14.0\msvc2017_64\mkspecs\win32-msvc</Qt_INCLUDEPATH_>
<Qt_STDCPP_></Qt_STDCPP_>
<Qt_RUNTIME_>MultiThreadedDLL</Qt_RUNTIME_>
<Qt_CL_OPTIONS_>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus</Qt_CL_OPTIONS_>
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论