Haxel Engine learning 4 -- Event System

博客介绍了Event系统代码的创建,在Event文件夹中包含4个.h文件,定义了EventCategory枚举,说明了不同事件类别之间的所属关系。还提到可以用宏来代替部分代码,最后给出了四个event文件的完整代码,并提及在Appication.cpp里添加事件及运行操作。

完整代码:https://github.com/DXT00/Hazel_study/tree/master/Event%20System

 

创建Event文件夹,包含4个.h文件 

Event.h

#pragma once

#include "Hazel/Core.h"

#include<string>
#include<functional>

namespace Hazel {
	//Events in Hazel is blocking,when an event happen 
	//,the whole APP stop and process that event.


	enum class EventType {
		None = 0,
		WindowClose, WindowResize, WindowFocus, WindowsLostFocus, WindowMoved,
		AppTick, AppUpdate, AppRender,
		KeyPressed, KeyReleased,
		MouseButtonPressed,MouseButtonRelease,MouseMoved,MouseScrolled

	};
	enum EventCategory {
		None = 0,
		EventCategoryApplication  = BIT(0),
		EventCategoryInput        = BIT(1),
		EventCategoryKeyBoard     = BIT(2),
		EventCategoryMouse        = BIT(3),
		EventCategoryMouseButton  = BIT(4)

	};

	class HAZEL_API Event {
		friend class EventDispatcher;
	public:
		virtual EventType GetEventype() const = 0;
		virtual const char* GetName() const = 0;
		virtual int GetCategoryFlags() const = 0;
		virtual std::string ToString()const { return GetName(); }

		inline bool IsInCategory(EventCategory category) {
			return GetCategoryFlags() & category;
		}
	protected:
		bool m_Handled = false; //Event是否被处理了
	};
}

Core.h

#define BIT(x) (1<<x)

 

 包含EventType 和 EventCategory 

注意EventCategory使用bit field

    enum EventCategory {
        None = 0,
        EventCategoryApplication      = BIT(0),       //0000 0000
        EventCategoryInput                = BIT(1),      //0000 0001
        EventCategoryKeyBoard        = BIT(2),      //0000 0010
        EventCategoryMouse             = BIT(3),      //0000 0100
        EventCategoryMouseButton   = BIT(4)      //0000 1000

    };

也即是:

 EventCategoryMouseButton,EventCategoryMouse, EventCategoryKeyBoard,EventCategoryInput 属于 EventCategoryApplication

 EventCategoryMouseButton,EventCategoryMouse, EventCategoryKeyBoard 属于 EventCategoryInput  

EventCategoryMouseButton 属于 EventCategoryMouse

比如 flags = 0000 0111时 ,

flags&EventCategoryMouse>0

flags&EventCategoryKeyBoard>0

flags&EventCategoryInput>0

所以flags属于EventCategoryMouse,EventCategoryKeyBoard,EventCategoryInput 3种Events

 

KeyEvent.h

class HAZEL_API KeyPressedEvent : public KeyEvent {
	public:
		KeyPressedEvent(int keycode,int repeatCount): //keep track the amount of time that the key has repeated
			KeyEvent(keycode), m_RepeatCount(repeatCount){}

		inline int GetRepeatCount() const { return m_RepeatCount; }
		
		std::string ToString()const override{
			std::stringstream ss;
			ss << "KeyPressedEvent: " << m_KeyCode << " (" << m_RepeatCount << "repeats)";
			return ss.str();
		}

		static EventType GetStaticType() { return EventType::MouseScrolled; }
		virtual EventType GetEventype()const override { return GetStaticType(); }
		virtual const char* GetName() const override { return "MouseScrolled"; }
		virtual int GetCategoryFlags() const override { return EventCategoryInput| EventCategoryMouse; }

	private:
		int m_RepeatCount;
	};

这4行可以用宏来代替: 

        static EventType GetStaticType() { return EventType::MouseScrolled; }
        virtual EventType GetEventype()const override { return GetStaticType(); }
        virtual const char* GetName() const override { return "MouseScrolled"; }
        virtual int GetCategoryFlags() const override { return EventCategoryInput| EventCategoryMouse; }

