### Module Initialization and Start Source: https://github.com/openluat/luatos/blob/master/module/Air8000/demo/string/readme.md Logs module initialization and the start of string operation demonstrations. ```lua I/user.string_demo 字符串操作演示模块初始化 I/user.string_demo 开始执行所有字符串操作演示 ``` -------------------------------- ### System Startup Log Example Source: https://github.com/openluat/luatos/blob/master/module/Air8101/demo/control_network_camera/readme.md Observe this log output to confirm the system is starting up correctly and network operations are initiated. ```log [2026-03-06 15:45:09.929] luat:U(2090):I/user.main CONTROL_NETWORK_CAMERA 001.000.000 [2026-03-06 15:45:09.960] luat:U(2113):I/user.执行STA连接操作 [2026-03-06 15:45:12.007] luat:D(4165):wlan:STA connected @PHICOMM_75 [2026-03-06 15:45:12.279] luat:U(4434):I/user.SDCARD 挂载SD卡结果: true [2026-03-06 15:45:12.279] luat:U(4436):I/user.开始运行OSD操作 [2026-03-06 15:45:12.279] luat:U(4436):I/user.osdsetup 检测到大华摄像头,开始初始化 [2026-03-06 15:45:12.279] luat:U(4438):I/user.元素解析 索引 1 值 1111 [2026-03-06 15:45:12.279] luat:U(4439):I/user.元素解析 索引 2 值 2222 [2026-03-06 15:45:12.279] luat:U(4439):I/user.元素解析 索引 3 值 3333 [2026-03-06 15:45:12.279] luat:U(4440):I/user.元素解析 索引 4 值 4444 [2026-03-06 15:45:12.279] luat:U(4440):I/user.元素解析 索引 5 值 5555 [2026-03-06 15:45:12.292] luat:U(4441):I/user.元素解析 索引 6 值 6666 [2026-03-06 15:45:12.292] luat:D(4449):net:adapter 2 connect 192.168.1.108:80 TCP [2026-03-06 15:45:16.708] luat:U(8863):I/user.DHosd 第一次请求http,code: 401 table: 609B1CB8 [2026-03-06 15:45:16.708] luat:U(4303):l/user.DigestAuth 鉴权信息重组完成 [2026-03-06 15:45:16.708] luat:U(8863):I/user.DHosd 第二次请求http,code:200 OK [2026-03-06 15:45:17.695] luat:U(9864):I/user.开始运行抓图操作 [2026-03-06 15:45:17.695] luat:U(9865):I/user.getphoto 检测到大华摄像头,开始初始化 [2026-03-06 15:45:17.695] luat:U(9865):I/user.DHPicture 开始执行 [2026-03-06 15:45:17.695] luat:D(9869):net:adapter 2 connect 192.168.1.108:80 TCP [2026-03-06 15:45:18.695] luat:U(5406):/user.DHPicture 第一次请求http,code: 401 table: 609AFFBO [2026-03-06 15:45:18.695] luat:U(5408):l/user.DigestAuth 鉴权信息重组完成 [2026-03-06 15:45:18.695] luat:U(5408):/user.DHPicture 鉴权信息重组完成 [2026-03-06 15:45:18.695] luat:U(8224):l/user.DHPicture 第二次请求http,code: 200 [2026-03-06 15:45:19.413] luat:U(8256):l/user.DHpicture 拍照完成 [2026-03-06 15:45:19.413] luat:U(8256):I/user.照片读取成功 文件大小: 102400 字节 路径: /sd/get_photo.jpeg [2026-03-06 15:45:19.413] luat:U(8256):I/user.照片上传结果 HTTP状态码: 200 [2026-03-06 15:45:19.413] luat:U(8256):I/user.照片上传成功 可在 https://www.air32.cn/upload/jpg/ 查看 [2026-03-06 15:45:19.413] luat:U(8256):I/user.本地照片文件已删除 路径: /sd/get_photo.jpeg ``` -------------------------------- ### Main Program Entry Point Source: https://github.com/openluat/luatos/blob/master/module/Air8101/demo/tf_card/readme.md Initializes project information, watchdog, memory monitoring timer, loads TF card and HTTP download modules, and starts the system. ```lua project.init("Air8101 TF Card Demo", "1.0.0") -- Initialize watchdog and feed it periodically watchdog.setup(5000) -- 5 second timeout watchdog.start() -- Start a timer to print memory usage every 3 seconds sys.timerStart(function() local mem_info = sys.getMemInfo() log.info("Memory Usage: Total=%d, Used=%d, MaxUsed=%d", mem_info.total, mem_info.used, mem_info.max) watchdog.feed() end, 3000) -- Load modules require "tfcard_app" require "http_download_file" -- Run the system sys.run() ``` -------------------------------- ### Start Full Measurement Flow Source: https://github.com/openluat/luatos/blob/master/app_engine/app_store/vertical_app/weight_600x1024/weight_600x1024.html Initiates the full measurement sequence by setting a flag and navigating to the stature guide page. ```javascript function startFullMeasurement() { isFullMeasuring = true; fullMeasureStep = 1; showPage('statureGuide'); } ``` -------------------------------- ### Demonstrate All UI Components Source: https://github.com/openluat/luatos/blob/master/module/Air8101/demo/ui/easyui/single/readme.md This example loads a module that demonstrates the comprehensive usage of all available UI components within the EasyUI library. It's useful for a complete overview of the UI capabilities. ```lua require("win_all_component") --所有组件综合演示 ``` -------------------------------- ### os.time() Examples Source: https://github.com/openluat/luatos/blob/master/module/Air8000/demo/os/readme.md Demonstrates obtaining Unix timestamps using os.time(). Supports getting the current timestamp and converting a custom time table into a timestamp. ```lua [2025-10-23 16:47:38.275][00000000.044] I/user.os.time 当前时间戳: 1761209258 秒 [2025-10-23 16:47:38.275][00000000.044] I/user.os.time 指定时间的时间戳: 1735093800 秒 [2025-10-23 16:47:38.275][00000000.044] I/user.os.time 当前时间详细信息: year=2025, month=10, day=23 ``` -------------------------------- ### Log Output Example Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/accessory_board/AirETH_1000/network_routing/4g_out_ethernet_in/readme.md Observe these log messages to confirm successful proxy setup and HTTP connection tests, indicating the network routing is functioning as expected. ```log [INFO] exnetif setproxy success [INFO] http执行结果 200 ... ``` -------------------------------- ### Main Program Entry Point Source: https://github.com/openluat/luatos/blob/master/module/Air8000/demo/accessory_board/AirMICROSD_1010/readme.md Initializes project information, watchdog, and timers. Loads necessary modules for TF card operations and HTTP file transfers. ```lua -- Initialize project info and version -- Initialize watchdog and feed it periodically -- Start a loop timer to print memory usage every 3 seconds -- Load tfcard_app module -- Load http_download_file module -- Load http_upload_file module ``` -------------------------------- ### Main Program Entry Point Source: https://github.com/openluat/luatos/blob/master/module/Air1601_Air1602/demo/tf_card/readme.md Initializes project information, watchdog, memory monitoring timer, and loads necessary modules for TF card and HTTP operations. ```lua -- Initialize project information and version number -- Initialize watchdog and feed it periodically -- Start a loop timer to print memory usage every 3 seconds -- Load tfcard_app module -- Load http_download_file module -- Load http_upload_file module -- Run the system ``` -------------------------------- ### Read Data from Flash Source: https://github.com/openluat/luatos/blob/master/components/fal/README.md Use 'fal read' followed by the starting address and length to read data from flash. This example reads 64 bytes from address 0. ```bash msh />fal read 0 64 Read data success. Start from 0x00000000, size is 64. The data is: Offset (h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F [00000000] FF FF FF FF FF FF FF FF 01 02 03 04 05 FF FF FF [00000010] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [00000020] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [00000030] FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF msh /> ``` -------------------------------- ### Unit Test Module Example (myfeature_test.lua) Source: https://github.com/openluat/luatos/blob/master/testcase/README.md Contains specific test logic where functions starting with 'test_' are automatically executed. Uses assert for verification and pcall for error handling. ```lua -- myfeature_test.lua local myfeature = {} -- 测试用例 1: 基础功能测试 function myfeature.test_basic_functionality() log.info("myfeature", "开始基础功能测试") -- 执行被测试的代码 local result = someFunction() -- 使用 assert 验证结果 assert(result == expected_value, "基础功能测试失败") log.info("myfeature", "基础功能测试通过") end -- 测试用例 2: 边界条件测试 function myfeature.test_boundary_conditions() log.info("myfeature", "开始边界条件测试") -- 测试边界值 assert(someFunction(0) == 0, "边界值 0 处理失败") assert(someFunction(-1) == -1, "负数处理失败") assert(someFunction(999999) == 999999, "大数处理失败") log.info("myfeature", "边界条件测试通过") end -- 测试用例 3: 错误处理测试 function myfeature.test_error_handling() log.info("myfeature", "开始错误处理测试") -- 测试异常情况 local success, err = pcall(function() -- 会抛出异常的代码 invalidFunction() end) assert(not success, "应该捕获异常") log.info("myfeature", "错误处理测试通过") end return myfeature ``` -------------------------------- ### Main Program Entry Point Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/tf_card/readme.md Initializes project information, watchdog, memory monitoring, and loads necessary modules before running the system. ```lua sys.init(nil, nil, nil) -- Initialize watchdog and feed it periodically watchdog.open() watchdog.feed() -- Start a timer to print memory usage every 3 seconds sys.timer.add(3000, function() local mem_info = sys.get_meminfo() log.info("Total Memory: %d, Used Memory: %d, Max Used Memory: %d", mem_info.total, mem_info.used, mem_info.max_used) watchdog.feed() end, nil, true) -- Load modules require "tfcard_app" require "http_download_file" require "http_upload_file" -- Run the system sys.run() -- Close watchdog watchdog.close() ``` -------------------------------- ### UART FOTA Upgrade Log Example Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/fota/fota(使用fota核心库)/readme.md This log demonstrates the sequence of events during a successful UART FOTA upgrade, from receiving the start command to the device rebooting with the new version. ```log [2025-10-24 19:04:42.229][000000130.217] I/user.fota version 1.0.0 [2025-10-24 19:04:43.235][000000131.217] I/user.fota version 1.0.0 [2025-10-24 19:04:44.239][000000132.217] I/user.fota version 1.0.0 [2025-10-24 19:04:44.896][000000132.888] luat_usb_recv_cb 447:usb serial connected [2025-10-24 19:04:44.909][000000132.889] I/user.uart 收到数据 6 累计 6 [2025-10-24 19:04:44.921][000000132.891] I/user.fota 检测到fota起始标记,进入FOTA状态 #FOTA [2025-10-24 19:04:45.238][000000133.217] I/user.fota version 1.0.0 [2025-10-24 19:04:45.916][000000133.894] I/user.uart 收到数据 256 累计 262 [2025-10-24 19:04:45.931][000000133.895] I/user.准备写入fota包 256 累计写入 256 [2025-10-24 19:04:45.939][000000133.896] I/fota write common data [2025-10-24 19:04:45.957][000000133.896] D/user.fota.run true false 1 [2025-10-24 19:04:45.968][000000133.896] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:46.227][000000134.217] I/user.fota version 1.0.0 [2025-10-24 19:04:46.929][000000134.906] I/user.uart 收到数据 256 累计 518 [2025-10-24 19:04:46.942][000000134.907] I/user.准备写入fota包 256 累计写入 512 [2025-10-24 19:04:46.953][000000134.908] D/user.fota.run true false 1 [2025-10-24 19:04:46.964][000000134.908] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:47.227][000000135.217] I/user.fota version 1.0.0 [2025-10-24 19:04:47.940][000000135.917] I/user.uart 收到数据 256 累计 774 [2025-10-24 19:04:47.950][000000135.918] I/user.准备写入fota包 256 累计写入 768 [2025-10-24 19:04:47.963][000000135.919] D/user.fota.run true false 1 [2025-10-24 19:04:47.971][000000135.919] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:48.238][000000136.217] I/user.fota version 1.0.0 [2025-10-24 19:04:48.956][000000136.933] I/user.uart 收到数据 256 累计 1030 [2025-10-24 19:04:48.965][000000136.933] I/user.准备写入fota包 256 累计写入 1024 [2025-10-24 19:04:48.976][000000136.934] D/user.fota.run true false 1 [2025-10-24 19:04:48.986][000000136.934] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:49.237][000000137.217] I/user.fota version 1.0.0 [2025-10-24 19:04:49.968][000000137.945] I/user.uart 收到数据 256 累计 1286 [2025-10-24 19:04:49.977][000000137.946] I/user.准备写入fota包 256 累计写入 1280 [2025-10-24 19:04:49.987][000000137.946] D/user.fota.run true false 1 [2025-10-24 19:04:49.995][000000137.947] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:50.231][000000138.217] I/user.fota version 1.0.0 [2025-10-24 19:04:50.981][000000138.957] I/user.uart 收到数据 256 累计 1542 [2025-10-24 19:04:50.990][000000138.958] I/user.准备写入fota包 256 累计写入 1536 [2025-10-24 19:04:51.008][000000138.958] D/user.fota.run true false 1 [2025-10-24 19:04:51.016][000000138.959] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:51.229][000000139.217] I/user.fota version 1.0.0 [2025-10-24 19:04:51.992][000000139.969] I/user.uart 收到数据 256 累计 1798 [2025-10-24 19:04:52.002][000000139.970] I/user.准备写入fota包 256 累计写入 1792 [2025-10-24 19:04:52.013][000000139.970] D/user.fota.run true false 1 [2025-10-24 19:04:52.020][000000139.971] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:52.228][000000140.217] I/user.fota version 1.0.0 [2025-10-24 19:04:53.007][000000140.984] I/user.uart 收到数据 256 累计 2054 [2025-10-24 19:04:53.019][000000140.985] I/user.准备写入fota包 256 累计写入 2048 [2025-10-24 19:04:53.029][000000140.985] D/user.fota.run true false 1 [2025-10-24 19:04:53.037][000000140.985] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:53.226][000000141.217] I/user.fota version 1.0.0 [2025-10-24 19:04:54.005][000000141.997] I/user.uart 收到数据 256 累计 2310 [2025-10-24 19:04:54.019][000000141.998] I/user.准备写入fota包 256 累计写入 2304 [2025-10-24 19:04:54.034][000000141.998] D/user.fota.run true false 1 [2025-10-24 19:04:54.044][000000141.999] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:54.225][000000142.217] I/user.fota version 1.0.0 [2025-10-24 19:04:55.022][000000142.998] I/user.uart 收到数据 256 累计 2566 [2025-10-24 19:04:55.032][000000142.999] I/user.准备写入fota包 256 累计写入 2560 [2025-10-24 19:04:55.042][000000143.000] D/user.fota.run true false 1 [2025-10-24 19:04:55.050][000000143.000] I/user.fota 单包写入完成 256 等待下一个包 [2025-10-24 19:04:55.240][000000143.217] I/user.fota version 1.0.0 [2025-10-24 19:04:56.035][000000144.012] I/user.uart 收到数据 256 累计 2822 [2025-10-24 19:04:56.044][000000144.013] I/user.准备写入fota包 256 累计写入 2816 [2025-10-24 19:04:56.054][000000144.013] D/user.fota.run true false 1 [2025-10-24 19:04:56.060][000000144.014] I/user.fota 单包写入完成 256 等待下一个包 ``` -------------------------------- ### Initialize exEasyUI and Drivers Source: https://github.com/openluat/luatos/blob/master/module/Air8101/demo/accessory_board/devboard_5inch1_800x480_gt9157/exeasyui/readme.md This code snippet demonstrates the essential setup for exEasyUI. It loads the exEasyUI module and initializes the necessary hardware drivers for LCD, touch, and font rendering. Choose one of the provided driver options based on your firmware and hardware. ```lua -- 必须加载才能启用exeasyui的功能 ui = require("exeasyui") -- 加载lcd、tp和字库驱动管理功能模块,有以下三种: -- 1、使用lcd内核固件中自带的12号中文字体的hw_default_font_drv,并按lcd显示驱动配置和tp触摸驱动配置进行初始化 -- 2、使用hzfont核心库驱动内核固件中支持的软件矢量字库的hw_hzfont_drv.lua -- 3、使用自定义字体的hw_customer_font_drv(目前开发中) -- 最新情况可查看模组选型手册中对应型号的固件列表内,支持的核心库是否包含lcd、tp、12号中文、hzfont,链接https://docs.openluat.com/air780epm/common/product/ -- 目前exeasyui V1.7.0版本支持使用已经实现的四种功能中的一种进行初始化,同时支持多种字体初始化功能正在开发中 -- require("hw_default_font_drv") --(Air8101 V2002版本101固件支持 102固件不支持) require("hw_hzfont_drv") --(Air8101 V2002版本102固件支持 101固件不支持) -- require("hw_customer_font_drv")(目前开发中) -- 加载exeassyui扩展库实现的用户界面功能模块 -- 实现多页面切换、触摸事件分发和界面渲染功能 -- 包含主页、组件演示页、默认字体演示页、HZfont演示页和自定义字体演示页 require("ui_main") ``` -------------------------------- ### Start Speech Recognition (JavaScript) Source: https://github.com/openluat/luatos/blob/master/app_engine/app_store/vertical_app/Pic2Word/user/picture_character_learning.html Initiates speech recognition for user input, specifically for reading characters aloud. It checks for browser support and provides a toast message to guide the user. ```javascript function startListening() { if (!('webkitSpeechRecognition' in window) && !('SpeechRecognition' in window)) { showToast("😢 浏览器不支持语音识别,请使用Chrome或安卓WebView", 1500); return; } const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; const recognition = new SpeechRecognition(); recognition.lang = 'zh-CN'; recognition.interimResults = false; recognition.maxAlternatives = 1; showToast("🎤 请大声跟读: " + getCurrentWord().character, 1200); recognition.start() ``` -------------------------------- ### Load Luatools Project File Source: https://github.com/openluat/luatos/blob/master/bsp/pc/doc/usage.md Start the LuatOS PC simulator by loading a project configuration file from Luatools using the `--llt` flag. ```bash luatos-pc.exe --llt=D:/luatools/project/air101_gpio.ini ``` -------------------------------- ### Main Program Entry Source: https://github.com/openluat/luatos/blob/master/module/Air8101/demo/accessory_board/AirMICROSD_1010/readme.md Initializes project information, watchdog, memory monitoring timer, and loads necessary modules. ```lua sys.init(project_name, project_version) watchdog.setup(5) -- 5 seconds watchdog -- Memory usage monitoring timer mem_timer = sys.timerLoopStart(function() local mem_info = sys.get_meminfo() log.info("Mem Total: %d, Used: %d, Max Used: %d", mem_info.total, mem_info.used, mem_info.max_used) end, 3000) -- every 3 seconds -- Load modules local sd = require "AirMICROSD_1010" local http_download = require "http_download_file" sys.run() -- Cleanup (optional, typically done before shutdown or error handling) -- sys.taskDelete(mem_timer) -- sd.unmount() ``` -------------------------------- ### Initiate WiFi Scan on Air8000 Source: https://github.com/openluat/luatos/blob/master/module/Air8000/demo/httpsrv/index.html Starts a WiFi scan by sending a GET request to the /scan/go endpoint. It updates the status message and schedules a call to getWifiResults after a short delay to allow the scan to begin. ```javascript function scanWifi() { document.getElementById("status").textContent = "正在扫描WiFi..."; document.getElementById("wifiResults").innerHTML = ""; fetch("/scan/go") .then(function(resp) { if (resp.status == 200) { document.getElementById("status").textContent = "扫描已开始,正在获取结果..."; // 等待1秒后获取扫描结果 setTimeout(getWifiResults, 1000); } else { document.getElementById("status").textContent = "扫描失败: " + resp.status; } }) .catch(function(error) { console.error("扫描错误:", error); document.getElementById("status").textContent = "扫描出错: " + error.message; }); } ``` -------------------------------- ### Install Dependencies with vcpkg Source: https://github.com/openluat/luatos/blob/master/components/mgba/src/README_ZH_CN.md Install necessary libraries for building mGBA with Visual Studio. This command installs common dependencies. For Nvidia hardware acceleration, additional steps and packages are required. ```bash vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip sdl2 sqlite3 ``` ```bash vcpkg install qt5-base qt5-multimedia ``` -------------------------------- ### Main Program Entry Point (main.lua) Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/fs_io/readme.md Initializes project information, watchdog, memory monitoring timer, and loads necessary modules for file system operations and HTTP downloads. Ensure sys.run() is called to start the main loop. ```lua local sys = require('sys') local log = require('log') local watchdog = require('watchdog') local memory = require('memory') -- Initialize project info and version log.info('Project: Air780EHM/780EHV/780EGH File System I/O Demo') log.info('Version: 1.0.0') -- Initialize watchdog and set timeout watchdog.init(20) -- 20 seconds timeout watchdog.start() -- Timer to monitor memory usage every 3 seconds sys.timerStart(function() local total_mem = memory.getMemInfo().total local used_mem = memory.getMemInfo().used local max_used_mem = memory.getMemInfo().max_used log.info('Memory Info: Total=%d, Used=%d, MaxUsed=%d', total_mem, used_mem, max_used_mem) watchdog.feed() -- Feed the watchdog end, 3000) -- Load flash_fs_io module local flash_fs_io = require('flash_fs_io') -- Load http_download_flash module local http_download_flash = require('http_download_flash') -- Run the system sys.run() ``` -------------------------------- ### Create and Write to File Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/tf_card/readme.md Opens a file named 'boottime' in write-binary mode ('wb') within the '/sd/io_test' directory and prepares it for writing. ```lua local file = io.open("/sd/io_test/boottime", "wb") ``` -------------------------------- ### Initialize exEasyUI and Load Drivers Source: https://github.com/openluat/luatos/blob/master/module/Air780EHM_Air780EHV_Air780EGH/demo/accessory_board/AirLCD_1010/exeasyui/readme.md This Lua code snippet demonstrates the essential steps for initializing the exEasyUI framework and loading the necessary hardware drivers for display and touch functionality. It shows how to include the exEasyUI library and select one of the available hardware driver modules (default font, HZFont, or custom font). ```lua -- 必须加载才能启用exeasyui的功能 ui = require("exeasyui") -- 加载lcd、tp和字库驱动管理功能模块,有以下三种: -- 1、使用lcd内核固件中自带的12号中文字体的hw_default_font_drv,并按lcd显示驱动配置和tp触摸驱动配置进行初始化 -- 2、使用hzfont核心库驱动内核固件中支持的软件矢量字库的hw_hzfont_drv.lua,并按lcd显示驱动配置和tp触摸驱动配置进行初始化 -- 3、使用自定义字体的hw_customer_font_drv(目前开发中) -- 最新情况可查看模组选型手册中对应型号的固件列表内,支持的核心库是否包含lcd、tp、12号中文、hzfont,链接https://docs.openluat.com/air780epm/common/product/ -- 目前exeasyui V1.7.0版本支持使用已经实现的三种功能中的一种进行初始化,同时支持多种字体初始化功能正在开发中 require("hw_default_font_drv") -- require("hw_hzfont_drv") -- require("hw_customer_font_drv")开发中 -- 加载exeassyui扩展库实现的用户界面功能模块 -- 实现多页面切换、触摸事件分发和界面渲染功能 -- 包含主页、组件演示页、默认字体演示页、HZfont演示页和自定义字体演示页 require("ui_main") ``` -------------------------------- ### Run AIRUI Msgbox Example Source: https://github.com/openluat/luatos/blob/master/bsp/pc/test/111.airui/readme.md Execute this command to run the message box example for AIRUI. ```bash # 消息框示例 .\luatos-lua.exe .\test_msgbox\ ``` -------------------------------- ### Run AIRUI Window Component Example Source: https://github.com/openluat/luatos/blob/master/bsp/pc/test/111.airui/readme.md Execute this command to run the window component example for AIRUI. ```bash # 窗口组件示例 .\luatos-lua.exe .\test_win\ ``` -------------------------------- ### Window Management Structure Example Source: https://github.com/openluat/luatos/blob/master/module/Air8000/demo/accessory_board/AirLCD_1010/airui/readme.md Demonstrates the basic structure for a window module using the exwin library. It includes functions for creating and destroying UI elements, and subscribing to window opening events. ```lua local win_id = nil local function on_create() -- 创建UI end local function on_destroy() -- 清理UI end sys.subscribe("OPEN_XXX_win", function() if not exwin.is_active(win_id) then win_id = exwin.open({ on_create = on_create, on_destroy = on_destroy, on_get_focus = on_get_focus, on_lose_focus = on_lose_focus, }) end end) ``` -------------------------------- ### Run AIRUI Switch Control Example Source: https://github.com/openluat/luatos/blob/master/bsp/pc/test/111.airui/readme.md Execute this command to run the switch control example for AIRUI. ```bash # 开关控件示例 .\luatos-lua.exe .\test_switch\ ```