当前位置: 首页 > wzjs >正文

从化建网站建站企业网站

从化建网站,建站企业网站,网络营销主页,浏览器主页2025年6月21-22日工作日志 一、主要工作内容 诊断函数封装与优化 初步完成了EMERGENCY_AUXILIARY_PROPULSION类的封装,统一管理主推进器的诊断逻辑和阈值配置。 实现功能: 时序检查:封装checkOutputTiming和checkFeedbackTiming,…

2025年6月21-22日工作日志


一、主要工作内容

  1. 诊断函数封装与优化

    • 初步完成了EMERGENCY_AUXILIARY_PROPULSION类的封装,统一管理主推进器的诊断逻辑和阈值配置。

    • 实现功能:

      • 时序检查:封装checkOutputTimingcheckFeedbackTiming,支持动态阈值配置。
      • 状态诊断:完成RPM、电压、电流、温度等参数的解析与状态检查(如checkRPMStatuscheckVoltageStatus)。
      • 故障检测:封装补偿器液位、伸缩机构状态、接近开关等故障检测逻辑(如checkFaultBits1Status)。
    • 新增功能:

      • 支持通过set/get方法动态调整阈值(如setTimingThresholds)。

      • 提供数据解析工具函数(如parseRPMparseVoltage)。

        #pragma once#include <cstdint>
        #include <string>
        #include <array>class MAIN_PROPULSION_CAN {
        public:// 阈值配置结构体struct TimingThresholds {int64_t output_no_response;    // 无输出阈值(微秒)int64_t output_too_fast;      // 输出过快阈值(微秒)int64_t output_too_slow;      // 输出过慢阈值(微秒)int64_t feedback_normal;      // 反馈正常阈值(微秒)int64_t feedback_slow;       // 反馈较慢阈值(微秒)int64_t feedback_no_response; // 无反馈阈值(微秒)};struct RPMThresholds {int16_t min_rpm;            // 最小转速int16_t max_rpm;            // 最大转速bool allow_negative;        // 是否允许负转速
        };struct VoltageThresholds {uint16_t min_voltage;      // 最小电压值 (0V)uint16_t max_voltage;      // 最大电压值 (根据实际系统设置)uint16_t high_voltage_threshold; // 高电压阈值
        };struct CurrentThresholds {uint16_t max_current;      // 最大电流值 (255A)
        };struct TemperatureThresholds {uint8_t max_motor_temp;    // 电机最高温度 (150℃)uint8_t max_driver_temp;   // 驱动器最高温度 (150℃)
        };// 阈值设置
        static void setTimingThresholds(const TimingThresholds& thresholds);
        static void setRPMThresholds(const RPMThresholds& thresholds);
        static void setVoltageThresholds(const VoltageThresholds& thresholds);
        static void setCurrentThresholds(const CurrentThresholds& thresholds);
        static void setTemperatureThresholds(const TemperatureThresholds& thresholds);// 阈值获取
        static TimingThresholds getCurrentThresholds();
        static RPMThresholds getCurrentRPMThresholds();
        static VoltageThresholds getCurrentVoltageThresholds();
        static CurrentThresholds getCurrentCurrentThresholds();
        static TemperatureThresholds getCurrentTemperatureThresholds();// 状态检查
        static int checkOutputTiming(int64_t timeInterval);
        static int checkFeedbackTiming(int64_t timeBack);
        static bool checkRPM(int16_t rpm, std::string& message);
        static int checkRPMStatus(const uint8_t* data, size_t offset);// 数据解析
        static int16_t parseRPM(const uint8_t* data, size_t offset);
        static uint16_t parseVoltage(const uint8_t data[], size_t offset);
        static uint8_t parseCurrent(const uint8_t data[], size_t offset);
        static uint8_t parseMotorTemperature(const uint8_t data[], size_t offset);
        static uint8_t parseDriverTemperature(const uint8_t data[], size_t offset);// 状态检查
        static int checkVoltageStatus(const uint8_t data[], size_t offset);
        static int checkCurrentStatus(const uint8_t data[], size_t offset);
        static int checkMotorTempStatus(const uint8_t data[],size_t motor_temp_offset);
        static int checkDriverTempStatus(const uint8_t data[],size_t driver_temp_offset);//320223
        // 状态反馈帧处理
        static uint8_t parseCompensatorLevel(const uint8_t* data, size_t offset);
        static uint8_t parseExtensionStatus(const uint8_t* data, size_t offset);
        static uint8_t parseProximitySwitches(const uint8_t* data, size_t offset);
        static uint8_t parseFaultBits1(const uint8_t* data, size_t offset);
        static uint8_t parseFaultBits2(const uint8_t* data, size_t offset);// 状态检查
        static int checkCompensatorLevelStatus(const uint8_t* data, size_t offset);
        static int checkExtensionStatus(const uint8_t* data, size_t offset);
        static int checkProximitySwitchesStatus(const uint8_t* data, size_t offset);
        static int checkFaultBits1Status(const uint8_t* data, size_t offset);
        static int checkFaultBits2Status(const uint8_t* data, size_t offset);private:static TimingThresholds currentTimingThresholds;static RPMThresholds currentRPMThresholds;static VoltageThresholds currentVoltageThresholds;static CurrentThresholds currentCurrentThresholds;static TemperatureThresholds currentTemperatureThresholds;
        };
        
  2. 辅助推进器与应急推进器封装

    • 初步完成EMERGENCY_AUXILIARY_PROPULSION_CAN类的封装。
    • 复用主推进器的诊断逻辑,调整部分阈值和状态检查规则(如应急推进器的RPM允许范围更广)。
  3. 代码可移植性改进

    • 将硬件相关参数(如CAN接口名称、缓冲区大小)通过常量定义集中管理。
    • 使用标准C++库(如<array><chrono>)替代平台特定代码。