#define EVENT_CLASS_TYPE(type) static EventType GetStaticType() { return EventType::##type; }\
                                virtual EventType GetEventype()const override { return GetStaticType(); }\
                                virtual const char* GetName() const override { return #type; }

#define EVENT_CLASS_CATEGORY(category) virtual int GetCategoryFlags() const override{ return category;} 

四个event文件完整代码:

Event.h

#pragma once

#include "Hazel/Core.h"

#include<string>
#include<functional>

namespace Hazel {
	//Events in Hazel is blocking,when an event happen 
	//,the whole APP stop and process that event.


	enum class EventType {
		None = 0,
		WindowClose, WindowResize, WindowFocus, WindowsLostFocus, WindowMoved,
		AppTick, AppUpdate, AppRender,
		KeyPressed, KeyReleased,
		MouseButtonPressed,MouseButtonReleased,MouseMoved,MouseScrolled

	};
	enum EventCategory {
		None = 0,
		EventCategoryApplication  = BIT(0),
		EventCategoryInput        = BIT(1),
		EventCategoryKeyBoard     = BIT(2),
		EventCategoryMouse        = BIT(3),
		EventCategoryMouseButton  = BIT(4)


	};

#define EVENT_CLASS_TYPE(type) static EventType GetStaticType() { return EventType::##type; }\
								virtual EventType GetEventype()const override { return GetStaticType(); }\
								virtual const char* GetName() const override { return #type; }

#define EVENT_CLASS_CATEGORY(category) virtual int GetCategoryFlags() const override{ return category;}


	/*-----------------------------------------------------------------------*/
	class HAZEL_API Event {
		friend class EventDispatcher;
	public:
		virtual EventType GetEventype() const = 0;
		virtual const char * GetName() const = 0;
		virtual int GetCategoryFlags() const = 0;
		virtual std::string ToString()const { return GetName(); }

		inline bool IsInCategory(EventCategory category) {
			return GetCategoryFlags() & category;
		}
	protected:
		bool m_Handled = false; //Event是否被处理了
	};
	/*-----------------------------------------------------------------------*/
	class EventDispatcher
	{
		template<typename T>
		using EventFn = std::function<bool(T&)>; //输入参数类型 (T&),返回参数类型 bool
	public:
		EventDispatcher(Event& event)
			:m_Event(event){}

		template<typename T>
		bool Dispatch(EventFn<T> func) {
			if (m_Event.GetEventype() == T::GetStaticType()) {
				m_Event.m_Handled = func(*(T*)&m_Event);
				return true;
			}
			return false;
		}

	private:
		Event &m_Event;
	};

	inline std::ostream& operator<<(std::ostream& os, const Event&e) {
		return os << e.ToString();
	}


}

event调度类:

class EventDispatcher
	{
		template<typename T>
		using EventFn = std::function<bool(T&)>; //输入参数类型 (T&),返回参数类型 bool
	public:
		EventDispatcher(Event& event)
			:m_Event(event){}

		template<typename T>
		bool Dispatch(EventFn<T> func) {
			if (m_Event.GetEventype() == T::GetStaticType()) {
				m_Event.m_Handled = func(*(T*)&m_Event);
				return true;
			}
			return false;
		}

	private:
		Event &m_Event;
	};

Application.h

#pragma once
#include"Event.h"
#include <sstream>

namespace Hazel {

	class HAZEL_API WindowResizeEvent :public Event
	{
	public:
		WindowResizeEvent(unsigned int width, unsigned int height)
			:m_Width(width), m_Height(height){}

		inline unsigned int GetWidth() const{ return m_Width; }
		inline unsigned int GetHeight() const { return m_Height; }

		std::string ToString() const override {
			std::stringstream ss;
			ss << "WindowResizeEvent: " << GetWidth() << ", " << GetHeight();
			return ss.str();
		}
		EVENT_CLASS_TYPE(WindowResize)
		EVENT_CLASS_CATEGORY(EventCategoryApplication)


	private:
		unsigned int m_Width, m_Height;
	};

	class HAZEL_API WindowCloseEvent :public Event
	{
	public:
		WindowCloseEvent() {}

		EVENT_CLASS_TYPE(WindowClose)
		EVENT_CLASS_CATEGORY(EventCategoryApplication)

	};

	class HAZEL_API AppTickEvent :public Event
	{
	public:
		AppTickEvent() {}

		EVENT_CLASS_TYPE(AppTick)
		EVENT_CLASS_CATEGORY(EventCategoryApplication)

	};
	class HAZEL_API AppUpdateEvent :public Event
	{
	public:
		AppUpdateEvent() {}

		EVENT_CLASS_TYPE(AppUpdate)
		EVENT_CLASS_CATEGORY(EventCategoryApplication)

	};
	class HAZEL_API AppRenderEvent :public Event
	{
	public:
		AppRenderEvent() {}

		EVENT_CLASS_TYPE(AppRender)
		EVENT_CLASS_CATEGORY(EventCategoryApplication)

	};
}

KeyEvent.h

#pragma once

#include "Event.h"
#include <sstream>

namespace Hazel {


	class HAZEL_API KeyEvent:public Event //abstact 
	{
	public:
		inline int GetKeyCode()const { return m_KeyCode; }
		EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryKeyBoard)
		
	protected:
		KeyEvent(int keycode):m_KeyCode(keycode){} //you won't be able to make a KeyEvent
		int m_KeyCode;
	};


	/*-----------------------------------------------------------------------*/
	class HAZEL_API KeyPressedEvent : public KeyEvent {
	public:
		KeyPressedEvent(int keycode,int repeatCount): //keep track the amount of time that the key has repeated
			KeyEvent(keycode), m_RepeatCount(repeatCount){}

		inline int GetRepeatCount() const { return m_RepeatCount; }
		
		std::string ToString()const override{
			std::stringstream ss;
			ss << "KeyPressedEvent: " << m_KeyCode << " (" << m_RepeatCount << "repeats)";
			return ss.str();
		}

	
		EVENT_CLASS_TYPE(KeyPressed)
		EVENT_CLASS_CATEGORY( EventCategoryInput | EventCategoryKeyBoard)
	private:
		int m_RepeatCount;
	};



	/*-----------------------------------------------------------------------*/
	class HAZEL_API KeyReleasedEvent : public KeyEvent {
	public:
		KeyReleasedEvent(int keycode) : //keep track the amount of time that the key has repeated
			KeyEvent(keycode) {}

		

		std::string ToString()const override {
			std::stringstream ss;
			ss << "KeyReleasedEvent: " << m_KeyCode ;
			return ss.str();
		}


		EVENT_CLASS_TYPE(KeyReleased)
		EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryKeyBoard)
	};
}

 MouseEvent.h

