Files
xiaozhi-esp32/main/boards/otto-robot/otto_emoji_display.h
小鹏 7bb17f7539 fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug (#812)
* otto v1.4.0 MCP

1.使用MCP协议控制机器人
2.gif继承lcdDisplay,避免修改lcdDisplay

* otto v1.4.1 gif as components

gif as components

* electronBot v1.1.0 mcp

1.增加electronBot支持
2.mcp协议
3.gif 作为组件
4.display子类

* 规范代码

1.规范代码
2.修复切换主题死机bug

* fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug
2025-06-13 13:46:14 +08:00

44 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <libs/gif/lv_gif.h>
#include "display/lcd_display.h"
#include "otto_emoji_gif.h"
/**
* @brief Otto机器人GIF表情显示类
* 继承LcdDisplay添加GIF表情支持
*/
class OttoEmojiDisplay : public SpiLcdDisplay {
public:
/**
* @brief 构造函数参数与SpiLcdDisplay相同
*/
OttoEmojiDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width,
int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y,
bool swap_xy, DisplayFonts fonts);
virtual ~OttoEmojiDisplay() = default;
// 重写表情设置方法
virtual void SetEmotion(const char* emotion) override;
// 重写聊天消息设置方法
virtual void SetChatMessage(const char* role, const char* content) override;
// 添加SetIcon方法声明
virtual void SetIcon(const char* icon) override;
private:
void SetupGifContainer();
lv_obj_t* emotion_gif_; ///< GIF表情组件
// 表情映射
struct EmotionMap {
const char* name;
const lv_img_dsc_t* gif;
};
static const EmotionMap emotion_maps_[];
};