二、代码修改示例(关键部分)

1. 诊断函数调用优化
// 原代码(分散调用)
Result_Buffer[i][packetIndex][8] = checkRPMStatus(g1_packet_buffer[i][packetIndex].data(), 26);
Result_Buffer[i][packetIndex][14] = checkVoltageStatus(g1_packet_buffer[i][packetIndex].data(), 30);// 封装后(通过类方法调用)
Result_Buffer[i][packetIndex][8] = MAIN_PROPULSION_CAN::checkRPMStatus(data, offset);
Result_Buffer[i][packetIndex][14] = MAIN_PROPULSION_CAN::checkVoltageStatus(data, offset);
2. 阈值动态配置示例
// 动态调整主推进器RPM阈值
MAIN_PROPULSION_CAN::RPMThresholds rpmThresholds = {-3000, 3000, true};
MAIN_PROPULSION_CAN::setRPMThresholds(rpmThresholds);

三、存在问题与下一步计划

  1. 未验证内容

    • 应急推进器封装代码(EMERGENCY_AUXILIARY_PROPULSION_CAN)尚未测试,可能存在阈值或解析逻辑错误。
    • 多线程环境下阈值动态调整的线程安全性需验证。
  2. 下一步任务

    • 验证可行性
      • 搭建测试环境,模拟CAN数据输入,验证应急推进器诊断逻辑的正确性。
      • 检查动态阈值修改是否实时生效。
    • 性能测试
      • 评估高负载下缓冲区(g_packet_buffer)的处理延迟。
    • 日志增强
      • 在诊断函数中添加详细错误日志输出,便于问题追踪。

四、其他备注

  • 提交代码至Git仓库,分支:feature/diagnostic-encapsulation
  • 进一步验证可行性。

作者wjj
联系方式:1816387198@qq.com


凡人修仙传:总会有办法的,他们世世代代生活在这里,毕竟凡人最擅长的就是坚强的活着。


http://www.dtcms.com/wzjs/348168.html

相关文章:

  • 唐山网站建设哪家专业视频号链接怎么获取
  • 台州做网站优化哪家好网络营销的优势
  • 网站页面策划怎么做网站seo链接购买
  • 做fpga的网站超级外链在线发布
  • 微网站推广网络推广
  • 杭州精高端网站建设搜索引擎优化涉及的内容
  • 注册公司什么网站搜索排名优化策划
  • cms开源系统手机优化什么意思
  • wordpress 数据库名贵济南做seo排名
  • 做网站优化需要做什么营销网络
  • 济南网站建设 伍际网络山西百度查关键词排名
  • 福安网站建设建设网站流程
  • wordpress 导入 微信seo引擎优化外包
  • 电子商务类型的网站广点通广告投放平台
  • 云主机建立web网站seo主要做什么工作
  • 纪检网站建设网站如何做推广
  • 龙岩天宫山缆车开放时间网站推广与优化平台
  • 舟山网站建设公司日本shopify独立站
  • 杭州网站建设招聘google推广方式和手段有哪些
  • 小程序价格多少钱seo基础培训
  • 专业手机移动网站建设网络营销团队
  • 做微信的微网站费用全球网站排名前100
  • wordpress 界面英文版韶山seo快速排名
  • 个人网站的设计与实现结论中文域名注册官网
  • 智能建站工具优化措施最新回应
  • 做网站用什么语言制作最安全百度免费推广怎么操作
  • 做淘宝站外推广网站seo代码优化
  • 厦门网站建设网站制作成都seo优化排名推广
  • 荔湾网站制作公司百度seo建议
  • 宜昌网站推广百度搜索引擎网站