#pragma once

#include "Event.h"
#include <sstream>

namespace Hazel {
	class HAZEL_API MouseMovedEvent : public Event 
	{
	public:
		MouseMovedEvent(float x,float y) : //keep track the amount of time that the key has repeated
			m_MouseX(x), m_MouseY(y) {}

		inline float GetX() const { return m_MouseX; }
		inline float GetY() const { return m_MouseY; }

		std::string ToString()const override {
			std::stringstream ss;
			ss << "MouseMovedEvent: " << GetX() << " , " << GetY();
			return ss.str();
		}

		
		EVENT_CLASS_TYPE(MouseMoved);
		EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryMouse);

	private:
		int m_MouseX,m_MouseY;
	};


	class HAZEL_API MouseScrolledEvent : public Event
	{
	public:
		MouseScrolledEvent(float xOffset, float yOffset) : //keep track the amount of time that the key has repeated
			m_XOffset(xOffset), m_YOffset(yOffset) {}

		inline float GetXOffset() const { return m_XOffset; }
		inline float GetYOffset() const { return m_YOffset; }

		std::string ToString()const override {
			std::stringstream ss;
			ss << "MouseScrolledEvent: " << GetXOffset() << " , " << GetYOffset();
			return ss.str();
		}

		EVENT_CLASS_TYPE(MouseScrolled);
		EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryMouse);

	/*	static EventType GetStaticType() { return EventType::MouseScrolled; }
		virtual EventType GetEventype()const override { return GetStaticType(); }
		virtual const char* GetName() const override { return "MouseScrolled"; }
		virtual int GetCategoryFlags() const override { return EventCategoryInput| EventCategoryMouse; }*/


	private:
		int m_XOffset, m_YOffset;
	};


	class HAZEL_API MouseButtonEvent : public Event 
	{
	public:
		inline int GetMouseButton() const { return m_Button; }
		EVENT_CLASS_CATEGORY(EventCategoryInput | EventCategoryMouse);

	protected:
		MouseButtonEvent(int button)
					:m_Button(button) {};

		int m_Button;
	};


	class HAZEL_API MouseButtonPressedEvent : public MouseButtonEvent 
	{
	public:
		MouseButtonPressedEvent(int button)
			:MouseButtonEvent(button) {};

		std::string ToString()const override {
			std::stringstream ss;
			ss << "MouseButtonPressedEvent: " << m_Button;
			return ss.str();
		}
		EVENT_CLASS_TYPE(MouseButtonPressed);

	};

	class HAZEL_API MouseButtonReleaseEvent : public MouseButtonEvent
	{
	public:
		MouseButtonReleaseEvent(int button)
			:MouseButtonEvent(button) {};

		std::string ToString()const override {
			std::stringstream ss;
			ss << "MouseButtonReleaseEvent: " << m_Button;
			return ss.str();
		}
		EVENT_CLASS_TYPE(MouseButtonReleased);

	};
}

 Appication.cpp里添加一个event:
 

#include "Application.h"
#include "Hazel/Event/ApplicationEvent.h"
#include "Hazel/Log.h"
namespace Hazel {

	Application::Application()
	{
	}
	
	
	Application::~Application()
	{
	}

	
	
	
	void Application:: Run() {
		WindowResizeEvent e(1280, 720);
		HZ_TRACE(e);
		while (true);
	}
}
	

 F5 run:

这是当前版本的结构图这是当前的结构图lufei@fedora:~/文档/聚核助手2.0$ tree -L 4 . ├── aicr.txt ├── assets │   ├── __init__.py │   └── response.mp3 ├── assistant.log ├── audio_test.py ├── backup_20250715_0859.zip ├── batch_update_entry_points.py ├── certs │   ├── ca-bundle.crt -> /etc/ssl/certs/ca-bundle.crt │   ├── eventbus.crt │   ├── eventbus.key │   └── __init__.py ├── chatgpt_importer.py ├── check_syntax.py ├── cleanup_legacy.py ├── code_metrics.csv ├── config │   ├── config.py │   ├── global_config.yaml │   ├── __init__.py │   ├── __pycache__ │   │   └── __init__.cpython-313.pyc │   └── user_config.yaml ├── config.py ├── config.yaml ├── conversations.json ├── core │   ├── aicore │   │   ├── action_manager.py │   │   ├── actions │   │   │   ├── action_dispatcher.py │   │   │   ├── action_handlers.py │   │   │   ├── actions.yaml │   │   │   ├── __init__.py │   │   │   └── __pycache__ │   │   ├── aicore.py │   │   ├── circuit_breaker.py │   │   ├── command_router.py │   │   ├── context_manager.py │   │   ├── health_monitor.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── memory │   │   │   ├── __init__.py │   │   │   ├── memory_data.json │   │   │   ├── memory_engine.py │   │   │   ├── memory.json │   │   │   ├── memory_log.txt │   │   │   ├── memory_manager.py │   │   │   └── __pycache__ │   │   ├── model_engine.py │   │   └── __pycache__ │   │   ├── action_manager.cpython-313.pyc │   │   ├── aicore.cpython-313.pyc │   │   ├── circuit_breaker.cpython-313.pyc │   │   ├── command_router.cpython-313.pyc │   │   ├── context_manager.cpython-313.pyc │   │   ├── health_monitor.cpython-313.pyc │   │   ├── __init__.cpython-313.pyc │   │   └── model_engine.cpython-313.pyc │   ├── core2_0 │   │   ├── action_dispatcher.py │   │   ├── aicore -> ../../core/aicore │   │   ├── certs │   │   │   └── __init__.py │   │   ├── cli.py │   │   ├── config_manager.py │   │   ├── config.py │   │   ├── error_logger.py │   │   ├── event_bus.py │   │   ├── framework │   │   │   └── __init__.py │   │   ├── __init__.py │   │   ├── jujue_module_generator.py │   │   ├── jumo_core.py │   │   ├── logger.py │   │   ├── module_loader.py │   │   ├── module_manager.py │   │   ├── module_watcher.py │   │   ├── __pycache__ │   │   │   ├── event_bus.cpython-313.pyc │   │   │   ├── __init__.cpython-313.pyc │   │   │   ├── reply_dispatcher.cpython-313.pyc │   │   │   └── trace_logger.cpython-313.pyc │   │   ├── query_handler.py │   │   ├── register_action.py │   │   ├── reply_dispatcher.py │   │   ├── sanhuatongyu │   │   │   ├── config.py │   │   │   ├── context.py │   │   │   ├── emergency_cli.py │   │   │   ├── entry_dispatcher.py │   │   │   ├── events │   │   │   ├── events.py │   │   │   ├── __init__.py │   │   │   ├── logger.py │   │   │   ├── master.py │   │   │   ├── metrics.py │   │   │   ├── module │   │   │   ├── monitoring │   │   │   ├── __pycache__ │   │   │   ├── run_sanhuatongyu.py │   │   │   ├── security │   │   │   ├── system_module.py │   │   │   ├── tests │   │   │   └── utils.py │   │   ├── security_manager.py │   │   ├── self_heal │   │   │   ├── __init__.py │   │   │   ├── log_analyzer.py │   │   │   ├── rollback_manager.py │   │   │   └── self_healing_scheduler.py │   │   ├── trace_logger.py │   │   └── utils.py │   ├── __init__.py │   ├── __pycache__ │   │   └── __init__.cpython-313.pyc │   └── system │   ├── __init__.py │   ├── __pycache__ │   │   ├── __init__.cpython-313.pyc │   │   ├── system_control.cpython-313.pyc │   │   └── system_sense.cpython-313.pyc │   ├── system_control.py │   └── system_sense.py ├── create_memory_module.py ├── data │   ├── __init__.py │   ├── logbook.jsonl │   ├── memory_data.json │   └── memory_log.txt ├── default_config.yaml ├── dependencies │   ├── audio_env │   │   ├── bin │   │   │   ├── activate │   │   │   ├── activate.csh │   │   │   ├── activate.fish │   │   │   ├── Activate.ps1 │   │   │   ├── autopep8 │   │   │   ├── bandit │   │   │   ├── bandit-baseline │   │   │   ├── bandit-config-generator │   │   │   ├── distro │   │   │   ├── edge-playback │   │   │   ├── edge-tts │   │   │   ├── f2py │   │   │   ├── find-corrupt-whisper-files.py │   │   │   ├── flake8 │   │   │   ├── huggingface-cli │   │   │   ├── __init__.py │   │   │   ├── isympy │   │   │   ├── jsonschema │   │   │   ├── markdown-it │   │   │   ├── normalizer │   │   │   ├── numpy-config │   │   │   ├── pbr │   │   │   ├── pip │   │   │   ├── pip3 │   │   │   ├── pip3.13 │   │   │   ├── proton │   │   │   ├── proton-viewer │   │   │   ├── pycodestyle │   │   │   ├── pyflakes │   │   │   ├── pygmentize │   │   │   ├── pylupdate6 │   │   │   ├── python -> /usr/bin/python │   │   │   ├── python3 -> python │   │   │   ├── python3.13 -> python │   │   │   ├── pyuic6 │   │   │   ├── radon │   │   │   ├── rrd2whisper.py │   │   │   ├── srt │   │   │   ├── srt-deduplicate │   │   │   ├── srt-fixed-timeshift │   │   │   ├── srt-linear-timeshift │   │   │   ├── srt-lines-matching │   │   │   ├── srt-mux │   │   │   ├── srt-normalise │   │   │   ├── srt-play │   │   │   ├── srt-process │   │   │   ├── tabulate │   │   │   ├── tiny-agents │   │   │   ├── torchfrtrace │   │   │   ├── torchrun │   │   │   ├── tqdm │   │   │   ├── transformers │   │   │   ├── transformers-cli │   │   │   ├── update-storage-times.py │   │   │   ├── watchmedo │   │   │   ├── whisper-auto-resize.py │   │   │   ├── whisper-auto-update.py │   │   │   ├── whisper-create.py │   │   │   ├── whisper-diff.py │   │   │   ├── whisper-dump.py │   │   │   ├── whisper-fetch.py │   │   │   ├── whisper-fill.py │   │   │   ├── whisper-info.py │   │   │   ├── whisper-merge.py │   │   │   ├── whisper-resize.py │   │   │   ├── whisper-set-aggregation-method.py │   │   │   ├── whisper-set-xfilesfactor.py │   │   │   └── whisper-update.py │   │   ├── include │   │   │   ├── __init__.py │   │   │   └── python3.13 │   │   ├── __init__.py │   │   ├── lib │   │   │   ├── __init__.py │   │   │   └── python3.13 │   │   ├── lib64 -> lib │   │   ├── pyvenv.cfg │   │   └── share │   │   ├── __init__.py │   │   └── man │   ├── __init__.py │   └── requirements.txt ├── dingtalk_install.sh ├── docs │   └── __init__.py ├── entry │   ├── add_entry_func.py │   ├── cli_entry │   │   ├── cli_entry.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── module.py │   │   └── __pycache__ │   │   ├── cli_entry.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── gui_entry │   │   ├── gui_main.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   └── module.py │   ├── __init__.py │   ├── __pycache__ │   │   └── __init__.cpython-313.pyc │   ├── register_and_run_entries.py │   ├── voice_entry │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── module.py │   │   └── voice_entry.py │   └── voice_input │   ├── 2 │   │   └── __init__.py │   ├── __init__.py │   ├── manifest.json │   ├── manifest.json.bak │   ├── module.py │   └── voice_input.py ├── external │   ├── cpp_example │   │   └── __init__.py │   ├── go_example │   │   └── __init__.py │   ├── __init__.py │   └── rust_example │   └── __init__.py ├── fix_ai_config.py ├── fix_all_issues.py ├── fix_and_run.sh ├── fix_cli_entry_path_and_dispatcher.py ├── fix_entry_import_paths.py ├── fix_errors.sh ├── fix_imports.py ├── fix_log_calls.py ├── fix_logger_calls.py ├── fix_logger_extra_parens.py ├── fix_logger_extra.py ├── fix_log_path.py ├── fix_package_exports.sh ├── fix_percent_format.py ├── fix_relative_imports.py ├── fix_systemmonitor.py ├── gui │   ├── aicore_gui.py │   ├── __init__.py │   ├── main_gui.py │   ├── main_gui.py.bak │   ├── utils │   │   ├── __init__.py │   │   ├── system_monitor.py │   │   ├── typing_effect.py │   │   └── voice_queue.py │   └── widgets │   ├── background_manager.py │   ├── chat_box.py │   ├── __init__.py │   ├── input_bar.py │   ├── menu_bar.py │   ├── status_panel.py │   └── voice_mode_overlay.py ├── health_checker.py ├── health_checker.py.bak ├── health_report.md ├── init_packages.py ├── init_project.sh ├── __init__.py ├── install_missing_dependencies.py ├── jindouyun_particles.py ├── juhe-main.py ├── juhe-main.py.bak ├── juhe_system.log ├── license ├── logbook.jsonl ├── logs │   ├── audit_20250719.log │   ├── audit_20250720.log │   ├── audit_20250721.log │   ├── cli_20250719_183927.log │   ├── cli_20250719_191337.log │   ├── cli_20250719.log │   ├── cli_20250720.log │   ├── cli_20250721.log │   ├── code_inserter │   │   ├── code_inserter.log │   │   └── __init__.py │   ├── code_reader │   │   ├── code_reader.log │   │   └── __init__.py │   ├── code_reviewer.log │   ├── format_manager │   │   └── format_manager.log │   ├── __init__.py │   ├── logbook │   │   ├── audit.log │   │   └── logbook.jsonl │   └── voice_input │   ├── __init__.py │   └── voice_input.log ├── main_controller.py ├── memory_data.json ├── memory.pkl ├── memory_retrieval.py ├── migrate_log.txt ├── migrate_structure.py ├── models.txt ├── module_loader.py ├── modules │   ├── audio_capture │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── capture.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   └── module.py │   ├── audio_consumer │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── audio_consumer.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   └── module.py │   ├── cli_entry │   │   ├── cli_main.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   └── module.py │   ├── code_executor │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── code_executor.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── code_executor.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── code_inserter │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── code_inserter.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── code_inserter.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── code_reader │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── code_reader.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── code_reader.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── code_reviewer │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── code_reviewer.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── code_reviewer.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── format_manager │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── format_manager.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── format_manager.cpython-313.pyc │   │   └── __init__.cpython-313.pyc │   ├── gui_entry │   │   ├── gui_main.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   └── module.py │   ├── hello_module │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── hello_module.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   └── module.py │   ├── __init__.py │   ├── ju_wu │   │   ├── action_mapper.py │   │   ├── __init__.py │   │   ├── intent_router.py │   │   ├── juwu.py │   │   ├── manifest.json │   │   ├── rules │   │   │   ├── __init__.py │   │   │   ├── intent_rules.json │   │   │   └── manifest.json │   │   ├── rule_trainer_gui.py │   │   ├── rule_trainer_interactive.py │   │   └── rule_trainer_widget.py │   ├── juzi │   │   ├── icons │   │   │   ├── file_000000007978620ab9d2f348a2d62a7f-9db60022-3243-4e66-acda-80f38ba5248b.png │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── juzi_engine.py │   │   ├── juzi.py │   │   ├── juzi.xml │   │   └── manifest.json │   ├── language_bridge │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── language_bridge.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   └── module.py │   ├── logbook │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── logbook_manager.py │   │   ├── logbook.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── __pycache__ │   │   ├── __init__.cpython-313.pyc │   │   └── logbook.cpython-313.pyc │   ├── model_engine │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── model_engine.py │   │   ├── module.py │   │   └── __pycache__ │   │   ├── __init__.cpython-313.pyc │   │   ├── model_engine.cpython-313.pyc │   │   └── module.cpython-313.pyc │   ├── music_manager │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   ├── music_manager.py │   │   └── __pycache__ │   │   ├── __init__.cpython-313.pyc │   │   ├── module.cpython-313.pyc │   │   └── music_manager.cpython-313.pyc │   ├── __pycache__ │   │   └── __init__.cpython-313.pyc │   ├── reply_dispatcher │   │   ├── dispatcher.py │   │   ├── __init__.py │   │   ├── manifest.json │   │   └── register_actions.py │   ├── self_learning_module │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── self_learning_module.py │   ├── smart_demo_module │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── smart_demo_module.py │   ├── speech_manager │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   ├── __pycache__ │   │   │   ├── __init__.cpython-313.pyc │   │   │   └── module.cpython-313.pyc │   │   └── speech_manager.py │   ├── stt_module │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── stt_module.py │   ├── system_control │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   ├── __pycache__ │   │   │   ├── __init__.cpython-313.pyc │   │   │   └── module.cpython-313.pyc │   │   └── system_control.py │   ├── system_monitor │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   ├── __pycache__ │   │   │   ├── __init__.cpython-313.pyc │   │   │   ├── module.cpython-313.pyc │   │   │   └── system_monitor.cpython-313.pyc │   │   └── system_monitor.py │   ├── test_module │   │   ├── 1 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── test_module.py │   ├── voice_entry │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── module.py │   │   └── voice_entry.py │   ├── voice_input │   │   ├── 2 │   │   │   ├── __init__.py │   │   │   └── manifest.json │   │   ├── __init__.py │   │   ├── manifest.json │   │   ├── manifest.json.bak │   │   ├── module.py │   │   └── voice_input.py │   └── wake_word_detector │   ├── 1 │   │   ├── __init__.py │   │   └── manifest.json │   ├── download_whisper_model.py │   ├── __init__.py │   ├── manifest.json │   ├── manifest.json.bak │   ├── module.py │   └── wake_word_detector.py ├── module_standardizer.py ├── mysterious_entry_tool.py ├── ollama_bin │   ├── __init__.py │   └── ollama ├── ollama_data │   ├── history │   ├── id_ed25519 │   ├── id_ed25519.pub │   └── __init__.py ├── ollama_models │   ├── blobs │   │   ├── __init__.py │   │   ├── sha256-3f8eb4da87fa7a3c9da615036b0dc418d31fef2a30b115ff33562588b32c691d │   │   ├── sha256-4fa551d4f938f68b8c1e6afa9d28befb70e3f33f75d0753248d530364aeea40f │   │   ├── sha256-577073ffcc6ce95b9981eacc77d1039568639e5638e83044994560d9ef82ce1b │   │   ├── sha256-6a0746a1ec1aef3e7ec53868f220ff6e389f6f8ef87a01d77c96807de94ca2aa │   │   └── sha256-8ab4849b038cf0abc5b1c9b8ee1443dca6b93a045c2272180d985126eb40bf6f │   ├── __init__.py │   └── manifests │   ├── __init__.py │   └── registry.ollama.ai │   ├── __init__.py │   └── library ├── README.md ├── recordings │   └── __init__.py ├── register_entries.sh ├── replace_imports.py ├── replace_logging.py ├── restructure_dirs.sh ├── rollback_snapshots │   ├── backup │   │   ├── backup_20250629_215816_94cd3d │   │   │   ├── code_executor.py │   │   │   ├── code_inserter.py │   │   │   ├── code_reader.py │   │   │   ├── code_reviewer.py │   │   │   ├── format_manager.py │   │   │   ├── hello_module.py │   │   │   ├── __init__.py │   │   │   ├── logbook.py │   │   │   ├── model_engine.py │   │   │   ├── music_manager.py │   │   │   ├── speech_manager.py │   │   │   ├── system_control.py │   │   │   └── system_monitor.py │   │   └── __init__.py │   ├── __init__.py │   ├── rollback_history.json │   ├── snapshot_20250629_215118_795f59e1 │   │   ├── code_executor.py │   │   ├── code_inserter.py │   │   ├── code_reader.py │   │   ├── code_reviewer.py │   │   ├── format_manager.py │   │   ├── hello_module.py │   │   ├── __init__.py │   │   ├── logbook.py │   │   ├── model_engine.py │   │   ├── music_manager.py │   │   ├── speech_manager.py │   │   ├── system_control.py │   │   └── system_monitor.py │   ├── snapshot_20250629_215407_65d62c0e │   │   ├── code_executor.py │   │   ├── code_inserter.py │   │   ├── code_reader.py │   │   ├── code_reviewer.py │   │   ├── format_manager.py │   │   ├── hello_module.py │   │   ├── __init__.py │   │   ├── logbook.py │   │   ├── model_engine.py │   │   ├── music_manager.py │   │   ├── speech_manager.py │   │   ├── system_control.py │   │   └── system_monitor.py │   └── snapshot_20250629_215816_c3d93551 │   ├── code_executor.py │   ├── code_inserter.py │   ├── code_reader.py │   ├── code_reviewer.py │   ├── format_manager.py │   ├── hello_module.py │   ├── __init__.py │   ├── logbook.py │   ├── model_engine.py │   ├── music_manager.py │   ├── speech_manager.py │   ├── system_control.py │   └── system_monitor.py ├── rule_trainer.py ├── run_all_entries.py ├── runtime │   ├── __init__.py │   ├── logs │   │   └── __init__.py │   ├── recordings │   │   └── __init__.py │   └── temp │   └── __init__.py ├── sanhua_self_healer.py ├── scaffold │   ├── fix_all_imports.py │   ├── health_checker.py │   ├── __init__.py │   └── standardize_modules.py ├── scan_old_imports.py ├── start_ollama.sh ├── startup_fix.py ├── system.log ├── test_mic.py ├── tests │   ├── __init__.py │   ├── test_aicore.py │   ├── test_entry_dispatcher.py │   └── test_modules_loading.py ├── test.wav ├── third_party │   ├── __init__.py │   └── ollama │   └── __init__.py ├── tools │   ├── cert_fix_tool.py │   ├── config_validator.py │   ├── import_checker.py │   └── path_dependency_checker.py ├── trace_memory_summary_calls.py ├── update_entry_points.py ├── utils │   └── __init__.py └── venv ├── bin │   ├── activate │   ├── activate.csh │   ├── activate.fish │   ├── Activate.ps1 │   ├── bandit │   ├── bandit-baseline │   ├── bandit-config-generator │   ├── flake8 │   ├── futurize │   ├── markdown-it │   ├── pasteurize │   ├── pbr │   ├── pip │   ├── pip3 │   ├── pip3.11 │   ├── pycodestyle │   ├── pyflakes │   ├── pygmentize │   ├── python -> python3.11 │   ├── python3 -> python3.11 │   ├── python3.11 -> /usr/bin/python3.11 │   ├── radon │   └── watchmedo ├── include │   └── python3.11 ├── lib │   └── python3.11 │   └── site-packages ├── lib64 -> lib ├── pyvenv.cfg └── share └── man └── man1 159 directories, 624 files lufei@fedora:~/文档/聚核助手2.0$
07-22
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值