From: p15692025051 <846603105@qq.com> Date: Sat, 6 Jul 2024 07:27:12 +0000 (+0800) Subject: 无外部flash,无支付宝,240*283分辨率项目 X-Git-Url: http://git.snicker.com.cn/css/html/static/gitweb.css?a=commitdiff_plain;h=b5c226ed39d99a307ab02a7e0507d0f2918cb8ba;p=mirrors%2FASR1603_G5.git 无外部flash,无支付宝,240*283分辨率项目 --- diff --git a/2.sdk-ZY/Helios_SDK/config/autoconf.h b/2.sdk-ZY/Helios_SDK/config/autoconf.h index 1e7def92..16fe13e3 100644 --- a/2.sdk-ZY/Helios_SDK/config/autoconf.h +++ b/2.sdk-ZY/Helios_SDK/config/autoconf.h @@ -4,16 +4,15 @@ * Helios SDK Configuration * */ -#define PROJECT_NAME_G3_K01 1 //项目宏定义 +#define PROJECT_NAME_M36_W8 1 //项目宏定义 #define CONFIG_LVGL_SPAN 1 #define CONFIG_LVGL_FS_HELIOS 1 -#define CONFIG_LVGL_GIF_DECODE 1 +//#define CONFIG_LVGL_GIF_DECODE 1 #define CONFIG_LVGL_SPINNER 1 #define CONFIG_LCD 1 #define CONFIG_LVGL_ANIMIMG 1 #define CONFIG_LVGL_KEYBOARD 1 #define CONFIG_LVGL_CALENDAR 1 -#define CONFIG_AUDIO_G711_COMPRESS 1 #define CONFIG_LVGL_LED 1 #define CONFIG_VIOCE_CALL 1 #define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1 @@ -31,7 +30,7 @@ //#define CONFIG_GH301x 1 #define CONFIG_MBEDTLS 1 //#define CONFIG_TTS 1 -#define CONFIG_SC7A20 1 +//#define CONFIG_SC7A20 1 #define CONFIG_LVGL_WIN 1 #define CONFIG_LVGL_COLORWHEEL 1 #define CONFIG_LVGL_CANVAS 1 @@ -43,4 +42,6 @@ #define CONFIG_JPEG 1 #define CONFIG_CAMERA_SAVEPHOTOS 1 //菊风视频通话 -#define CONFIG_juphoon 1 \ No newline at end of file +#define CONFIG_juphoon 1 +//#define CONFIG_LVGL_USE_FREETYPE 1//矢量字库 +#define PROJECT_NAME_G3_K01_font 1 \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/config/config.mk b/2.sdk-ZY/Helios_SDK/config/config.mk index 879f09ae..012987df 100644 --- a/2.sdk-ZY/Helios_SDK/config/config.mk +++ b/2.sdk-ZY/Helios_SDK/config/config.mk @@ -2,7 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Helios SDK Configuration # -PROJECT_NAME_G3_K01=y +PROJECT_NAME_M36_W8=y # # System Configuration # @@ -60,8 +60,9 @@ CONFIG_LCD=y # CONFIG_UART_SLIP is not set # CONFIG_POC is not set #CONFIG_GH301x=y -CONFIG_AUDIO_G711_COMPRESS=y -CONFIG_SC7A20=y +#CONFIG_HX3918=y +#CONFIG_SC7A20=y +#CONFIG_LVGL_USE_FREETYPE=y #菊风视频通话 CONFIG_juphoon=y - +PROJECT_NAME_G3_K01_font=y diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/config/lvgl_option.in b/2.sdk-ZY/Helios_SDK/services/microPython/config/lvgl_option.in index 4d823ec0..7af01e36 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/config/lvgl_option.in +++ b/2.sdk-ZY/Helios_SDK/services/microPython/config/lvgl_option.in @@ -413,3 +413,9 @@ config LVGL_IME_PINYIN help This is lvgl_span support. +config LVGL_USE_FREETYPE + bool "Enable lvgl freetype" + default n +help + This is lvgl_freetype support. + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/moducryptolib.c b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/moducryptolib.c index d6ce4dae..5b967da0 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/moducryptolib.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/moducryptolib.c @@ -992,21 +992,21 @@ STATIC mp_obj_t ucryptolib_sm2_make_new(const mp_obj_type_t *type, size_t n_args STATIC mp_obj_t ucryptolib_sm2_genkey(size_t n_args, const mp_obj_t *args) { - mp_obj_sm2_t *sm2_self = MP_OBJ_TO_PTR(args[0]); + SM2_KEY sm2_key; vstr_t pri_vstr, pub_vstr; unsigned char *pub_buf, *pri_buf = NULL; vstr_init_len(&pri_vstr, 32); vstr_init_len(&pub_vstr, 64); - if (sm2_key_generate(&sm2_self->sm2_key) != 1) + if (sm2_key_generate(&sm2_key) != 1) { mp_raise_ValueError(MP_ERROR_TEXT("key generate error")); } - memcpy(pri_vstr.buf, sm2_self->sm2_key.private_key, 32); - memcpy(pub_vstr.buf, sm2_self->sm2_key.public_key.x, 32); - memcpy(pub_vstr.buf + 32, sm2_self->sm2_key.public_key.y, 32); + memcpy(pri_vstr.buf, sm2_key.private_key, 32); + memcpy(pub_vstr.buf, sm2_key.public_key.x, 32); + memcpy(pub_vstr.buf + 32, sm2_key.public_key.y, 32); mp_obj_t key_tuple[2] = { mp_obj_new_str_from_vstr(&mp_type_bytes, &pri_vstr), @@ -1015,7 +1015,7 @@ STATIC mp_obj_t ucryptolib_sm2_genkey(size_t n_args, const mp_obj_t *args) return mp_obj_new_tuple(2, key_tuple); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_genkey_obj, 1, 1, ucryptolib_sm2_genkey); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_genkey_obj, 0, 1, ucryptolib_sm2_genkey); #define SIGN 1 @@ -1040,11 +1040,28 @@ STATIC mp_obj_t sm2_sign_pross(mp_obj_sm2_t *self, size_t n_args, const mp_obj_t if (mode) { - vstr_t vstr; - if ((sm2_sign(&sm2_self->sm2_key, dgst, sig, &siglen)) != 1) + if (n_args == 2) { - mp_raise_ValueError(MP_ERROR_TEXT("sign failed")); + if ((sm2_sign(&sm2_self->sm2_key, dgst, sig, &siglen)) != 1) + { + mp_raise_ValueError(MP_ERROR_TEXT("sign failed")); + } + } + else + { + SM2_SIGN_CTX sign_ctx; + mp_obj_t id_input = MP_OBJ_NULL; + id_input = args[2]; + mp_buffer_info_t id_info; + mp_get_buffer_raise(id_input, &id_info, MP_BUFFER_READ); + + if (sm2_sign_init(&sign_ctx, &sm2_self->sm2_key, id_info.buf, id_info.len) != 1 + || sm2_sign_update(&sign_ctx, dgst_info.buf, dgst_info.len) != 1 + || sm2_sign_finish(&sign_ctx, sig, &siglen) != 1) { + mp_raise_ValueError(MP_ERROR_TEXT("sign failed")); + } } + vstr_t vstr; vstr_init_len(&vstr, siglen); memcpy(vstr.buf, &sig, siglen); return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); @@ -1055,12 +1072,30 @@ STATIC mp_obj_t sm2_sign_pross(mp_obj_sm2_t *self, size_t n_args, const mp_obj_t sig_input = args[2]; mp_buffer_info_t sig_info; mp_get_buffer_raise(sig_input, &sig_info, MP_BUFFER_READ); - memcpy(&pub_key, &sm2_self->sm2_key, sizeof(SM2_POINT)); - if ((ret = sm2_verify(&pub_key, dgst, sig_info.buf, sig_info.len)) != 1) - { - mp_raise_ValueError(MP_ERROR_TEXT("verify failed")); + + if (n_args == 3) + { + if ((ret = sm2_verify(&pub_key, dgst, sig_info.buf, sig_info.len)) != 1) + { + mp_raise_ValueError(MP_ERROR_TEXT("verify failed")); + } } + else + { + SM2_SIGN_CTX verify_ctx; + mp_obj_t id_input = MP_OBJ_NULL; + id_input = args[3]; + mp_buffer_info_t id_info; + mp_get_buffer_raise(id_input, &id_info, MP_BUFFER_READ); + + if (sm2_verify_init(&verify_ctx, &pub_key, id_info.buf, id_info.len) != 1 + || sm2_verify_update(&verify_ctx, dgst_info.buf, dgst_info.len) != 1 + || (ret = sm2_verify_finish(&verify_ctx, sig_info.buf, sig_info.len)) != 1) { + mp_raise_ValueError(MP_ERROR_TEXT("verify failed")); + } + } + return mp_obj_new_int(0); } } @@ -1079,47 +1114,159 @@ STATIC mp_obj_t ucryptolib_sm2_verify(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_verify_obj, 1, 4, ucryptolib_sm2_verify); -#define ENCRYPT 1 -#define DECRYPT 0 +#define ENCRYPT 1 +#define DECRYPT 0 + +enum { + SM2_MODE_COMPATIBLE = 1, + SM2_MODE_DEFAULT = 0, + SM2_FORMAT_C1C3C2 = 1, + SM2_FORMAT_C1C2C3 = 0, +}; + +#define CHECK_BOOLEAN_PARAM(param) \ + do { \ + if ((param) != 0 && (param) != 1) { \ + mp_raise_ValueError(MP_ERROR_TEXT("Invalid Param")); \ + } \ + } while (0) + STATIC mp_obj_t sm2_crpty_pross(mp_obj_sm2_t *self, size_t n_args, const mp_obj_t *args, bool crpty_mode) { mp_obj_sm2_t *sm2_self = MP_OBJ_TO_PTR(args[0]); - + + int ret = 0; size_t len; vstr_t vstr; - int mode = 0; SM2_KEY pub_key; + int data_fmt = 0; + int enc_dec_mode = 0; + int def_comp_mode = 0; mp_obj_t input_buf = MP_OBJ_NULL; unsigned char plaintext[SM2_MAX_PLAINTEXT_SIZE]; unsigned char ciphertext[SM2_MAX_CIPHERTEXT_SIZE]; - mode = crpty_mode; + if (n_args == 2) + { + def_comp_mode = 0; + data_fmt = 0; + CHECK_BOOLEAN_PARAM(data_fmt); + } + else if (n_args == 3) + { + def_comp_mode = mp_obj_get_int(args[2]); + data_fmt = 0; + if (def_comp_mode != SM2_MODE_DEFAULT) mp_raise_ValueError(MP_ERROR_TEXT("Invalid Param")); + CHECK_BOOLEAN_PARAM(data_fmt); + } + else if (n_args == 4) + { + def_comp_mode = mp_obj_get_int(args[2]); + data_fmt = mp_obj_get_int(args[3]); + CHECK_BOOLEAN_PARAM(def_comp_mode); + CHECK_BOOLEAN_PARAM(data_fmt); + } + else + { + mp_raise_ValueError(MP_ERROR_TEXT("Invalid Param")); + } + + enc_dec_mode = crpty_mode; input_buf = args[1]; mp_buffer_info_t input_info; memcpy(sm2_self->sm2_key.private_key, sm2_self->pri_key, 32); mp_get_buffer_raise(input_buf, &input_info, MP_BUFFER_READ); - if (mode) + if (enc_dec_mode) { memcpy(&pub_key, &sm2_self->sm2_key, sizeof(SM2_POINT)); - if (sm2_encrypt(&pub_key, input_info.buf, input_info.len, ciphertext, &len) != 1) + + if (def_comp_mode) + { + // Compatibility mode + SM2_CIPHERTEXT C = {0}; + ret = sm2_do_encrypt(&pub_key, (const uint8_t *)input_info.buf, input_info.len, &C); + if (ret == 1) + { + if (data_fmt) + { + //Format: C1+C3+C2 + memcpy(ciphertext, &C.point.x, 32); + memcpy(ciphertext + 32, &C.point.y, 32); + memcpy(ciphertext + 64, C.hash, 32); + memcpy(ciphertext + 96, C.ciphertext, C.ciphertext_size); + len = 96 + C.ciphertext_size; + } + else + { + //Format: C1+C2+C3 + ciphertext[0] = 0x04; + memcpy(ciphertext + 1, &C.point.x, 32); + memcpy(ciphertext + 32 + 1, &C.point.y, 32); + memcpy(ciphertext + 64 + 1, C.ciphertext, C.ciphertext_size); + memcpy(ciphertext + 64 + C.ciphertext_size + 1, C.hash, 32); + len = 96 + C.ciphertext_size + 1; + } + } + } + else + { + // GMSSL Default mode(Format: ASN.1 DER) + ret = sm2_encrypt(&pub_key, input_info.buf, input_info.len, ciphertext, &len); + } + + if (ret != 1) { mp_raise_ValueError(MP_ERROR_TEXT("encrypt failed")); } vstr_init_len(&vstr, len); memcpy(vstr.buf, ciphertext, len); + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } else { - if (sm2_decrypt(&sm2_self->sm2_key, input_info.buf, input_info.len, plaintext, &len) != 1) + if (def_comp_mode) + { + // Compatibility mode + SM2_CIPHERTEXT C = {0}; + if (data_fmt) + { + //Format: C1+C3+C2 + C.ciphertext_size = (uint8_t)(input_info.len - 96); + memcpy(&C.point.x, input_info.buf, 32); + memcpy(&C.point.y, input_info.buf + 32, 32); + memcpy(C.hash, input_info.buf + 64, 32); + memcpy(C.ciphertext, input_info.buf + 96, C.ciphertext_size); + } + else + { + //Format: C1+C2+C3 + input_info.buf ++; + input_info.len --; + C.ciphertext_size = (uint8_t)(input_info.len - 96); + memcpy(&C.point.x, input_info.buf, 32); + memcpy(&C.point.y, input_info.buf + 32, 32); + memcpy(C.ciphertext, input_info.buf + 64, C.ciphertext_size); + memcpy(C.hash, input_info.buf + 64 + C.ciphertext_size, 32); + } + ret = sm2_do_decrypt(&sm2_self->sm2_key, &C, (uint8_t *)plaintext, &len); + } + else + { + // GMSSL Default mode(Format: ASN.1 DER) + ret = sm2_decrypt(&sm2_self->sm2_key, input_info.buf, input_info.len, plaintext, &len); + } + + if (ret != 1) { - mp_raise_ValueError(MP_ERROR_TEXT("decrypt failed")); + mp_raise_ValueError(MP_ERROR_TEXT("decrypt failed")); } - plaintext[len] = 0; + plaintext[len] = 0; vstr_init_len(&vstr, len); memcpy(vstr.buf, plaintext, len); + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } } @@ -1128,14 +1275,14 @@ STATIC mp_obj_t ucryptolib_sm2_encrypt(size_t n_args, const mp_obj_t *args) { mp_obj_sm2_t *sm2_self = MP_OBJ_TO_PTR(args[0]); return sm2_crpty_pross(sm2_self, n_args, args, ENCRYPT); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_encrypt_obj, 1, 2, ucryptolib_sm2_encrypt); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_encrypt_obj, 1, 4, ucryptolib_sm2_encrypt); STATIC mp_obj_t ucryptolib_sm2_decrypt(size_t n_args, const mp_obj_t *args) { mp_obj_sm2_t *sm2_self = MP_OBJ_TO_PTR(args[0]); return sm2_crpty_pross(sm2_self, n_args, args, DECRYPT); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_decrypt_obj, 1, 2, ucryptolib_sm2_decrypt); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ucryptolib_sm2_decrypt_obj, 1, 4, ucryptolib_sm2_decrypt); STATIC const mp_rom_map_elem_t ucryptolib_sm2_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_genkey), MP_ROM_PTR(&ucryptolib_sm2_genkey_obj) }, @@ -1143,6 +1290,10 @@ STATIC const mp_rom_map_elem_t ucryptolib_sm2_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_decrypt), MP_ROM_PTR(&ucryptolib_sm2_decrypt_obj) }, { MP_ROM_QSTR(MP_QSTR_sign), MP_ROM_PTR(&ucryptolib_sm2_sign_obj) }, { MP_ROM_QSTR(MP_QSTR_verify), MP_ROM_PTR(&ucryptolib_sm2_verify_obj) }, + { MP_ROM_QSTR(MP_QSTR_MODE_OMP), MP_ROM_INT(SM2_MODE_COMPATIBLE) }, + { MP_ROM_QSTR(MP_QSTR_MODE_DEF), MP_ROM_INT(SM2_MODE_DEFAULT) }, + { MP_ROM_QSTR(MP_QSTR_FMT_C1C3C2), MP_ROM_INT(SM2_FORMAT_C1C3C2) }, + { MP_ROM_QSTR(MP_QSTR_FMT_C1C2C3), MP_ROM_INT(SM2_FORMAT_C1C2C3) }, }; STATIC MP_DEFINE_CONST_DICT(ucryptolib_sm2_locals_dict, ucryptolib_sm2_locals_dict_table); @@ -1505,3 +1656,4 @@ const mp_obj_module_t mp_module_ucryptolib = { }; #endif // MICROPY_PY_UCRYPTOLIB + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/modussl_mbedtls.c b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/modussl_mbedtls.c index 311fdb9d..9ba688b1 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/modussl_mbedtls.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/modussl_mbedtls.c @@ -66,6 +66,7 @@ typedef struct _mp_obj_ssl_socket_t { } mp_obj_ssl_socket_t; struct ssl_args { + mp_arg_val_t ca; mp_arg_val_t key; mp_arg_val_t cert; mp_arg_val_t server_side; @@ -157,6 +158,32 @@ STATIC int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { } } +#define SSL_IGNORE_BADCERT_EXPIRED 0x01 /**< The certificate validity has expired. */ +#define SSL_IGNORE_BADCERT_REVOKED 0x02 /**< The certificate has been revoked (is on a CRL). */ +#define SSL_IGNORE_BADCERT_CN_MISMATCH 0x04 /**< The certificate Common Name (CN) does not match with the expected CN. */ +#define SSL_IGNORE_BADCERT_NOT_TRUSTED 0x08 /**< The certificate is not correctly signed by the trusted CA. */ +#define SSL_IGNORE_BADCRL_NOT_TRUSTED 0x10 /**< The CRL is not correctly signed by the trusted CA. */ +#define SSL_IGNORE_BADCRL_EXPIRED 0x20 /**< The CRL is expired. */ +#define SSL_IGNORE_BADCERT_MISSING 0x40 /**< Certificate was missing. */ +#define SSL_IGNORE_BADCERT_SKIP_VERIFY 0x80 /**< Certificate verification was skipped. */ +#define SSL_IGNORE_BADCERT_FUTURE 0x0200 /**< The certificate validity starts in the future. */ + +static int my_verify( void *data, mbedtls_x509_crt *crt, int depth, uint32_t *flags ) +{ + char buf[1024]; + ((void) data); + + mbedtls_x509_crt_info( buf, sizeof( buf ) - 1, "", crt ); + + mp_printf(&mp_plat_print, "[mbedtls](*flags %d error) :\n", *flags); + if(*flags & (SSL_IGNORE_BADCERT_FUTURE)) + { + *flags &= ~(SSL_IGNORE_BADCERT_FUTURE); + return( 0 ); + } + + return *flags; +} STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { // Verify the socket object has the full stream protocol @@ -246,6 +273,21 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) { } mbedtls_ssl_set_bio(o->ssl, &o->sock, _mbedtls_ssl_send, _mbedtls_ssl_recv, NULL); + + if (args->ca.u_obj != mp_const_none) { + size_t cert_len; + const byte *cert = (const byte *)mp_obj_str_get_data(args->ca.u_obj, &cert_len); + + ret = mbedtls_x509_crt_parse(o->cacert, cert, cert_len + 1); + if (ret != 0) { + ret = MBEDTLS_ERR_X509_BAD_INPUT_DATA; // use general error for all cert errors + goto cleanup; + } + + mbedtls_ssl_conf_ca_chain(o->conf, o->cacert, NULL); + mbedtls_ssl_conf_authmode(o->conf, MBEDTLS_SSL_VERIFY_REQUIRED); + mbedtls_ssl_conf_verify( o->conf, my_verify, NULL ); + } if (args->key.u_obj != mp_const_none) { size_t key_len; @@ -498,6 +540,7 @@ bool mp_obj_is_ussl_socket(mp_obj_t o) { STATIC mp_obj_t mod_ssl_wrap_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // TODO: Implement more args static const mp_arg_t allowed_args[] = { + { MP_QSTR_ca, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, { MP_QSTR_key, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, { MP_QSTR_cert, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_NONE} }, { MP_QSTR_server_side, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/vfs.c b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/vfs.c index 55ce10ca..d25f63e6 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/extmod/vfs.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/extmod/vfs.c @@ -113,7 +113,7 @@ mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out) { return MP_STATE_VM(vfs_cur); } #if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8850) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) void get_vfs_path(const char* base_path, char* dsc_path) { char *p_out = NULL; if(0 == strncmp(base_path, "mp3files=", 9) || 0 == strncmp(base_path, "amrfiles=", 9)) { @@ -270,8 +270,8 @@ STATIC mp_obj_t mp_vfs_autodetect(mp_obj_t bdev_obj) { return bdev_obj; } -#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) +#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718) \ + || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) #if MICROPY_VFS_LFS1 #include "lib/littlefs/lfs1.h" typedef struct lfs1_flash_info @@ -355,8 +355,8 @@ mp_obj_t mp_vfs_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args vfs->str = mnt_str; vfs->len = mnt_len; vfs->obj = vfs_obj; -#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) +#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718) \ + || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) MP_OBJ_VFS_LFSx *self = (MP_OBJ_VFS_LFSx *)vfs_obj; mp_vfs_log("------partition_name [%s]\n",self->partition_name); #endif @@ -402,11 +402,11 @@ mp_obj_t mp_vfs_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args } *vfsp = vfs; -#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) +#if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718) \ + || defined(PLAT_Unisoc_8850) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) if(self->partition_name != NULL) { - #if defined(PLAT_EIGEN) || defined(PLAT_ASR_1803s) + #if defined(PLAT_EIGEN) || defined(PLAT_ASR_1803s) || defined(PLAT_EIGEN_718) char *letter = NULL; if(strcmp(self->partition_name, "customer_fs") == 0){ letter = "U:"; @@ -443,7 +443,7 @@ mp_obj_t mp_vfs_umount(mp_obj_t mnt_in) { mp_vfs_log("umont:%s\n", mnt_str); #if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8850) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) int ret = Helios_lfs_unregister_map(mnt_str); mp_vfs_log("unregister[%s]map, result[%d]\n", mnt_str, ret); diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/freetype-2.11.1/include/freetype/config/ftstdlib.h b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/freetype-2.11.1/include/freetype/config/ftstdlib.h index 6ee412a0..a1aeaf13 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/freetype-2.11.1/include/freetype/config/ftstdlib.h +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/freetype-2.11.1/include/freetype/config/ftstdlib.h @@ -110,16 +110,27 @@ #include +FILE *ft2_fopen( const char *fileName, const char *mode ); +int ft2_fclose( FILE *stream ); +size_t ft2_fread( void *buffer, size_t elementSize, size_t elementCount, FILE *stream ); +int ft2_fseek( FILE *stream, long offset, int origin ); +long ft2_ftell( FILE *stream ); -#define FT_FILE FILE +#if 0 #define ft_fclose fclose #define ft_fopen fopen #define ft_fread fread #define ft_fseek fseek #define ft_ftell ftell +#else +#define ft_fclose ft2_fclose +#define ft_fopen ft2_fopen +#define ft_fread ft2_fread +#define ft_fseek ft2_fseek +#define ft_ftell ft2_ftell +#endif +#define FT_FILE FILE #define ft_sprintf sprintf - - /************************************************************************** * * sorting diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/lv_conf.h b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/lv_conf.h index 41f470ed..2c65d160 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/lv_conf.h +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/lv_conf.h @@ -137,6 +137,10 @@ #define LODEPNG_NO_COMPILE_ALLOCATORS +#ifdef CONFIG_LVGL_USE_FREETYPE +#define LV_USE_FREETYPE 1 +#define LV_FREETYPE_SBIT_CACHE 0 +#endif /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ #ifndef LV_COLOR_16_SWAP diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/freetype/lv_freetype.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/freetype/lv_freetype.c index 4bf66022..35a3d8b3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/freetype/lv_freetype.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/freetype/lv_freetype.c @@ -16,6 +16,12 @@ #include FT_SIZES_H #include FT_IMAGE_H #include FT_OUTLINE_H +#include "helios_debug.h" +#if 0 +#define QPY_FREETYPE_LOG(msg, ...) custom_log("FREETYPE", msg, ##__VA_ARGS__) +#else +#define QPY_FREETYPE_LOG(msg, ...) +#endif /********************* * DEFINES @@ -101,7 +107,7 @@ bool lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes { FT_Error error = FT_Init_FreeType(&library); if(error) { - LV_LOG_ERROR("init freeType error(%d)", error); + QPY_FREETYPE_LOG("init freeType error(%d)", error); return false; } @@ -112,26 +118,26 @@ bool lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes max_bytes, font_face_requester, NULL, &cache_manager); if(error) { FT_Done_FreeType(library); - LV_LOG_ERROR("Failed to open cache manager"); + QPY_FREETYPE_LOG("Failed to open cache manager"); return false; } error = FTC_CMapCache_New(cache_manager, &cmap_cache); if(error) { - LV_LOG_ERROR("Failed to open Cmap Cache"); + QPY_FREETYPE_LOG("Failed to open Cmap Cache"); goto Fail; } #if LV_FREETYPE_SBIT_CACHE error = FTC_SBitCache_New(cache_manager, &sbit_cache); if(error) { - LV_LOG_ERROR("Failed to open sbit cache"); + QPY_FREETYPE_LOG("Failed to open sbit cache"); goto Fail; } #else error = FTC_ImageCache_New(cache_manager, &image_cache); if(error) { - LV_LOG_ERROR("Failed to open image cache"); + QPY_FREETYPE_LOG("Failed to open image cache"); goto Fail; } #endif @@ -196,7 +202,7 @@ static FT_Error font_face_requester(FTC_FaceID face_id, error = FT_New_Face(library, dsc->name, 0, aface); } if(error) { - LV_LOG_ERROR("FT_New_Face error:%d\n", error); + QPY_FREETYPE_LOG("FT_New_Face error:%d\n", error); return error; } return FT_Err_Ok; @@ -291,7 +297,7 @@ static bool get_glyph_dsc_cb_cache(const lv_font_t * font, #if LV_FREETYPE_SBIT_CACHE FT_Error error = FTC_SBitCache_Lookup(sbit_cache, &desc_type, glyph_index, &sbit, NULL); if(error) { - LV_LOG_ERROR("SBitCache_Lookup error"); + QPY_FREETYPE_LOG("SBitCache_Lookup error"); return false; } @@ -304,11 +310,11 @@ static bool get_glyph_dsc_cb_cache(const lv_font_t * font, #else FT_Error error = FTC_ImageCache_Lookup(image_cache, &desc_type, glyph_index, &image_glyph, NULL); if(error) { - LV_LOG_ERROR("ImageCache_Lookup error"); + QPY_FREETYPE_LOG("ImageCache_Lookup error"); return false; } if(image_glyph->format != FT_GLYPH_FORMAT_BITMAP) { - LV_LOG_ERROR("Glyph_To_Bitmap error"); + QPY_FREETYPE_LOG("Glyph_To_Bitmap error"); return false; } @@ -373,7 +379,7 @@ static bool lv_ft_font_init_cache(lv_ft_info_t * info) scaler.pixel = 1; FT_Error error = FTC_Manager_LookupSize(cache_manager, &scaler, &face_size); if(error) { - LV_LOG_ERROR("Failed to LookupSize"); + QPY_FREETYPE_LOG("Failed to LookupSize"); goto Fail; } @@ -454,7 +460,7 @@ static void face_generic_finalizer(void * object) { FT_Face face = (FT_Face)object; face_remove_from_list(face); - LV_LOG_INFO("face finalizer(%p)\n", face); + QPY_FREETYPE_LOG("face finalizer(%p)\n", face); } static bool get_glyph_dsc_cb_nocache(const lv_font_t * font, @@ -555,7 +561,7 @@ static bool lv_ft_font_init_nocache(lv_ft_info_t * info) error = FT_New_Face(library, dsc->name, 0, &face); } if(error) { - LV_LOG_WARN("create face error(%d)", error); + QPY_FREETYPE_LOG("create face error(%d)", error); goto Fail; } @@ -653,7 +659,7 @@ static void name_refer_del(const char * name) refer = _lv_ll_get_next(&names_ll, refer); } - LV_LOG_WARN("name_in_names_del error(not find:%p).", name); + QPY_FREETYPE_LOG("name_in_names_del error(not find:%p).", name); } /** @@ -680,8 +686,129 @@ static const char * name_refer_save(const char * name) _lv_ll_remove(&names_ll, refer); lv_mem_free(refer); } - LV_LOG_WARN("save_name_to_names error(not memory)."); + QPY_FREETYPE_LOG("save_name_to_names error(not memory)."); return ""; } + + +//add for third party software +/* return file instead of fd, following lv_fs */ +FILE *ft2_fopen(const char *path, const char *mode) +{ + lv_fs_file_t *fp = lv_mem_alloc(sizeof(lv_fs_file_t)); + + (void)mode; + QPY_FREETYPE_LOG("%s: file %s\n", __func__, path); + + lv_fs_res_t res = lv_fs_open(fp, path, LV_FS_MODE_RD); + if(res != LV_FS_RES_OK) { + QPY_FREETYPE_LOG("[%s] error,path = %s,errno = %d !!!\n", __func__, path, res); + return NULL; + } + QPY_FREETYPE_LOG ("[%s]: file =%p, path=%s\n",__FUNCTION__, fp, path); + + return (FILE*)fp; +} + +int ft2_fclose(FILE *fp) +{ + lv_fs_file_t *file = (lv_fs_file_t *)fp; + + if(!file){ + QPY_FREETYPE_LOG("[%s]: file is null\n", __func__); + return -1; + } + + lv_res_t res = lv_fs_close(file); + lv_mem_free(file); + + if(LV_FS_RES_OK != res) { + QPY_FREETYPE_LOG("[%s]: failed\n", __func__); + return -1; + } + + QPY_FREETYPE_LOG ("[%s]: file %p\n",__FUNCTION__, file); + return 0; +} + +size_t ft2_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + uint32_t rn = 0; + lv_fs_file_t *file = (lv_fs_file_t *)stream; + + QPY_FREETYPE_LOG("ft2_fread: file=%p, len=0x%x\n", file, (size * nmemb)); + /*lv_freetype.c FT2_read has normal case: len = 0 and buf=NULL */ + if(size * nmemb == 0 || ptr == NULL) { + return size * nmemb; + } + + lv_fs_read(file, ptr, (size * nmemb), &rn); + + return rn; +} + +size_t ft2_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + uint32_t rn = 0; + lv_fs_file_t *file = (lv_fs_file_t *)stream; + + lv_fs_write(file, ptr, (size * nmemb), &rn); + + return rn; +} + +long ft2_ftell(FILE *stream) +{ + lv_fs_file_t *file = (lv_fs_file_t *)stream; + uint32_t pos = 0; + + lv_fs_tell(file, &pos); + QPY_FREETYPE_LOG("[%s]: file %p, pos=0x%x\n",__FUNCTION__, file, (unsigned)pos); + + return pos; +} + +int ft2_fseek(FILE *stream, long offset, int whence) +{ + lv_fs_file_t *file = (lv_fs_file_t *)stream; + + if(LV_FS_RES_OK != lv_fs_seek(file, offset, whence)) { + QPY_FREETYPE_LOG("%s, failed", __func__); + return -1; + } + QPY_FREETYPE_LOG("[%s]: file =%p, offset=0x%x\n",__FUNCTION__, file, (unsigned)offset); + + return 0; +} + + +void ASR_FREE(void *p) { + lv_mem_free(p); +} + +void * ASR_MALLOC(unsigned long size) +{ + void * p = lv_mem_alloc(size); + return p; +} + +void * ASR_REALLOC(void *p, unsigned long size) +{ + uint32_t old_size = _lv_mem_get_size(p); + if(old_size == size) return p; /*Also avoid reallocating the same memory*/ + + void * data_p = lv_mem_alloc(size); + if(data_p != NULL) { + /*Copy the old data to the new. Use the smaller size*/ + if(old_size != 0) { + _lv_memcpy(data_p, p, LV_MATH_MIN(size, old_size)); + lv_mem_free(p); + } + } + + return data_p; +} + + #endif /*LV_USE_FREETYPE*/ diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/fsdrv/lv_fs_helios.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/fsdrv/lv_fs_helios.c index 0a983550..b4fdf29c 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/fsdrv/lv_fs_helios.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/libs/fsdrv/lv_fs_helios.c @@ -51,7 +51,7 @@ typedef QDIR * dir_t; -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) extern int Helios_frename(const char *old_path, const char *new_path); extern int Helios_frmdir(const char *path); extern int Helios_fmkdir(const char *path, uint16_t mode); @@ -117,7 +117,7 @@ void lv_fs_if_helios_init(void) fs_drv.seek_cb = fs_seek; fs_drv.tell_cb = fs_tell; -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) fs_drv.dir_close_cb = fs_dir_close; fs_drv.dir_open_cb = fs_dir_open; fs_drv.dir_read_cb = fs_dir_read; @@ -150,7 +150,7 @@ void lv_fs_if_helios_bak_init(void) fs_drv.seek_cb = fs_seek; fs_drv.tell_cb = fs_tell; -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) fs_drv.dir_close_cb = fs_dir_close; fs_drv.dir_open_cb = fs_dir_open; fs_drv.dir_read_cb = fs_dir_read; @@ -185,7 +185,7 @@ void lv_fs_if_helios_SD_init(void) fs_drv.seek_cb = fs_seek; fs_drv.tell_cb = fs_tell; -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) fs_drv.dir_close_cb = fs_dir_close; fs_drv.dir_open_cb = fs_dir_open; fs_drv.dir_read_cb = fs_dir_read; @@ -222,7 +222,7 @@ void lv_fs_if_helios_extflash_init(void) fs_drv.seek_cb = fs_seek; fs_drv.tell_cb = fs_tell; -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) fs_drv.dir_close_cb = fs_dir_close; fs_drv.dir_open_cb = fs_dir_open; fs_drv.dir_read_cb = fs_dir_read; @@ -428,7 +428,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) * @param path path to a directory * @return LV_FS_RES_OK or any error from lv_fs_res_t enum */ -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) static void * fs_dir_open(lv_fs_drv_t * drv, const char * path) { LV_UNUSED(drv); diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/others/ime/lv_ime_pinyin.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/others/ime/lv_ime_pinyin.c index 6aa47ad7..325ae0b4 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/others/ime/lv_ime_pinyin.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/extra/others/ime/lv_ime_pinyin.c @@ -1176,6 +1176,7 @@ static void pinyin_ime_clear_data(lv_obj_t * obj) lv_memset_00(lv_pinyin_k9_cand_str, sizeof(lv_pinyin_k9_cand_str)); strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM], LV_SYMBOL_RIGHT"\0"); strcpy(lv_pinyin_k9_cand_str[LV_IME_PINYIN_K9_CAND_TEXT_NUM + 1], "\0"); + _lv_ll_clear(&pinyin_ime->k9_legal_py_ll); } #endif @@ -1383,15 +1384,16 @@ static void pinyin_k9_cand_page_proc(lv_obj_t * obj, uint16_t dir) if(dir == 1) { count = 0; while(ll_index) { - if(count >= (LV_IME_PINYIN_K9_CAND_TEXT_NUM - 1)) + if (count >= (LV_IME_PINYIN_K9_CAND_TEXT_NUM)) break; strcpy(lv_pinyin_k9_cand_str[count], ll_index->py_str); ll_index = _lv_ll_get_next(&pinyin_ime->k9_legal_py_ll, ll_index); /*Find the next list*/ count++; } - pinyin_ime->k9_py_ll_pos += count - 1; - + if(ll_index) { + pinyin_ime->k9_py_ll_pos += count; + } } // previous page else { diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c index 6ca480bf..76bab247 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_16_ALL.c @@ -14,7 +14,7 @@ // #define K01_font_16_ALL 1 // #endif -#if PROJECT_NAME_G3_K01 +#if PROJECT_NAME_G3_K01_font /*----------------- * BITMAPS diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_30_DIAL.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_30_DIAL.c index f4fe0700..37c74cca 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_30_DIAL.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/K01_font_30_DIAL.c @@ -10,11 +10,9 @@ #include "lvgl/lvgl.h" #endif -#ifndef K01_FONT_30_DIAL -#define K01_FONT_30_DIAL 1 -#endif -#if K01_FONT_30_DIAL + +#if PROJECT_NAME_G3_K01_font /*----------------- * BITMAPS diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h index f3faea81..727b59e3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font.h @@ -245,7 +245,7 @@ LV_FONT_DECLARE(lv_font_70_bold) LV_FONT_DECLARE(lv_font_28_dial) LV_FONT_DECLARE(lv_font_60_main_menu) #endif -#ifdef PROJECT_NAME_G3_K01 +#ifdef PROJECT_NAME_G3_K01_font LV_FONT_DECLARE(K01_font_16_ALL) LV_FONT_DECLARE(K01_font_30_DIAL) #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font_70_bold.c b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font_70_bold.c index 7ddcd061..28a92989 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font_70_bold.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/font/lv_font_70_bold.c @@ -11,7 +11,7 @@ #endif -#if LV_FONT_YINGKA_DEMO +#if PROJECT_NAME_G5_K5 || PROJECT_NAME_G3_C06S ||PROJECT_NAME_C3_W8 /*----------------- * BITMAPS diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/hal/lv_hal_indev.h b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/hal/lv_hal_indev.h index 8ffaa583..1601d9c2 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/hal/lv_hal_indev.h +++ b/2.sdk-ZY/Helios_SDK/services/microPython/lib/lvgl/src/hal/lv_hal_indev.h @@ -32,7 +32,7 @@ extern "C" { /*Drag throw slow-down in [%]. Greater value -> faster slow-down*/ #define LV_INDEV_DEF_SCROLL_THROW 2 -//xÖỬ¶¯²¹³¥£¬ÖµÔ½´óÔ½¿ì£¬¾¡Á¿²»³¬¹ý·Ö±æÂʵÄÒ»°ë +//x轴滑动补偿,值越大越快,尽量不超过分辨率的一半 #if PROJECT_NAME_G3_K01 #define LV_INDEV_DEF_X_SLIDING_SPEED 50 #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/microPython.mk b/2.sdk-ZY/Helios_SDK/services/microPython/microPython.mk index 0e377646..d0f83376 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/microPython.mk +++ b/2.sdk-ZY/Helios_SDK/services/microPython/microPython.mk @@ -559,8 +559,48 @@ lib/lvgl/src/widgets/lv_roller.c \ lib/lvgl/src/widgets/lv_slider.c \ lib/lvgl/src/widgets/lv_switch.c \ lib/lvgl/src/widgets/lv_table.c \ -lib/lvgl/src/widgets/lv_textarea.c - +lib/lvgl/src/widgets/lv_textarea.c \ +lib/lvgl/freetype-2.11.1/src/autofit/autofit.c \ +lib/lvgl/freetype-2.11.1/src/base/ftbase.c \ +lib/lvgl/freetype-2.11.1/src/base/ftbbox.c \ +lib/lvgl/freetype-2.11.1/src/base/ftbdf.c \ +lib/lvgl/freetype-2.11.1/src/base/ftbitmap.c \ +lib/lvgl/freetype-2.11.1/src/base/ftcid.c \ +lib/lvgl/freetype-2.11.1/src/base/ftfstype.c \ +lib/lvgl/freetype-2.11.1/src/base/ftgasp.c \ +lib/lvgl/freetype-2.11.1/src/base/ftglyph.c \ +lib/lvgl/freetype-2.11.1/src/base/ftgxval.c \ +lib/lvgl/freetype-2.11.1/src/base/ftinit.c \ +lib/lvgl/freetype-2.11.1/src/base/ftmm.c \ +lib/lvgl/freetype-2.11.1/src/base/ftotval.c \ +lib/lvgl/freetype-2.11.1/src/base/ftpatent.c \ +lib/lvgl/freetype-2.11.1/src/base/ftpfr.c \ +lib/lvgl/freetype-2.11.1/src/base/ftstroke.c \ +lib/lvgl/freetype-2.11.1/src/base/ftsynth.c \ +lib/lvgl/freetype-2.11.1/src/base/fttype1.c \ +lib/lvgl/freetype-2.11.1/src/base/ftwinfnt.c \ +lib/lvgl/freetype-2.11.1/src/bdf/bdf.c \ +lib/lvgl/freetype-2.11.1/src/bzip2/ftbzip2.c \ +lib/lvgl/freetype-2.11.1/src/cache/ftcache.c \ +lib/lvgl/freetype-2.11.1/src/cff/cff.c \ +lib/lvgl/freetype-2.11.1/src/cid/type1cid.c \ +lib/lvgl/freetype-2.11.1/src/gzip/ftgzip.c \ +lib/lvgl/freetype-2.11.1/src/lzw/ftlzw.c \ +lib/lvgl/freetype-2.11.1/src/pcf/pcf.c \ +lib/lvgl/freetype-2.11.1/src/pfr/pfr.c \ +lib/lvgl/freetype-2.11.1/src/psaux/psaux.c \ +lib/lvgl/freetype-2.11.1/src/pshinter/pshinter.c \ +lib/lvgl/freetype-2.11.1/src/psnames/psnames.c \ +lib/lvgl/freetype-2.11.1/src/raster/raster.c \ +lib/lvgl/freetype-2.11.1/src/sdf/sdf.c \ +lib/lvgl/freetype-2.11.1/src/sfnt/sfnt.c \ +lib/lvgl/freetype-2.11.1/src/smooth/smooth.c \ +lib/lvgl/freetype-2.11.1/src/truetype/truetype.c \ +lib/lvgl/freetype-2.11.1/src/type1/type1.c \ +lib/lvgl/freetype-2.11.1/src/type42/type42.c \ +lib/lvgl/freetype-2.11.1/src/winfonts/winfnt.c \ +lib/lvgl/freetype-2.11.1/src/base/ftsystem.c \ +lib/lvgl/freetype-2.11.1/src/base/ftdebug.c endif @@ -596,7 +636,35 @@ $(NAME)_INCS += \ lib/lvgl/src/gpu \ lib/lvgl/src/hal \ lib/lvgl/src/misc \ - lib/lvgl/src/widgts + lib/lvgl/src/widgts \ + lib/lvgl/freetype-2.11.1/include \ + lib/lvgl/freetype-2.11.1/include/dlg \ + lib/lvgl/freetype-2.11.1/include/freetype \ + lib/lvgl/freetype-2.11.1/include/freetype/config \ + lib/lvgl/freetype-2.11.1/include/freetype/internal \ + lib/lvgl/freetype-2.11.1/include/freetype/internal/services \ + lib/lvgl/freetype-2.11.1/src/base \ + lib/lvgl/freetype-2.11.1/src/autofit \ + lib/lvgl/freetype-2.11.1/src/bdf \ + lib/lvgl/freetype-2.11.1/src/bzip2 \ + lib/lvgl/freetype-2.11.1/src/cache \ + lib/lvgl/freetype-2.11.1/src/cff \ + lib/lvgl/freetype-2.11.1/src/cid \ + lib/lvgl/freetype-2.11.1/src/gzip \ + lib/lvgl/freetype-2.11.1/src/lzw \ + lib/lvgl/freetype-2.11.1/src/pcf \ + lib/lvgl/freetype-2.11.1/src/pfr \ + lib/lvgl/freetype-2.11.1/src/psaux \ + lib/lvgl/freetype-2.11.1/src/pshinter \ + lib/lvgl/freetype-2.11.1/src/psnames \ + lib/lvgl/freetype-2.11.1/src/raster \ + lib/lvgl/freetype-2.11.1/src/sdf \ + lib/lvgl/freetype-2.11.1/src/sfnt \ + lib/lvgl/freetype-2.11.1/src/smooth \ + lib/lvgl/freetype-2.11.1/src/truetype \ + lib/lvgl/freetype-2.11.1/src/type1 \ + lib/lvgl/freetype-2.11.1/src/type42 \ + lib/lvgl/freetype-2.11.1/src/winfonts endif EMPTY= diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/EventMesh.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/EventMesh.py index 3f601bc4..e1cceaa7 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/EventMesh.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/EventMesh.py @@ -1,18 +1,13 @@ import _thread import usys -import uos -import utime import versions -MODEL = "K01_" #项目型号 +MODEL = "W8_" #项目型号 version = "{}{}".format(MODEL,versions.Version) builTime = "{}".format(versions.Build_Time) - - - class EventStore(object): def __init__(self): self.map = dict() @@ -89,6 +84,8 @@ def set_log(log_adapter): def add_filter(flt): event_store.add_filter(flt) +import utime +import uos Txt_Log = 0 def txt_log(data): if Txt_Log != 0 : @@ -99,7 +96,7 @@ def txt_log(data): uos.remove("ext/log.txt") except Exception as e: usys.print_exception(e) - with open("/ext/log.txt","a",encoding="utf-8") as fd: + with open("/usr/log.txt","a",encoding="utf-8") as fd: d_time = utime.localtime() data_tmp = "%02d-%02d %02d:%02d:%02d :"%(d_time[1],d_time[2],d_time[3],d_time[4],d_time[5]) fd.write(data_tmp+data+"\n") diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ZY_lcd.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ZY_lcd.py deleted file mode 100644 index e8bdcfee..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ZY_lcd.py +++ /dev/null @@ -1,295 +0,0 @@ -import lvgl as lv -from machine import LCD, Pin -from tp import cst816 -import _thread -import utime -#import EventMesh -from misc import PWM - -init_data = ( - 0, 0, 0xfe, - 0, 0, 0xfe, - 0, 0, 0xEF, - - 0, 0, 0x20, - - 0, 1, 0x36, - 1, 1, 0xd8, - - 0, 1, 0x3A, - 1, 1, 0x05, - - 0, 1, 0x35, - 1, 1, 0x00, - - 0, 1, 0xA8, - 1, 1, 0x22, - - 0, 1, 0xB4, - 1, 1, 0x00, - - 0, 1, 0xc6, - 1, 1, 0x3f, - - 0, 1, 0xB0, - 1, 1, 0xC0, - - 0, 1, 0xB2, - 1, 1, 0x2F, - - 0, 1, 0xB3, - 1, 1, 0x13, - - 0, 1, 0xB6, - 1, 1, 0x19, - - 0, 1, 0xB7, - 1, 1, 0x01, - - 0, 1, 0xAC, - 1, 1, 0xC8, - - 0, 1, 0xAB, - 1, 1, 0x0f, - - 0, 1, 0xb8, - 1, 1, 0x08, - - 0, 1, 0xE8, - 1, 1, 0x27, - - 2, 0, 12, - - 0, 1, 0xE9, - 1, 1, 0x47, - - 0, 1, 0xea, - 1, 1, 0x44, - - 0, 1, 0xeb, - 1, 1, 0xb0, - - # 0, 1, 0xed, - # 1, 1, 0x03, - - 0, 1, 0x44, - 1, 1, 0x00, - - - - 0, 1, 0xc7, - 1, 1, 0x1D, - - 0, 14, 0xF0, - 1, 1, 0x0F, - 1, 1, 0x24, - 1, 1, 0x2c, - 1, 1, 0x38, - 1, 1, 0x67, - 1, 1, 0x39, - 1, 1, 0x20, - 1, 1, 0x60, - 1, 1, 0x04, - 1, 1, 0x14, - 1, 1, 0x10, - 1, 1, 0x10, - 1, 1, 0x0c, - 1, 1, 0x1f, - - 0, 14, 0xF1, - 1, 1, 0x1f, - 1, 1, 0x38, - 1, 1, 0x3f, - 1, 1, 0x4f, - 1, 1, 0xd7, - 1, 1, 0x24, - 1, 1, 0x3f, - 1, 1, 0x60, - 1, 1, 0x00, - 1, 1, 0x03, - 1, 1, 0x09, - 1, 1, 0x14, - 1, 1, 0x10, - 1, 1, 0x1F, - - 0, 3, 0xf4, - 1, 1, 0x00, - 1, 1, 0x00, - 1, 1, 0xff, - - 0, 0, 0x11, - 2, 0, 120, - 0, 0, 0x29, - 0, 0, 0x2c, - -) - -XSTART_H = 0xf0 -XSTART_L = 0xf1 -YSTART_H = 0xf2 -YSTART_L = 0xf3 -XEND_H = 0xE0 -XEND_L = 0xE1 -YEND_H = 0xE2 -YEND_L = 0xE3 - - -XSTART = 0xD0 -XEND = 0xD1 -YSTART = 0xD2 -YEND = 0xD3 - -lcd = LCD() - -init_buf = bytearray(init_data) - -init_data2 = ( - 0, 4, 0x2a, - 1, 1, XSTART_H, - 1, 1, XSTART_L, - 1, 1, XEND_H, - 1, 1, XEND_L, - 0, 4, 0x2b, - 1, 1, YSTART_H, - 1, 1, YSTART_L, - 1, 1, YEND_H, - 1, 1, YEND_L, - 0, 0, 0x2c, - -) -invalid = bytearray(init_data2) - -init_data3 = ( - 0, 0, 0x28, - 2, 0, 120, - 0, 0, 0x10, - -) -displayoff = bytearray(init_data3) - -init_data4 = ( - 0, 0, 0x11, - 2, 0, 120, - 0, 0, 0x29, - -) -displayon = bytearray(init_data4) -# CST816初始化 -import initTP -initTP.HYN_Initial() -tp_cst816 = cst816(i2c_no = 2,irq=33, reset=32) -tp_cst816.activate() -tp_cst816.init() - -print("cst816 init...") -from btn_device_ec800m import BtnDevice -btn_device = BtnDevice(tp_cst816) -btn_device.start() - -print("lcd_init2 ...") -lcd_ctrl = Pin(Pin.GPIO18, Pin.OUT, Pin.PULL_DISABLE, 1) - -#lcd.lcd_init(init_buf, 128, 128, 26000, 1, 4, 0, invalid, displayon, displayoff, None,spi_mode=0,TESel = True,TEPin = 17) -#lcd.lcd_init(init_buf, 240,320,4,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 3, 31) -#lcd.lcd_init(init_buf, 128, 128,4,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 4, 31,) -#2是spi_cs引脚的GPIO号,30是DC引脚的GPIO号,31是RST引脚的GPIO号 -lcd.lcd_init(init_buf, 128,128,4,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 4, 31,) -lcd.lcd_set_offset(0,32) -# gpio_backlight = Pin(Pin.GPIO37, Pin.OUT, Pin.PULL_DISABLE, 0) -# gpio_backlight.write(1) -PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1000) -PWM_backlight.open() -lcd.lcd_clear(0x00f8) -lcd.lcd_display_on() -utime.sleep_ms(1*1000) -LCD_SIZE_W = 128 -LCD_SIZE_H = 128 -# pwm.close() -# 初始化lvgl -lv.init() - -# Register SDL display driver. -disp_buf1 = lv.disp_draw_buf_t() -buf1_1 = bytearray(LCD_SIZE_W * LCD_SIZE_H * 2) -#buf1_2= bytearray(LCD_SIZE_W * LCD_SIZE_H * 2) - -disp_buf1.init(buf1_1, None, len(buf1_1)) -disp_drv = lv.disp_drv_t() -disp_drv.init() -disp_drv.draw_buf = disp_buf1 -disp_drv.flush_cb = lcd.lcd_write -disp_drv.hor_res = LCD_SIZE_W -disp_drv.ver_res = LCD_SIZE_H -disp_drv.register() - - -# LVGL触摸注册 -indev_drv = lv.indev_drv_t() -indev_drv.init() -indev_drv.type = lv.INDEV_TYPE.POINTER -indev_drv.read_cb = tp_cst816.read -indev_drv.long_press_time = 400 -indev_drv.register() -gpio4 = Pin(Pin.GPIO33, Pin.OUT, Pin.PULL_PU, 0) - -# def indev_task(): -# while 1: -# pos_s = tp_cst816.read_xy() -# # import _thread -# # x = _thread.get_heap_size() -# # print('heap:',x) -# if pos_s: -# if 100 == pos_s[0] and 400 == pos_s[1]: -# EventMesh.publish("done_return") -# print("return") -# utime.sleep_ms(200) -# else: -# utime.sleep_ms(200) - -# _thread.start_new_thread(indev_task,()) - -# 启动lvgv线程 -lv.tick_inc(5) -lv.task_handler() -style_screen = lv.style_t() -style_screen.init() -style_screen.set_radius(0) -style_screen.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -style_screen.set_bg_opa(255) -style_screen.set_border_width(0) -style_screen.set_pad_left(0) -style_screen.set_pad_right(0) -style_screen.set_pad_top(0) -style_screen.set_pad_bottom(0) -#开机画面 -# style_font_youyuan_40 = lv.style_t() -# style_font_youyuan_40.init() -# style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -# style_font_youyuan_40.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) - -lcd.lcd_display_on() -utime.sleep_ms(2) -lv.autoSleep(0) - -power_on_screen = lv.obj() -print("power_on_screen") -power_on_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -# power_on_label = lv.label(power_on_screen) -# power_on_label.set_text("系统初始化中") -# power_on_label.set_pos(0, 50) -# power_on_label.set_size(128, 20) -# power_on_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# power_on_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) -print("power_on_screen init...") - - -lv.scr_load(power_on_screen) -utime.sleep_ms(200) -print("power_on_screen end...") -PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 200, 1000) -PWM_backlight.open() -lcd.lcd_clear(0xF800) -lcd.lcd_display_on() -#class camera.camPreview(model,cam_w,cam_h,lcd_w,lcd_h,perview_level) \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appFactoryMode.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appFactoryMode.py deleted file mode 100644 index 8a00e40b..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appFactoryMode.py +++ /dev/null @@ -1,355 +0,0 @@ -import osTimer -import lvgl as lv -import EventMesh -import osTimer -import constants -import ujson -import ql_fs -import audio -from machine import Pin -from ui import style_screen,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn -import audio -import utime -import usys -from misc import ADC -from misc import Power -factorymode_cont_y = 0 -factorymode_screen = lv.obj() -print("factorymode_screen") -factorymode_screen.center() -factorymode_screen.set_size(128, 128) -factorymode_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -factorymode_title = lv.label(factorymode_screen) -factorymode_title.set_pos(0, 5) -factorymode_title.set_size(128, 20) -factorymode_title.set_text("-工厂模式-") -factorymode_title.set_long_mode(lv.label.LONG.WRAP) -factorymode_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -factorymode_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -factorymode_cont_style = lv.style_t() -factorymode_cont_style.init() -factorymode_cont_style.set_radius(0) -factorymode_cont_style.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -factorymode_cont_style.set_bg_grad_color(lv.color_make(0x00, 0x00, 0x00)) -factorymode_cont_style.set_bg_grad_dir(lv.GRAD_DIR.VER) -factorymode_cont_style.set_bg_opa(255) -factorymode_cont_style.set_border_width(0) -factorymode_cont_style.set_pad_left(0) -factorymode_cont_style.set_pad_right(0) -factorymode_cont_style.set_pad_top(0) -factorymode_cont_style.set_pad_bottom(0) - -factorymode_cont = lv.obj(factorymode_screen) -factorymode_cont.set_pos(0, 50) -factorymode_cont.set_size(128, 270) -factorymode_cont.add_style(factorymode_cont_style,lv.PART.MAIN | lv.STATE.DEFAULT) - -factorymode_location = lv.btn(factorymode_cont) -factorymode_location.set_pos(0, factorymode_cont_y) -factorymode_location.set_size(128, 60) -factorymode_location_label = lv.label(factorymode_location) -factorymode_location_label.set_text("定位测试") -factorymode_location.set_style_pad_all(0, lv.STATE.DEFAULT) -factorymode_location_label.align(lv.ALIGN.LEFT_MID, 0, 0) -factorymode_location_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -factorymode_location_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -factorymode_location.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - -factorymode_cont_y+=60 -factorymode_bat_test = lv.btn(factorymode_cont) -factorymode_bat_test.set_pos(0, factorymode_cont_y) -factorymode_bat_test.set_size(128, 60) -factorymode_bat_test_label = lv.label(factorymode_bat_test) -factorymode_bat_test_label.set_text("电池测试") -factorymode_bat_test.set_style_pad_all(0, lv.STATE.DEFAULT) -factorymode_bat_test_label.align(lv.ALIGN.LEFT_MID, 0, 0) -factorymode_bat_test_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -factorymode_bat_test_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -factorymode_bat_test.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - -factorymode_cont_y+=60 -factorymode_step = lv.btn(factorymode_cont) -factorymode_step.set_pos(0, factorymode_cont_y) -factorymode_step.set_size(240, 60) -factorymode_step_label = lv.label(factorymode_step) -factorymode_step_label.set_text("计步测试") -factorymode_step.set_style_pad_all(0, lv.STATE.DEFAULT) -factorymode_step_label.align(lv.ALIGN.LEFT_MID, 70, 0) -factorymode_step_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -factorymode_step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -factorymode_step.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - -class FactoryModeScreen(Screen): - NAME = "factorymode" - def __init__(self): - super().__init__() - self.meta = factorymode_screen - factorymode_location.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "FactoryModeLocation"})), lv.EVENT.SHORT_CLICKED, None) - factorymode_bat_test.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "FactoryModeBatTest"})), lv.EVENT.SHORT_CLICKED, None) - factorymode_step.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "FactoryModestep"})), lv.EVENT.SHORT_CLICKED, None) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -FactoryModeBatTest_screen = lv.obj() -FactoryModeBatTest_screen.center() -FactoryModeBatTest_screen.set_size(128, 128) -FactoryModeBatTest_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -FactoryModeBatTest_label = lv.label(FactoryModeBatTest_screen) -FactoryModeBatTest_label.set_text("Vbat:0V") -FactoryModeBatTest_label.set_size(128, 100) -FactoryModeBatTest_label.set_pos(0, 40) -FactoryModeBatTest_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) -FactoryModeBatTest_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -FactoryModeBatTest_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - -class FactoryModeBatTestScreen(Screen): - NAME = "FactoryModeBatTest" - def __init__(self): - super().__init__() - self.meta = FactoryModeBatTest_screen - self.BatTest_timer = osTimer() - self.adc = ADC() - def initialization(self): - print("FactoryModeBatTestScreen") - self.BatTest_timer.start(1000,1,self.BatTest_timer_cb) - self.adc.open() - - def post_processor_after_initialization(self): - pass - - def BatTest_timer_cb(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - temp = self.adc.read(ADC.ADC0)#Power.getVbatt() - temp1 = self.adc.read(ADC.ADC1) - FactoryModeBatTest_label.set_text("adc0{}v \nadc1:{}V".format(temp,temp1)) - - def Close(self): - self.BatTest_timer.stop() - self.adc.close() - pass - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -#显示x y z 三轴数据 -FactoryModestep_screen = lv.obj() -FactoryModestep_screen.center() -FactoryModestep_screen.set_size(128, 128) -FactoryModestep_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - -FactoryMode_step_label = lv.label(FactoryModestep_screen) -FactoryMode_step_label.set_text(" ") -FactoryMode_step_label.set_pos(0, 20) -FactoryMode_step_label.set_size(128, 40) -FactoryMode_step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -FactoryMode_step_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - -FactoryMode_xyz_label = lv.label(FactoryModestep_screen) -FactoryMode_xyz_label.set_text(" ") -FactoryMode_xyz_label.set_pos(0, 60) -FactoryMode_xyz_label.set_size(128, 68) -FactoryMode_xyz_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -FactoryMode_xyz_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -#FactoryModeLogNext_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) - -class FactoryModestepScreen(Screen): - NAME = "FactoryModestep" - def __init__(self): - super().__init__() - self.meta = FactoryModestep_screen - self.Log_timer_count = 0 - self.Log_timer = osTimer() - - def initialization(self): - step = EventMesh.publish(constants.EVENT.GET_STEP) - FactoryMode_step_label.set_text("步数{}".format(step[0])) - FactoryMode_xyz_label.set_text("X:{}\nY:{}\nZ:{}".format(step[1],step[2],step[3])) - self.Log_timer.start(1*1000,1,self.step_cb) - - def post_processor_after_initialization(self): - - pass - - def step_cb(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - step = EventMesh.publish(constants.EVENT.GET_STEP) - print("FactoryModestepScreen",step) - FactoryMode_step_label.set_text("步数{}".format(step[0])) - FactoryMode_xyz_label.set_text("X:{}\nY:{}\nZ:{}".format(step[1],step[2],step[3])) - pass - - - - def Close(self): - self.Log_timer.stop() - self.log_data = "" - pass - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - -FactoryModeLocation_screen = lv.obj() -print("FactoryModeLocation_screen") -FactoryModeLocation_screen.center() -FactoryModeLocation_screen.set_size(128, 128) -FactoryModeLocation_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -# FactoryModeLocation_WIFI_label = lv.label(FactoryModeLocation_screen) -# FactoryModeLocation_WIFI_label.set_text("WIFI:") -# FactoryModeLocation_WIFI_label.set_size(240, 120) -# FactoryModeLocation_WIFI_label.set_pos(0, 0) -# FactoryModeLocation_WIFI_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -# FactoryModeLocation_WIFI_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# FactoryModeLocation_CALL_label = lv.label(FactoryModeLocation_screen) -# FactoryModeLocation_CALL_label.set_text("CALL:") -# FactoryModeLocation_CALL_label.set_size(240, 100) -# FactoryModeLocation_CALL_label.set_pos(0, 120) -# FactoryModeLocation_CALL_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -# FactoryModeLocation_CALL_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -FactoryModeLocation_GNSS_label = lv.label(FactoryModeLocation_screen) -FactoryModeLocation_GNSS_label.set_text("GNSS:\n") -FactoryModeLocation_GNSS_label.set_size(128, lv.SIZE.CONTENT) -FactoryModeLocation_GNSS_label.set_pos(0, 0) -FactoryModeLocation_GNSS_label.set_long_mode(lv.label.LONG.WRAP) -FactoryModeLocation_GNSS_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -FactoryModeLocation_GNSS_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -class FactoryModeLocationScreen(Screen): - NAME = "FactoryModeLocation" - def __init__(self): - super().__init__() - self.meta = FactoryModeLocation_screen - EventMesh.subscribe("PUSH_LOCATION_DATA",self.GET_LOCATION_DATA) - self.timer_FactoryModeLocation = osTimer() - self.time_count = 0 - self.time_GNSS = 0 - self.GNSS_status = 0 - self.timer_c = 0 - def initialization(self): - FactoryModeLocation_GNSS_label.set_text("GNSS:\n") - # FactoryModeLocation_WIFI_label.set_text("WIFI:") - # FactoryModeLocation_CALL_label.set_text("CALL:") - self.timer_FactoryModeLocation.start(1000, 1, self.timer_FactoryModeLocation_cb) - self.time_count = utime.mktime(utime.localtime()) - self.time_GNSS = 0 - self.GNSS_status = 0 - def post_processor_after_initialization(self): - #utime.sleep_ms(1000) - EventMesh.publish(constants.EVENT.START_LOCATION_TEST) #测试模式 - - def timer_FactoryModeLocation_cb(self, *args, **kwargs): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.timer_c += 1 - if self.timer_c >= 7: - get_location_flag = EventMesh.publish("get_location_flag") - self.timer_c = 0 - if get_location_flag != None: - if(get_location_flag == 0): - EventMesh.publish(constants.EVENT.START_LOCATION_TEST) #测试模式 - self.time_count = utime.mktime(utime.localtime()) - - def GET_LOCATION_DATA(self, event, msg): - # print("GPS:{}".format(msg[0])) - # print("WIFI:{}".format(msg[1])) - # print("CALL:{}".format(msg[2])) - EventMesh.publish("system_sleep_rest")#防止黑屏 - _DATA = "" - time_tmp = utime.mktime(utime.localtime()) - - - if len(msg[0]) > 1 : #GPS - GNSS_DATA = "GNSS:------\n" - gnss_data = msg[0][0] - if gnss_data : - GNSS_DATA = GNSS_DATA + "{},{},{}\n".format("A",gnss_data["latitude"],gnss_data["longitude"]) - - self.time_GNSS = time_tmp-self.time_count - EventMesh.txt_log("test location time:{}".format(self.time_GNSS)) - self.time_count = utime.mktime(utime.localtime()) - else: - - GNSS_DATA = GNSS_DATA + "{},{},{}\n".format("V",0,0) - _DATA += "定位时间:{};{}秒\n".format(self.time_GNSS,time_tmp-self.time_count) - - GSV_dict = msg[0][1] - #print("GET_LOCATION_DATA:{}".format(GSV_dict)) - if GSV_dict : - count = 0 - try: - for j in range(200): - for key in GSV_dict : - - if(key != j): - continue - #print("GSV_dict[key]:len:{}".format(len(GSV_dict[key]))) - if GSV_dict[key] >= 1 : - GNSS_DATA+=" {:<3}:[{:<3}] ".format(key,GSV_dict[key])#:<3 宽度为3左对齐 - count+=1 - if count % 2 == 0: - GNSS_DATA+="\n" - - if count > 50: - break - except Exception as e: - usys.print_exception(e) - #print("GxGSV:{}".format(GNSS_DATA)) - _DATA += GNSS_DATA - #FactoryModeLocation_GNSS_label.set_text(GNSS_DATA) - if msg[1] != [] : #WIFI - WIFI_len = len(msg[1][1]) - _DATA += "\nWIFI:------\n" - if WIFI_len > 3: - WIFI_len = 3 - for i in range(WIFI_len) : - _DATA += "{}".format(msg[1][1][i]) - if msg[2] != [] :#基站 - #print("CALL data:".format(msg[2][0])) - if len(msg[2]) >= 2 : - _DATA += "CALL:------\n{}".format(msg[2][0]) - #FactoryModeLocation_CALL_label.set_text("CALL:{}".format(msg[2][0])) - print("GET_LOCATION_DATA:data:{}".format(_DATA)) - FactoryModeLocation_GNSS_label.set_text(_DATA) - self.timer_c = 0 - def Close(self): - EventMesh.publish(constants.EVENT.CLOSE_LOCATION) - self.timer_FactoryModeLocation.stop() - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "factorymode"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/btn_device_ec800m.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/btn_device_ec800m.py index e28f977f..8b744ba3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/btn_device_ec800m.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/btn_device_ec800m.py @@ -5,7 +5,10 @@ from misc import PowerKey import EventMesh from machine import Pin from machine import ExtInt +import utime import constants +#import encoder + class BtnDevice(Abstract): def __init__(self, tp=None): @@ -19,7 +22,19 @@ class BtnDevice(Abstract): self.pwk_count = 0 self.GPIO41_status = 0 self.powerKey_status = 0 - self.pin_timer = osTimer() + self.Coder_timer = osTimer() + self.Coder_timer_count = 0 + self.Coder_data_str_1 = "" + self.Coder_data_str_2 = "" + + self.Coder_IO_tmp = 0 + self.Coder_data_tmp = [] + self.Coder_data1 = [] + self.start_timer_a = 0 + self.start_timer_b = 0 + self.start_timer_flag = 0 + self.tmp_a = 1 + self.tmp_b = 1 def post_processor_after_instantiation(self): # self.keypad.init() # self.keypad.set_callback(self.key_callback) @@ -30,8 +45,127 @@ class BtnDevice(Abstract): self.extint = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) self.extint.enable() + # self.coder = encoder(Pin.GPIO22,Pin.GPIO21) + # self.coder.set_callback(self.Coder_cb) + self.Coder_A = ExtInt(ExtInt.GPIO22, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.Coder_cb) + self.Coder_A.enable() + + self.Coder_B = ExtInt(ExtInt.GPIO21, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.Coder_cb) + self.Coder_B.enable() + + # def Coder_A_cb(self,args): + # if self.Coder_data == []: + # self.Coder_timer.start(1000, 1, self.Coder_timer_cb) + # if self.Coder_A.read_level() == 1: + # self.Coder_data+=args + # else : + # self.Coder_data+=args + + + def Coder_cb(self,args): + #print("Coder_cb {}".format(args)) + self.Coder_timer_count = 0 + if self.start_timer_flag == 0: + #self.Coder_timer.stop() + #self.Coder_data_str_2 = "11" + self.start_timer_flag = 1 + self.Coder_timer_count = 0 + self.Coder_timer.start(100, 1, self.Coder_timer_cb) + rest_flag = 0 + data_tmp = "" + # if args[0] == 21: + # # if self.Coder_B.read_level() == 1: + # # self.start_timer_b = utime.ticks_us() + # # else : + # diff = utime.ticks_diff(utime.ticks_us(), self.start_timer_b) + # self.start_timer_b = utime.ticks_us() + # if diff > 8000 :#and diff <200000: + # pass + # #data_tmp = "B:{} {} {}\n".format(args[1],diff//1000,self.Coder_B.read_level()) + # else : + # return + # elif args[0] == 22: + # #if self.Coder_A.read_level() == 1: + + # diff = utime.ticks_diff(utime.ticks_us(), self.start_timer_a) + # self.start_timer_a = utime.ticks_us() + # if diff > 8000 :#and diff <200000: + # pass + # #data_tmp = "A:{} {} {}\n".format(args[1],diff//1000,self.Coder_A.read_level()) + # else : + # return + #self.Coder_data_str_1+=data_tmp + if self.Coder_IO_tmp != 0 : + if self.Coder_IO_tmp != args[0] :#上一个中断io和当前中断io不一样 + + if self.Coder_data1 == []: + self.Coder_data1 = self.Coder_data_tmp + if self.Coder_data1[0] == 22 and self.Coder_data1[1] == 1: + #self.Coder_data_str_1 += "-上滑\n" + self.Coder_data_str_2+="上滑 " + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish("done_UP") + #rest_flag = 1 + elif self.Coder_data1[0] == 21 and self.Coder_data1[1] == 1 : + #self.Coder_data_str_1 += "-下滑\n" + self.Coder_data_str_2+="下滑 " + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish("done_DOWN") + else: + rest_flag = 1 + elif args[0] != self.Coder_data1[0] and args[1] == 0:#分段 + #self.Coder_data_str_3 += "Coder_data:{} {}".format(self.Coder_data1,self.Coder_data2) + self.Coder_data_str_2+="||" + #self.Coder_data_str_1+="分段" + rest_flag = 1 + + if rest_flag == 1 :#判断完有效清数据 + self.Coder_data1 = [] + self.Coder_IO_tmp = 0 + else : + + self.Coder_IO_tmp = args[0] + self.Coder_data_tmp =args + + def Coder_timer_cb(self, *args): + # tmp = self.Coder_A.read_level() + # data_tmp = "" + # if self.tmp_a != tmp : + # if self.start_timer_a != 0: + # data_tmp = "A{} {},".format(self.tmp_a,self.start_timer_a*6) + # self.start_timer_a = 0 + # else: + # self.start_timer_a += 1 + # self.tmp_a = tmp + # tmp = self.Coder_B.read_level() + # if self.tmp_b != tmp : + # if self.start_timer_b != 0: + # data_tmp = "B{} {},".format(self.tmp_b,self.start_timer_b*6) + # self.start_timer_b = 0 + # else: + # self.start_timer_b += 1 + # self.tmp_b = tmp + # self.Coder_data_str_1+=data_tmp + + self.Coder_timer_count += 1 + if self.Coder_timer_count > 6: + #print("Coder1:\n{}".format(self.Coder_data_str_1)) + #print("Coder2:\n{}".format(self.Coder_data_str_2)) + self.Coder_timer_count = 0 + self.Coder_data_str_1 = "" + self.Coder_data_str_2 = "" + self.Coder_data1 = [] + self.Coder_IO_tmp = 0 + self.start_timer_b = 0 + self.start_timer_a = 0 + self.tmp_a = 1 + self.tmp_b = 1 + self.Coder_timer.stop() + self.start_timer_flag=0 def pwk_extint_cb(self,args): #print('### interrupt {} '.format(args)) # args[0]:gpio号 args[1]:上升沿或下降沿 @@ -114,3 +248,6 @@ class BtnDevice(Abstract): def start(self): self.post_processor_after_instantiation() + +if __name__ == "__main__": + a = BtnDevice() \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/calculator.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/calculator.py deleted file mode 100644 index 47ca5992..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/calculator.py +++ /dev/null @@ -1,670 +0,0 @@ -import lvgl as lv -import ql_fs -import EventMesh -from misc import Power -from ui import style_screen_ta_1_main_main_focused,style_screen_phone_ta_1_main_scrollbar_default,style_screen_phone_ta_1_main_main_default,style_font_youyuan_20_red,style_white_screen,style_font_youyuan_20,style_screen,style_font_youyuan_20_black,style_btn,style_img,Screen,style_contact_btn,style_bar,style_bar_indic -import constants -import osTimer -import audio -from machine import Pin -import usys - -CALCULAROR_NUM = 10 -#style_font_youyuan_20_red.set_text_font_v2("font_28.bin",28,0) -style_screen_text_ta_1_main_main_default = lv.style_t() -style_screen_text_ta_1_main_main_default.init() -style_screen_text_ta_1_main_main_default.set_radius(0) -style_screen_text_ta_1_main_main_default.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_text_ta_1_main_main_default.set_bg_grad_color(lv.color_make(0xff,0xff,0xff)) -style_screen_text_ta_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_text_ta_1_main_main_default.set_bg_opa(255) -style_screen_text_ta_1_main_main_default.set_border_color(lv.color_make(0x00,0x00,0x00)) -style_screen_text_ta_1_main_main_default.set_border_width(0) -style_screen_text_ta_1_main_main_default.set_border_opa(255) -style_screen_text_ta_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_text_ta_1_main_main_default.set_text_letter_space(0) -style_screen_text_ta_1_main_main_default.set_text_align(lv.TEXT_ALIGN.RIGHT) -style_screen_text_ta_1_main_main_default.set_pad_left(0) -style_screen_text_ta_1_main_main_default.set_pad_right(0) -style_screen_text_ta_1_main_main_default.set_pad_top(0) -style_screen_text_ta_1_main_main_default.set_pad_bottom(0) -calculator_screen = lv.obj() -print("calculator_screen") -calculator_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -calculator_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -# 创建文本框 - - -calculator_label = lv.textarea(calculator_screen) -calculator_label.set_one_line(True) # 关闭1行模式 -calculator_label.set_size(128, 30) # 设置宽高 - -calculator_label.set_style_base_dir(lv.BASE_DIR.LTR,0)#LV_BASE_DIR_LTR -calculator_label.align(lv.ALIGN.TOP_RIGHT,0,5) # 设置位置LV_ALIGN_LEFT_MID CENTER LV_ALIGN_TOP_RIGHT -calculator_label.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) #不显示滚动条 -calculator_label.set_cursor_click_pos(False) -calculator_label.set_password_show_time(0) -calculator_label.set_cursor_pos(0x7fff) -calculator_label.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - - -# # add style for screen_ta_1 -calculator_label.add_style(style_screen_phone_ta_1_main_scrollbar_default, lv.PART.SCROLLBAR|lv.STATE.DEFAULT) - -# create style style_screen_ta_1_main_main_default - -calculator_label.add_style(style_screen_ta_1_main_main_focused, lv.PART.MAIN|lv.STATE.FOCUSED) - -# add style for screen_ta_1 -calculator_label.add_style(style_screen_text_ta_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - - -calculator_num = lv.btnmatrix(calculator_screen) -calculator_num.set_pos(int(0),int(30)) -calculator_num.set_size(128,90) -calculator_num.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -btnm_map = [ -"C","<-","=","\n", -"1","2","3","+","\n", -"4","5","6","-","\n", -"7","8","9","*","\n", -".","0","%","/",""] -calculator_num.set_map(btnm_map) -# create style style_calculator_num_main_default -style_calculator_num_main_default = lv.style_t() -style_calculator_num_main_default.init() -style_calculator_num_main_default.set_radius(0) -style_calculator_num_main_default.set_bg_color(lv.color_make(0xff,0xff,0xff)) -style_calculator_num_main_default.set_bg_grad_color(lv.color_make(0xff,0xff,0xff)) -style_calculator_num_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_calculator_num_main_default.set_bg_opa(255) -style_calculator_num_main_default.set_border_color(lv.color_make(0xff,0xff,0xff)) -style_calculator_num_main_default.set_border_width(0) -style_calculator_num_main_default.set_border_opa(255) -style_calculator_num_main_default.set_pad_left(0) -style_calculator_num_main_default.set_pad_right(0) -style_calculator_num_main_default.set_pad_top(0) -style_calculator_num_main_default.set_pad_bottom(0) -style_calculator_num_main_default.set_pad_row(1) -style_calculator_num_main_default.set_pad_column(1) - -# add style for calculator_num -calculator_num.add_style(style_calculator_num_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# create style style_calculator_num_items_default -style_calculator_num_items_default = lv.style_t() -style_calculator_num_items_default.init() -style_calculator_num_items_default.set_radius(4) -style_calculator_num_items_default.set_bg_color(lv.color_make(0xe6,0xe6,0xe6)) -style_calculator_num_items_default.set_bg_grad_color(lv.color_make(0xe6,0xe6,0xe6)) -style_calculator_num_items_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_calculator_num_items_default.set_bg_opa(255) -style_calculator_num_items_default.set_border_color(lv.color_make(0xd6,0xdd,0xe3)) -style_calculator_num_items_default.set_border_width(0) -style_calculator_num_items_default.set_border_opa(255) -style_calculator_num_items_default.set_text_color(lv.color_make(0x00,0x00,0x00)) -try: - style_calculator_num_items_default.set_text_font(lv.K01_font_16_ALL) -except AttributeError: - print("set_font:error") - -# add style for calculator_num -calculator_num.add_style(style_calculator_num_items_default, lv.PART.ITEMS|lv.STATE.DEFAULT) - -waring_label = lv.label(calculator_screen) -waring_label.set_pos(0, 55) -waring_label.set_size(128, 20) -waring_label.set_text("最大位数为10个") -waring_label.add_style(style_font_youyuan_20_red, lv.PART.MAIN | lv.STATE.DEFAULT) -waring_label.set_long_mode(lv.label.LONG.CLIP) -waring_label.add_flag(lv.obj.FLAG.HIDDEN) -waring_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - -def my_round(src, idx): - src_flag = 1 #正负数 - if src < 0: - src_flag = 0 - src = abs(src) - tmp_str = "{}".format(src) - tmp_str_l= tmp_str.split(".") - # print("tmp_str1:{} {}".format(tmp_str,tmp_str_l)) - if len(tmp_str_l)>1 : - if len(tmp_str_l[1]) > idx: - for i in range(idx): - src *=10 - dest = int(src) - if src >= dest+0.5 : - dest += 1 - # print("dest:{}".format(dest)) - tmp_str = "{}".format(dest) - if len(tmp_str) > idx: - tmp_str = tmp_str[:len(tmp_str)-idx]+'.'+tmp_str[len(tmp_str)-idx:] - else : #位数不够,补0 - zero_str = "" - for j in range(idx-len(tmp_str)): - zero_str += "0" - # print("zero_str:{}".format(zero_str)) - tmp_str = '0.'+zero_str+tmp_str - tmp_str = tmp_str.rstrip('0')#去掉尾数的 0 - if "." in tmp_str: - tmp_str = tmp_str.rstrip('.')#去掉尾数的 . - # for i in range(idx): - # dest /=10 - # print("tmp_str:{}".format(tmp_str)) - if src_flag == 0 : - tmp_str = "-" + tmp_str - return tmp_str - -class calculatorScreen(Screen): - NAME = "calculator" - - def __init__(self): - - super().__init__() - self.meta = None - self.calculator_num = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.calculator_list = [] - self.button = 0 - self.timer = osTimer() - self.timer_cb = 0 - self.count = 0 - self.str = "" - self.equal = '' - calculator_num.add_event_cb(lambda e: self.calculator_event_cb(e,calculator_num), lv.EVENT.VALUE_CHANGED, None) - self.calculator_flag = '' - self.result = '' - self.num_count = 0 #限制输入位数 20位 - def initialization(self): - self.result = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.equal = '' - self.str = '' - self.calculator_flag = '' - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text(" ") - self.meta = calculator_screen - - - def calculator_eval(self,str): - print("calculator_eval:str{}".format) - try : - num = eval(str) - ret = "{}".format((my_round(num,8))) #只保留小数点8位 - # print("calcutlor result:",ret) - # tmp = ret.split('.') - # if len(tmp) > 1: - # if len(tmp[1]) > 8 : #保留小数点失败 - # str_tmp = tmp[0]+"."+tmp[1][:-1] - # ret = "{}".format((float(str_tmp))) - - return ret - except Exception as e: - usys.print_exception(e) - e_tmp = "{}".format(e) - if e_tmp.find("divide by zero") != -1 : - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text("除数不能为0") - elif e_tmp.find("invalid syntax") != -1 : - EventMesh.txt_log("calculator:{} {}".format(self.calculator_flag,self.str)) - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text("无效语法") - else : - EventMesh.txt_log("calculator:{} {}".format(self.calculator_flag,self.str)) - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text("运算异常") - self.str = "" - self.result = '' - self.calculator_buf2 = '' - self.calculator_buf1 = '' - self.calculator_flag = '' - self.equal = '' - return -1 - def calculator_event_cb(self,e,calculator_num): - src = e.get_target() - code = e.get_code() - #print("calculator_clicked:{} {}".format(src,code)) - if code == lv.EVENT.VALUE_CHANGED: - txt = src.get_btn_text(src.get_selected_btn()) # 获取被点击的按钮的内容 - try : - if txt == "<-": # 如果是退格键,那么就删除1个字符 - if self.equal == '=': - return - if self.calculator_buf1 != '': - if self.calculator_flag != '': - if self.calculator_buf2 != '': - data_str = list(self.calculator_buf2) - data_tmp = data_str.pop() - self.calculator_buf2 = ''.join(data_str) - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - else: - data_str = list(self.calculator_flag) - data_tmp = data_str.pop() - self.calculator_flag = ''.join(data_str) - self.str = self.calculator_buf1+self.calculator_flag - else: - data_str = list(self.calculator_buf1) - - data_tmp = data_str.pop() - self.calculator_buf1 = ''.join(data_str) - print("data_str",data_str,data_tmp,self.calculator_buf1) - self.str = self.calculator_buf1 - - elif txt == "C": #清除键 - self.equal = '' - self.num_count = 0 - self.str = "" - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.calculator_flag = '' - self.result = '' - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text(" ") - - - elif txt == "=" : - # if self.result != '': - # self.calculator_buf1=self.result - # self.calculator_flag='' - # self.calculator_buf2 = '' - # self.str = self.calculator_buf1 - # else: - print("self.calculator_flag",self.calculator_flag) - if self.calculator_flag == '/': - if self.calculator_buf2 != '': - if self.calculator_buf2.find('.') != -1: - data = self.calculator_buf2.split('.')[1] - if len(data) == 0: - self.calculator_buf2 = self.calculator_buf2.split('.')[0] - if float(self.calculator_buf2) == 0.0 or float(self.calculator_buf2) == 0: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("除数不能为0") - return - - self.equal = '=' - - if self.calculator_buf1 != '': - if self.calculator_flag != '': - if self.calculator_buf2 != '': - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - self.result = self.calculator_eval(self.str) - self.calculator_buf1=self.result - self.calculator_flag ='' - self.calculator_buf2 = '' - self.str = self.calculator_buf1 - - else: - self.result = self.calculator_buf1 - self.calculator_flag = '' - self.calculator_buf2 = '' - self.str = self.calculator_buf1 - else: - self.result = self.calculator_buf1 - self.calculator_flag = '' - self.calculator_buf2 = '' - self.str = self.calculator_buf1 - - elif txt == "%" : - if self.calculator_flag == '/': - if self.calculator_buf2 != '': - if self.calculator_buf2.find('.') != -1: - data = self.calculator_buf2.split('.')[1] - if len(data) == 0: - self.calculator_buf2 = self.calculator_buf2.split('.')[0] - if float(self.calculator_buf2) == 0.0 or float(self.calculator_buf2) == 0: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("除数不能为0") - return - self.equal = '%' - if self.calculator_buf1 != '': - if self.calculator_flag != '': - if self.calculator_buf2 != '': - if self.calculator_buf2.find('.') != -1: - data = self.calculator_buf2.split('.')[1] - if len(data) == 0: - self.calculator_buf2 = self.calculator_buf2.split('.')[0] - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - dat_tmp = self.calculator_eval(self.str) - self.result = self.calculator_eval(dat_tmp+'/100') - self.calculator_flag = '' - self.calculator_buf1 = self.result - self.calculator_buf2 = '' - self.str = self.calculator_buf1+self.calculator_flag - else: - self.calculator_flag = '' - self.str = self.calculator_buf1+"/100" - self.result = self.calculator_eval(self.str) - self.calculator_buf1 = self.result - self.calculator_buf2 = '' - self.str = self.calculator_buf1+self.calculator_flag - else: - if self.calculator_buf1.find('.') != -1: - data = self.calculator_buf1.split('.')[1] - if len(data) == 0: - self.calculator_buf1 = self.calculator_buf1.split('.')[0] - self.calculator_flag = '' - self.str = self.calculator_buf1+"/100" - self.result = self.calculator_eval(self.str) - self.calculator_buf1 = self.result - self.calculator_buf2 = '' - self.str = self.calculator_buf1+self.calculator_flag - - - elif txt == "/" or txt == "*" or txt == "-" or txt == "+" : # 如果是符号,就运算 - # print("result",txt,self.result) - self.equal = txt - if self.calculator_buf1 != '': - if self.calculator_buf1.find('.') != -1: - data = self.calculator_buf1.split('.')[1] - if len(data) == 0: - self.calculator_buf1 = self.calculator_buf1.split('.')[0] - - if self.calculator_flag != '': - if self.calculator_buf2 != '':#第二个数据不为空,则运算结果 - - if self.calculator_buf2.find('.') != -1: - data = self.calculator_buf2.split('.')[1] - if len(data) == 0: - self.calculator_buf2 = self.calculator_buf2.split('.')[0] - if txt == '/' or self.calculator_flag == '/': - - if float(self.calculator_buf2) == 0.0 or float(self.calculator_buf2) == 0: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("除数不能为0") - # calculator_label.add_flag(lv.obj.FLAG.HIDDEN) - return - self.calculator_flag = txt - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - self.result = self.calculator_eval(self.str) - self.calculator_buf1 = self.result - self.calculator_buf2 = '' - self.str = self.calculator_buf1+self.calculator_flag - else:#第二个数据为空不算结果 直接显示最新的符号 - self.calculator_flag = str(txt) - self.str = self.calculator_buf1+self.calculator_flag - - else: - self.calculator_flag = str(txt) - self.str = self.calculator_buf1+self.calculator_flag - - elif txt == ".": - self.equal = txt - if self.result != '': - if self.calculator_flag == '': - self.result = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.str = '' - self.calculator_flag = '' - - if self.calculator_buf1 == '': - self.calculator_buf1+='0.' - self.str = self.calculator_buf1 - else: - if self.calculator_flag == '':#没有特殊字符 + - / * 一直会将数字添加到数字1中 否则添加到数字2中 - if len(self.calculator_buf1) >= CALCULAROR_NUM: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("最大位数为10个") - # calculator_label.add_flag(lv.obj.FLAG.HIDDEN) - return - if self.calculator_buf1.find('.') == -1:#数据1有点了不再加点了直接相加 - self.calculator_buf1+=txt - - - self.str = self.calculator_buf1+self.calculator_flag - - else: - if self.calculator_buf2 != '': - if len(self.calculator_buf2) >= CALCULAROR_NUM: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("最大位数为10个") - # calculator_label.add_flag(lv.obj.FLAG.HIDDEN) - return - if self.calculator_buf2.find('.') == -1:#数据1有点了不再加点了直接相加 - self.calculator_buf2+=txt - - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - - else:# 0 0. 122121 - self.calculator_buf2=self.calculator_buf2+'0.' - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - - elif txt:#数字 - self.equal = txt - if self.result != '': - if self.calculator_flag == '': - self.result = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.str = '' - self.calculator_flag = '' - - if self.calculator_buf1 == '': - if txt == '0': - self.calculator_buf1+='0' - else: - self.calculator_buf1+=txt - self.str = self.calculator_buf1 - else: - if self.calculator_flag == '':#没有特殊字符 + - / * 一直会将数字添加到数字1中 否则添加到数字2中 - if len(self.calculator_buf1) >= CALCULAROR_NUM: - self.timer.stop() - self.timer.start(2000,0,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("最大位数为10个") - # calculator_label.add_flag(lv.obj.FLAG.HIDDEN) - return - if len(self.calculator_buf1) == 1:#0 - if self.calculator_buf1 == '0': - self.calculator_buf1 = txt - else: - self.calculator_buf1+=txt - else: - self.calculator_buf1+=txt - self.str = self.calculator_buf1 - - else: - if self.calculator_buf2 != '': - if len(self.calculator_buf2) >= CALCULAROR_NUM: - self.timer.stop() - self.timer.start(2000,1,self.refresh_line) - waring_label.clear_flag(lv.obj.FLAG.HIDDEN) - waring_label.set_text("最大位数为10个") - # calculator_label.add_flag(lv.obj.FLAG.HIDDEN) - return - if len(self.calculator_buf2) == 1: - if self.calculator_buf2 == '0': - self.calculator_buf2 = txt - else: - self.calculator_buf2+=txt - else: - self.calculator_buf2+=txt - # self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - - else:# 0 0. 122121 - if txt == "0":#0 2 - if self.calculator_buf2.find('.') != -1: - self.calculator_buf2+=txt - else: - if len(self.calculator_buf2) > 1:#0.0 - self.calculator_buf2=self.calculator_buf2+txt - else:#0. - self.calculator_buf2=self.calculator_buf2+'0' - else: - self.calculator_buf2+=txt - # self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - self.str = self.calculator_buf1+self.calculator_flag+self.calculator_buf2 - - # print("self.str",self.str,self.calculator_buf1,self.calculator_buf2,self.calculator_flag,self.result) - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - # calculator_label.scroll_to_x(128, lv.ANIM.ON) - - calculator_label.scroll_to_x(calculator_label.get_scroll_x() - 240//4, lv.ANIM.ON) - calculator_label.scroll_to_view_recursive(lv.ANIM.ON) - calculator_label.scroll_to_view(lv.ANIM.ON) - calculator_label.align(lv.ALIGN.TOP_RIGHT,0,5) # 设置位置LV_ALIGN_LEFT_MID CENTER LV_ALIGN_TOP_RIGHT - calculator_label.set_text(self.str) - - # if txt == "<-": # 如果是退格键,那么就删除1个字符 - # if self.calculator_flag != 2 : - # if len(self.str) > 1: - # str_tmp = self.str[-1] - # if str_tmp == "/" or str_tmp == "*" or str_tmp == "-" or str_tmp == "+" : #最后一个是运算符 - # self.calculator_flag = 0 - # self.str = self.str[0:-1] - # else : - # self.str = "" - # self.calculator_flag = 0 - # if self.num_count > 0 : - # self.num_count-=1 - # #calculator_label.del_char() - # elif txt == "C": #清除键 - # self.num_count = 0 - # self.str = "" - # calculator_label.set_text("") - # self.calculator_flag = 0 - # elif txt == "=" : - # if(self.calculator_flag == 1): #有运算符 - # str_tmp = self.str[-1] - # if str_tmp == "/" or str_tmp == "*" or str_tmp == "-" or str_tmp == "+" : #最后一个是运算符 - # return - # else: - # self.num_count = 0 - # self.result = self.calculator_eval(self.str) - # if self.result == -1: - # return - # self.str += txt+self.result - # self.calculator_flag = 2 - # elif txt == "%" : - # str_tmp = self.str[-1] - # if str_tmp == "/" or str_tmp == "*" or str_tmp == "-" or str_tmp == "+" : #最后一个是运算符 - # self.str = self.str[:-1] - - # self.num_count = 0 - # self.result = self.calculator_eval(self.str+"/100") - # if self.result == -1: - # return - # self.str += txt+"="+self.result - # self.calculator_flag = 2 - # elif txt == "/" or txt == "*" or txt == "-" or txt == "+" : # 如果是符号,就运算 - # self.num_count = 0 - # if self.calculator_flag == 0:#无运算符 - # if len(self.str) == 0: #开头不能为运算符 - # return - # self.calculator_flag = 1 - # self.str += txt - # elif self.calculator_flag == 1 : #有运算符 - # str_tmp = self.str[-1] - # if str_tmp == "/" or str_tmp == "*" or str_tmp == "-" or str_tmp == "+" : #最后一个是运算符 - # self.str = self.str[:-1]+txt - - # elif str_tmp == ".": #最后一个是.,去除再运算 - # self.str = self.str[0:-1] - # self.result = self.calculator_eval(self.str) - # if self.result == -1: - # return - # self.str = self.result+txt - # else : - # self.result = self.calculator_eval(self.str) - # if self.result == -1: - # return - # self.str = self.result+txt - # elif self.calculator_flag == 2 : #已经运算了一次 - # self.str = self.result + txt - # self.calculator_flag = 1 - # elif txt == ".": - # if self.num_count >=20: - # return - # self.num_count += 1 - # str_tmp = self.str[-1] - # if str_tmp == "." :#最后一个是. 不再添加 - # pass - # elif str_tmp == "/" or str_tmp == "*" or str_tmp == "-" or str_tmp == "+": #最后一个是符号 前面加一个0 - # self.str = self.str + "0"+ txt - # else : - # self.str+=txt - # elif txt:#数字 - # if self.num_count >=20: - # return - # self.num_count += 1 - # #calculator_label.add_text(txt) # 如果不是回车键,那么就将当前数字显示到文本框 - # self.str+=txt - # if self.calculator_flag == 2 : - # self.str=txt - # self.calculator_flag = 0 - # calculator_label.set_text(self.str) - except Exception as e: - usys.print_exception(e) - e_tmp = "{}".format(e) - if e_tmp.find("divide by zero") != -1 : - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text("0不能为除数") - self.str = "" - self.equal = '' - self.result = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.calculator_flag = '' - else : - EventMesh.txt_log("calculator:{} {} {}".format(self.calculator_flag,self.str,txt)) - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - calculator_label.set_text("运算异常") - self.str = "" - self.equal = '' - self.result = '' - self.calculator_buf1 = '' - self.calculator_buf2 = '' - self.calculator_flag = '' - #print("ui_queue_thread:ERROR:{}".format(e)) - - # print("calculator_clicked:flag:{} str{} ".format(self.calculator_flag,self.str)) - - - - def lcd_on(self): - if self.timer_cb != 0: - self.timer_cb = 0 - #self.timer.start(1000,1,self.refresh_line) - def refresh_line(self,*argc): - waring_label.add_flag(lv.obj.FLAG.HIDDEN) - calculator_label.clear_flag(lv.obj.FLAG.HIDDEN) - - def lcd_off(self): - self.timer_cb = 1 - self.timer.stop() - - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py index f889d580..e74c2074 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py @@ -1,199 +1,188 @@ """ -*Name : capacitive_hynitron_cst816d_update.h -*Author : gary -*Version : V1.0 -*Copyright : Hynitron -*ProjectName : CSW_2211527_CST816D_COB_ZT_YAT_K5_G1_JL_55028.hex Modify at 2022-11-21 17:57:42 +// ic type: cst8xx +// proj name: CSW_2311097_CST816D_COB_DWS_HY_HTY1384183CG_C06_AKL_G3.hex +// check sum: 0xa796 +// create time: 2023/11/8 10:14:38 """ app_bin_816d = [ -0x00, 0x00, 0x00, 0x3c, 0x47, 0xb6, -0x02, 0x2d, 0x1b, 0x75, 0x91, 0xcc, 0x75, 0x91, 0x00, 0x32, 0x32, 0x22, 0x02, 0x00, 0x03, 0x02, -0x30, 0x6b, 0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x25, 0x02, 0x10, 0x59, -0x00, 0x02, 0x33, 0xac, 0xe4, 0x7b, 0x02, 0xfa, 0xf9, 0xf8, 0xaf, 0x00, 0xae, 0x00, 0xad, 0x00, -0xac, 0x00, 0x12, 0x0f, 0x42, 0xef, 0x25, 0x00, 0xff, 0xee, 0x35, 0x00, 0xfe, 0xed, 0x35, 0x00, -0xfd, 0xec, 0x35, 0x00, 0xfc, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0x12, 0x0f, 0x42, +0x00, 0x00, 0x00, 0x3c, 0x61, 0x8c, +0x02, 0x29, 0xeb, 0x75, 0x91, 0xcc, 0x75, 0x91, 0x00, 0x32, 0x32, 0x22, 0x02, 0x00, 0x03, 0x02, +0x2e, 0x51, 0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x25, 0x02, 0x0f, 0xac, +0x00, 0x02, 0x30, 0xbf, 0x8f, 0x22, 0x8d, 0x23, 0x12, 0x08, 0xae, 0xe2, 0x70, 0x03, 0x02, 0x05, +0x5d, 0x12, 0x05, 0xf0, 0x12, 0x09, 0xe9, 0x50, 0x18, 0x12, 0x06, 0x39, 0x12, 0x08, 0xae, 0xe4, +0xf2, 0xfa, 0xa9, 0x07, 0x7b, 0xfe, 0xef, 0x24, 0x06, 0x7f, 0x06, 0x12, 0x06, 0x60, 0x02, 0x01, +0x5a, 0x12, 0x0a, 0xd6, 0xe2, 0x70, 0x53, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x2a, 0x12, 0x06, 0xea, +0x12, 0x0a, 0x00, 0x12, 0x06, 0xe4, 0x12, 0x09, 0x6a, 0x12, 0x05, 0xf0, 0x74, 0x17, 0x93, 0x75, +0x34, 0x00, 0xf5, 0x35, 0xaf, 0x2b, 0xae, 0x2a, 0x12, 0x3a, 0x14, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x29, 0xae, 0x28, 0x12, 0x3a, 0x14, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0xd3, 0xef, +0x95, 0x35, 0xee, 0x95, 0x34, 0x40, 0x08, 0x12, 0x0a, 0xd6, 0x74, 0x01, 0xf2, 0x80, 0x20, 0xe4, +0xf5, 0x28, 0xf5, 0x29, 0xf5, 0x2a, 0xf5, 0x2b, 0x80, 0x15, 0x12, 0x0a, 0x15, 0x12, 0x06, 0xea, +0x12, 0x0a, 0x00, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x08, 0x12, 0x06, 0xea, 0x12, 0x09, 0x6a, 0x12, +0x09, 0x09, 0xc0, 0x04, 0x12, 0x06, 0x7c, 0x78, 0x79, 0xe6, 0x24, 0x15, 0x12, 0x06, 0x32, 0x12, +0x08, 0xc6, 0xd0, 0x00, 0x12, 0x0e, 0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x23, 0xab, 0x07, 0xae, 0x28, 0xaf, 0x29, 0x12, 0x08, 0xc2, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, +0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x8d, 0x12, 0x31, 0x90, 0x8e, 0x28, 0x8f, 0x29, 0x12, +0x09, 0x09, 0xc0, 0x04, 0x12, 0x06, 0x7c, 0x78, 0x79, 0xe6, 0x24, 0x17, 0x12, 0x06, 0x32, 0x12, +0x08, 0xc6, 0xd0, 0x00, 0x12, 0x0e, 0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x23, 0xab, 0x07, 0xae, 0x2a, 0xaf, 0x2b, 0x12, 0x08, 0xc2, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, +0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x8d, 0x12, 0x31, 0x90, 0x8e, 0x2a, 0x8f, 0x2b, 0x78, +0x79, 0xe6, 0xff, 0x24, 0x15, 0xf8, 0xe5, 0x28, 0xf2, 0x08, 0xe5, 0x29, 0xf2, 0xa8, 0x07, 0xe8, +0x24, 0x17, 0xf8, 0xe5, 0x2a, 0xf2, 0x08, 0xe5, 0x2b, 0xf2, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, +0xff, 0x12, 0x09, 0xf7, 0x9f, 0x50, 0x03, 0x02, 0x05, 0x4c, 0x78, 0x79, 0xe6, 0xfb, 0x24, 0x06, +0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x28, 0xa2, 0xe7, 0x13, 0xfe, 0xe5, 0x29, +0x12, 0x07, 0xe4, 0xa8, 0x03, 0x12, 0x0a, 0x31, 0x12, 0x0a, 0xc8, 0xd8, 0xfb, 0xff, 0x12, 0x05, +0xf0, 0x74, 0x01, 0x93, 0xfc, 0x74, 0x02, 0x93, 0xfd, 0x12, 0x34, 0xc0, 0x8e, 0x24, 0x8f, 0x25, +0x78, 0x79, 0xe6, 0xfb, 0x24, 0x08, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x2a, +0xa2, 0xe7, 0x13, 0xfe, 0xe5, 0x2b, 0x12, 0x07, 0xe4, 0xa8, 0x03, 0xe8, 0x24, 0x02, 0xf8, 0x12, +0x0a, 0x31, 0x12, 0x0a, 0xc8, 0xd8, 0xfb, 0xff, 0x12, 0x05, 0xf0, 0x74, 0x03, 0x93, 0xfc, 0x74, +0x04, 0x93, 0xfd, 0x12, 0x34, 0xc0, 0x8e, 0x26, 0x8f, 0x27, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, +0x24, 0x0a, 0xff, 0xe4, 0x33, 0xfe, 0x78, 0x79, 0xe6, 0xfd, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9f, +0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x50, 0x54, 0xa8, 0x05, 0xe8, 0x24, 0x15, 0x12, 0x06, +0x32, 0x12, 0x3a, 0x14, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, 0xfd, 0x78, 0x79, 0xe6, 0xf9, 0x12, +0x08, 0x73, 0x24, 0x89, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0x12, 0x09, 0xcb, 0xa8, 0x01, 0xe8, 0x24, +0x17, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, 0xfd, 0x78, 0x79, +0xe6, 0x12, 0x08, 0x73, 0x24, 0x9d, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0x12, 0x09, 0xcb, 0x75, 0x38, +0x00, 0x75, 0x39, 0x80, 0x75, 0x3a, 0x00, 0x75, 0x3b, 0x80, 0x02, 0x03, 0xbe, 0x12, 0x08, 0x7e, +0x24, 0x92, 0xf9, 0x74, 0x00, 0x35, 0xf0, 0xfa, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, +0x78, 0x79, 0xe6, 0x24, 0x15, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0xad, 0x07, 0xd0, 0x01, 0xd0, +0x02, 0xd0, 0x03, 0x12, 0x33, 0xe6, 0x8e, 0x34, 0x8f, 0x35, 0x12, 0x08, 0x7e, 0x24, 0xa6, 0xf9, +0x74, 0x00, 0x35, 0xf0, 0xfa, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0x78, 0x79, 0xe6, +0x24, 0x17, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0xad, 0x07, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, +0x12, 0x33, 0xe6, 0x8e, 0x36, 0x8f, 0x37, 0x12, 0x0a, 0xdd, 0x40, 0x18, 0xe5, 0x35, 0xae, 0x34, +0x78, 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe5, 0x37, 0x24, 0x01, 0xfd, 0xe4, +0x35, 0x36, 0x80, 0x16, 0xe5, 0x37, 0xae, 0x36, 0x78, 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, +0xf9, 0xff, 0xe5, 0x35, 0x24, 0x01, 0xfd, 0xe4, 0x35, 0x34, 0xfc, 0x12, 0x0c, 0x7a, 0xab, 0x07, +0xaa, 0x06, 0x78, 0x79, 0xe6, 0xf9, 0x24, 0x0f, 0x12, 0x06, 0x32, 0x12, 0x07, 0xea, 0xef, 0x2b, +0xff, 0xee, 0x3a, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xfb, 0xaa, +0x06, 0xc3, 0x94, 0x28, 0xea, 0x94, 0x00, 0x50, 0x06, 0x7a, 0x00, 0x7b, 0x28, 0x80, 0x0d, 0xd3, +0xeb, 0x94, 0x46, 0xea, 0x94, 0x00, 0x40, 0x04, 0x7a, 0x00, 0x7b, 0x46, 0x7c, 0x00, 0x7d, 0x0a, +0xaf, 0x03, 0xae, 0x02, 0x12, 0x0c, 0x68, 0xef, 0x24, 0xf0, 0xf5, 0x39, 0xee, 0x34, 0xfe, 0xf5, +0x38, 0xeb, 0x25, 0xe0, 0xff, 0xea, 0x33, 0xfe, 0xc3, 0x74, 0xd0, 0x9f, 0xf5, 0x3b, 0xe4, 0x9e, +0xf5, 0x3a, 0x12, 0x0a, 0xdd, 0x40, 0x12, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x85, 0x3a, 0x38, +0x85, 0x3b, 0x39, 0x85, 0x34, 0x3a, 0x85, 0x35, 0x3b, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0f, 0xf8, +0xea, 0xf2, 0x08, 0xeb, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x11, 0x12, 0x06, 0x32, 0x12, 0x07, 0xea, +0xe5, 0x39, 0x2f, 0xff, 0xe5, 0x38, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, +0xd8, 0xf9, 0xf5, 0x39, 0x8e, 0x38, 0x78, 0x79, 0xe6, 0xfb, 0x24, 0x13, 0x12, 0x06, 0x32, 0x12, +0x07, 0xea, 0xe5, 0x3b, 0x2f, 0xff, 0xe5, 0x3a, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, +0xce, 0x13, 0xd8, 0xf9, 0xf5, 0x3b, 0x8e, 0x3a, 0xeb, 0x24, 0x11, 0xf8, 0xe5, 0x38, 0xf2, 0x08, +0xe5, 0x39, 0xf2, 0xe9, 0x24, 0x13, 0xf8, 0xe5, 0x3a, 0xf2, 0x08, 0xe5, 0x3b, 0xf2, 0x12, 0x05, +0x8c, 0x7c, 0x00, 0x7d, 0x02, 0x12, 0x0c, 0xcf, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xa0, 0xd0, +0xe0, 0x2f, 0xf5, 0x35, 0xd0, 0xe0, 0x3e, 0xf5, 0x34, 0x12, 0x05, 0xf0, 0xae, 0x34, 0xaf, 0x35, +0x12, 0x08, 0xcd, 0x25, 0x35, 0xf5, 0x35, 0xee, 0x35, 0x34, 0xf5, 0x34, 0xd3, 0xe5, 0x35, 0x95, +0x39, 0xe5, 0x34, 0x95, 0x38, 0x40, 0x06, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x78, 0x79, 0xe6, +0x24, 0x06, 0x12, 0x06, 0x32, 0xc3, 0xe5, 0x39, 0x95, 0x35, 0xfd, 0xe5, 0x38, 0x95, 0x34, 0xfc, +0x12, 0x0f, 0xbe, 0x8f, 0x2f, 0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0xae, 0x24, 0xaf, 0x25, 0x12, +0x08, 0x69, 0xae, 0x34, 0xaf, 0x35, 0x12, 0x0a, 0x9c, 0xef, 0x25, 0x2f, 0xff, 0xee, 0x35, 0x2e, +0xfe, 0xed, 0x35, 0x2d, 0xfd, 0xec, 0x35, 0x2c, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x38, 0xc3, +0x13, 0xfe, 0xe5, 0x39, 0x12, 0x0a, 0xa3, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0a, 0x3e, 0xc0, 0x06, +0xc0, 0x07, 0xae, 0x38, 0xaf, 0x39, 0xab, 0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, +0x0e, 0xa2, 0x8f, 0x2f, 0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0x12, 0x05, 0xa0, 0x7c, 0x00, 0x7d, +0x02, 0x12, 0x0c, 0xcf, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0x8c, 0xd0, 0xe0, 0x2f, 0xf5, 0x37, +0xd0, 0xe0, 0x3e, 0xf5, 0x36, 0x12, 0x05, 0xf0, 0xae, 0x36, 0xaf, 0x37, 0x12, 0x08, 0xcd, 0x25, +0x37, 0xf5, 0x37, 0xee, 0x35, 0x36, 0xf5, 0x36, 0xd3, 0xe5, 0x37, 0x95, 0x3b, 0xe5, 0x36, 0x95, +0x3a, 0x40, 0x06, 0x85, 0x3a, 0x36, 0x85, 0x3b, 0x37, 0x78, 0x79, 0xe6, 0x24, 0x08, 0x12, 0x06, +0x32, 0xc3, 0xe5, 0x3b, 0x95, 0x37, 0xfd, 0xe5, 0x3a, 0x95, 0x36, 0xfc, 0x12, 0x0f, 0xbe, 0x8f, +0x33, 0x8e, 0x32, 0x8d, 0x31, 0x8c, 0x30, 0xae, 0x26, 0xaf, 0x27, 0x12, 0x08, 0x69, 0xae, 0x36, +0xaf, 0x37, 0x12, 0x0a, 0x9c, 0xef, 0x25, 0x33, 0xff, 0xee, 0x35, 0x32, 0xfe, 0xed, 0x35, 0x31, +0xfd, 0xec, 0x35, 0x30, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x3a, 0xc3, 0x13, 0xfe, 0xe5, 0x3b, +0x12, 0x0a, 0xa3, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0a, 0x3e, 0xc0, 0x06, 0xc0, 0x07, 0xae, 0x3a, +0xaf, 0x3b, 0xab, 0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0e, 0xa2, 0x8f, 0x33, +0x8e, 0x32, 0x8d, 0x31, 0x8c, 0x30, 0x12, 0x05, 0xf0, 0x74, 0x16, 0x93, 0xf4, 0x60, 0x2d, 0x78, +0x79, 0xe6, 0xff, 0x24, 0x0c, 0xf8, 0xe2, 0xb4, 0x01, 0x15, 0xa8, 0x07, 0xe5, 0x2e, 0xf2, 0x08, +0xe5, 0x2f, 0xf2, 0x12, 0x0a, 0x23, 0xe5, 0x32, 0xf2, 0x08, 0xe5, 0x33, 0xf2, 0x80, 0x0d, 0x78, +0x79, 0x12, 0x06, 0xd4, 0x12, 0x0a, 0x23, 0xec, 0xf2, 0x08, 0xed, 0xf2, 0x12, 0x09, 0xf7, 0x94, +0x14, 0x50, 0x03, 0xe2, 0x04, 0xf2, 0x12, 0x0a, 0x2a, 0x74, 0x01, 0xf2, 0x22, 0x12, 0x0a, 0x2a, +0xe2, 0xd3, 0x94, 0x00, 0x40, 0x03, 0xe2, 0x14, 0xf2, 0xe2, 0x70, 0x1f, 0x78, 0x79, 0xe6, 0xff, +0x24, 0x0d, 0xf8, 0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x11, 0x12, 0x0a, 0xab, 0x24, 0x13, 0x12, +0x0a, 0xab, 0x24, 0x0f, 0xf8, 0xe4, 0xf2, 0x08, 0x74, 0x28, 0xf2, 0x22, 0x78, 0x79, 0xe6, 0x24, +0x09, 0xf8, 0xc3, 0xe2, 0x95, 0x27, 0xff, 0x18, 0xe2, 0x95, 0x26, 0xfe, 0x12, 0x3a, 0x14, 0x22, +0x78, 0x79, 0xe6, 0x24, 0x07, 0xf8, 0xc3, 0xe2, 0x95, 0x25, 0xff, 0x18, 0xe2, 0x95, 0x24, 0xfe, +0x12, 0x3a, 0x14, 0x22, 0xe4, 0x7b, 0x02, 0xfa, 0xf9, 0xf8, 0xaf, 0x00, 0xae, 0x00, 0xad, 0x00, +0xac, 0x00, 0x12, 0x0e, 0xa2, 0xef, 0x25, 0x00, 0xff, 0xee, 0x35, 0x00, 0xfe, 0xed, 0x35, 0x00, +0xfd, 0xec, 0x35, 0x00, 0xfc, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0x12, 0x0e, 0xa2, 0xef, 0x24, 0xe0, 0xfb, 0xee, 0x34, 0xff, 0xfa, 0xed, 0x34, 0xff, 0xf9, 0xec, 0x34, 0xff, 0xf8, -0x85, 0x44, 0x82, 0x85, 0x43, 0x83, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, -0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0xb7, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0f, 0x42, 0x8f, +0x85, 0x4a, 0x82, 0x85, 0x49, 0x83, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, +0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, 0x00, 0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, -0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, 0xc3, 0x02, 0x0f, 0xd4, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x0d, -0xf8, 0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x16, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xa8, 0x07, 0xe8, -0x24, 0x18, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xef, 0x04, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xef, 0x24, -0x2b, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0c, 0x68, 0x78, 0x6b, 0xe6, -0xff, 0x24, 0x05, 0xf8, 0xe4, 0xf2, 0xef, 0x04, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xef, 0x24, 0x07, -0x7f, 0x06, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x02, 0x0c, 0x68, 0xeb, 0x25, 0xe0, 0x25, -0xe0, 0x24, 0x61, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x22, 0xe6, 0xff, 0x24, 0x2b, 0xf8, 0xe2, -0xfc, 0x08, 0xe2, 0xfd, 0xa8, 0x07, 0xe8, 0x04, 0xf8, 0xec, 0xf2, 0x08, 0xed, 0xf2, 0x78, 0x6b, -0xe6, 0xff, 0x24, 0x2d, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, 0xa8, 0x07, 0xe8, 0x22, 0xab, 0x00, -0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0x93, 0xff, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0xb7, 0xa8, 0x04, -0xa9, 0x05, 0xaa, 0x06, 0xab, 0x07, 0x22, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xe5, 0x00, 0x75, -0xf0, 0x02, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x02, 0x0d, 0xe6, 0x74, 0x1d, 0x93, 0x24, 0x64, -0xff, 0xe4, 0x33, 0xfe, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0xb7, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, -0x12, 0x0f, 0x42, 0x8f, 0x00, 0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0xae, 0x00, 0xaf, 0x00, 0xab, -0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, 0xc3, 0x02, 0x0f, 0xd4, 0xaf, 0x00, -0xef, 0x33, 0x95, 0xe0, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xfe, 0x74, 0xb5, 0x2f, 0xf5, -0x82, 0x74, 0x00, 0x3e, 0xf5, 0x83, 0x22, 0x78, 0x6d, 0xa6, 0x07, 0x78, 0x70, 0xe6, 0x78, 0x6e, -0xf6, 0x90, 0x00, 0xb7, 0xe0, 0xff, 0xa3, 0xe0, 0x90, 0x00, 0xb5, 0xcf, 0xf0, 0xa3, 0xef, 0xf0, -0x08, 0x76, 0xff, 0x22, 0x7e, 0x00, 0x7d, 0x00, 0x7f, 0x04, 0x7b, 0x01, 0x7a, 0x00, 0x79, 0xb5, -0x02, 0x10, 0x98, 0xef, 0x2b, 0xff, 0xee, 0x3a, 0xfe, 0xed, 0x39, 0xfd, 0xec, 0x38, 0xfc, 0x22, -0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x85, 0x00, 0x82, 0x75, 0x83, 0x00, 0xe5, 0x00, 0x12, 0x0c, -0xe6, 0xe5, 0x00, 0x25, 0xe0, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0xf5, 0x83, 0x22, 0x74, -0x15, 0x93, 0x08, 0x26, 0x25, 0xe0, 0x24, 0x5f, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, 0xef, 0x25, -0xe0, 0x24, 0x60, 0xf8, 0xe2, 0x2d, 0xff, 0x18, 0xe2, 0x3c, 0xc3, 0x13, 0xf5, 0x00, 0xef, 0x13, -0xf5, 0x00, 0xd3, 0x74, 0x10, 0x93, 0x95, 0x00, 0x74, 0x0f, 0x93, 0x95, 0x00, 0x22, 0xe5, 0x00, -0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xfe, 0xef, 0x24, 0xff, 0xff, 0xee, 0x34, 0xff, 0xfe, 0xe4, -0xfc, 0xfd, 0x22, 0xeb, 0x7b, 0x64, 0x2f, 0xff, 0xea, 0x3e, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, -0xfc, 0xe4, 0xfa, 0xf9, 0xf8, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, 0xe4, -0xfc, 0xfd, 0x12, 0x0e, 0xb7, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0f, 0x42, 0x8f, 0x00, -0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0x24, 0x6d, 0xf8, 0xe6, 0xff, -0x33, 0x95, 0xe0, 0xfe, 0xad, 0x00, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xc3, 0x22, 0x93, 0xfd, 0x12, -0x0d, 0x08, 0x7c, 0x00, 0x7d, 0x32, 0x12, 0x0d, 0x1a, 0xe5, 0x28, 0x2f, 0xf5, 0x2e, 0xe5, 0x27, -0x3e, 0xf5, 0x2d, 0xd3, 0xe5, 0x2e, 0x94, 0x00, 0xe5, 0x2d, 0x64, 0x80, 0x94, 0x80, 0x22, 0x7a, -0x00, 0x79, 0x02, 0x7b, 0xfe, 0x7e, 0x00, 0x7f, 0x06, 0x02, 0x0c, 0x68, 0x75, 0xf0, 0x2f, 0xa4, -0x24, 0x02, 0xf8, 0xee, 0xf2, 0x08, 0xef, 0xf2, 0x22, 0xeb, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x60, -0xf8, 0xe2, 0x2f, 0xf5, 0x26, 0x18, 0xe2, 0x3e, 0xf5, 0x25, 0x22, 0x13, 0x2d, 0xff, 0xee, 0x3c, -0xfe, 0x7c, 0x00, 0x7d, 0x03, 0x02, 0x0d, 0x08, 0x25, 0xe0, 0x24, 0x60, 0xf8, 0xe2, 0x2f, 0xff, -0x18, 0xe2, 0x3e, 0xfe, 0x22, 0x7e, 0x00, 0x7f, 0x04, 0x7d, 0xff, 0x7b, 0x00, 0x7a, 0x00, 0x79, -0x6d, 0x02, 0x10, 0x98, 0x24, 0x09, 0xf8, 0xec, 0xf2, 0x08, 0xed, 0xf2, 0x78, 0x6b, 0xe6, 0x24, -0x0e, 0xf8, 0xe2, 0xc3, 0x22, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, 0xff, 0xe4, 0xfc, 0xfd, -0x02, 0x10, 0x17, 0x74, 0x1a, 0x93, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xfd, 0xfc, 0xeb, 0x2f, 0x22, +0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, 0xc3, 0x02, 0x0f, 0x4a, 0xe5, 0x2f, 0x25, 0xe0, 0x25, 0xe0, +0x24, 0x5f, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x22, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0c, 0xf8, +0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x15, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xa8, 0x07, 0xe8, 0x24, +0x17, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xfa, 0xa9, 0x07, 0x7b, 0xfe, 0xef, 0x24, 0x2a, 0x7f, 0x04, +0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x02, 0x0b, 0xc8, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, +0xa8, 0x00, 0x93, 0xff, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xa8, 0x04, 0xa9, 0x05, 0xaa, 0x06, +0xab, 0x07, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x41, 0xf8, 0x22, 0xab, 0x00, 0xaa, +0x00, 0xa9, 0x00, 0xe5, 0x00, 0x75, 0xf0, 0x02, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x02, 0x0d, +0x46, 0x74, 0x1d, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, +0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, 0x00, 0x8e, 0x00, 0x8d, 0x00, 0x8c, +0x00, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, +0xc3, 0x02, 0x0f, 0x4a, 0xe6, 0xff, 0x24, 0x2a, 0xf8, 0xe2, 0xfd, 0x08, 0xe2, 0xa8, 0x07, 0xcd, +0xf2, 0x08, 0xed, 0xf2, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x2c, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, +0x22, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x85, 0x00, 0x82, 0x75, 0x83, 0x00, 0xe5, 0x00, 0x12, +0x0c, 0x46, 0xe5, 0x00, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x43, 0xf8, 0x22, 0xef, 0x2b, 0xff, 0xee, +0x3a, 0xfe, 0xed, 0x39, 0xfd, 0xec, 0x38, 0xfc, 0x22, 0x7a, 0x00, 0x79, 0x01, 0x7b, 0xfe, 0x7e, +0x00, 0x7f, 0x06, 0x02, 0x0b, 0xc8, 0xe5, 0x00, 0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xfe, 0xef, +0x24, 0xff, 0xff, 0xee, 0x34, 0xff, 0xfe, 0xe4, 0xfc, 0xfd, 0x22, 0x78, 0x41, 0x7c, 0x00, 0x7d, +0x00, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x45, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0x75, 0x45, +0xff, 0x22, 0x93, 0xff, 0xee, 0x33, 0x95, 0xe0, 0xfd, 0xfc, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x32, +0xfa, 0xf9, 0xf8, 0x12, 0x31, 0x90, 0xe5, 0x28, 0x2f, 0xf5, 0x2e, 0xe5, 0x27, 0x3e, 0xf5, 0x2d, +0xd3, 0xe5, 0x2e, 0x94, 0x00, 0xe5, 0x2d, 0x64, 0x80, 0x94, 0x80, 0x22, 0xf8, 0xe2, 0x2f, 0xf5, +0x26, 0x18, 0xe2, 0x3e, 0xf5, 0x25, 0xe5, 0x2f, 0x25, 0xe0, 0x25, 0xe0, 0x22, 0xeb, 0x7b, 0x64, +0x2f, 0xff, 0xea, 0x3e, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, 0xfc, 0xe4, 0xfa, 0xf9, 0xf8, 0x22, +0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x2f, 0xff, 0x18, 0xe2, 0x3e, 0x22, 0xe5, 0x00, 0x25, 0xe0, +0x25, 0xe0, 0x24, 0x42, 0xf8, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, 0xe4, +0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, 0x00, +0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0x22, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x01, 0xf8, 0xee, 0xf2, +0x08, 0xef, 0xf2, 0x22, 0x13, 0x2d, 0xff, 0xee, 0x3c, 0xfe, 0x7c, 0x00, 0x7d, 0x03, 0x02, 0x0c, +0x68, 0xe6, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xad, 0x00, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xc3, 0x22, +0x7f, 0x08, 0x7d, 0xff, 0x7a, 0x00, 0x79, 0x41, 0x12, 0x0f, 0xeb, 0xe4, 0xf5, 0x43, 0xf5, 0x44, +0xf5, 0x47, 0xf5, 0x48, 0x22, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, 0xff, 0xe4, 0xfc, 0xfd, +0x02, 0x0f, 0x7a, 0x74, 0x1a, 0x93, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xfd, 0xfc, 0xeb, 0x2f, 0x22, 0xaf, 0x00, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xab, 0x00, 0xaa, -0x00, 0xa9, 0x00, 0x8f, 0x82, 0xf5, 0x83, 0x02, 0x0d, 0xe6, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x07, +0x00, 0xa9, 0x00, 0x8f, 0x82, 0xf5, 0x83, 0x02, 0x0d, 0x46, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x07, 0xaa, 0x06, 0xc3, 0xe5, 0x00, 0x9b, 0xfb, 0xe5, 0x00, 0x9a, 0xfa, 0xe5, 0x00, 0x94, 0x00, 0xf9, -0xe5, 0x00, 0x94, 0x00, 0x22, 0x85, 0x42, 0x82, 0x85, 0x41, 0x83, 0x74, 0x04, 0x93, 0xfe, 0x74, -0x05, 0x93, 0xff, 0x22, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x07, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xef, -0x22, 0xeb, 0x25, 0xe0, 0x24, 0x6d, 0xf8, 0xe6, 0x22, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, -0x00, 0xa9, 0x00, 0xa8, 0x00, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xab, 0x07, -0xfa, 0xe4, 0xf9, 0xf8, 0x22, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x7f, 0x04, 0x02, 0x0c, -0x68, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, 0xc3, 0xe5, 0x00, 0x9d, 0xf5, 0x00, 0xe5, 0x00, 0x9c, -0xf5, 0x00, 0xa8, 0x07, 0xe8, 0x22, 0x2f, 0xff, 0xe0, 0x3e, 0xfe, 0xd3, 0xe5, 0x00, 0x9f, 0xe5, -0x00, 0x9e, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, 0xfe, 0x22, 0xe4, -0xfa, 0xf9, 0xf8, 0xee, 0x33, 0x95, 0xe0, 0xfd, 0xfc, 0x22, 0x74, 0x18, 0x93, 0xfb, 0x7c, 0x00, -0x7d, 0x0a, 0x12, 0x0d, 0x1a, 0xad, 0x03, 0x7c, 0x00, 0x12, 0x10, 0x6b, 0xef, 0x22, 0xc3, 0xe5, -0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, 0xfe, 0xe4, 0x95, 0x00, 0xfd, 0xe4, 0x95, 0x00, -0xfc, 0x22, 0xe4, 0x93, 0xfd, 0x7c, 0x00, 0x74, 0x03, 0x93, 0xfe, 0x74, 0x04, 0x93, 0xff, 0x22, -0xc3, 0x74, 0x64, 0x95, 0x23, 0xff, 0xe4, 0x94, 0x00, 0xfe, 0xe4, 0xfc, 0xfd, 0x22, 0x9d, 0xfd, -0xe4, 0x94, 0x00, 0xfc, 0xe5, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x22, 0x25, 0xe0, 0x24, 0x5f, 0xf8, -0xe2, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xfb, 0xe5, 0x00, 0x95, 0x00, 0xfa, 0xe4, 0x95, 0x00, -0xf9, 0xe4, 0x95, 0x00, 0x22, 0xe5, 0x00, 0x25, 0x00, 0xff, 0xe5, 0x00, 0x35, 0x00, 0xfe, 0xe4, -0x35, 0x00, 0xfd, 0xe4, 0x35, 0x00, 0xfc, 0x22, 0x7e, 0x00, 0x7f, 0x06, 0x7d, 0x00, 0x7b, 0xfe, -0x02, 0x10, 0x98, 0x93, 0xff, 0xe4, 0xfc, 0xfd, 0x12, 0x10, 0x17, 0x12, 0x0e, 0xb7, 0xe4, 0x7b, -0x02, 0xfa, 0xf9, 0xf8, 0x22, 0xf8, 0xe2, 0x2f, 0xf5, 0x28, 0x18, 0xe2, 0x3e, 0xf5, 0x27, 0x22, -0xea, 0x33, 0x95, 0xe0, 0xf9, 0xf8, 0xe4, 0xfc, 0xfd, 0x02, 0x0e, 0xb7, 0x85, 0x42, 0x82, 0x85, -0x41, 0x83, 0x74, 0x05, 0x93, 0x22, 0xff, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xef, 0x2d, 0xff, 0xe4, -0x3c, 0xc3, 0x13, 0xef, 0x13, 0x22, 0x24, 0x03, 0xf8, 0xec, 0xf2, 0x08, 0xed, 0xf2, 0x22, 0xf5, -0x83, 0xe5, 0x82, 0x2d, 0xf5, 0x82, 0xe5, 0x83, 0x3c, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xe5, 0x00, -0x25, 0xe0, 0x24, 0x6e, 0xf8, 0xe6, 0x22, 0xf5, 0x00, 0xea, 0x3e, 0xf5, 0x00, 0xe9, 0x3d, 0xf5, -0x00, 0xe8, 0x3c, 0xf5, 0x00, 0x22, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x05, 0xf8, 0xe2, 0x22, 0x74, -0x1e, 0x93, 0xfe, 0xa8, 0x07, 0xe8, 0x24, 0x0e, 0xf8, 0xe2, 0xc3, 0x9e, 0x22, 0x24, 0x02, 0xf8, -0xc3, 0xe2, 0x9d, 0xf5, 0x29, 0x18, 0xe2, 0x9c, 0xf5, 0x28, 0x22, 0x24, 0x04, 0xf8, 0xc3, 0xe2, -0x9d, 0xf5, 0x2b, 0x18, 0xe2, 0x9c, 0xf5, 0x2a, 0x22, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0x2f, 0xff, -0xee, 0x3c, 0xfe, 0xef, 0x78, 0x02, 0x22, 0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x04, 0x22, 0xff, 0xae, -0xf0, 0xe4, 0xfc, 0xfd, 0x22, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x2b, 0x22, 0x78, 0x6b, 0xe6, 0x24, -0x0f, 0xf8, 0x22, 0xef, 0x2b, 0xff, 0xee, 0x3a, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, 0xfc, 0x22, -0xef, 0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x01, 0xf8, 0x22, 0xe4, 0x7f, 0x01, 0xfe, 0xfd, 0xfc, 0x22, -0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x22, 0xc3, 0xe5, 0x00, 0x9f, 0xf5, 0x00, 0xe5, 0x00, 0x9e, -0xf5, 0x00, 0x22, 0x78, 0x58, 0x12, 0x10, 0x0b, 0x78, 0x54, 0x12, 0x10, 0x17, 0xeb, 0x22, 0xe5, -0x30, 0x25, 0x30, 0xf5, 0x30, 0xe5, 0x2f, 0x33, 0xf5, 0x2f, 0x22, 0xc3, 0xe5, 0x26, 0x95, 0x28, -0xff, 0xe5, 0x25, 0x95, 0x27, 0xfe, 0x22, 0xe5, 0x00, 0xf0, 0xa3, 0xe5, 0x00, 0xf0, 0x22, 0xf9, -0x7a, 0x00, 0x7b, 0xfe, 0x75, 0xf0, 0x02, 0xe5, 0x00, 0x22, 0x13, 0xfb, 0xaa, 0x06, 0xe4, 0xf9, -0xf8, 0x22, 0xf8, 0xe4, 0xf2, 0x08, 0x74, 0x80, 0xf2, 0xa8, 0x07, 0xe8, 0x22, 0xe4, 0xfc, 0xfd, -0xeb, 0x25, 0x00, 0xff, 0xea, 0x35, 0x00, 0x22, 0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x02, 0x22, 0xce, -0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, 0x78, 0x6b, 0xe6, 0x24, 0x1a, 0xf8, 0x22, 0x78, 0x6b, 0xe6, -0x24, 0x0d, 0xf8, 0x22, 0xd3, 0xe5, 0x35, 0x95, 0x37, 0xe5, 0x34, 0x95, 0x36, 0x22, 0x33, 0xfe, -0x7c, 0x00, 0x7d, 0x03, 0x02, 0x0d, 0x1a, 0x24, 0x40, 0xff, 0xe4, 0x3e, 0xfe, 0x22, 0xe5, 0x00, -0x25, 0xe0, 0x24, 0x6d, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0x24, 0x6e, 0x22, 0x8f, 0x22, 0x8d, 0x23, -0x12, 0x04, 0xd6, 0x70, 0x03, 0x02, 0x0b, 0x41, 0x12, 0x00, 0x60, 0x12, 0x04, 0xdf, 0x50, 0x06, -0x12, 0x00, 0x9a, 0x02, 0x07, 0x1f, 0x12, 0x05, 0xcd, 0xe2, 0x70, 0x50, 0x12, 0x05, 0x25, 0x12, -0x01, 0x14, 0x12, 0x04, 0xed, 0x12, 0x01, 0x0e, 0x12, 0x04, 0xfb, 0x12, 0x00, 0x60, 0x74, 0x17, -0x93, 0x75, 0x34, 0x00, 0xf5, 0x35, 0xaf, 0x2b, 0xae, 0x2a, 0x12, 0x3b, 0x31, 0xc0, 0x06, 0xc0, -0x07, 0xaf, 0x29, 0xae, 0x28, 0x12, 0x3b, 0x31, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, -0xd3, 0xef, 0x95, 0x35, 0xee, 0x95, 0x34, 0x40, 0x08, 0x12, 0x05, 0xcd, 0x74, 0x01, 0xf2, 0x80, -0x23, 0xe4, 0xf5, 0x28, 0xf5, 0x29, 0xf5, 0x2a, 0xf5, 0x2b, 0x80, 0x18, 0x78, 0x6b, 0xe6, 0xff, -0x24, 0x07, 0x12, 0x01, 0x14, 0x12, 0x04, 0xed, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x09, 0x12, 0x01, -0x14, 0x12, 0x04, 0xfb, 0x12, 0x04, 0x10, 0xc0, 0x04, 0x12, 0x01, 0x30, 0x78, 0x6b, 0xe6, 0x24, -0x16, 0x12, 0x00, 0xf3, 0x12, 0x03, 0xd3, 0xd0, 0x00, 0x12, 0x0e, 0xb7, 0xc0, 0x04, 0xc0, 0x05, -0xc0, 0x06, 0xc0, 0x07, 0xaf, 0x23, 0xab, 0x07, 0xae, 0x28, 0xaf, 0x29, 0x12, 0x03, 0xcf, 0x12, -0x0e, 0xb7, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x02, 0x33, 0x12, 0x34, 0x7d, -0x8e, 0x28, 0x8f, 0x29, 0x12, 0x04, 0x10, 0xc0, 0x04, 0x12, 0x01, 0x30, 0x78, 0x6b, 0xe6, 0x24, -0x18, 0x12, 0x00, 0xf3, 0x12, 0x03, 0xd3, 0xd0, 0x00, 0x12, 0x0e, 0xb7, 0xc0, 0x04, 0xc0, 0x05, -0xc0, 0x06, 0xc0, 0x07, 0xaf, 0x23, 0xab, 0x07, 0xae, 0x2a, 0xaf, 0x2b, 0x12, 0x03, 0xcf, 0x12, -0x0e, 0xb7, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x02, 0x33, 0x12, 0x34, 0x7d, -0x8e, 0x2a, 0x8f, 0x2b, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x16, 0xf8, 0xe5, 0x28, 0xf2, 0x08, 0xe5, -0x29, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x18, 0xf8, 0xe5, 0x2a, 0xf2, 0x08, 0xe5, 0x2b, 0xf2, 0x12, -0x00, 0x60, 0x74, 0x1e, 0x93, 0xff, 0x12, 0x02, 0xfc, 0x9f, 0x50, 0x03, 0x02, 0x0b, 0x1a, 0x78, -0x6b, 0xe6, 0xfb, 0x24, 0x07, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x28, 0xa2, -0xe7, 0x13, 0xfe, 0xe5, 0x29, 0x12, 0x02, 0xcb, 0xa8, 0x03, 0xe8, 0x04, 0x12, 0x05, 0x09, 0x12, -0x05, 0xbf, 0xd8, 0xfb, 0xff, 0x12, 0x00, 0x60, 0x74, 0x01, 0x93, 0xfc, 0x74, 0x02, 0x93, 0xfd, -0x12, 0x3a, 0x19, 0x8e, 0x24, 0x8f, 0x25, 0x78, 0x6b, 0xe6, 0xfb, 0x24, 0x09, 0xf8, 0xe2, 0xfe, -0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x2a, 0xa2, 0xe7, 0x13, 0xfe, 0xe5, 0x2b, 0x12, 0x02, 0xcb, -0xa8, 0x03, 0xe8, 0x24, 0x03, 0x12, 0x05, 0x09, 0x12, 0x05, 0xbf, 0xd8, 0xfb, 0xff, 0x12, 0x00, -0x60, 0x74, 0x03, 0x93, 0xfc, 0x74, 0x04, 0x93, 0xfd, 0x12, 0x3a, 0x19, 0x8e, 0x26, 0x8f, 0x27, -0x12, 0x00, 0x60, 0x74, 0x1e, 0x93, 0x24, 0x0a, 0xff, 0xe4, 0x33, 0xfe, 0x78, 0x6b, 0xe6, 0xfd, -0x24, 0x0e, 0xf8, 0xe2, 0xc3, 0x9f, 0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x50, 0x59, 0xa8, -0x05, 0xe8, 0x24, 0x16, 0x12, 0x00, 0xf3, 0x12, 0x3b, 0x31, 0x12, 0x00, 0x60, 0x74, 0x1e, 0x93, -0xfd, 0x78, 0x6b, 0xe6, 0xf9, 0x24, 0x0e, 0xf8, 0xe2, 0xc3, 0x12, 0x04, 0x1e, 0x24, 0x8d, 0xf5, -0x82, 0xe4, 0x34, 0x00, 0x12, 0x04, 0xaf, 0xa8, 0x01, 0xe8, 0x24, 0x18, 0x12, 0x00, 0xf3, 0x12, -0x3b, 0x31, 0x12, 0x00, 0x60, 0x74, 0x1e, 0x93, 0xfd, 0x12, 0x02, 0xfc, 0x12, 0x04, 0x1e, 0x24, -0xa1, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0x12, 0x04, 0xaf, 0x75, 0x38, 0x00, 0x75, 0x39, 0x80, 0x75, -0x3a, 0x00, 0x75, 0x3b, 0x80, 0x02, 0x09, 0x89, 0x12, 0x04, 0x24, 0x24, 0x96, 0xf9, 0x74, 0x00, -0x35, 0xf0, 0xfa, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0x78, 0x6b, 0xe6, 0x24, 0x16, -0x12, 0x00, 0xf3, 0x12, 0x3b, 0x31, 0xad, 0x07, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, 0x12, 0x39, -0x3b, 0x8e, 0x34, 0x8f, 0x35, 0x12, 0x04, 0x24, 0x24, 0xaa, 0xf9, 0x74, 0x00, 0x35, 0xf0, 0xfa, -0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0x78, 0x6b, 0xe6, 0x24, 0x18, 0x12, 0x00, 0xf3, -0x12, 0x3b, 0x31, 0xad, 0x07, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, 0x12, 0x39, 0x3b, 0x8e, 0x36, -0x8f, 0x37, 0x12, 0x05, 0xd4, 0x40, 0x18, 0xe5, 0x35, 0xae, 0x34, 0x78, 0x03, 0xc3, 0x33, 0xce, -0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe5, 0x37, 0x24, 0x01, 0xfd, 0xe4, 0x35, 0x36, 0x80, 0x16, 0xe5, -0x37, 0xae, 0x36, 0x78, 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe5, 0x35, 0x24, -0x01, 0xfd, 0xe4, 0x35, 0x34, 0xfc, 0x12, 0x0d, 0x1a, 0xab, 0x07, 0xaa, 0x06, 0x78, 0x6b, 0xe6, -0xf9, 0x24, 0x10, 0x12, 0x00, 0xf3, 0x12, 0x02, 0xd1, 0xef, 0x2b, 0xff, 0xee, 0x3a, 0xfe, 0xef, -0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xfb, 0xaa, 0x06, 0xc3, 0x94, 0x28, 0xea, -0x94, 0x00, 0x50, 0x06, 0x7a, 0x00, 0x7b, 0x28, 0x80, 0x0d, 0xd3, 0xeb, 0x94, 0x46, 0xea, 0x94, -0x00, 0x40, 0x04, 0x7a, 0x00, 0x7b, 0x46, 0x7c, 0x00, 0x7d, 0x0a, 0xaf, 0x03, 0xae, 0x02, 0x12, -0x0d, 0x08, 0xef, 0x24, 0xf0, 0xf5, 0x39, 0xee, 0x34, 0xfe, 0xf5, 0x38, 0xeb, 0x25, 0xe0, 0xff, -0xea, 0x33, 0xfe, 0xc3, 0x74, 0xd0, 0x9f, 0xf5, 0x3b, 0xe4, 0x9e, 0xf5, 0x3a, 0x12, 0x05, 0xd4, -0x40, 0x12, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x85, 0x3a, 0x38, 0x85, 0x3b, 0x39, 0x85, 0x34, -0x3a, 0x85, 0x35, 0x3b, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x10, 0xf8, 0xea, 0xf2, 0x08, 0xeb, 0xf2, -0xa8, 0x07, 0xe8, 0x24, 0x12, 0x12, 0x00, 0xf3, 0x12, 0x02, 0xd1, 0xe5, 0x39, 0x2f, 0xff, 0xe5, -0x38, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xf5, 0x39, 0x8e, -0x38, 0x78, 0x6b, 0xe6, 0xfb, 0x24, 0x14, 0x12, 0x00, 0xf3, 0x12, 0x02, 0xd1, 0xe5, 0x3b, 0x2f, -0xff, 0xe5, 0x3a, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xf5, -0x3b, 0x8e, 0x3a, 0xeb, 0x24, 0x12, 0xf8, 0xe5, 0x38, 0xf2, 0x08, 0xe5, 0x39, 0xf2, 0xe9, 0x24, -0x14, 0xf8, 0xe5, 0x3a, 0xf2, 0x08, 0xe5, 0x3b, 0xf2, 0x12, 0x0b, 0x70, 0x7c, 0x00, 0x7d, 0x02, -0x12, 0x0d, 0x6f, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x0b, 0x84, 0xd0, 0xe0, 0x2f, 0xf5, 0x35, 0xd0, -0xe0, 0x3e, 0xf5, 0x34, 0x12, 0x00, 0x60, 0xae, 0x34, 0xaf, 0x35, 0x12, 0x03, 0xda, 0x25, 0x35, -0xf5, 0x35, 0xee, 0x35, 0x34, 0xf5, 0x34, 0xd3, 0xe5, 0x35, 0x95, 0x39, 0xe5, 0x34, 0x95, 0x38, -0x40, 0x06, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x78, 0x6b, 0xe6, 0x24, 0x07, 0x12, 0x00, 0xf3, -0xc3, 0xe5, 0x39, 0x95, 0x35, 0xfd, 0xe5, 0x38, 0x95, 0x34, 0xfc, 0x12, 0x10, 0x6b, 0x8f, 0x2f, -0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0xae, 0x24, 0xaf, 0x25, 0xab, 0x07, 0xaa, 0x06, 0xae, 0x34, -0xaf, 0x35, 0x12, 0x04, 0x80, 0xef, 0x25, 0x2f, 0xff, 0xee, 0x35, 0x2e, 0xfe, 0xed, 0x35, 0x2d, -0xfd, 0xec, 0x35, 0x2c, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x38, 0xc3, 0x13, 0xfe, 0xe5, 0x39, -0x12, 0x05, 0x9a, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x05, 0x33, 0xc0, 0x06, 0xc0, 0x07, 0xae, 0x38, -0xaf, 0x39, 0xab, 0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0f, 0x42, 0x8f, 0x2f, -0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0x12, 0x0b, 0x84, 0x7c, 0x00, 0x7d, 0x02, 0x12, 0x0d, 0x6f, -0xc0, 0x06, 0xc0, 0x07, 0x12, 0x0b, 0x70, 0xd0, 0xe0, 0x2f, 0xf5, 0x37, 0xd0, 0xe0, 0x3e, 0xf5, -0x36, 0x12, 0x00, 0x60, 0xae, 0x36, 0xaf, 0x37, 0x12, 0x03, 0xda, 0x25, 0x37, 0xf5, 0x37, 0xee, -0x35, 0x36, 0xf5, 0x36, 0xd3, 0xe5, 0x37, 0x95, 0x3b, 0xe5, 0x36, 0x95, 0x3a, 0x40, 0x06, 0x85, -0x3a, 0x36, 0x85, 0x3b, 0x37, 0x78, 0x6b, 0xe6, 0x24, 0x09, 0x12, 0x00, 0xf3, 0xc3, 0xe5, 0x3b, -0x95, 0x37, 0xfd, 0xe5, 0x3a, 0x95, 0x36, 0xfc, 0x12, 0x10, 0x6b, 0x8f, 0x33, 0x8e, 0x32, 0x8d, -0x31, 0x8c, 0x30, 0xae, 0x26, 0xaf, 0x27, 0xab, 0x07, 0xaa, 0x06, 0xae, 0x36, 0xaf, 0x37, 0x12, -0x04, 0x80, 0xef, 0x25, 0x33, 0xff, 0xee, 0x35, 0x32, 0xfe, 0xed, 0x35, 0x31, 0xfd, 0xec, 0x35, -0x30, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x3a, 0xc3, 0x13, 0xfe, 0xe5, 0x3b, 0x12, 0x05, 0x9a, -0xd0, 0x07, 0xd0, 0x06, 0x12, 0x05, 0x33, 0xc0, 0x06, 0xc0, 0x07, 0xae, 0x3a, 0xaf, 0x3b, 0xab, -0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0f, 0x42, 0x8f, 0x33, 0x8e, 0x32, 0x8d, -0x31, 0x8c, 0x30, 0x12, 0x00, 0x60, 0x74, 0x16, 0x93, 0xf4, 0x60, 0x2e, 0x78, 0x6b, 0xe6, 0xff, -0x24, 0x0d, 0xf8, 0xe2, 0xb4, 0x01, 0x1b, 0xa8, 0x07, 0xe8, 0x04, 0xf8, 0xe5, 0x2e, 0xf2, 0x08, -0xe5, 0x2f, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x03, 0xf8, 0xe5, 0x32, 0xf2, 0x08, 0xe5, 0x33, 0xf2, -0x80, 0x08, 0x78, 0x6b, 0x12, 0x00, 0xfa, 0x12, 0x04, 0xa6, 0x78, 0x6b, 0xe6, 0xff, 0x04, 0x12, -0x01, 0x14, 0x24, 0x07, 0x12, 0x04, 0xa8, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x03, 0x12, 0x01, 0x14, -0x12, 0x02, 0xf4, 0x94, 0x14, 0x50, 0x03, 0xe2, 0x04, 0xf2, 0x12, 0x05, 0x2c, 0x74, 0x01, 0xf2, -0x22, 0x12, 0x05, 0x2c, 0xe2, 0xd3, 0x94, 0x00, 0x40, 0x03, 0xe2, 0x14, 0xf2, 0xe2, 0x70, 0x1f, -0x78, 0x6b, 0xe6, 0xff, 0x24, 0x0e, 0xf8, 0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x12, 0x12, 0x05, -0xa2, 0x24, 0x14, 0x12, 0x05, 0xa2, 0x24, 0x10, 0xf8, 0xe4, 0xf2, 0x08, 0x74, 0x28, 0xf2, 0x22, -0x78, 0x6b, 0xe6, 0x24, 0x0a, 0xf8, 0xc3, 0xe2, 0x95, 0x27, 0xff, 0x18, 0xe2, 0x95, 0x26, 0xfe, -0x12, 0x3b, 0x31, 0x22, 0x78, 0x6b, 0xe6, 0x24, 0x08, 0xf8, 0xc3, 0xe2, 0x95, 0x25, 0xff, 0x18, -0xe2, 0x95, 0x24, 0xfe, 0x12, 0x3b, 0x31, 0x22, 0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, +0xe5, 0x00, 0x94, 0x00, 0x22, 0x8e, 0x2d, 0x8f, 0x2e, 0xab, 0x07, 0xaa, 0x06, 0xea, 0x33, 0x95, +0xe0, 0xf9, 0x22, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9d, 0xfd, 0xe4, 0x94, 0x00, 0xfc, 0xe5, 0x22, +0x75, 0xf0, 0x0a, 0xa4, 0x22, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, +0x00, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xab, 0x07, 0xfa, 0xe4, 0xf9, 0xf8, +0x22, 0x7e, 0x00, 0x7a, 0x00, 0x79, 0x01, 0x7d, 0x00, 0x7b, 0xfe, 0x02, 0x0f, 0xeb, 0x78, 0x79, +0xe6, 0xff, 0x24, 0x04, 0xf8, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, +0xfe, 0x22, 0xe4, 0xfa, 0xf9, 0xf8, 0xee, 0x33, 0x95, 0xe0, 0xfd, 0xfc, 0x22, 0x74, 0x18, 0x93, +0xfb, 0x7c, 0x00, 0x7d, 0x0a, 0x12, 0x0c, 0x7a, 0xad, 0x03, 0x7c, 0x00, 0x12, 0x0f, 0xbe, 0xef, +0x22, 0xc3, 0x13, 0xf5, 0x00, 0xef, 0x13, 0xf5, 0x00, 0xd3, 0x74, 0x10, 0x93, 0x95, 0x00, 0x74, +0x0f, 0x93, 0x95, 0x00, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, 0xfe, +0xe4, 0x95, 0x00, 0xfd, 0xe4, 0x95, 0x00, 0xfc, 0x22, 0xc3, 0x74, 0x64, 0x95, 0x23, 0xff, 0xe4, +0x94, 0x00, 0xfe, 0xe4, 0xfc, 0xfd, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xfb, 0xe5, 0x00, 0x95, +0x00, 0xfa, 0xe4, 0x95, 0x00, 0xf9, 0xe4, 0x95, 0x00, 0x22, 0xe5, 0x00, 0x25, 0x00, 0xff, 0xe5, +0x00, 0x35, 0x00, 0xfe, 0xe4, 0x35, 0x00, 0xfd, 0xe4, 0x35, 0x00, 0xfc, 0x22, 0x74, 0x03, 0x93, +0xfe, 0x74, 0x04, 0x93, 0xff, 0x78, 0x7a, 0xe6, 0xfd, 0x7c, 0x00, 0x02, 0x0c, 0x7a, 0x93, 0xff, +0xe4, 0xfc, 0xfd, 0x12, 0x0f, 0x7a, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x02, 0xfa, 0xf9, 0xf8, 0x22, +0x3c, 0xfe, 0xd3, 0xe5, 0x00, 0x9f, 0xe5, 0x00, 0x9e, 0x22, 0xa8, 0x07, 0xe8, 0x24, 0x03, 0xf8, +0xc3, 0xe2, 0x9d, 0xf5, 0x2b, 0x18, 0xe2, 0x9c, 0xf5, 0x2a, 0x22, 0xf8, 0xe2, 0x2f, 0xf5, 0x28, +0x18, 0xe2, 0x3e, 0xf5, 0x27, 0x22, 0xe6, 0xff, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xef, 0x2d, 0xff, +0xe4, 0x3c, 0xc3, 0x13, 0xef, 0x13, 0x22, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x22, 0x25, 0xe0, +0x24, 0x5d, 0xf8, 0xe2, 0x22, 0x85, 0x40, 0x82, 0x85, 0x3f, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x21, +0x02, 0x0f, 0xac, 0x24, 0x2a, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xef, 0x22, 0xc3, 0xe5, 0x00, 0x9d, +0xf5, 0x00, 0xe5, 0x00, 0x9c, 0xf5, 0x00, 0xa8, 0x07, 0xe8, 0x22, 0xf5, 0x83, 0xe5, 0x82, 0x2d, +0xf5, 0x82, 0xe5, 0x83, 0x3c, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xf5, 0x00, 0xea, 0x3e, 0xf5, 0x00, +0xe9, 0x3d, 0xf5, 0x00, 0xe8, 0x3c, 0xf5, 0x00, 0x22, 0x74, 0x1e, 0x93, 0xfe, 0xa8, 0x07, 0xe8, +0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9e, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x22, +0xa8, 0x07, 0xc3, 0x08, 0xe2, 0x9d, 0xf5, 0x29, 0x18, 0xe2, 0x9c, 0xf5, 0x28, 0x22, 0x75, 0xf0, +0x2e, 0xa4, 0x24, 0x03, 0x22, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x06, 0x22, 0xff, 0xae, 0xf0, 0xe4, +0xfc, 0xfd, 0x22, 0xa8, 0x07, 0xe8, 0x24, 0x02, 0xf8, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0e, 0xf8, +0x22, 0xe2, 0xfc, 0x08, 0xe2, 0x2f, 0xff, 0xee, 0x3c, 0xfe, 0xef, 0x78, 0x02, 0x22, 0xef, 0x2b, +0xff, 0xee, 0x3a, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, 0xfc, 0x22, 0xe4, 0x7f, 0x01, 0xfe, 0xfd, +0xfc, 0x22, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x22, 0xc3, 0xe5, 0x00, 0x9f, 0xf5, 0x00, 0xe5, +0x00, 0x9e, 0xf5, 0x00, 0x22, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xfe, 0x22, 0x78, 0x66, 0x12, +0x0f, 0x6e, 0x78, 0x62, 0x12, 0x0f, 0x7a, 0xeb, 0x22, 0xe5, 0x31, 0x25, 0x31, 0xf5, 0x31, 0xe5, +0x30, 0x33, 0xf5, 0x30, 0x22, 0xc3, 0xe5, 0x26, 0x95, 0x28, 0xff, 0xe5, 0x25, 0x95, 0x27, 0xfe, +0x22, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0x75, 0xf0, 0x02, 0xe5, 0x00, 0x22, 0xf8, 0xe4, 0xfc, 0xfd, +0x02, 0x0e, 0x17, 0x13, 0xfb, 0xaa, 0x06, 0xe4, 0xf9, 0xf8, 0x22, 0xf8, 0xe4, 0xf2, 0x08, 0x74, +0x80, 0xf2, 0xa8, 0x07, 0xe8, 0x22, 0xe4, 0xfc, 0xfd, 0xeb, 0x25, 0x00, 0xff, 0xea, 0x35, 0x00, +0x22, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x01, 0x22, 0xce, 0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, 0x78, +0x79, 0xe6, 0x24, 0x19, 0xf8, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0c, 0xf8, 0x22, 0xd3, 0xe5, 0x35, +0x95, 0x37, 0xe5, 0x34, 0x95, 0x36, 0x22, 0xe2, 0x2f, 0xf5, 0x26, 0x18, 0xe2, 0x3e, 0xf5, 0x25, +0x22, 0x24, 0x40, 0xff, 0xe4, 0x3e, 0xfe, 0x22, 0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, 0xe7, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x3e, 0x88, 0x82, 0x8c, 0x83, 0xe7, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x32, 0xe3, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x78, 0xe3, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x70, 0x88, 0x82, 0x8c, 0x83, 0xe3, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x64, @@ -208,7 +197,7 @@ app_bin_816d = [ 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xea, 0xde, 0xe8, 0x80, 0xdb, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf2, 0x08, 0xdf, 0xf9, 0x80, 0xcc, 0x88, 0xf0, 0xef, 0x60, 0x01, 0x0e, 0x4e, 0x60, 0xc3, 0x88, 0xf0, 0xed, 0x24, 0x02, 0xb4, 0x04, 0x00, 0x50, 0xb9, 0xf5, 0x82, 0xeb, 0x24, 0x02, -0xb4, 0x04, 0x00, 0x50, 0xaf, 0x23, 0x23, 0x45, 0x82, 0x23, 0x90, 0x0b, 0xe8, 0x73, 0xbb, 0x01, +0xb4, 0x04, 0x00, 0x50, 0xaf, 0x23, 0x23, 0x45, 0x82, 0x23, 0x90, 0x0b, 0x48, 0x73, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, @@ -224,8 +213,8 @@ app_bin_816d = [ 0xd2, 0x1c, 0xfe, 0xad, 0xf0, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, 0x40, 0x07, 0x98, 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, 0xfd, 0x0f, 0xd5, 0xf0, 0xea, 0x22, 0xc2, 0xd5, 0xec, 0x30, 0xe7, 0x09, 0xb2, 0xd5, 0xe4, 0xc3, 0x9d, 0xfd, 0xe4, 0x9c, 0xfc, 0xee, 0x30, -0xe7, 0x15, 0xb2, 0xd5, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x12, 0x0d, 0x1a, 0xc3, 0xe4, -0x9d, 0xfd, 0xe4, 0x9c, 0xfc, 0x80, 0x03, 0x12, 0x0d, 0x1a, 0x30, 0xd5, 0x07, 0xc3, 0xe4, 0x9f, +0xe7, 0x15, 0xb2, 0xd5, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x12, 0x0c, 0x7a, 0xc3, 0xe4, +0x9d, 0xfd, 0xe4, 0x9c, 0xfc, 0x80, 0x03, 0x12, 0x0c, 0x7a, 0x30, 0xd5, 0x07, 0xc3, 0xe4, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22, 0xbb, 0x01, 0x0a, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xf5, 0xf0, 0xa3, 0xe0, 0x22, 0x50, 0x06, 0x87, 0xf0, 0x09, 0xe7, 0x19, 0x22, @@ -234,7 +223,7 @@ app_bin_816d = [ 0x3a, 0xf5, 0x83, 0xe0, 0xf5, 0xf0, 0xa3, 0xe0, 0x22, 0x50, 0x09, 0xe9, 0x25, 0x82, 0xf8, 0x86, 0xf0, 0x08, 0xe6, 0x22, 0xbb, 0xfe, 0x0a, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0xf5, 0xf0, 0x08, 0xe2, 0x22, 0xe5, 0x83, 0x2a, 0xf5, 0x83, 0xe9, 0x93, 0xf5, 0xf0, 0xa3, 0xe9, 0x93, 0x22, 0xbb, 0x01, -0x0d, 0xc5, 0x82, 0x29, 0xc5, 0x82, 0xc5, 0x83, 0x3a, 0xc5, 0x83, 0x02, 0x0d, 0xa5, 0x50, 0x11, +0x0d, 0xc5, 0x82, 0x29, 0xc5, 0x82, 0xc5, 0x83, 0x3a, 0xc5, 0x83, 0x02, 0x0d, 0x05, 0x50, 0x11, 0xc5, 0x82, 0x29, 0xf8, 0x08, 0xe5, 0xf0, 0x26, 0xf6, 0x18, 0xf5, 0xf0, 0xe5, 0x82, 0x36, 0xf6, 0x22, 0xbb, 0xfe, 0x11, 0xc5, 0x82, 0x29, 0xf8, 0x08, 0xe2, 0x25, 0xf0, 0xf5, 0xf0, 0xf2, 0x18, 0xe2, 0x35, 0x82, 0xf2, 0x22, 0xf8, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x2a, 0xf5, 0x83, @@ -262,519 +251,488 @@ app_bin_816d = [ 0xc8, 0x33, 0xc8, 0x10, 0xd7, 0x07, 0x9b, 0xec, 0x9a, 0xe8, 0x99, 0x40, 0x0a, 0xed, 0x9b, 0xfd, 0xec, 0x9a, 0xfc, 0xe8, 0x99, 0xf8, 0x0f, 0xd5, 0xf0, 0xda, 0xe4, 0xcd, 0xfb, 0xe4, 0xcc, 0xfa, 0xe4, 0xc8, 0xf9, 0x22, 0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, 0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, -0xe8, 0x9c, 0x45, 0xf0, 0x22, 0xe8, 0x60, 0x0f, 0xec, 0xc3, 0x13, 0xfc, 0xed, 0x13, 0xfd, 0xee, -0x13, 0xfe, 0xef, 0x13, 0xff, 0xd8, 0xf1, 0x22, 0xe8, 0x60, 0x0f, 0xef, 0xc3, 0x33, 0xff, 0xee, -0x33, 0xfe, 0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc, 0xd8, 0xf1, 0x22, 0xe6, 0xfc, 0x08, 0xe6, 0xfd, -0x08, 0xe6, 0xfe, 0x08, 0xe6, 0xff, 0x22, 0xe6, 0xfb, 0x08, 0xe6, 0xf9, 0x08, 0xe6, 0xfa, 0x08, -0xe6, 0xcb, 0xf8, 0x22, 0xe4, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf9, 0x74, 0x02, 0x93, 0xfa, 0x74, -0x03, 0x93, 0xfb, 0x22, 0xec, 0xf6, 0x08, 0xed, 0xf6, 0x08, 0xee, 0xf6, 0x08, 0xef, 0xf6, 0x22, -0xd0, 0x83, 0xd0, 0x82, 0xe4, 0x93, 0xf6, 0x08, 0x74, 0x01, 0x93, 0xf6, 0x08, 0x74, 0x02, 0x93, -0xf6, 0x08, 0x74, 0x03, 0x93, 0xf6, 0x74, 0x04, 0x73, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, 0xf0, -0x35, 0x83, 0xf5, 0x83, 0x22, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xec, 0x8e, 0xf0, 0xa4, 0xcc, -0xc5, 0xf0, 0xcc, 0xcd, 0xf8, 0xef, 0xa4, 0xce, 0xc5, 0xf0, 0x2d, 0xfd, 0xe4, 0x3c, 0xfc, 0xe8, -0xa4, 0x2e, 0xc8, 0xc5, 0xf0, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xef, 0xa4, 0xff, 0xe5, 0xf0, 0x28, -0xfe, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0x22, 0xef, 0x4e, 0x60, 0x12, 0xef, 0x60, 0x01, 0x0e, -0xed, 0xbb, 0x01, 0x0b, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0xa3, 0xdf, 0xfc, 0xde, 0xfa, 0x22, 0x89, -0xf0, 0x50, 0x07, 0xf7, 0x09, 0xdf, 0xfc, 0xa9, 0xf0, 0x22, 0xbb, 0xfe, 0xfc, 0xf3, 0x09, 0xdf, -0xfc, 0xa9, 0xf0, 0x22, 0x90, 0x36, 0x03, 0x7d, 0x1f, 0x12, 0x33, 0x47, 0xee, 0x44, 0x80, 0xf5, -0x8f, 0x8f, 0x8e, 0x75, 0x8a, 0xa0, 0x75, 0x8a, 0x0a, 0xe4, 0x90, 0x00, 0xc3, 0xf0, 0x90, 0x00, -0xc9, 0xe0, 0x70, 0x03, 0x02, 0x11, 0xd7, 0x14, 0x70, 0x03, 0x02, 0x12, 0x02, 0x24, 0xfc, 0x70, -0x03, 0x02, 0x13, 0xbf, 0x04, 0x60, 0x03, 0x02, 0x13, 0xf8, 0xe4, 0xf5, 0x18, 0x78, 0x73, 0xf6, -0x90, 0x36, 0x12, 0x93, 0x70, 0x0e, 0x75, 0x3f, 0x36, 0x75, 0x40, 0x2a, 0x12, 0x3b, 0x47, 0x8f, -0x18, 0x02, 0x11, 0xc6, 0xe4, 0xf5, 0x1a, 0xf5, 0x1b, 0x75, 0x3f, 0x38, 0x75, 0x40, 0x9e, 0x12, -0x14, 0xeb, 0x12, 0x33, 0x34, 0x12, 0x20, 0xa8, 0xe4, 0xf5, 0x19, 0x12, 0x33, 0x19, 0xe4, 0x93, -0xff, 0xe5, 0x19, 0xc3, 0x9f, 0x50, 0x33, 0xaf, 0x19, 0x12, 0x3b, 0x57, 0xac, 0x06, 0xad, 0x07, -0x12, 0x33, 0x19, 0x74, 0x2c, 0x93, 0x75, 0xf0, 0xc8, 0xa4, 0xff, 0xd3, 0xed, 0x9f, 0xec, 0x95, -0xf0, 0x40, 0x13, 0xe4, 0x7f, 0x01, 0xfe, 0xfd, 0xfc, 0xa9, 0x19, 0xa8, 0x01, 0x12, 0x0f, 0xf8, -0xef, 0x42, 0x1b, 0xee, 0x42, 0x1a, 0x05, 0x19, 0x80, 0xc1, 0xe5, 0x1a, 0x90, 0x01, 0xab, 0xf0, -0xa3, 0xe5, 0x1b, 0xf0, 0xe4, 0xf5, 0x19, 0xae, 0x1a, 0xaf, 0x1b, 0xe4, 0xfc, 0xfd, 0xe5, 0x19, -0x25, 0xe0, 0x25, 0xe0, 0x24, 0x13, 0xf5, 0x82, 0xe4, 0x34, 0x36, 0xf5, 0x83, 0x12, 0x10, 0x24, -0xc3, 0x12, 0x0f, 0xd4, 0x60, 0x07, 0x05, 0x19, 0xe5, 0x19, 0xb4, 0x04, 0xda, 0xe5, 0x19, 0xc3, -0x94, 0x04, 0x50, 0x19, 0x85, 0x19, 0x18, 0x75, 0xf0, 0x9d, 0xe5, 0x19, 0xa4, 0x24, 0x2a, 0xf5, -0x82, 0xe5, 0xf0, 0x34, 0x36, 0xaf, 0x82, 0xf5, 0x3f, 0x8f, 0x40, 0x80, 0x09, 0xe4, 0xf5, 0x18, -0x75, 0x3f, 0x36, 0x75, 0x40, 0x2a, 0x90, 0x01, 0xaa, 0xe5, 0x18, 0xf0, 0x90, 0x01, 0xf0, 0x74, -0x40, 0xf0, 0xa3, 0xf0, 0x02, 0x13, 0xf8, 0xe4, 0x78, 0x73, 0xf6, 0x12, 0x31, 0x4b, 0xef, 0x64, -0x01, 0x60, 0xf8, 0x12, 0x14, 0xeb, 0xaf, 0x40, 0xae, 0x3f, 0x12, 0x3a, 0xee, 0xe5, 0x40, 0x24, -0x79, 0xff, 0xe4, 0x35, 0x3f, 0xfe, 0x12, 0x3a, 0x9e, 0x12, 0x33, 0x51, 0xa3, 0x04, 0xf0, 0x02, -0x13, 0xfd, 0xe4, 0xf5, 0x18, 0x78, 0x47, 0xf6, 0x90, 0x01, 0xff, 0xe0, 0xb4, 0x01, 0x09, 0x90, -0x00, 0xc9, 0x74, 0x05, 0xf0, 0x02, 0x13, 0xfd, 0x78, 0x73, 0x76, 0x01, 0x12, 0x33, 0x34, 0x12, -0x20, 0xa8, 0x78, 0x47, 0xa6, 0x07, 0x12, 0x33, 0x19, 0x74, 0x63, 0x93, 0x70, 0x03, 0x74, 0x62, -0x93, 0x60, 0x1b, 0x08, 0xe6, 0xf5, 0x19, 0x08, 0xe6, 0xf5, 0x1a, 0x08, 0xe6, 0xfe, 0x08, 0xe6, -0xff, 0x78, 0x48, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x08, 0xa6, 0x19, 0x08, 0xa6, 0x1a, 0x7f, 0x5f, -0xe5, 0x40, 0x24, 0x79, 0xfd, 0xe4, 0x35, 0x3f, 0xfc, 0x12, 0x2e, 0x51, 0x8f, 0x18, 0x12, 0x33, -0x34, 0x75, 0x20, 0x36, 0x75, 0x21, 0x23, 0xad, 0x18, 0x12, 0x1b, 0xb2, 0x8f, 0x18, 0x78, 0x47, -0xe6, 0x64, 0x02, 0x70, 0x6f, 0xf5, 0x19, 0xe5, 0x18, 0x64, 0x05, 0x60, 0x05, 0xe5, 0x18, 0xb4, -0x0c, 0x03, 0x43, 0x18, 0x80, 0x78, 0x47, 0xa6, 0x0a, 0xe5, 0x0a, 0x70, 0x03, 0x78, 0x4c, 0xf6, -0xe5, 0x19, 0xd3, 0x94, 0x03, 0x50, 0x51, 0x74, 0x01, 0x7e, 0x00, 0xa8, 0x19, 0x08, 0x80, 0x05, -0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0x78, 0x47, 0xe6, 0xfd, 0xef, 0x5d, 0x60, 0x30, -0x12, 0x33, 0x19, 0x75, 0xf0, 0x09, 0xe5, 0x19, 0x12, 0x10, 0x59, 0x74, 0x36, 0x93, 0xfe, 0x74, -0x37, 0x93, 0x08, 0xa6, 0x06, 0x08, 0xf6, 0x12, 0x33, 0x19, 0x75, 0xf0, 0x09, 0xe5, 0x19, 0x12, -0x10, 0x59, 0x74, 0x38, 0x93, 0xfe, 0x74, 0x39, 0x93, 0x08, 0xa6, 0x06, 0x08, 0xf6, 0x80, 0x08, -0x05, 0x19, 0x80, 0xac, 0xe4, 0x78, 0x47, 0xf6, 0x78, 0x4c, 0xe6, 0x70, 0x03, 0x02, 0x13, 0x72, -0xe5, 0x18, 0x70, 0x12, 0x90, 0x01, 0xea, 0xe0, 0x30, 0xe2, 0x0b, 0x78, 0x89, 0xe2, 0x24, 0x01, -0xf2, 0x18, 0xe2, 0x34, 0x00, 0xf2, 0x78, 0x52, 0xe6, 0x60, 0x07, 0x90, 0x01, 0xea, 0xe0, 0x20, -0xe0, 0x0c, 0xe5, 0x18, 0xb4, 0xaa, 0x0f, 0x90, 0x01, 0xea, 0xe0, 0x30, 0xe1, 0x08, 0x90, 0x00, -0xc8, 0xe0, 0x04, 0xf0, 0x80, 0x08, 0x90, 0x00, 0xc8, 0xe0, 0x60, 0x02, 0x14, 0xf0, 0x90, 0x36, -0x08, 0xe4, 0x93, 0x75, 0xf0, 0x64, 0xa4, 0xff, 0xd3, 0x78, 0x89, 0xe2, 0x9f, 0x18, 0xe2, 0x95, -0xf0, 0x50, 0x1b, 0x12, 0x33, 0x19, 0x74, 0x9c, 0x93, 0x24, 0x02, 0xff, 0xe4, 0x33, 0xfe, 0x90, -0x00, 0xc8, 0xe0, 0xd3, 0x9f, 0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x14, 0x7f, 0x01, -0x12, 0x3b, 0x52, 0xe4, 0x78, 0x4c, 0xf6, 0x78, 0x52, 0xf6, 0x78, 0x4d, 0x76, 0x04, 0x78, 0x53, -0x76, 0x04, 0x12, 0x33, 0x34, 0x78, 0x47, 0xe6, 0xf5, 0x20, 0xad, 0x18, 0x12, 0x14, 0xfa, 0x78, -0x4c, 0xe6, 0x60, 0x19, 0x90, 0x36, 0x06, 0x7d, 0x64, 0x12, 0x33, 0x47, 0xc3, 0x78, 0x75, 0xe6, -0x9f, 0x18, 0xe6, 0x9e, 0x50, 0x67, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x80, 0x60, 0x90, 0x01, 0xfe, -0xe0, 0x70, 0x17, 0x78, 0x75, 0xe6, 0x18, 0x46, 0x60, 0x09, 0x08, 0xe6, 0x16, 0x18, 0x70, 0x0a, -0x16, 0x80, 0x07, 0x78, 0x74, 0x76, 0x00, 0x08, 0x76, 0x14, 0x12, 0x33, 0x51, 0x80, 0x3e, 0x12, -0x33, 0x19, 0xe4, 0x93, 0x90, 0x01, 0xcb, 0xf0, 0x90, 0x01, 0xff, 0xe0, 0xb4, 0x01, 0x2e, 0x75, -0x1f, 0x01, 0x75, 0x20, 0x01, 0x75, 0x21, 0x40, 0x75, 0x22, 0x01, 0x75, 0x23, 0x01, 0x75, 0x24, -0x80, 0x7b, 0x01, 0x7a, 0x01, 0x79, 0xc0, 0x12, 0x1d, 0x75, 0xe4, 0x90, 0x01, 0xff, 0xf0, 0x75, -0x8a, 0xa0, 0x90, 0x00, 0xc0, 0xf0, 0x80, 0xd0, 0xe4, 0x90, 0x00, 0xc9, 0xf0, 0x90, 0x01, 0xe5, -0xe0, 0x64, 0x03, 0x60, 0x0b, 0x90, 0x01, 0xb5, 0xe0, 0x64, 0x03, 0x60, 0x03, 0x02, 0x14, 0x96, -0x90, 0x36, 0x0e, 0xe4, 0x93, 0xf5, 0x18, 0x7f, 0x01, 0x12, 0x39, 0xf3, 0xe5, 0x18, 0x70, 0x05, -0x90, 0xff, 0x11, 0x80, 0x0d, 0xe5, 0x18, 0xb4, 0x01, 0x0c, 0x90, 0xff, 0x10, 0xe0, 0x44, 0x18, -0xf0, 0xa3, 0xe0, 0x44, 0x18, 0xf0, 0x90, 0x01, 0xb5, 0xe0, 0xb4, 0x03, 0x15, 0x90, 0xff, 0x12, -0xe0, 0x54, 0xe3, 0xf0, 0x90, 0xff, 0x11, 0xe0, 0x54, 0xe3, 0xf0, 0x90, 0xff, 0x10, 0xe0, 0x54, -0xe3, 0xf0, 0x75, 0x8f, 0x87, 0x75, 0x8e, 0xff, 0x75, 0x8d, 0x87, 0x75, 0x8c, 0xff, 0x12, 0x33, -0x2b, 0x75, 0x8a, 0xa0, 0xf0, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x33, 0x20, 0x50, 0x03, 0xe0, -0x04, 0xf0, 0x75, 0x91, 0xc3, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x33, 0x20, -0x50, 0x03, 0xe0, 0x04, 0xf0, 0x12, 0x33, 0x2b, 0x75, 0x8a, 0xa0, 0xf0, 0x75, 0x8a, 0xa0, 0xf0, -0x75, 0x8a, 0xa0, 0xf0, 0x80, 0xc8, 0x75, 0x18, 0x27, 0x75, 0x19, 0x10, 0xe5, 0x89, 0x30, 0xe7, -0x08, 0x12, 0x33, 0x20, 0x50, 0x03, 0xe0, 0x04, 0xf0, 0x90, 0x00, 0xc3, 0xe0, 0xff, 0xc3, 0x78, -0x73, 0x96, 0x50, 0x36, 0xe5, 0x19, 0x15, 0x19, 0xac, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4c, 0x60, -0x29, 0xe5, 0x89, 0x30, 0xe7, 0x0c, 0x75, 0x89, 0x80, 0xef, 0xc3, 0x94, 0xff, 0x50, 0x03, 0xe0, -0x04, 0xf0, 0x75, 0x91, 0xc1, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x33, 0x20, -0x50, 0x03, 0xe0, 0x04, 0xf0, 0x12, 0x33, 0x2b, 0x80, 0xbf, 0x22, 0xaf, 0x40, 0xae, 0x3f, 0x12, -0x23, 0x86, 0xaf, 0x40, 0xae, 0x3f, 0x12, 0x3a, 0x3c, 0x22, 0x8b, 0x1c, 0x8a, 0x1d, 0x89, 0x1e, -0x8d, 0x1f, 0x90, 0x01, 0xfa, 0xe0, 0xf5, 0x21, 0xe4, 0xf5, 0x22, 0x85, 0x20, 0x20, 0xe5, 0x1f, -0x60, 0x04, 0x90, 0x00, 0xcb, 0xf0, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x34, 0x39, 0x75, 0x23, 0x01, -0x75, 0x24, 0x00, 0x78, 0x78, 0xe6, 0xff, 0x70, 0x0b, 0x74, 0x20, 0x25, 0x24, 0xf5, 0x24, 0xe4, -0x35, 0x23, 0xf5, 0x23, 0x74, 0x00, 0x2f, 0xf9, 0xe4, 0x34, 0x01, 0xfa, 0x7b, 0x01, 0xa8, 0x24, -0xac, 0x23, 0x7d, 0x01, 0x7e, 0x00, 0x7f, 0x20, 0x12, 0x0c, 0x68, 0x7e, 0x00, 0x7f, 0x0b, 0x7d, -0xff, 0xe5, 0x24, 0x24, 0x09, 0xfb, 0xe4, 0x35, 0x23, 0xfa, 0xa9, 0x03, 0x7b, 0x01, 0x12, 0x10, -0x98, 0x05, 0x24, 0xe5, 0x24, 0xae, 0x23, 0x70, 0x02, 0x05, 0x23, 0x14, 0xf5, 0x82, 0x8e, 0x83, -0xe4, 0xf0, 0x12, 0x2d, 0x00, 0x90, 0x00, 0x0a, 0x12, 0x2c, 0xb6, 0xff, 0x90, 0x00, 0x04, 0x12, -0x0c, 0xa7, 0x2f, 0xf5, 0x22, 0x90, 0x00, 0x05, 0x12, 0x0c, 0xa7, 0xb4, 0x04, 0x09, 0x12, 0x2c, -0xdb, 0x70, 0x04, 0x90, 0x00, 0xca, 0xf0, 0x90, 0x00, 0xca, 0xe0, 0x60, 0x55, 0x14, 0xf0, 0xe0, -0xff, 0x7e, 0x04, 0x60, 0x02, 0x7e, 0x08, 0x12, 0x2c, 0xee, 0x90, 0x00, 0x05, 0xee, 0x12, 0x0c, -0xe6, 0xef, 0x60, 0x0b, 0x12, 0x2d, 0x0a, 0x12, 0x0d, 0xbb, 0xff, 0xae, 0xf0, 0x80, 0x10, 0x90, -0x00, 0xcb, 0xe0, 0xff, 0xb4, 0x05, 0x02, 0x80, 0x02, 0x7f, 0x00, 0xef, 0x7f, 0x00, 0xfe, 0x12, -0x2c, 0x9d, 0x12, 0x2c, 0xb3, 0xc4, 0x54, 0xf0, 0xfe, 0x12, 0x2d, 0x0a, 0x12, 0x0d, 0xbb, 0xfd, -0xe5, 0xf0, 0x54, 0x0f, 0xfc, 0xe4, 0x2d, 0xff, 0xee, 0x3c, 0x8f, 0xf0, 0x12, 0x0e, 0x6b, 0x02, -0x16, 0xff, 0x12, 0x2c, 0xb3, 0x70, 0x09, 0x12, 0x2c, 0xdb, 0x70, 0x04, 0xe5, 0x1f, 0x60, 0x51, -0x12, 0x2c, 0xe1, 0x12, 0x2c, 0x9d, 0x12, 0x2c, 0xb3, 0x60, 0x14, 0xc4, 0x54, 0xf0, 0xfe, 0x12, -0x0d, 0xbb, 0x24, 0x00, 0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2c, 0x78, 0x12, 0x2c, 0xbf, 0x12, -0x2c, 0xd5, 0x60, 0x32, 0xc4, 0x54, 0xf0, 0xfe, 0x90, 0x00, 0x06, 0x12, 0x0d, 0xe6, 0x24, 0x00, -0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2c, 0x9d, 0x12, 0x2c, 0xee, 0x90, 0x00, 0x08, 0x12, 0x0d, -0xe6, 0x24, 0x00, 0xff, 0xe5, 0xf0, 0x34, 0x10, 0xfe, 0x12, 0x2c, 0x9d, 0x12, 0x2c, 0xbf, 0x80, -0x05, 0xe4, 0x90, 0x00, 0xcb, 0xf0, 0x90, 0x01, 0xfe, 0xe0, 0xd3, 0x94, 0xf0, 0x50, 0x03, 0x02, -0x16, 0xff, 0x12, 0x2d, 0x00, 0xe5, 0x20, 0x60, 0x14, 0x12, 0x2c, 0xe3, 0x12, 0x2c, 0x9d, 0x7e, -0x00, 0x7f, 0x08, 0x7d, 0x00, 0x12, 0x2d, 0x0a, 0x12, 0x10, 0x98, 0x80, 0x21, 0x12, 0x2c, 0xe1, -0x12, 0x2c, 0x9d, 0x12, 0x2c, 0xee, 0x12, 0x0d, 0xbb, 0xff, 0xae, 0xf0, 0x12, 0x2c, 0x78, 0x90, -0x00, 0x06, 0x12, 0x2c, 0x91, 0x12, 0x2c, 0xee, 0x90, 0x00, 0x08, 0x12, 0x2c, 0x97, 0x90, 0x01, -0x40, 0x74, 0x40, 0xf0, 0x90, 0x01, 0x60, 0x74, 0x60, 0xf0, 0x75, 0x2b, 0x01, 0x75, 0x2c, 0x41, -0x75, 0x29, 0x01, 0x75, 0x2a, 0x61, 0xe4, 0xf5, 0x28, 0xaf, 0x28, 0x12, 0x3b, 0x57, 0xe5, 0x2c, -0xfd, 0x24, 0x02, 0xf5, 0x2c, 0xe5, 0x2b, 0xfc, 0x34, 0x00, 0xf5, 0x2b, 0x12, 0x2d, 0x11, 0xaf, -0x28, 0x12, 0x3a, 0xff, 0xef, 0xd3, 0x94, 0x1c, 0x40, 0x06, 0x7e, 0x0f, 0x7f, 0xff, 0x80, 0x05, -0xaf, 0x28, 0x12, 0x3b, 0x25, 0xe5, 0x2a, 0xfd, 0x24, 0x02, 0xf5, 0x2a, 0xe5, 0x29, 0xfc, 0x34, -0x00, 0xf5, 0x29, 0x12, 0x2d, 0x11, 0x05, 0x28, 0xe5, 0x28, 0xc3, 0x94, 0x10, 0x40, 0xba, 0x78, -0x78, 0xe6, 0x7f, 0x00, 0x70, 0x02, 0x7f, 0x20, 0x78, 0x78, 0xa6, 0x07, 0xe5, 0x21, 0x20, 0xe7, -0x2a, 0x30, 0xe6, 0x0a, 0x12, 0x2c, 0xb3, 0x70, 0x22, 0x12, 0x2c, 0xdb, 0x70, 0x1d, 0xe5, 0x21, -0x30, 0xe5, 0x0f, 0x12, 0x2c, 0xd5, 0xff, 0x90, 0x00, 0x05, 0x12, 0x0c, 0xa7, 0x4f, 0x54, 0x84, -0x70, 0x09, 0xe5, 0x21, 0x30, 0xe4, 0x0c, 0xe5, 0x1f, 0x60, 0x08, 0x90, 0x01, 0xed, 0xe0, 0xff, -0x12, 0x32, 0xca, 0x22, 0x75, 0x89, 0x80, 0x90, 0x00, 0xc3, 0xe0, 0xc3, 0x94, 0xff, 0x22, 0x43, -0xad, 0x04, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0x85, 0x42, 0x82, 0x85, -0x41, 0x83, 0x74, 0x26, 0x93, 0x90, 0xff, 0x48, 0xf0, 0x85, 0x42, 0x82, 0x85, 0x41, 0x83, 0x74, -0x27, 0x93, 0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, 0x40, 0x74, 0x6c, 0xf0, 0x90, 0xff, 0x57, 0x74, -0xff, 0xf0, 0x90, 0xff, 0x56, 0xe4, 0xf0, 0x90, 0xff, 0x5f, 0x74, 0xff, 0xf0, 0x90, 0xff, 0x5e, -0xe4, 0xf0, 0x85, 0x42, 0x82, 0x85, 0x41, 0x83, 0x22, 0x78, 0x61, 0xe6, 0xff, 0x78, 0x84, 0xe2, -0xfc, 0x08, 0xe2, 0x2f, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xe0, 0x22, 0xe5, 0x22, 0x75, 0xf0, -0x0a, 0xa4, 0x24, 0x03, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x54, 0xe0, -0x90, 0x01, 0xf0, 0xf0, 0x90, 0xff, 0x5c, 0xe0, 0x90, 0x01, 0xf1, 0xf0, 0x75, 0x8a, 0xa0, 0xe4, -0x90, 0x00, 0xc0, 0xf0, 0x8c, 0x8f, 0x8d, 0x8e, 0x75, 0x8a, 0xa0, 0xf0, 0x90, 0xff, 0x43, 0x74, -0x5f, 0xf0, 0xe5, 0x89, 0x22, 0xe5, 0x27, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x05, 0xf5, 0x82, 0xe4, -0x34, 0x02, 0xf5, 0x83, 0x22, 0x78, 0x61, 0xe6, 0xff, 0x24, 0xb7, 0xf5, 0x82, 0xe4, 0x34, 0x02, -0xf5, 0x83, 0xe0, 0x90, 0xff, 0x54, 0xf0, 0x18, 0xe6, 0x24, 0xb7, 0xf5, 0x82, 0xe4, 0x34, 0x02, -0xf5, 0x83, 0xe0, 0x90, 0xff, 0x5c, 0xf0, 0xef, 0xc3, 0x13, 0xff, 0xe5, 0x42, 0x24, 0x1a, 0xf5, -0x82, 0xe4, 0x35, 0x41, 0xf5, 0x83, 0xe5, 0x82, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, -0xe4, 0x93, 0x90, 0xff, 0x55, 0xf0, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x75, 0xf0, 0x0a, -0xa4, 0x24, 0x09, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0xff, 0xa8, 0x0f, 0x08, 0x08, -0xe6, 0xfa, 0x08, 0xe6, 0xf5, 0x82, 0x8a, 0x83, 0x22, 0x74, 0x28, 0x93, 0x90, 0xff, 0x55, 0xf0, -0x90, 0x01, 0xf0, 0xe0, 0x90, 0xff, 0x54, 0xf0, 0x90, 0x01, 0xf1, 0xe0, 0x90, 0xff, 0x5c, 0xf0, -0x90, 0xff, 0x48, 0xe0, 0xff, 0x7e, 0x00, 0xc3, 0x94, 0x07, 0xee, 0x94, 0x00, 0x22, 0x75, 0x91, -0xc3, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x22, 0xfd, 0x7c, 0x00, 0xe6, 0xfa, 0x08, 0xe6, 0xfb, 0xc3, -0x9d, 0xff, 0xea, 0x9c, 0xfe, 0xef, 0x78, 0x03, 0x22, 0xce, 0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, -0xad, 0x8e, 0xac, 0x8f, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xc0, 0x22, 0x90, 0xff, 0x52, 0xe0, -0xfe, 0xa3, 0xe0, 0xa6, 0x06, 0x08, 0xf6, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, 0x22, 0xe5, -0x27, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0xd3, -0xe5, 0x2a, 0x94, 0x00, 0xe5, 0x29, 0x64, 0x80, 0x94, 0x80, 0x22, 0x90, 0xff, 0x52, 0xe0, 0xfa, -0xa3, 0xe0, 0xc3, 0x9f, 0xea, 0x9e, 0x22, 0x90, 0xff, 0x5f, 0xf0, 0xed, 0x2b, 0xff, 0xec, 0x3a, -0xfe, 0xef, 0x78, 0x03, 0x22, 0x7f, 0xb4, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0x03, 0x02, 0x10, 0x98, -0x90, 0xff, 0x5e, 0xf0, 0x90, 0xff, 0x56, 0xe0, 0xff, 0xa3, 0xe0, 0xd3, 0x9f, 0x22, 0x75, 0x91, -0xc1, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x22, 0x78, 0x84, 0xe2, 0xfc, 0x08, 0xe2, 0x22, 0x74, 0xb7, -0x25, 0x22, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x26, 0x22, 0xe5, 0x27, -0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0xd3, 0x74, -0x05, 0x93, 0x9f, 0x74, 0x04, 0x93, 0x9e, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x0b, 0xf5, 0x82, -0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x43, 0x74, 0x9f, 0xf0, 0x22, 0x78, 0x83, 0xe2, -0x90, 0xff, 0x40, 0xf0, 0x22, 0xe5, 0x42, 0x24, 0x2b, 0xff, 0xe4, 0x35, 0x41, 0xa9, 0x07, 0x22, -0xef, 0x24, 0x01, 0xff, 0xee, 0x33, 0xfe, 0xef, 0x78, 0x07, 0x22, 0xe5, 0x22, 0xc3, 0x78, 0x6a, -0x96, 0x22, 0xe0, 0xfc, 0xa3, 0xe0, 0xc3, 0x9f, 0x22, 0x8f, 0x23, 0x12, 0x05, 0x40, 0xe2, 0xfb, -0x12, 0x00, 0x60, 0x12, 0x04, 0x02, 0x12, 0x0d, 0x1a, 0x8e, 0x2f, 0x8f, 0x30, 0xeb, 0x70, 0x5f, -0x75, 0x24, 0x01, 0x12, 0x05, 0x6f, 0xe4, 0xf5, 0x29, 0xf5, 0x2a, 0x78, 0x61, 0xe2, 0xfe, 0x08, -0xe2, 0xff, 0x78, 0x60, 0x12, 0x02, 0xc1, 0x78, 0x65, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x64, -0x12, 0x04, 0x76, 0xc3, 0x74, 0x09, 0x93, 0x94, 0x00, 0x50, 0x05, 0x12, 0x05, 0x7b, 0x80, 0x04, -0xae, 0x27, 0xaf, 0x28, 0x8e, 0x2d, 0x8f, 0x2e, 0x12, 0x00, 0x60, 0x74, 0x09, 0x93, 0xfc, 0x74, -0x0a, 0x12, 0x02, 0x7d, 0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, -0x8e, 0x27, 0x8f, 0x28, 0x78, 0x69, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x68, 0x80, 0x76, 0x78, -0x6c, 0xe6, 0x14, 0x6b, 0x70, 0x7a, 0xf5, 0x24, 0x12, 0x05, 0x6f, 0x12, 0x00, 0x60, 0x74, 0x03, -0x93, 0xf5, 0x29, 0x74, 0x04, 0x93, 0xf5, 0x2a, 0x12, 0x00, 0xec, 0x12, 0x02, 0xb9, 0xeb, 0x25, -0xe0, 0x25, 0xe0, 0x24, 0x5d, 0x12, 0x00, 0xf3, 0xeb, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x5c, 0x12, -0x04, 0x75, 0xc3, 0x74, 0x0b, 0x93, 0x94, 0x00, 0x50, 0x05, 0x12, 0x05, 0x7b, 0x80, 0x04, 0xae, -0x27, 0xaf, 0x28, 0x8e, 0x2d, 0x8f, 0x2e, 0x12, 0x00, 0x60, 0x74, 0x0b, 0x93, 0xfc, 0x74, 0x0c, -0x12, 0x02, 0x7d, 0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0x8e, -0x27, 0x8f, 0x28, 0xeb, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x59, 0x12, 0x00, 0xf3, 0xeb, 0x25, 0xe0, -0x25, 0xe0, 0x24, 0x58, 0xf8, 0xe2, 0x2f, 0xf5, 0x2c, 0x18, 0xe2, 0x3e, 0xf5, 0x2b, 0x80, 0x7d, -0xeb, 0xfd, 0x7c, 0x00, 0xae, 0x2f, 0xaf, 0x30, 0x12, 0x0d, 0x08, 0xac, 0x06, 0xad, 0x07, 0xe5, -0x2f, 0xc3, 0x13, 0xfe, 0xe5, 0x30, 0x13, 0x2d, 0xf5, 0x2a, 0xec, 0x3e, 0xf5, 0x29, 0xeb, 0x25, -0xe0, 0x25, 0xe0, 0x24, 0x5d, 0x12, 0x00, 0xf3, 0xeb, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x5c, 0x12, -0x02, 0xc0, 0xeb, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x65, 0x12, 0x00, 0xf3, 0xeb, 0x25, 0xe0, 0x25, -0xe0, 0x24, 0x64, 0x12, 0x04, 0x75, 0xd3, 0xe5, 0x26, 0x95, 0x28, 0xe5, 0x27, 0x64, 0x80, 0xf8, -0xe5, 0x25, 0x64, 0x80, 0x98, 0x40, 0x11, 0xe4, 0xf5, 0x24, 0x85, 0x27, 0x2b, 0x85, 0x28, 0x2c, -0x85, 0x25, 0x27, 0x85, 0x26, 0x28, 0x80, 0x0f, 0x75, 0x24, 0x01, 0x85, 0x25, 0x2b, 0x85, 0x26, -0x2c, 0x85, 0x27, 0x27, 0x85, 0x28, 0x28, 0x12, 0x00, 0xec, 0x12, 0x02, 0xb9, 0xc3, 0xe5, 0x26, -0x95, 0x2c, 0xf5, 0x26, 0xe5, 0x25, 0x95, 0x2b, 0xf5, 0x25, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, -0x05, 0xe4, 0xf5, 0x25, 0xf5, 0x26, 0xc3, 0xe5, 0x28, 0x95, 0x2c, 0xf5, 0x28, 0xe5, 0x27, 0x95, -0x2b, 0xf5, 0x27, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0xe4, 0xf5, 0x27, 0xf5, 0x28, 0x85, -0x27, 0x2b, 0x85, 0x28, 0x2c, 0xae, 0x2b, 0xaf, 0x2c, 0x12, 0x03, 0xd3, 0xe4, 0x7b, 0x80, 0xfa, -0xf9, 0xf8, 0x12, 0x01, 0x2b, 0xae, 0x2f, 0xaf, 0x30, 0x12, 0x04, 0x86, 0xc0, 0x06, 0xc0, 0x07, -0xe5, 0x26, 0x25, 0x28, 0xcf, 0xe5, 0x25, 0x35, 0x27, 0xcf, 0x24, 0x01, 0xcf, 0x34, 0x00, 0xab, -0x07, 0xfa, 0x33, 0x95, 0xe0, 0xf9, 0xf8, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0f, 0x42, 0xef, 0x12, -0x05, 0xe7, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xe4, 0x7b, 0x80, 0xfa, 0xf9, 0xf8, 0x12, 0x0f, -0x42, 0x8e, 0x2b, 0x8f, 0x2c, 0xe5, 0x24, 0x60, 0x0e, 0xe5, 0x2a, 0x25, 0x2c, 0xf5, 0x2c, 0xe5, -0x29, 0x35, 0x2b, 0xf5, 0x2b, 0x80, 0x0d, 0xc3, 0xe5, 0x2a, 0x95, 0x2c, 0xf5, 0x2c, 0xe5, 0x29, -0x95, 0x2b, 0xf5, 0x2b, 0xe5, 0x23, 0x12, 0x05, 0x17, 0xf8, 0xe5, 0x2b, 0xf2, 0x08, 0xe5, 0x2c, -0xf2, 0x22, 0x8b, 0x1c, 0x8a, 0x1d, 0x89, 0x1e, 0x8d, 0x1f, 0xe4, 0xf5, 0x22, 0x90, 0x00, 0x05, -0x12, 0x0c, 0xa7, 0xf5, 0x23, 0x90, 0x00, 0x0b, 0x12, 0x0c, 0xa7, 0x60, 0x08, 0xe4, 0x78, 0x8a, -0xf2, 0x90, 0x00, 0xbf, 0xf0, 0xe5, 0x23, 0xb4, 0x80, 0x29, 0x78, 0x8a, 0x74, 0xff, 0xf2, 0x12, -0x39, 0xa1, 0x90, 0x00, 0xb9, 0xe5, 0xf0, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x39, 0xb2, 0x90, 0x00, -0xbb, 0xe5, 0xf0, 0xf0, 0xa3, 0xef, 0xf0, 0xe4, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xe0, 0x04, 0xf0, -0x02, 0x1d, 0x46, 0xe5, 0x23, 0x64, 0x08, 0x60, 0x03, 0x02, 0x1c, 0xf3, 0x12, 0x39, 0xa1, 0xc3, -0x90, 0x00, 0xba, 0xe0, 0x90, 0x00, 0xb9, 0x12, 0x1d, 0x6b, 0x8e, 0x24, 0x8f, 0x25, 0x12, 0x39, -0xac, 0xc3, 0x90, 0x00, 0xbc, 0xe0, 0x90, 0x00, 0xbb, 0x12, 0x1d, 0x6b, 0x12, 0x39, 0x9a, 0x74, -0x01, 0x93, 0xfc, 0x74, 0x02, 0x12, 0x39, 0xba, 0x40, 0x12, 0x90, 0x01, 0xec, 0xe0, 0x30, 0xe0, -0x0b, 0x78, 0x8a, 0xe2, 0x54, 0xfe, 0xf2, 0xe4, 0x90, 0x00, 0xbf, 0xf0, 0xe5, 0x25, 0x2f, 0xfd, -0xe5, 0x24, 0x3e, 0xfc, 0x12, 0x39, 0x9a, 0x74, 0x05, 0x93, 0xfb, 0xd3, 0xed, 0x9b, 0xec, 0x94, -0x00, 0x40, 0x0b, 0x78, 0x8a, 0xe2, 0x54, 0xfc, 0xf2, 0xe4, 0x90, 0x00, 0xbf, 0xf0, 0x12, 0x39, -0x9a, 0x74, 0x03, 0x93, 0xfc, 0x74, 0x04, 0x12, 0x39, 0xba, 0x40, 0x13, 0x78, 0x8a, 0xe2, 0x20, -0xe1, 0x04, 0xe5, 0x1f, 0x60, 0x09, 0x75, 0x22, 0x0c, 0xe4, 0x78, 0x8a, 0xf2, 0xf5, 0x1f, 0x78, -0x8a, 0xe2, 0x54, 0x3c, 0x70, 0x03, 0x02, 0x1d, 0x46, 0x12, 0x39, 0x9a, 0x74, 0x06, 0x93, 0xfd, -0x7c, 0x00, 0xd3, 0xe5, 0x25, 0x9d, 0xe5, 0x24, 0x9c, 0x50, 0x09, 0xef, 0x9d, 0xee, 0x9c, 0x50, -0x03, 0x02, 0x1d, 0x46, 0xd3, 0xef, 0x95, 0x25, 0xee, 0x95, 0x24, 0x40, 0x17, 0x12, 0x39, 0xac, -0xd3, 0x90, 0x00, 0xbc, 0xe0, 0x9f, 0x90, 0x00, 0xbb, 0xe0, 0x95, 0xf0, 0x7f, 0x02, 0x40, 0x02, -0x7f, 0x01, 0x80, 0x15, 0x12, 0x39, 0xa1, 0xd3, 0x90, 0x00, 0xba, 0xe0, 0x9f, 0x90, 0x00, 0xb9, -0xe0, 0x95, 0xf0, 0x7f, 0x04, 0x40, 0x02, 0x7f, 0x03, 0x8f, 0x22, 0x78, 0x8a, 0xe2, 0x54, 0xc3, -0xf2, 0x80, 0x53, 0xe5, 0x23, 0xb4, 0x04, 0x09, 0xe4, 0x90, 0x00, 0xbd, 0xf0, 0xa3, 0xf0, 0x80, -0x45, 0x12, 0x39, 0x9a, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, 0xff, 0xd3, 0x90, 0x00, 0xbe, -0xe0, 0x9f, 0x90, 0x00, 0xbd, 0xe0, 0x9e, 0x50, 0x07, 0x90, 0x01, 0xec, 0xe0, 0x20, 0xe0, 0x26, -0x78, 0x8a, 0xe2, 0xff, 0x30, 0xe0, 0x1a, 0x90, 0x00, 0xbf, 0xe0, 0xfe, 0xd3, 0x94, 0x02, 0x50, -0x0a, 0xee, 0x7e, 0x0b, 0xb4, 0x01, 0x02, 0x7e, 0x05, 0x8e, 0x22, 0xef, 0x54, 0xfe, 0x78, 0x8a, -0xf2, 0xe4, 0x90, 0x00, 0xbf, 0xf0, 0xc3, 0x90, 0x00, 0xbd, 0xe0, 0x94, 0xff, 0x50, 0x13, 0x12, -0x39, 0x9a, 0xe4, 0x93, 0xff, 0x90, 0x00, 0xbe, 0xe0, 0x2f, 0xf0, 0x90, 0x00, 0xbd, 0xe0, 0x34, -0x00, 0xf0, 0xe5, 0x1f, 0xaf, 0x1f, 0x70, 0x02, 0xaf, 0x22, 0x22, 0x9f, 0xff, 0xe0, 0x95, 0xf0, -0xfe, 0x12, 0x3b, 0x31, 0x22, 0x8b, 0x1c, 0x8a, 0x1d, 0x89, 0x1e, 0x43, 0xad, 0x04, 0x90, 0xff, -0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x43, 0x95, 0x80, 0x90, 0xff, 0x41, 0x74, 0x37, 0xf0, 0x90, 0xff, -0x49, 0x74, 0x0d, 0xf0, 0xe4, 0xf5, 0x25, 0xf5, 0x25, 0x12, 0x34, 0xdd, 0xe5, 0x25, 0xc3, 0x9f, -0x50, 0x22, 0xe9, 0x24, 0x0c, 0xf9, 0xe4, 0x3a, 0x12, 0x34, 0xce, 0xe4, 0xfd, 0x12, 0x39, 0x6b, -0x12, 0x34, 0xc4, 0x7d, 0x08, 0x12, 0x32, 0x1e, 0x12, 0x34, 0xc4, 0xe4, 0xfd, 0x12, 0x34, 0x39, -0x05, 0x25, 0x80, 0xd5, 0x90, 0xff, 0x4a, 0xe4, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, -0xff, 0x58, 0xe4, 0xf0, 0x90, 0xff, 0x40, 0x74, 0x08, 0xf0, 0x90, 0xff, 0x43, 0x74, 0x9f, 0xf0, -0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x12, 0x0c, 0x8e, 0x90, 0xff, 0x48, 0xf0, 0x90, 0x00, 0x01, -0x12, 0x0c, 0xa7, 0x90, 0xff, 0x42, 0xf0, 0x90, 0x00, 0x02, 0x12, 0x0c, 0xa7, 0x90, 0xff, 0x55, -0xf0, 0x90, 0x00, 0x03, 0x12, 0x0c, 0xa7, 0x90, 0xff, 0x54, 0xf0, 0x90, 0xff, 0x5c, 0xe4, 0xf0, -0xf5, 0x25, 0x12, 0x34, 0xdd, 0xe5, 0x25, 0xc3, 0x9f, 0x50, 0x5b, 0xe4, 0xf5, 0x26, 0x75, 0x27, -0x64, 0x90, 0xff, 0x50, 0xe0, 0x20, 0xe7, 0x03, 0x43, 0x26, 0x01, 0xe5, 0x26, 0x64, 0x01, 0x60, -0x03, 0xd5, 0x27, 0xed, 0x12, 0x34, 0xeb, 0x12, 0x34, 0xc4, 0x7d, 0x06, 0x12, 0x32, 0x1e, 0x90, -0xff, 0x40, 0x74, 0x29, 0xf0, 0x90, 0xff, 0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x12, 0x34, 0xc4, 0x7d, -0x08, 0x12, 0x32, 0x1e, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xab, 0x1f, 0xe5, 0x21, -0xf9, 0x24, 0x02, 0xf5, 0x21, 0xe5, 0x20, 0xfa, 0x34, 0x00, 0xf5, 0x20, 0xee, 0x8f, 0xf0, 0x12, -0x0e, 0x6b, 0x05, 0x25, 0x80, 0x9c, 0xe4, 0xf5, 0x25, 0x90, 0xff, 0x54, 0xf0, 0x75, 0x28, 0x01, -0x12, 0x34, 0xf4, 0x74, 0xff, 0x12, 0x34, 0xc1, 0x7d, 0x07, 0x12, 0x32, 0x1e, 0x90, 0xff, 0x55, -0x74, 0x64, 0xf0, 0xe4, 0xf5, 0x26, 0xf5, 0x27, 0x90, 0xff, 0x50, 0xe0, 0x30, 0xe7, 0x10, 0x05, -0x27, 0xe5, 0x27, 0x70, 0x02, 0x05, 0x26, 0xb4, 0xe8, 0xee, 0xe5, 0x26, 0xb4, 0x03, 0xe9, 0xe5, -0x28, 0x24, 0x02, 0x90, 0xff, 0x55, 0xf0, 0xe4, 0xf5, 0x26, 0xf5, 0x27, 0x00, 0x05, 0x27, 0xe5, -0x27, 0x70, 0x02, 0x05, 0x26, 0xb4, 0xe8, 0xf4, 0xe5, 0x26, 0xb4, 0x03, 0xef, 0xe4, 0xf5, 0x29, -0xf5, 0x26, 0xf5, 0x27, 0x90, 0xff, 0x50, 0xe0, 0x30, 0xe7, 0x03, 0x00, 0x80, 0x02, 0x05, 0x29, -0x05, 0x27, 0xe5, 0x27, 0x70, 0x02, 0x05, 0x26, 0x64, 0x64, 0x45, 0x26, 0x70, 0xe6, 0xe5, 0x29, -0xd3, 0x94, 0x28, 0x50, 0x0c, 0x12, 0x34, 0xeb, 0x05, 0x28, 0xe5, 0x28, 0xc3, 0x94, 0x64, 0x40, -0xae, 0x12, 0x34, 0xf4, 0xe5, 0x28, 0x12, 0x34, 0xc1, 0x7d, 0x08, 0x12, 0x32, 0x1e, 0x12, 0x34, -0xeb, 0x12, 0x34, 0xdd, 0x05, 0x25, 0xe5, 0x25, 0xc3, 0x9f, 0x50, 0x03, 0x02, 0x1e, 0x7d, 0x90, -0xff, 0x50, 0xe4, 0xf0, 0xff, 0x22, 0xe4, 0x78, 0x67, 0xf6, 0x18, 0xe6, 0x14, 0x70, 0x03, 0x02, -0x20, 0x06, 0x14, 0x70, 0x03, 0x02, 0x20, 0x77, 0x24, 0x02, 0x60, 0x03, 0x02, 0x20, 0x99, 0x12, -0x17, 0x92, 0xe4, 0x93, 0x78, 0x6a, 0xf6, 0x78, 0x65, 0xe6, 0x30, 0xe0, 0x08, 0x75, 0x23, 0x05, -0x75, 0x24, 0x01, 0x80, 0x06, 0x75, 0x23, 0x08, 0xe4, 0xf5, 0x24, 0xe4, 0xf5, 0x22, 0x12, 0x19, -0x7b, 0x50, 0x3f, 0x12, 0x19, 0x17, 0x25, 0x22, 0x12, 0x17, 0xa4, 0xf5, 0x25, 0xe5, 0x22, 0x54, -0x01, 0xfd, 0xaf, 0x25, 0x12, 0x39, 0x6b, 0xad, 0x24, 0xaf, 0x25, 0x12, 0x34, 0x39, 0xad, 0x23, -0xaf, 0x25, 0x12, 0x32, 0x1e, 0x78, 0x65, 0xe6, 0xb4, 0x03, 0x13, 0xe5, 0x22, 0x30, 0xe0, 0x0e, -0xe4, 0xfd, 0xaf, 0x25, 0x12, 0x34, 0x39, 0x7d, 0x08, 0xaf, 0x25, 0x12, 0x32, 0x1e, 0x05, 0x22, -0x80, 0xbc, 0x78, 0x62, 0xe6, 0xf5, 0x25, 0x75, 0x26, 0x10, 0x76, 0x40, 0x7e, 0x00, 0x7f, 0x12, -0x7d, 0x10, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0xb7, 0x12, 0x10, 0x98, 0xe5, 0x26, 0xd3, 0x94, 0x01, -0x40, 0x3c, 0x12, 0x20, 0x9e, 0x12, 0x19, 0x7b, 0x50, 0x2c, 0x12, 0x17, 0x92, 0x74, 0x02, 0x93, -0x75, 0xf0, 0xa3, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x17, 0xac, 0x12, 0x19, 0x82, 0xec, 0x9e, 0x50, -0x08, 0x12, 0x19, 0x1e, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x12, 0x19, 0x1e, 0xc3, 0x13, 0xfe, 0xef, -0x4e, 0xf0, 0x05, 0x22, 0x80, 0xcf, 0xe5, 0x26, 0xc3, 0x13, 0xf5, 0x26, 0x80, 0xbd, 0x78, 0x62, -0xa6, 0x25, 0x78, 0x66, 0x76, 0x01, 0x12, 0x17, 0x92, 0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x25, -0x74, 0x04, 0x93, 0x33, 0xf5, 0x24, 0xe4, 0x78, 0x69, 0xf6, 0xfe, 0xfd, 0x12, 0x18, 0xf5, 0x7e, -0x00, 0x7f, 0x24, 0x7d, 0x00, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x5f, 0x12, 0x10, 0x98, 0x75, 0x23, -0x04, 0x12, 0x32, 0x78, 0x12, 0x20, 0x9e, 0x12, 0x19, 0x7b, 0x50, 0x34, 0x12, 0x17, 0xac, 0xe0, -0xfe, 0xa3, 0xe0, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0xe5, 0x22, 0x12, -0x17, 0xe7, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xa5, 0xe5, 0x22, 0x12, 0x17, 0xe7, 0xe0, 0xfe, 0xa3, -0xe0, 0xff, 0xe5, 0x22, 0x12, 0x19, 0x48, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x05, 0x22, 0x80, 0xc7, -0xd5, 0x23, 0xc1, 0x78, 0x66, 0x76, 0x02, 0x12, 0x32, 0x78, 0x12, 0x27, 0x5f, 0x78, 0x6a, 0xe6, -0xfd, 0xe4, 0xff, 0x12, 0x30, 0xdb, 0x78, 0x67, 0xe6, 0x30, 0xe1, 0x04, 0x78, 0x69, 0x76, 0x28, -0x78, 0x6a, 0xe6, 0xfd, 0xe4, 0xff, 0x02, 0x22, 0x1f, 0xe4, 0x78, 0x66, 0xf6, 0x22, 0x12, 0x27, -0x5f, 0x12, 0x32, 0x78, 0xe4, 0xf5, 0x22, 0x22, 0x8b, 0x1c, 0x8a, 0x1d, 0x89, 0x1e, 0xe4, 0xf5, -0x1f, 0xfe, 0x7f, 0x0c, 0xfd, 0x12, 0x10, 0x98, 0x7a, 0x00, 0x79, 0x02, 0x12, 0x04, 0x58, 0x7a, -0x00, 0x79, 0x31, 0x12, 0x04, 0x58, 0x78, 0x72, 0xe6, 0x14, 0x60, 0x30, 0x04, 0x60, 0x03, 0x02, -0x22, 0x18, 0xe4, 0x78, 0x71, 0xf6, 0xff, 0x12, 0x3b, 0x52, 0x12, 0x1f, 0x26, 0x78, 0x67, 0xe6, -0x30, 0xe4, 0x03, 0x02, 0x22, 0x1c, 0x7e, 0x00, 0x7f, 0x5e, 0x7d, 0x00, 0x7b, 0xfe, 0x7a, 0x00, -0x79, 0x01, 0x12, 0x10, 0x98, 0x78, 0x72, 0x76, 0x01, 0x02, 0x22, 0x10, 0x12, 0x1f, 0x26, 0x78, -0x67, 0xe6, 0xff, 0x30, 0xe4, 0x03, 0x02, 0x22, 0x18, 0xef, 0x20, 0xe3, 0x03, 0x02, 0x21, 0xbc, -0x90, 0x00, 0x8b, 0xe0, 0x30, 0xe1, 0x39, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x21, 0x12, 0x2a, 0xab, -0xef, 0x60, 0x2d, 0x90, 0x00, 0x8b, 0x74, 0x02, 0xf0, 0x78, 0x06, 0x14, 0xf2, 0x78, 0x02, 0x14, -0xf2, 0x08, 0xe5, 0x21, 0xf2, 0x12, 0x00, 0x60, 0x74, 0x03, 0x93, 0xfc, 0x74, 0x04, 0x93, 0xfd, -0xec, 0xc3, 0x13, 0xfe, 0xed, 0x13, 0xff, 0xed, 0x2f, 0x78, 0x05, 0xf2, 0xec, 0x3e, 0x18, 0xf2, -0x90, 0x00, 0x8b, 0xe0, 0x30, 0xe0, 0x5b, 0x75, 0x25, 0x00, 0x75, 0x26, 0x00, 0x75, 0x27, 0x6d, -0x75, 0x28, 0x00, 0x75, 0x29, 0x00, 0x75, 0x2a, 0x6f, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x5f, 0x12, -0x29, 0xad, 0xe4, 0xf5, 0x20, 0xe5, 0x20, 0x12, 0x03, 0x72, 0xff, 0xe5, 0x20, 0x12, 0x05, 0x41, -0xef, 0xf2, 0xf4, 0x60, 0x1b, 0xe5, 0x20, 0x12, 0x05, 0xb8, 0xf9, 0xe4, 0xfa, 0x7b, 0xfe, 0xad, -0x20, 0x12, 0x3b, 0x19, 0xe5, 0x20, 0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x06, 0xf8, 0x74, 0x01, 0xf2, -0x05, 0x20, 0xe5, 0x20, 0xc3, 0x94, 0x02, 0x40, 0xcc, 0x12, 0x2b, 0x9a, 0x90, 0x00, 0x8b, 0x74, -0x01, 0xf0, 0x78, 0x67, 0xe6, 0x30, 0xe5, 0x04, 0x78, 0x71, 0x76, 0x01, 0x90, 0x00, 0x8b, 0xe0, -0xf5, 0x1f, 0x78, 0x6b, 0x76, 0x01, 0xe4, 0xf5, 0x20, 0xe5, 0x20, 0xc3, 0x94, 0x02, 0x50, 0x19, -0x90, 0x00, 0x8b, 0xe0, 0x30, 0xe0, 0x05, 0xaf, 0x20, 0x12, 0x3b, 0x3d, 0x12, 0x31, 0xb9, 0x05, -0x20, 0x78, 0x6b, 0x74, 0x2f, 0x26, 0xf6, 0x80, 0xe0, 0xa8, 0x1e, 0xac, 0x1d, 0xad, 0x1c, 0x12, -0x02, 0x9f, 0xe5, 0x1e, 0x24, 0x06, 0xf9, 0xe4, 0x35, 0x1d, 0xa8, 0x01, 0xfc, 0xad, 0x1c, 0x7a, -0x00, 0x79, 0x31, 0x12, 0x02, 0xa3, 0x78, 0x0d, 0xe2, 0x70, 0x11, 0x78, 0x3c, 0xe2, 0x70, 0x0c, -0x90, 0x00, 0x8b, 0x74, 0x03, 0xf0, 0x80, 0x04, 0xe4, 0x78, 0x72, 0xf6, 0xaf, 0x1f, 0x22, 0x8f, -0x27, 0x8d, 0x28, 0x78, 0x69, 0xe6, 0x60, 0x01, 0x16, 0x12, 0x17, 0xe5, 0xe0, 0xfe, 0xa3, 0xe0, -0xff, 0xe5, 0x27, 0x12, 0x17, 0xae, 0x12, 0x19, 0x82, 0xf5, 0x2a, 0xec, 0x9e, 0xf5, 0x29, 0x12, -0x19, 0x2e, 0xe0, 0xf5, 0x2b, 0xe4, 0xf5, 0x2c, 0x12, 0x18, 0xcf, 0x40, 0x06, 0xae, 0x29, 0xaf, -0x2a, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xe5, 0x27, 0x25, 0xe0, 0x24, 0x5f, 0xf8, 0xee, 0xf2, -0x08, 0xef, 0xf2, 0x90, 0x36, 0x0b, 0xe4, 0x93, 0x60, 0x07, 0x78, 0x69, 0xe6, 0xf5, 0x2c, 0x80, -0x0f, 0x12, 0x18, 0xcf, 0x7f, 0x00, 0x40, 0x02, 0x7f, 0x01, 0xef, 0x78, 0x69, 0x56, 0xf5, 0x2c, -0xe5, 0x2c, 0x60, 0x03, 0x02, 0x23, 0x3b, 0xaf, 0x2a, 0xae, 0x29, 0x12, 0x3b, 0x31, 0x12, 0x17, -0x92, 0xc3, 0x12, 0x19, 0x3f, 0x50, 0x0d, 0x12, 0x18, 0xd0, 0x40, 0x04, 0x05, 0x2b, 0x80, 0x57, -0x15, 0x2b, 0x80, 0x53, 0x12, 0x18, 0xbf, 0xe0, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xef, 0x25, 0x2a, -0xf5, 0x2a, 0xee, 0x35, 0x29, 0xf5, 0x29, 0xd3, 0xe5, 0x2a, 0x94, 0x78, 0x12, 0x18, 0xd4, 0x40, -0x09, 0x12, 0x17, 0xe5, 0xe4, 0x75, 0xf0, 0x01, 0x80, 0x1a, 0xe5, 0x2a, 0x24, 0x78, 0xe4, 0x35, -0x29, 0xc3, 0x64, 0x80, 0x94, 0x80, 0xe5, 0x27, 0x75, 0xf0, 0x0a, 0x50, 0x11, 0x12, 0x17, 0xea, -0x74, 0xff, 0xf5, 0xf0, 0x12, 0x0d, 0xa5, 0x12, 0x18, 0xbf, 0xe4, 0xf0, 0x80, 0x06, 0x12, 0x18, -0xc4, 0xe5, 0x2a, 0xf0, 0xe4, 0xf5, 0x2b, 0x12, 0x17, 0x92, 0x74, 0x01, 0x93, 0xff, 0xd3, 0x64, -0x80, 0xf8, 0xe5, 0x2b, 0x64, 0x80, 0x98, 0x50, 0x17, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0xad, 0x2b, -0xed, 0x33, 0x95, 0xe0, 0xfc, 0xed, 0x2f, 0xec, 0x3e, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x15, -0xe4, 0xf5, 0x2b, 0xe5, 0x27, 0x12, 0x17, 0xae, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x12, 0x17, 0xe5, -0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x19, 0x2e, 0xe5, 0x2b, 0xf0, 0x78, 0x69, 0xe6, 0x70, 0x3a, -0x12, 0x17, 0xe5, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x27, 0x12, 0x19, 0x48, 0x12, 0x19, 0x82, -0xff, 0xec, 0x9e, 0xfe, 0x12, 0x3b, 0x31, 0xaa, 0x06, 0xab, 0x07, 0x12, 0x17, 0x92, 0x74, 0x04, -0x93, 0xfe, 0x74, 0x05, 0x93, 0xff, 0x7c, 0x00, 0x7d, 0x03, 0x12, 0x0d, 0x08, 0xd3, 0xeb, 0x9f, -0xea, 0x9e, 0x40, 0x06, 0x78, 0x67, 0xe6, 0x44, 0x10, 0xf6, 0x05, 0x27, 0x15, 0x28, 0xe5, 0x28, -0x60, 0x03, 0x02, 0x22, 0x29, 0x22, 0x8e, 0x1c, 0x8f, 0x1d, 0xe4, 0x78, 0x66, 0xf6, 0x85, 0x1c, -0x41, 0x85, 0x1d, 0x42, 0xe5, 0x1d, 0x24, 0x2c, 0xff, 0xe4, 0x35, 0x1c, 0xfa, 0xa9, 0x07, 0x7b, -0xff, 0x78, 0x62, 0x7c, 0x00, 0x7d, 0x00, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0c, 0x68, 0x78, 0x84, -0x74, 0x01, 0xf2, 0x08, 0x74, 0xcc, 0xf2, 0x85, 0x1d, 0x82, 0x85, 0x1c, 0x83, 0xe4, 0x93, 0xff, -0x7e, 0x00, 0xe5, 0x1d, 0x24, 0x06, 0xfd, 0xe4, 0x35, 0x1c, 0xfa, 0xa9, 0x05, 0x7b, 0xff, 0x18, -0xe2, 0xfc, 0x08, 0xe2, 0xf8, 0x7d, 0x01, 0x12, 0x0c, 0x68, 0x90, 0x01, 0xa7, 0xe0, 0xff, 0x12, -0x35, 0x7a, 0x90, 0x00, 0xc1, 0xe0, 0x64, 0x80, 0x70, 0x04, 0xa3, 0xe0, 0x64, 0x75, 0x70, 0x44, -0xff, 0x85, 0x1d, 0x82, 0x85, 0x1c, 0x83, 0xe4, 0x93, 0xfe, 0xef, 0xc3, 0x9e, 0x50, 0x35, 0xe4, -0xf5, 0x1f, 0x12, 0x19, 0x17, 0xfd, 0x12, 0x17, 0xa3, 0xfe, 0xe5, 0x1f, 0x90, 0x3b, 0x5b, 0x93, -0xfb, 0xee, 0x6b, 0x60, 0x0b, 0xe5, 0x1f, 0xc3, 0x94, 0x0f, 0x50, 0x04, 0x05, 0x1f, 0x80, 0xe2, -0xe5, 0x1f, 0x90, 0x3b, 0x6a, 0x93, 0xfe, 0xed, 0x2f, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0xee, -0xf0, 0x0f, 0x80, 0xbd, 0x7e, 0x00, 0x7d, 0x00, 0x12, 0x18, 0xf5, 0x12, 0x17, 0x92, 0x74, 0x02, -0x93, 0xff, 0x7e, 0x00, 0x7c, 0x10, 0x7d, 0x00, 0x12, 0x10, 0x6b, 0xe4, 0x7b, 0xc8, 0xfa, 0xf9, -0xf8, 0x12, 0x0f, 0x42, 0x90, 0x02, 0x00, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x78, 0x83, 0x74, 0x09, -0xf2, 0x78, 0x64, 0xe6, 0xff, 0x20, 0xe3, 0x06, 0x78, 0x83, 0xe2, 0x44, 0x04, 0xf2, 0xef, 0x20, -0xe2, 0x06, 0x78, 0x83, 0xe2, 0x44, 0x20, 0xf2, 0xe4, 0x78, 0x68, 0xf6, 0x43, 0x95, 0x80, 0x78, -0x64, 0xe6, 0x7f, 0x00, 0x30, 0xe1, 0x02, 0x7f, 0x40, 0xef, 0x44, 0x37, 0x90, 0xff, 0x41, 0xf0, -0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0x75, 0x1e, 0x11, 0xe5, 0x1e, 0xf4, 0x60, 0x0c, 0xe4, 0xfd, -0xaf, 0x1e, 0x12, 0x34, 0x39, 0xe4, 0xfd, 0x12, 0x24, 0xcd, 0x75, 0x1e, 0x16, 0xe5, 0x1e, 0xf4, -0x60, 0x0c, 0xe4, 0xfd, 0xaf, 0x1e, 0x12, 0x34, 0x39, 0x7d, 0x01, 0x12, 0x24, 0xcd, 0x78, 0x65, -0xe6, 0x7f, 0x08, 0x30, 0xe0, 0x02, 0x7f, 0x05, 0x78, 0x87, 0xef, 0xf2, 0x22, 0xaf, 0x1e, 0x12, -0x39, 0x6b, 0x7d, 0x08, 0xaf, 0x1e, 0x12, 0x32, 0x1e, 0x7d, 0x07, 0xaf, 0x1e, 0x12, 0x32, 0x1e, -0x22, 0x8f, 0x23, 0x12, 0x05, 0x40, 0xe2, 0xff, 0x70, 0x04, 0xf5, 0x24, 0x80, 0x18, 0x78, 0x6c, -0xe6, 0xfe, 0x14, 0xb5, 0x07, 0x09, 0xee, 0x25, 0xe0, 0x24, 0xfa, 0xf5, 0x24, 0x80, 0x07, 0xef, -0x25, 0xe0, 0x24, 0xfe, 0xf5, 0x24, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x63, 0x12, 0x00, 0xf3, 0xe5, -0x24, 0x12, 0x02, 0xd8, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x68, 0x12, 0x02, 0xdc, 0xe4, 0xfc, 0xfd, -0x78, 0x54, 0x12, 0x10, 0x34, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x65, 0x12, 0x00, 0xf3, 0xe5, 0x24, -0x25, 0xe0, 0x24, 0x62, 0x12, 0x02, 0xdc, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x6a, 0x12, 0x02, 0xdc, -0xe4, 0xfc, 0xfd, 0x78, 0x58, 0x12, 0x10, 0x34, 0x12, 0x00, 0x60, 0x74, 0x07, 0x93, 0xfe, 0x74, -0x08, 0x78, 0x58, 0x12, 0x04, 0x63, 0x12, 0x0e, 0xb7, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, -0x07, 0x12, 0x00, 0x60, 0x78, 0x58, 0x12, 0x03, 0x05, 0x12, 0x0e, 0xb7, 0xd0, 0x03, 0xd0, 0x02, -0xd0, 0x01, 0xd0, 0x00, 0x12, 0x01, 0xc3, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, -0x00, 0x60, 0x74, 0x05, 0x93, 0xfe, 0x74, 0x06, 0x78, 0x54, 0x12, 0x04, 0x63, 0x12, 0x01, 0x2b, -0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, 0xc3, 0xef, 0x9b, 0xff, 0xee, 0x9a, 0xfe, 0xed, -0x99, 0xfd, 0xec, 0x98, 0xfc, 0x78, 0x5c, 0x12, 0x10, 0x34, 0x78, 0x5c, 0x12, 0x10, 0x0b, 0xec, -0x33, 0x50, 0x0b, 0x78, 0x54, 0x12, 0x10, 0x40, 0x00, 0x00, 0x00, 0x01, 0x80, 0x5b, 0x12, 0x05, -0x63, 0x7b, 0x02, 0x12, 0x02, 0x36, 0x12, 0x0f, 0x42, 0x78, 0x5c, 0x12, 0x10, 0x17, 0x12, 0x01, -0xc3, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0x63, 0x2f, 0xfb, 0xea, 0x3e, -0xfa, 0xe9, 0x3d, 0xf9, 0xe8, 0x3c, 0xf8, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, 0x12, -0x0f, 0x42, 0x78, 0x54, 0x12, 0x10, 0x34, 0x12, 0x00, 0x60, 0x78, 0x54, 0x12, 0x03, 0x05, 0xd3, -0x12, 0x0f, 0xd4, 0x40, 0x14, 0x12, 0x00, 0x60, 0x74, 0x02, 0x93, 0x24, 0xff, 0xff, 0x74, 0x01, -0x93, 0x12, 0x02, 0x2c, 0x78, 0x54, 0x12, 0x10, 0x34, 0x78, 0x54, 0x12, 0x10, 0x0b, 0xe5, 0x23, -0x12, 0x02, 0xac, 0x22, 0x8b, 0x1f, 0x8a, 0x20, 0x89, 0x21, 0x43, 0xad, 0x04, 0x43, 0x95, 0x80, -0x90, 0xff, 0x41, 0x74, 0x80, 0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0xa3, 0xe4, 0xf0, 0x90, -0xff, 0x42, 0x04, 0xf0, 0x90, 0xff, 0x55, 0x74, 0x7d, 0xf0, 0x90, 0xff, 0x54, 0xe4, 0xf0, 0x90, -0xff, 0x5c, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x10, 0xf0, 0xe4, 0xf5, 0x26, 0xf5, 0x27, 0xf5, 0x28, -0xf5, 0x29, 0xf5, 0x25, 0xe4, 0x12, 0x3a, 0x6b, 0xf4, 0x60, 0x0d, 0xe4, 0xfd, 0x12, 0x34, 0x39, -0x12, 0x3a, 0x73, 0x7d, 0x08, 0x12, 0x32, 0x1e, 0x12, 0x3a, 0x5d, 0xf4, 0x60, 0x0d, 0xe4, 0xfd, -0x12, 0x34, 0x39, 0x12, 0x3a, 0x5d, 0x7d, 0x08, 0x12, 0x32, 0x1e, 0xe4, 0xff, 0x00, 0x0f, 0xbf, -0xc8, 0xfb, 0x74, 0x03, 0x12, 0x3a, 0x6b, 0xf4, 0x60, 0x0d, 0xe4, 0xfd, 0x12, 0x39, 0x6b, 0x12, -0x3a, 0x73, 0x7d, 0x07, 0x12, 0x32, 0x1e, 0x12, 0x3a, 0x5d, 0xf4, 0x60, 0x0d, 0x7d, 0x01, 0x12, -0x39, 0x6b, 0x12, 0x3a, 0x5d, 0x7d, 0x07, 0x12, 0x32, 0x1e, 0x90, 0xff, 0x43, 0x74, 0x9f, 0xf0, -0x90, 0xff, 0x50, 0x74, 0x07, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0x90, 0xff, 0x40, 0x74, 0x09, 0xf0, -0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xc0, 0xf0, 0x90, 0xff, 0x43, 0xe0, 0x30, 0xe4, 0xf9, 0x90, -0xff, 0x43, 0x74, 0x9f, 0xf0, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0x25, 0x27, 0xf5, 0x27, -0xee, 0x35, 0x26, 0xf5, 0x26, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, 0x25, 0x29, 0xf5, 0x29, -0xee, 0x35, 0x28, 0xf5, 0x28, 0x05, 0x25, 0xe5, 0x25, 0xc3, 0x94, 0x04, 0x50, 0x03, 0x02, 0x26, -0x64, 0xe5, 0x27, 0xae, 0x26, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0xab, -0x22, 0xaa, 0x23, 0xa9, 0x24, 0xee, 0x8f, 0xf0, 0x12, 0x0e, 0x6b, 0xe5, 0x29, 0xae, 0x28, 0x78, -0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0xab, 0x22, 0xaa, 0x23, 0xa9, 0x24, 0x90, -0x00, 0x02, 0xee, 0x8f, 0xf0, 0x12, 0x0e, 0x8a, 0x12, 0x3a, 0x73, 0xf4, 0x60, 0x05, 0xe4, 0xfd, -0x12, 0x32, 0x1e, 0x12, 0x3a, 0x5d, 0xf4, 0x60, 0x05, 0xe4, 0xfd, 0x12, 0x32, 0x1e, 0x22, 0xe4, -0xf5, 0x27, 0xe5, 0x27, 0xc3, 0x78, 0x6a, 0x96, 0x50, 0x2b, 0x12, 0x19, 0x17, 0x25, 0x27, 0x12, -0x17, 0xa4, 0xf5, 0x28, 0x78, 0x65, 0xe6, 0x54, 0x01, 0xfd, 0xaf, 0x28, 0x12, 0x34, 0x39, 0x78, -0x65, 0xe6, 0xb4, 0x03, 0x0c, 0xe5, 0x27, 0x30, 0xe0, 0x07, 0xe4, 0xfd, 0xaf, 0x28, 0x12, 0x34, -0x39, 0x05, 0x27, 0x80, 0xcd, 0x90, 0xff, 0x4a, 0x74, 0x71, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x0f, -0xf0, 0x90, 0xff, 0x58, 0xf0, 0x90, 0xff, 0x40, 0xe4, 0xf0, 0x12, 0x19, 0x56, 0x90, 0xff, 0x54, -0xe4, 0xf0, 0x90, 0xff, 0x5c, 0xf0, 0x78, 0x63, 0xe6, 0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, 0x55, -0x74, 0x28, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x02, 0xf0, 0x43, 0xad, 0x04, 0x12, 0x19, 0x5d, 0x90, -0xff, 0x43, 0xe0, 0x20, 0xe4, 0x1d, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x17, 0x44, 0x50, 0x03, -0xe0, 0x04, 0xf0, 0x12, 0x19, 0x0e, 0x30, 0xe7, 0xe6, 0x12, 0x17, 0x44, 0x50, 0xe1, 0xe0, 0x04, -0xf0, 0x80, 0xdc, 0x12, 0x19, 0x56, 0xe4, 0x78, 0x86, 0xf2, 0x78, 0x61, 0xf6, 0x18, 0x76, 0x01, -0x78, 0x6a, 0xe6, 0xc3, 0x13, 0x78, 0x68, 0xf6, 0x78, 0x63, 0xe6, 0x90, 0xff, 0x42, 0xf0, 0x18, -0xe6, 0x90, 0xff, 0x48, 0xf0, 0x78, 0x64, 0xe6, 0x7f, 0x00, 0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, -0x02, 0x02, 0xef, 0xf0, 0x12, 0x17, 0xf5, 0x08, 0x12, 0x17, 0x9b, 0xff, 0x7d, 0x06, 0x12, 0x32, -0x1e, 0x78, 0x60, 0x12, 0x17, 0x9b, 0xff, 0x7d, 0x06, 0x12, 0x32, 0x1e, 0x78, 0x83, 0xe2, 0xff, -0x90, 0xff, 0x40, 0xf0, 0x78, 0x64, 0xe6, 0x30, 0xe7, 0x3e, 0x43, 0xad, 0x04, 0xef, 0xf0, 0x90, -0xff, 0x43, 0xe0, 0x20, 0xe4, 0x1d, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x17, 0x44, 0x50, 0x03, -0xe0, 0x04, 0xf0, 0x12, 0x19, 0x0e, 0x30, 0xe7, 0xe6, 0x12, 0x17, 0x44, 0x50, 0xe1, 0xe0, 0x04, -0xf0, 0x80, 0xdc, 0x7b, 0xff, 0x7a, 0x32, 0x79, 0x1e, 0x12, 0x28, 0x8f, 0x12, 0x18, 0xa4, 0xf0, -0x78, 0x68, 0xe6, 0x70, 0xca, 0x02, 0x32, 0x78, 0x53, 0xad, 0xfb, 0x12, 0x19, 0x5d, 0x22, 0x15, -0x0f, 0x15, 0x0f, 0x15, 0x0f, 0xa8, 0x0f, 0xa6, 0x03, 0x08, 0xa6, 0x02, 0x08, 0xa6, 0x01, 0x15, -0x0f, 0x12, 0x19, 0x56, 0x78, 0x87, 0xe2, 0xa8, 0x0f, 0xf6, 0x12, 0x17, 0x99, 0xff, 0xa8, 0x0f, -0xe6, 0xfd, 0x12, 0x18, 0x4e, 0x12, 0x10, 0x69, 0x78, 0x65, 0xe6, 0x64, 0x03, 0x78, 0x60, 0x60, -0x0d, 0x12, 0x17, 0x9b, 0xff, 0xa8, 0x0f, 0xe6, 0xfd, 0x12, 0x18, 0x4e, 0x80, 0x08, 0x12, 0x17, -0x9b, 0x12, 0x18, 0x4b, 0x7d, 0x08, 0x12, 0x10, 0x69, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, -0xff, 0x78, 0x61, 0xe6, 0x12, 0x18, 0x3d, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x18, 0xb7, 0xff, -0x18, 0xe6, 0x12, 0x18, 0x3d, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x02, 0x02, 0xe0, 0x60, 0x2e, -0x08, 0xe6, 0xff, 0x12, 0x17, 0xae, 0x12, 0x18, 0x37, 0x12, 0x29, 0x9f, 0x12, 0x17, 0x92, 0x12, -0x19, 0x3e, 0x40, 0x1a, 0x78, 0x60, 0xe6, 0xff, 0x12, 0x17, 0xae, 0x12, 0x18, 0x37, 0x12, 0x29, -0x9f, 0x12, 0x17, 0x92, 0x12, 0x19, 0x3e, 0x40, 0x05, 0xe4, 0x90, 0x02, 0x02, 0xf0, 0x90, 0x02, -0x02, 0xe0, 0x70, 0x1b, 0x78, 0x61, 0x06, 0x06, 0x18, 0x06, 0x06, 0x78, 0x68, 0x16, 0x78, 0x64, -0xe6, 0x7f, 0x00, 0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, 0x02, 0x02, 0xef, 0xf0, 0x80, 0x05, 0xe4, -0x90, 0x02, 0x02, 0xf0, 0x78, 0x68, 0xe6, 0x70, 0x0a, 0x90, 0xff, 0x50, 0xf0, 0x90, 0xff, 0x58, -0xf0, 0x80, 0x35, 0x12, 0x17, 0xf5, 0xa8, 0x0f, 0x76, 0x64, 0x90, 0xff, 0x58, 0xe0, 0xff, 0x90, -0xff, 0x50, 0xe0, 0x4f, 0x30, 0xe7, 0x06, 0xa8, 0x0f, 0x16, 0xe6, 0x70, 0xed, 0x12, 0x17, 0x99, -0x12, 0x18, 0x4b, 0x7d, 0x06, 0x12, 0x10, 0x69, 0x78, 0x60, 0x12, 0x17, 0x9b, 0x12, 0x18, 0x4b, -0x7d, 0x06, 0x12, 0x10, 0x69, 0x12, 0x19, 0x5d, 0xe5, 0x0f, 0x24, 0x04, 0xf5, 0x0f, 0x22, 0xe0, -0xfe, 0xa3, 0xe0, 0xc3, 0x9d, 0xff, 0xee, 0x9c, 0xfe, 0x12, 0x3b, 0x31, 0x22, 0x8b, 0x22, 0x8a, -0x23, 0x89, 0x24, 0x12, 0x2e, 0xe6, 0x12, 0x2f, 0x69, 0x12, 0x33, 0x19, 0x74, 0x55, 0x93, 0xf5, -0x2b, 0xe4, 0xf5, 0x2c, 0x12, 0x33, 0x5c, 0x12, 0x0c, 0x8e, 0x70, 0x21, 0x12, 0x33, 0x19, 0x74, -0x74, 0x93, 0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x7f, 0x00, 0x50, 0x02, 0x7f, 0x01, 0x12, -0x2a, 0x73, 0xee, 0x8f, 0xf0, 0x12, 0x0e, 0x1e, 0x75, 0x2c, 0x03, 0x80, 0x3a, 0x12, 0x33, 0x5c, -0x12, 0x0c, 0x8e, 0xff, 0xe5, 0x2b, 0x14, 0x6f, 0x70, 0x2d, 0x12, 0x33, 0x19, 0x74, 0x75, 0x93, -0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0xe5, 0x2b, 0x50, 0x06, 0x25, 0xe0, 0x14, 0xff, 0x80, -0x05, 0x25, 0xe0, 0x24, 0xfe, 0xff, 0x12, 0x2a, 0x73, 0xee, 0x8f, 0xf0, 0x12, 0x0e, 0x1e, 0xe5, -0x2b, 0x25, 0xe0, 0x24, 0xfd, 0xf5, 0x2c, 0xe5, 0x2c, 0x60, 0x47, 0x24, 0xff, 0xff, 0xe4, 0x34, -0xff, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xab, 0x22, 0xaa, 0x23, 0xa9, 0x24, 0x8f, 0x82, -0xf5, 0x83, 0x12, 0x0d, 0xe6, 0xff, 0xae, 0xf0, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, 0x82, -0x85, 0xf0, 0x83, 0x12, 0x0d, 0xe6, 0x2f, 0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x33, 0x19, 0xd3, -0x74, 0x77, 0x93, 0x9f, 0x74, 0x76, 0x93, 0x9e, 0x40, 0x08, 0x12, 0x33, 0x5c, 0x74, 0xff, 0x12, -0x0c, 0xd4, 0x22, 0x8f, 0x2c, 0xaf, 0x2d, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0x12, 0x3b, 0x31, 0xab, -0x22, 0xaa, 0x23, 0xa9, 0x24, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, -0x12, 0x0d, 0xe6, 0xfd, 0xac, 0xf0, 0xcf, 0xcd, 0xcf, 0xce, 0xcc, 0xce, 0x12, 0x0d, 0x1a, 0x75, -0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x22, 0x8b, 0x22, 0x8a, 0x23, 0x89, -0x24, 0xe4, 0xf5, 0x27, 0xf5, 0x25, 0xf5, 0x26, 0xf5, 0x27, 0x85, 0x09, 0x82, 0x85, 0x08, 0x83, -0xe4, 0x93, 0xff, 0xe5, 0x25, 0xc3, 0x9f, 0x40, 0x03, 0x02, 0x2b, 0x70, 0x12, 0x00, 0x18, 0x74, -0x01, 0x93, 0xf5, 0x28, 0x12, 0x00, 0x12, 0x74, 0x02, 0x93, 0xf5, 0x29, 0x12, 0x00, 0x12, 0x74, -0x04, 0x93, 0xfc, 0x74, 0x05, 0x93, 0xfd, 0xe5, 0x28, 0x25, 0xe0, 0x24, 0x5f, 0xf8, 0xe2, 0xfe, -0x08, 0xe2, 0xff, 0xd3, 0x9d, 0xee, 0x9c, 0x40, 0x72, 0x7c, 0x00, 0x7d, 0x05, 0x12, 0x0d, 0x08, -0xe5, 0x29, 0x25, 0xe0, 0x24, 0x60, 0xf8, 0xe2, 0x24, 0x01, 0xfd, 0x18, 0xe2, 0x34, 0x00, 0xfc, -0x12, 0x0d, 0x1a, 0x8e, 0x2a, 0x8f, 0x2b, 0x12, 0x00, 0x12, 0x74, 0x03, 0x93, 0x30, 0xe7, 0x2b, -0x54, 0x7f, 0xc3, 0x95, 0x2b, 0xff, 0xe4, 0x95, 0x2a, 0xfe, 0x12, 0x3b, 0x31, 0xc3, 0x74, 0x03, -0x9f, 0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x2e, 0xaf, 0x25, 0x74, 0x01, 0xa8, 0x07, -0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x80, 0x1d, 0x12, 0x00, 0x12, 0x74, 0x03, -0x93, 0xc3, 0x95, 0x2b, 0xe4, 0x95, 0x2a, 0x50, 0x0f, 0xaf, 0x25, 0x74, 0x01, 0xa8, 0x07, 0x08, -0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x75, 0x27, 0x01, 0x05, 0x25, 0x02, 0x2a, 0xba, -0xe5, 0x26, 0x65, 0x0c, 0x60, 0x08, 0x85, 0x26, 0x0c, 0xe4, 0xf5, 0x0b, 0x80, 0x0e, 0x05, 0x0b, -0xe5, 0x0b, 0xc3, 0x94, 0x03, 0x40, 0x05, 0x15, 0x0b, 0x85, 0x26, 0x0a, 0xab, 0x22, 0xaa, 0x23, -0xa9, 0x24, 0xe5, 0x0a, 0x12, 0x0c, 0xd4, 0xaf, 0x27, 0x22, 0xe4, 0xf5, 0x22, 0xf5, 0x23, 0xff, -0xfe, 0x78, 0x35, 0xe2, 0x25, 0xe0, 0xfd, 0x78, 0x06, 0xe2, 0x2d, 0xfd, 0x78, 0x0c, 0xe2, 0xc4, -0x54, 0xf0, 0x2d, 0xfd, 0x78, 0x3b, 0xe2, 0xfc, 0xc4, 0x33, 0x54, 0xe0, 0x2d, 0x24, 0xfe, 0x60, -0x25, 0x24, 0xf0, 0x60, 0x21, 0x14, 0x60, 0x26, 0x24, 0xf2, 0x60, 0x1a, 0x24, 0xfe, 0x60, 0x2e, -0x24, 0xf1, 0x60, 0x0c, 0x14, 0x60, 0x3b, 0x24, 0x02, 0x70, 0x6c, 0xe4, 0xfd, 0xff, 0x80, 0x22, -0x7d, 0x01, 0x7f, 0x01, 0x80, 0x0b, 0x75, 0x22, 0x00, 0x75, 0x23, 0x01, 0x80, 0x59, 0xe4, 0xfd, -0xff, 0x12, 0x33, 0xf3, 0x8e, 0x22, 0x8f, 0x23, 0xe4, 0xfd, 0x7f, 0x01, 0x80, 0x0f, 0x7d, 0x01, -0x7f, 0x01, 0x12, 0x33, 0xf3, 0x8e, 0x22, 0x8f, 0x23, 0x7d, 0x01, 0xe4, 0xff, 0x12, 0x33, 0xf3, -0x80, 0x35, 0x7d, 0x01, 0x7f, 0x01, 0x12, 0x33, 0xf3, 0xc0, 0x06, 0xc0, 0x07, 0xe4, 0xfd, 0xff, -0x12, 0x33, 0xf3, 0xd0, 0xe0, 0x2f, 0xf5, 0x23, 0xd0, 0xe0, 0x3e, 0xf5, 0x22, 0xe4, 0xfd, 0x7f, -0x01, 0x12, 0x33, 0xf3, 0xc0, 0x06, 0xc0, 0x07, 0x7d, 0x01, 0xe4, 0xff, 0x12, 0x33, 0xf3, 0xd0, -0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0xd3, 0xe5, 0x23, 0x9f, 0xe5, 0x22, 0x9e, 0x40, 0x27, -0x78, 0x24, 0x7c, 0x00, 0x7d, 0x00, 0x12, 0x02, 0x9f, 0x78, 0x02, 0x7c, 0x00, 0x7d, 0xfe, 0x7b, -0xfe, 0x7a, 0x00, 0x79, 0x31, 0x12, 0x02, 0xa5, 0x78, 0x31, 0x7c, 0x00, 0x7d, 0xfe, 0x7b, 0x00, -0x7a, 0x00, 0x79, 0x24, 0x12, 0x02, 0xa5, 0x22, 0xab, 0x25, 0xe5, 0x27, 0xf9, 0x24, 0x02, 0xf5, -0x27, 0xe5, 0x26, 0xfa, 0x34, 0x00, 0xf5, 0x26, 0xee, 0x8f, 0xf0, 0x12, 0x0e, 0x6b, 0x90, 0x00, -0x02, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x12, 0x0d, 0xe6, 0xff, 0xae, 0xf0, 0xab, 0x25, 0xe5, -0x27, 0xf9, 0x24, 0x02, 0xf5, 0x27, 0xe5, 0x26, 0xfa, 0x34, 0x00, 0xf5, 0x26, 0xee, 0x8f, 0xf0, -0x02, 0x0e, 0x6b, 0x90, 0x00, 0x05, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x02, 0x0c, 0xa7, 0xab, -0x25, 0xe5, 0x27, 0xf9, 0x24, 0x02, 0xf5, 0x27, 0xe5, 0x26, 0xfa, 0x34, 0x00, 0xf5, 0x26, 0xe4, -0xf5, 0xf0, 0x02, 0x0e, 0x6b, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x90, 0x00, 0x0b, 0x02, 0x0c, -0xa7, 0xe5, 0x1f, 0xfe, 0x7c, 0x00, 0xe4, 0x25, 0x22, 0xff, 0xec, 0x3e, 0xfe, 0x22, 0xab, 0x1c, -0xaa, 0x1d, 0xa9, 0x1e, 0x22, 0x75, 0x89, 0x80, 0x90, 0x00, 0xc3, 0xe0, 0xc3, 0x94, 0xff, 0x22, -0x75, 0x25, 0x01, 0x85, 0x23, 0x26, 0x85, 0x24, 0x27, 0x22, 0xab, 0x25, 0xaa, 0x26, 0xa9, 0x27, -0x22, 0x8d, 0x82, 0x8c, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0x78, 0xff, 0xe4, 0xf6, 0xd8, +0xec, 0x64, 0x80, 0xc8, 0x64, 0x80, 0x98, 0x45, 0xf0, 0x22, 0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, +0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, 0xe8, 0x9c, 0x45, 0xf0, 0x22, 0xe8, 0x60, 0x0f, 0xec, 0xc3, +0x13, 0xfc, 0xed, 0x13, 0xfd, 0xee, 0x13, 0xfe, 0xef, 0x13, 0xff, 0xd8, 0xf1, 0x22, 0xe6, 0xfc, +0x08, 0xe6, 0xfd, 0x08, 0xe6, 0xfe, 0x08, 0xe6, 0xff, 0x22, 0xe6, 0xfb, 0x08, 0xe6, 0xf9, 0x08, +0xe6, 0xfa, 0x08, 0xe6, 0xcb, 0xf8, 0x22, 0xec, 0xf6, 0x08, 0xed, 0xf6, 0x08, 0xee, 0xf6, 0x08, +0xef, 0xf6, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xe4, 0x93, 0xf6, 0x08, 0x74, 0x01, 0x93, 0xf6, 0x08, +0x74, 0x02, 0x93, 0xf6, 0x08, 0x74, 0x03, 0x93, 0xf6, 0x74, 0x04, 0x73, 0xa4, 0x25, 0x82, 0xf5, +0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xec, 0x8e, +0xf0, 0xa4, 0xcc, 0xc5, 0xf0, 0xcc, 0xcd, 0xf8, 0xef, 0xa4, 0xce, 0xc5, 0xf0, 0x2d, 0xfd, 0xe4, +0x3c, 0xfc, 0xe8, 0xa4, 0x2e, 0xc8, 0xc5, 0xf0, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xef, 0xa4, 0xff, +0xe5, 0xf0, 0x28, 0xfe, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0x22, 0xef, 0x4e, 0x60, 0x12, 0xef, +0x60, 0x01, 0x0e, 0xed, 0xbb, 0x01, 0x0b, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0xa3, 0xdf, 0xfc, 0xde, +0xfa, 0x22, 0x89, 0xf0, 0x50, 0x07, 0xf7, 0x09, 0xdf, 0xfc, 0xa9, 0xf0, 0x22, 0xbb, 0xfe, 0xfc, +0xf3, 0x09, 0xdf, 0xfc, 0xa9, 0xf0, 0x22, 0x90, 0x36, 0x03, 0x7d, 0x1f, 0x12, 0x32, 0xb1, 0xee, +0x44, 0x80, 0xf5, 0x8f, 0x8f, 0x8e, 0x75, 0x8a, 0xa0, 0x75, 0x8a, 0x0a, 0xe4, 0x90, 0x00, 0xbb, +0xf0, 0x90, 0x00, 0xc1, 0xe0, 0x60, 0x33, 0x14, 0x60, 0x66, 0x24, 0xfc, 0x70, 0x03, 0x02, 0x12, +0x1b, 0x04, 0x60, 0x03, 0x02, 0x12, 0x57, 0xe4, 0xf5, 0x18, 0x75, 0x19, 0x04, 0x78, 0x7d, 0xf6, +0x90, 0x36, 0x12, 0x93, 0x70, 0x0b, 0x75, 0x4d, 0x36, 0x75, 0x4e, 0x2a, 0x12, 0x3a, 0x2b, 0x8f, +0x18, 0x90, 0x01, 0xaa, 0xe5, 0x18, 0xf0, 0x02, 0x12, 0x57, 0xe4, 0x78, 0x7d, 0xf6, 0x12, 0x2f, +0x31, 0xef, 0x64, 0x01, 0x60, 0xf8, 0xaf, 0x4e, 0xae, 0x4d, 0x12, 0x20, 0x21, 0xaf, 0x4e, 0xae, +0x4d, 0x12, 0x34, 0x70, 0xaf, 0x4e, 0xae, 0x4d, 0x12, 0x35, 0x66, 0xe5, 0x4e, 0x24, 0x9d, 0xff, +0xe4, 0x35, 0x4d, 0xfe, 0x12, 0x35, 0x96, 0x12, 0x32, 0xbb, 0xa3, 0x04, 0xf0, 0x02, 0x12, 0x5c, +0xe4, 0xf5, 0x18, 0x78, 0x55, 0xf6, 0x90, 0x01, 0xff, 0xe0, 0xff, 0xb4, 0x01, 0x09, 0x90, 0x00, +0xc1, 0x74, 0x05, 0xf0, 0x02, 0x12, 0x5c, 0xef, 0xb4, 0x02, 0x0e, 0x90, 0x01, 0xc0, 0xe0, 0xb4, +0xca, 0x07, 0x75, 0x4b, 0x01, 0xa3, 0xe0, 0xf5, 0x4c, 0x78, 0x7d, 0x76, 0x01, 0x12, 0x32, 0xc6, +0x12, 0x1c, 0xec, 0x78, 0x55, 0xa6, 0x07, 0x12, 0x32, 0x95, 0x74, 0x87, 0x93, 0x70, 0x03, 0x74, +0x86, 0x93, 0x60, 0x1b, 0x08, 0xe6, 0xf5, 0x19, 0x08, 0xe6, 0xf5, 0x1a, 0x08, 0xe6, 0xfe, 0x08, +0xe6, 0xff, 0x78, 0x56, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x08, 0xa6, 0x19, 0x08, 0xa6, 0x1a, 0x7f, +0x5d, 0xe5, 0x4e, 0x24, 0x9d, 0xfd, 0xe4, 0x35, 0x4d, 0xfc, 0x12, 0x2b, 0xb9, 0x8f, 0x18, 0x12, +0x32, 0xc6, 0x75, 0x1f, 0x36, 0x75, 0x20, 0x23, 0xad, 0x18, 0x12, 0x19, 0x5d, 0x8f, 0x18, 0x78, +0x55, 0xe6, 0xb4, 0x02, 0x17, 0xe4, 0xf5, 0x19, 0xe5, 0x18, 0x64, 0x05, 0x60, 0x05, 0xe5, 0x18, +0xb4, 0x0c, 0x03, 0x43, 0x18, 0x80, 0x78, 0x55, 0xa6, 0x0a, 0x80, 0x04, 0xe4, 0x78, 0x55, 0xf6, +0x78, 0x5a, 0xe6, 0x70, 0x03, 0x02, 0x11, 0xce, 0xe5, 0x4b, 0x60, 0x03, 0x02, 0x11, 0xce, 0x90, +0x01, 0xea, 0xe0, 0xff, 0x30, 0xe2, 0x0b, 0x78, 0x85, 0xe2, 0x24, 0x01, 0xf2, 0x18, 0xe2, 0x34, +0x00, 0xf2, 0x78, 0x60, 0xe6, 0x60, 0x04, 0xef, 0x20, 0xe0, 0x0c, 0xe5, 0x18, 0xb4, 0xaa, 0x0f, +0x90, 0x01, 0xea, 0xe0, 0x30, 0xe1, 0x08, 0x90, 0x00, 0xc0, 0xe0, 0x04, 0xf0, 0x80, 0x08, 0x90, +0x00, 0xc0, 0xe0, 0x60, 0x02, 0x14, 0xf0, 0x90, 0x36, 0x08, 0xe4, 0x93, 0x75, 0xf0, 0x64, 0xa4, +0xff, 0xd3, 0x78, 0x85, 0xe2, 0x9f, 0x18, 0xe2, 0x95, 0xf0, 0x50, 0x1b, 0x12, 0x32, 0x95, 0x74, +0xc0, 0x93, 0x24, 0x02, 0xff, 0xe4, 0x33, 0xfe, 0x90, 0x00, 0xc0, 0xe0, 0xd3, 0x9f, 0xee, 0x64, +0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x17, 0x12, 0x31, 0xd4, 0x7f, 0x01, 0x12, 0x3a, 0x36, 0xe4, +0x78, 0x5a, 0xf6, 0x78, 0x60, 0xf6, 0x78, 0x5b, 0x76, 0x04, 0x78, 0x61, 0x76, 0x04, 0x12, 0x32, +0xc6, 0x78, 0x55, 0xe6, 0xf5, 0x1f, 0xad, 0x18, 0x12, 0x13, 0x0a, 0x78, 0x5a, 0xe6, 0x60, 0x19, +0x90, 0x36, 0x06, 0x7d, 0x64, 0x12, 0x32, 0xb1, 0xc3, 0x78, 0x7f, 0xe6, 0x9f, 0x18, 0xe6, 0x9e, +0x50, 0x6a, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x80, 0x63, 0x90, 0x01, 0xfe, 0xe0, 0x70, 0x17, 0x78, +0x7f, 0xe6, 0x18, 0x46, 0x60, 0x09, 0x08, 0xe6, 0x16, 0x18, 0x70, 0x0a, 0x16, 0x80, 0x07, 0x78, +0x7e, 0x76, 0x00, 0x08, 0x76, 0x14, 0x12, 0x32, 0xbb, 0x80, 0x41, 0x12, 0x31, 0xd4, 0x12, 0x32, +0x95, 0xe4, 0x93, 0x90, 0x01, 0xcb, 0xf0, 0x90, 0x01, 0xff, 0xe0, 0xb4, 0x01, 0x2e, 0x75, 0x1e, +0x01, 0x75, 0x1f, 0x01, 0x75, 0x20, 0x40, 0x75, 0x21, 0x01, 0x75, 0x22, 0x01, 0x75, 0x23, 0x80, +0x7b, 0x01, 0x7a, 0x01, 0x79, 0xc0, 0x12, 0x1e, 0x88, 0xe4, 0x90, 0x01, 0xff, 0xf0, 0x75, 0x8a, +0xa0, 0x90, 0x00, 0xb8, 0xf0, 0x80, 0xd0, 0xe4, 0x90, 0x00, 0xc1, 0xf0, 0x90, 0x01, 0xe5, 0xe0, +0x64, 0x03, 0x60, 0x08, 0x90, 0x01, 0xb5, 0xe0, 0x64, 0x03, 0x70, 0x64, 0x90, 0x36, 0x0e, 0xe4, +0x93, 0xf5, 0x18, 0x12, 0x31, 0xd4, 0x7f, 0x01, 0x12, 0x34, 0x9a, 0xe5, 0x18, 0x70, 0x05, 0x90, +0xff, 0x11, 0x80, 0x0d, 0xe5, 0x18, 0xb4, 0x01, 0x0c, 0x90, 0xff, 0x10, 0xe0, 0x44, 0x18, 0xf0, +0xa3, 0xe0, 0x44, 0x18, 0xf0, 0x90, 0x01, 0xb5, 0xe0, 0xb4, 0x03, 0x15, 0x90, 0xff, 0x12, 0xe0, +0x54, 0xe3, 0xf0, 0x90, 0xff, 0x11, 0xe0, 0x54, 0xe3, 0xf0, 0x90, 0xff, 0x10, 0xe0, 0x54, 0xe3, +0xf0, 0x75, 0x8f, 0x87, 0x75, 0x8e, 0xff, 0x75, 0x8d, 0x87, 0x75, 0x8c, 0xff, 0x12, 0x32, 0x9c, +0x75, 0x8a, 0xa0, 0xf0, 0x12, 0x35, 0x04, 0x12, 0x32, 0x9c, 0x75, 0x8a, 0xa0, 0xf0, 0x80, 0xed, +0x75, 0x18, 0x27, 0x75, 0x19, 0x10, 0xe5, 0x89, 0x30, 0xe7, 0x0f, 0x75, 0x89, 0x80, 0x90, 0x00, +0xbb, 0xe0, 0xc3, 0x94, 0xff, 0x50, 0x03, 0xe0, 0x04, 0xf0, 0x90, 0x00, 0xbb, 0xe0, 0xc3, 0x78, +0x7d, 0x96, 0x50, 0x15, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, +0x08, 0x12, 0x34, 0xe3, 0x12, 0x32, 0x9c, 0x80, 0xe1, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, 0x89, 0x1d, +0x8d, 0x1e, 0x90, 0x01, 0xfa, 0xe0, 0xf5, 0x20, 0xe4, 0xf5, 0x21, 0x85, 0x1f, 0x1f, 0xe5, 0x1e, +0x60, 0x04, 0x90, 0x00, 0xc3, 0xf0, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0x75, 0x22, 0x01, +0x75, 0x23, 0x00, 0x78, 0x82, 0xe6, 0xff, 0x70, 0x0b, 0x74, 0x20, 0x25, 0x23, 0xf5, 0x23, 0xe4, +0x35, 0x22, 0xf5, 0x22, 0x74, 0x00, 0x2f, 0xf9, 0xe4, 0x34, 0x01, 0xfa, 0x7b, 0x01, 0xa8, 0x23, +0xac, 0x22, 0x7d, 0x01, 0x7e, 0x00, 0x7f, 0x20, 0x12, 0x0b, 0xc8, 0x7e, 0x00, 0x7f, 0x0b, 0x7d, +0xff, 0xe5, 0x23, 0x24, 0x09, 0xfb, 0xe4, 0x35, 0x22, 0xfa, 0xa9, 0x03, 0x7b, 0x01, 0x12, 0x0f, +0xeb, 0x05, 0x23, 0xe5, 0x23, 0xae, 0x22, 0x70, 0x02, 0x05, 0x22, 0x14, 0xf5, 0x82, 0x8e, 0x83, +0xe4, 0xf0, 0x12, 0x2b, 0x9e, 0x90, 0x00, 0x0a, 0x12, 0x2b, 0x5f, 0xff, 0x90, 0x00, 0x04, 0x12, +0x0c, 0x07, 0x2f, 0xf5, 0x21, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xb4, 0x04, 0x09, 0x12, 0x2b, +0x84, 0x70, 0x04, 0x90, 0x00, 0xc2, 0xf0, 0x90, 0x00, 0xc2, 0xe0, 0x60, 0x55, 0x14, 0xf0, 0xe0, +0xff, 0x7e, 0x04, 0x60, 0x02, 0x7e, 0x08, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x05, 0xee, 0x12, 0x0c, +0x46, 0xef, 0x60, 0x0b, 0x12, 0x2b, 0xa8, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0x80, 0x10, 0x90, +0x00, 0xc3, 0xe0, 0xff, 0xb4, 0x05, 0x02, 0x80, 0x02, 0x7f, 0x00, 0xef, 0x7f, 0x00, 0xfe, 0x12, +0x2b, 0x46, 0x12, 0x2b, 0x5c, 0xc4, 0x54, 0xf0, 0xfe, 0x12, 0x2b, 0xa8, 0x12, 0x0d, 0x1b, 0xfd, +0xe5, 0xf0, 0x54, 0x0f, 0xfc, 0xe4, 0x2d, 0xff, 0xee, 0x3c, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x02, +0x15, 0x0f, 0x12, 0x2b, 0x5c, 0x70, 0x09, 0x12, 0x2b, 0x84, 0x70, 0x04, 0xe5, 0x1e, 0x60, 0x51, +0x12, 0x2b, 0x8a, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x5c, 0x60, 0x14, 0xc4, 0x54, 0xf0, 0xfe, 0x12, +0x0d, 0x1b, 0x24, 0x00, 0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2b, 0x21, 0x12, 0x2b, 0x68, 0x12, +0x2b, 0x7e, 0x60, 0x32, 0xc4, 0x54, 0xf0, 0xfe, 0x90, 0x00, 0x06, 0x12, 0x0d, 0x46, 0x24, 0x00, +0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x08, 0x12, 0x0d, +0x46, 0x24, 0x00, 0xff, 0xe5, 0xf0, 0x34, 0x10, 0xfe, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x68, 0x80, +0x05, 0xe4, 0x90, 0x00, 0xc3, 0xf0, 0x90, 0x01, 0xfe, 0xe0, 0xd3, 0x94, 0xf0, 0x50, 0x03, 0x02, +0x15, 0x0f, 0x12, 0x2b, 0x9e, 0xe5, 0x1f, 0x60, 0x14, 0x12, 0x2b, 0x8c, 0x12, 0x2b, 0x46, 0x7e, +0x00, 0x7f, 0x08, 0x7d, 0x00, 0x12, 0x2b, 0xa8, 0x12, 0x0f, 0xeb, 0x80, 0x21, 0x12, 0x2b, 0x8a, +0x12, 0x2b, 0x46, 0x12, 0x2b, 0x97, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0x12, 0x2b, 0x21, 0x90, +0x00, 0x06, 0x12, 0x2b, 0x3a, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x08, 0x12, 0x2b, 0x40, 0x90, 0x01, +0x40, 0x74, 0x40, 0xf0, 0x90, 0x01, 0x60, 0x74, 0x60, 0xf0, 0x75, 0x2a, 0x01, 0x75, 0x2b, 0x41, +0x75, 0x28, 0x01, 0x75, 0x29, 0x61, 0xe4, 0xf5, 0x27, 0xaf, 0x27, 0x12, 0x3a, 0x3b, 0xe5, 0x2b, +0xfd, 0x24, 0x02, 0xf5, 0x2b, 0xe5, 0x2a, 0xfc, 0x34, 0x00, 0xf5, 0x2a, 0x12, 0x2b, 0xaf, 0xaf, +0x27, 0x12, 0x35, 0xe9, 0xef, 0xd3, 0x94, 0x1c, 0x40, 0x06, 0x7e, 0x0f, 0x7f, 0xff, 0x80, 0x05, +0xaf, 0x27, 0x12, 0x3a, 0x08, 0xe5, 0x29, 0xfd, 0x24, 0x02, 0xf5, 0x29, 0xe5, 0x28, 0xfc, 0x34, +0x00, 0xf5, 0x28, 0x12, 0x2b, 0xaf, 0x05, 0x27, 0xe5, 0x27, 0xc3, 0x94, 0x10, 0x40, 0xba, 0x78, +0x82, 0xe6, 0x7f, 0x00, 0x70, 0x02, 0x7f, 0x20, 0x78, 0x82, 0xa6, 0x07, 0xe5, 0x20, 0x20, 0xe7, +0x2a, 0x30, 0xe6, 0x0a, 0x12, 0x2b, 0x5c, 0x70, 0x22, 0x12, 0x2b, 0x84, 0x70, 0x1d, 0xe5, 0x20, +0x30, 0xe5, 0x0f, 0x12, 0x2b, 0x7e, 0xff, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0x4f, 0x54, 0x84, +0x70, 0x09, 0xe5, 0x20, 0x30, 0xe4, 0x0c, 0xe5, 0x1e, 0x60, 0x08, 0x90, 0x01, 0xed, 0xe0, 0xff, +0x12, 0x33, 0xb4, 0x22, 0x8f, 0x23, 0xef, 0x12, 0x06, 0x85, 0xe6, 0xf5, 0x2f, 0x12, 0x05, 0xf0, +0x12, 0x09, 0x3d, 0x8e, 0x30, 0x8f, 0x31, 0xe5, 0x2f, 0x70, 0x60, 0x75, 0x24, 0x01, 0x12, 0x0a, +0x79, 0xe4, 0xf5, 0x29, 0xf5, 0x2a, 0x78, 0x5f, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x5e, 0x12, +0x0a, 0xe7, 0x78, 0x63, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x62, 0x12, 0x09, 0x7c, 0xc3, 0x74, +0x09, 0x93, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0x12, 0x0a, 0x85, 0x80, 0x04, 0xae, 0x27, 0xaf, +0x28, 0x12, 0x08, 0x65, 0x12, 0x05, 0xef, 0x74, 0x09, 0x93, 0xfe, 0x74, 0x0a, 0x12, 0x07, 0x52, +0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0x8e, 0x27, 0x8f, 0x28, +0x78, 0x67, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x66, 0x80, 0x72, 0x78, 0x7a, 0xe6, 0x14, 0x65, +0x2f, 0x70, 0x75, 0xf5, 0x24, 0x12, 0x0a, 0x79, 0x12, 0x05, 0xf0, 0x74, 0x03, 0x93, 0xf5, 0x29, +0x74, 0x04, 0x93, 0xf5, 0x2a, 0x12, 0x06, 0x2a, 0x12, 0x07, 0x86, 0x24, 0x5e, 0x12, 0x07, 0x7c, +0x24, 0x5b, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, 0x5a, 0x12, 0x09, 0x7b, 0xc3, 0x74, 0x0b, +0x93, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0x12, 0x0a, 0x85, 0x80, 0x04, 0xae, 0x27, 0xaf, 0x28, +0x12, 0x08, 0x65, 0x12, 0x05, 0xef, 0x74, 0x0b, 0x93, 0xfe, 0x74, 0x0c, 0x12, 0x07, 0x52, 0x40, +0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0x8e, 0x27, 0x8f, 0x28, 0x12, +0x07, 0x86, 0x24, 0x57, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, 0x56, 0xf8, 0xe2, 0x2f, 0xf5, +0x2c, 0x18, 0xe2, 0x3e, 0xf5, 0x2b, 0x80, 0x79, 0xe5, 0x2f, 0xfd, 0x7c, 0x00, 0xae, 0x30, 0xaf, +0x31, 0x12, 0x0c, 0x68, 0xac, 0x06, 0xad, 0x07, 0xe5, 0x30, 0xc3, 0x13, 0xfe, 0xe5, 0x31, 0x13, +0x2d, 0xf5, 0x2a, 0xec, 0x3e, 0xf5, 0x29, 0x12, 0x07, 0x86, 0x24, 0x5b, 0x12, 0x06, 0x32, 0x12, +0x07, 0x86, 0x24, 0x5a, 0x12, 0x07, 0x7c, 0x24, 0x63, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, +0x62, 0x12, 0x09, 0x7b, 0xd3, 0xe5, 0x26, 0x95, 0x28, 0xe5, 0x27, 0x64, 0x80, 0xf8, 0xe5, 0x25, +0x64, 0x80, 0x98, 0x40, 0x11, 0xe4, 0xf5, 0x24, 0x85, 0x27, 0x2b, 0x85, 0x28, 0x2c, 0x85, 0x25, +0x27, 0x85, 0x26, 0x28, 0x80, 0x0f, 0x75, 0x24, 0x01, 0x85, 0x25, 0x2b, 0x85, 0x26, 0x2c, 0x85, +0x27, 0x27, 0x85, 0x28, 0x28, 0x12, 0x06, 0x2a, 0x12, 0x07, 0x86, 0x24, 0x5e, 0xf8, 0x12, 0x0a, +0xe7, 0xc3, 0xe5, 0x26, 0x95, 0x2c, 0xf5, 0x26, 0xe5, 0x25, 0x95, 0x2b, 0xf5, 0x25, 0xc3, 0x64, +0x80, 0x94, 0x80, 0x50, 0x05, 0xe4, 0xf5, 0x25, 0xf5, 0x26, 0xc3, 0xe5, 0x28, 0x95, 0x2c, 0xf5, +0x28, 0xe5, 0x27, 0x95, 0x2b, 0xf5, 0x27, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0xe4, 0xf5, +0x27, 0xf5, 0x28, 0x85, 0x27, 0x2b, 0x85, 0x28, 0x2c, 0xae, 0x2b, 0xaf, 0x2c, 0x12, 0x08, 0xc6, +0xe4, 0x7b, 0x80, 0xfa, 0xf9, 0xf8, 0x12, 0x06, 0x77, 0xae, 0x30, 0xaf, 0x31, 0x12, 0x0a, 0x9d, +0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x26, 0x25, 0x28, 0xcf, 0xe5, 0x25, 0x35, 0x27, 0xcf, 0x24, 0x01, +0xcf, 0x34, 0x00, 0xab, 0x07, 0xfa, 0x33, 0x95, 0xe0, 0xf9, 0xf8, 0xd0, 0x07, 0xd0, 0x06, 0x12, +0x0e, 0xa2, 0xef, 0x12, 0x0a, 0xf1, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xe4, 0x7b, 0x80, 0xfa, +0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8e, 0x2b, 0x8f, 0x2c, 0xe5, 0x24, 0x60, 0x0e, 0xe5, 0x2a, 0x25, +0x2c, 0xf5, 0x2c, 0xe5, 0x29, 0x35, 0x2b, 0xf5, 0x2b, 0x80, 0x0d, 0xc3, 0xe5, 0x2a, 0x95, 0x2c, +0xf5, 0x2c, 0xe5, 0x29, 0x95, 0x2b, 0xf5, 0x2b, 0xe5, 0x23, 0x12, 0x0a, 0x0e, 0xf8, 0xe5, 0x2b, +0xf2, 0x08, 0xe5, 0x2c, 0xf2, 0x22, 0x43, 0xad, 0x04, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, +0xff, 0x58, 0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x74, 0x26, 0x93, 0xff, 0x90, 0xff, 0x48, +0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x74, 0x27, 0x93, 0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, +0x40, 0x74, 0x6c, 0xf0, 0x90, 0xff, 0x57, 0x74, 0xff, 0xf0, 0x90, 0xff, 0x56, 0xe4, 0xf0, 0x90, +0xff, 0x5f, 0x74, 0xff, 0xf0, 0x90, 0xff, 0x5e, 0xe4, 0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, +0x22, 0x78, 0x6f, 0xe6, 0xff, 0x78, 0x82, 0xe2, 0xfc, 0x08, 0xe2, 0x2f, 0xf5, 0x82, 0xe4, 0x3c, +0xf5, 0x83, 0xe0, 0xff, 0x22, 0xe5, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, +0x34, 0x02, 0xf5, 0x83, 0x22, 0x78, 0x6f, 0xe6, 0xff, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x02, +0xf5, 0x83, 0xe0, 0x90, 0xff, 0x54, 0xf0, 0x18, 0xe6, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x02, +0xf5, 0x83, 0xe0, 0x90, 0xff, 0x5c, 0xf0, 0xef, 0xc3, 0x13, 0xff, 0xe5, 0x52, 0x24, 0x1a, 0xf5, +0x82, 0xe4, 0x35, 0x51, 0xf5, 0x83, 0xe5, 0x82, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, +0xe4, 0x93, 0x90, 0xff, 0x55, 0xf0, 0x22, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x75, +0x8f, 0x80, 0x75, 0x8e, 0x20, 0x75, 0x8a, 0xa0, 0xf0, 0x90, 0xff, 0x43, 0x74, 0x5f, 0xf0, 0x22, +0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x54, 0xe0, 0x90, 0x01, 0xf0, 0xf0, 0x90, 0xff, 0x5c, 0xe0, +0x90, 0x01, 0xf1, 0xf0, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0x22, 0xa8, 0x0f, 0xe6, 0xfd, +0x08, 0x08, 0xe6, 0xfa, 0x08, 0xe6, 0xf5, 0x82, 0x8a, 0x83, 0x22, 0xe5, 0x22, 0x75, 0xf0, 0x0a, +0xa4, 0x24, 0x03, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0xff, 0xfe, 0xfd, 0xfc, 0xab, +0x2e, 0xaa, 0x2d, 0xa9, 0x2c, 0xa8, 0x2b, 0x22, 0xab, 0x28, 0xaa, 0x29, 0xa9, 0x2a, 0x22, 0x7f, +0xb4, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0x01, 0x02, 0x0f, 0xeb, 0x90, 0xff, 0x5e, 0xf0, 0x90, 0xff, +0x56, 0xe0, 0xff, 0xa3, 0xe0, 0xd3, 0x9f, 0x22, 0xce, 0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, 0x78, +0x82, 0xe2, 0xfc, 0x08, 0xe2, 0x22, 0x74, 0xb5, 0x25, 0x22, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, +0x83, 0xe0, 0xff, 0xe5, 0x24, 0x22, 0x85, 0x1c, 0x82, 0x85, 0x1b, 0x83, 0xe4, 0x93, 0xff, 0x22, +0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0x22, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, 0x22, +0xd3, 0x74, 0x05, 0x93, 0x9f, 0x74, 0x04, 0x93, 0x9e, 0x22, 0x90, 0xff, 0x54, 0xf0, 0x90, 0xff, +0x5c, 0xf0, 0x22, 0xed, 0x25, 0x1e, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x43, +0x74, 0x9f, 0xf0, 0x22, 0x78, 0x81, 0xe2, 0x90, 0xff, 0x40, 0xf0, 0x22, 0x74, 0x28, 0x93, 0x90, +0xff, 0x55, 0xf0, 0xef, 0xc3, 0x94, 0x08, 0x22, 0xe5, 0x52, 0x24, 0x2b, 0xff, 0xe4, 0x35, 0x51, +0xa9, 0x07, 0x22, 0xa3, 0xe0, 0xff, 0xe5, 0x00, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0xa3, 0xe0, +0xff, 0xe5, 0x00, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0x90, 0x00, 0x02, 0x12, 0x0d, 0x46, 0xff, +0xae, 0xf0, 0x22, 0xe6, 0xff, 0xc3, 0x95, 0x00, 0xf0, 0xe5, 0x00, 0x2f, 0x22, 0x8b, 0x1b, 0x8a, +0x1c, 0x89, 0x1d, 0x8d, 0x1e, 0xe4, 0xf5, 0x21, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xf5, 0x22, +0x90, 0x00, 0x0b, 0x12, 0x0c, 0x07, 0x60, 0x08, 0xe4, 0x78, 0x86, 0xf2, 0x90, 0x00, 0xb7, 0xf0, +0xe5, 0x22, 0xb4, 0x80, 0x29, 0x78, 0x86, 0x74, 0xff, 0xf2, 0x12, 0x33, 0x52, 0x90, 0x00, 0xb1, +0xe5, 0xf0, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x33, 0x63, 0x90, 0x00, 0xb3, 0xe5, 0xf0, 0xf0, 0xa3, +0xef, 0xf0, 0xe4, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xe0, 0x04, 0xf0, 0x02, 0x1a, 0xf6, 0xe5, 0x22, +0x64, 0x08, 0x60, 0x03, 0x02, 0x1a, 0x98, 0x12, 0x33, 0x52, 0xc3, 0x90, 0x00, 0xb2, 0xe0, 0x90, +0x00, 0xb1, 0x12, 0x1b, 0x1b, 0x8e, 0x23, 0x8f, 0x24, 0x12, 0x33, 0x5d, 0xc3, 0x90, 0x00, 0xb4, +0xe0, 0x90, 0x00, 0xb3, 0x12, 0x1b, 0x1b, 0x12, 0x33, 0x4b, 0x74, 0x01, 0x93, 0xfc, 0x74, 0x02, +0x12, 0x33, 0x6b, 0x40, 0x0f, 0x90, 0x01, 0xec, 0xe0, 0x30, 0xe0, 0x08, 0x78, 0x86, 0xe2, 0x54, +0xfe, 0x12, 0x33, 0x79, 0xe5, 0x24, 0x2f, 0xfd, 0xe5, 0x23, 0x3e, 0xfc, 0x12, 0x33, 0x4b, 0x74, +0x05, 0x93, 0xfb, 0xd3, 0xed, 0x9b, 0xec, 0x94, 0x00, 0x40, 0x08, 0x78, 0x86, 0xe2, 0x54, 0xfc, +0x12, 0x33, 0x79, 0x12, 0x33, 0x4b, 0x74, 0x03, 0x93, 0xfc, 0x74, 0x04, 0x12, 0x33, 0x6b, 0x40, +0x13, 0x78, 0x86, 0xe2, 0x20, 0xe1, 0x04, 0xe5, 0x1e, 0x60, 0x09, 0x75, 0x21, 0x0c, 0xe4, 0x78, +0x86, 0xf2, 0xf5, 0x1e, 0x78, 0x86, 0xe2, 0x54, 0x3c, 0x70, 0x03, 0x02, 0x1a, 0xf6, 0x12, 0x33, +0x4b, 0x74, 0x06, 0x93, 0xfd, 0x7c, 0x00, 0xd3, 0xe5, 0x24, 0x9d, 0xe5, 0x23, 0x9c, 0x50, 0x09, +0xef, 0x9d, 0xee, 0x9c, 0x50, 0x03, 0x02, 0x1a, 0xf6, 0xd3, 0xef, 0x95, 0x24, 0xee, 0x95, 0x23, +0x40, 0x17, 0x12, 0x33, 0x5d, 0xd3, 0x90, 0x00, 0xb4, 0xe0, 0x9f, 0x90, 0x00, 0xb3, 0xe0, 0x95, +0xf0, 0x7f, 0x02, 0x40, 0x02, 0x7f, 0x01, 0x80, 0x15, 0x12, 0x33, 0x52, 0xd3, 0x90, 0x00, 0xb2, +0xe0, 0x9f, 0x90, 0x00, 0xb1, 0xe0, 0x95, 0xf0, 0x7f, 0x04, 0x40, 0x02, 0x7f, 0x03, 0x8f, 0x21, +0x78, 0x86, 0xe2, 0x54, 0xc3, 0xf2, 0x80, 0x5e, 0xe5, 0x22, 0xb4, 0x04, 0x09, 0xe4, 0x90, 0x00, +0xb5, 0xf0, 0xa3, 0xf0, 0x80, 0x50, 0x12, 0x33, 0x4b, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, +0xff, 0xd3, 0x90, 0x00, 0xb6, 0xe0, 0x9f, 0x90, 0x00, 0xb5, 0xe0, 0x9e, 0x50, 0x15, 0x90, 0x01, +0xec, 0xe0, 0x30, 0xe0, 0x0e, 0x54, 0x11, 0x64, 0x11, 0x70, 0x2b, 0x90, 0x00, 0xb7, 0xe0, 0x64, +0x02, 0x70, 0x23, 0x78, 0x86, 0xe2, 0xff, 0x30, 0xe0, 0x1c, 0x90, 0x00, 0xb7, 0xe0, 0xfe, 0xd3, +0x94, 0x02, 0x50, 0x0a, 0xee, 0x7e, 0x0b, 0xb4, 0x01, 0x02, 0x7e, 0x05, 0x8e, 0x21, 0xef, 0x54, +0xfe, 0x78, 0x86, 0x12, 0x33, 0x79, 0xc3, 0x90, 0x00, 0xb5, 0xe0, 0x94, 0xff, 0x50, 0x13, 0x12, +0x33, 0x4b, 0xe4, 0x93, 0xff, 0x90, 0x00, 0xb6, 0xe0, 0x2f, 0xf0, 0x90, 0x00, 0xb5, 0xe0, 0x34, +0x00, 0xf0, 0xe5, 0x1e, 0xaf, 0x1e, 0x70, 0x02, 0xaf, 0x21, 0x22, 0x9f, 0xff, 0xe0, 0x95, 0xf0, +0xfe, 0x12, 0x3a, 0x14, 0x22, 0x8f, 0x26, 0x8d, 0x27, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, +0xf9, 0x74, 0x02, 0x35, 0xf0, 0x75, 0x28, 0x01, 0xf5, 0x29, 0x89, 0x2a, 0x78, 0x77, 0xe6, 0x60, +0x01, 0x16, 0x12, 0x18, 0x98, 0x12, 0x19, 0x49, 0xe4, 0xfc, 0xfd, 0xa8, 0x04, 0xc0, 0x05, 0xc0, +0x06, 0xc0, 0x07, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xc3, +0xef, 0x9b, 0xf5, 0x2e, 0xee, 0x9a, 0xf5, 0x2d, 0xed, 0x99, 0xf5, 0x2c, 0xec, 0x98, 0xf5, 0x2b, +0x12, 0x18, 0x98, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xf5, 0x2f, 0xe4, 0xff, 0xfe, 0x12, 0x18, +0x8f, 0xd3, 0x12, 0x0f, 0x34, 0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, +0x00, 0xe5, 0x26, 0x25, 0xe0, 0x24, 0x5d, 0xf8, 0xee, 0xf2, 0x08, 0xef, 0xf2, 0x78, 0x77, 0xe6, +0x60, 0x20, 0x90, 0x36, 0x0b, 0xe4, 0x93, 0x60, 0x03, 0x02, 0x1c, 0x97, 0x12, 0x18, 0x8b, 0xd3, +0x12, 0x0f, 0x34, 0x7f, 0x00, 0x40, 0x02, 0x7f, 0x01, 0xef, 0x78, 0x77, 0x56, 0x60, 0x03, 0x02, +0x1c, 0x97, 0xae, 0x2d, 0xaf, 0x2e, 0x12, 0x3a, 0x14, 0x12, 0x17, 0xba, 0xc3, 0x12, 0x18, 0xf1, +0x50, 0x11, 0xe4, 0x12, 0x18, 0x8b, 0x12, 0x0f, 0x34, 0x40, 0x04, 0x05, 0x2f, 0x80, 0x70, 0x15, +0x2f, 0x80, 0x6c, 0x12, 0x18, 0x98, 0x90, 0x00, 0x04, 0x12, 0x0c, 0x07, 0xff, 0x33, 0x95, 0xe0, +0xfe, 0xfd, 0xfc, 0xe5, 0x2e, 0x2f, 0xf5, 0x2e, 0xe5, 0x2d, 0x3e, 0xf5, 0x2d, 0xe5, 0x2c, 0x3d, +0xf5, 0x2c, 0xe5, 0x2b, 0x3c, 0xf5, 0x2b, 0xe4, 0x7f, 0x78, 0x12, 0x18, 0x8c, 0xd3, 0x12, 0x0f, +0x34, 0x40, 0x0c, 0x12, 0x18, 0x98, 0x90, 0x00, 0x02, 0xe4, 0x75, 0xf0, 0x01, 0x80, 0x1c, 0xe5, +0x2e, 0x24, 0x78, 0xe4, 0x35, 0x2d, 0xe4, 0x35, 0x2c, 0xfd, 0xe4, 0x35, 0x2b, 0xfc, 0x33, 0x12, +0x18, 0x98, 0x50, 0x10, 0x90, 0x00, 0x02, 0x74, 0xff, 0xf5, 0xf0, 0x12, 0x0d, 0x7e, 0x90, 0x00, +0x04, 0xe4, 0x80, 0x05, 0x90, 0x00, 0x04, 0xe5, 0x2e, 0x12, 0x0c, 0x46, 0xe4, 0xf5, 0x2f, 0x12, +0x17, 0xba, 0x74, 0x01, 0x93, 0xff, 0xd3, 0x64, 0x80, 0xf8, 0xe5, 0x2f, 0x64, 0x80, 0x98, 0x50, +0x17, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0xad, 0x2f, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xed, 0x2f, 0xec, +0x3e, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x14, 0xe4, 0xf5, 0x2f, 0x12, 0x18, 0x98, 0x12, 0x0d, +0x1b, 0xff, 0x90, 0x00, 0x02, 0xe5, 0xf0, 0x8f, 0xf0, 0x12, 0x0d, 0xea, 0x12, 0x18, 0x98, 0x90, +0x00, 0x05, 0xe5, 0x2f, 0x12, 0x0c, 0x46, 0x78, 0x77, 0xe6, 0x70, 0x39, 0x12, 0x18, 0x98, 0x12, +0x19, 0x49, 0x90, 0x00, 0x08, 0x12, 0x0d, 0x46, 0xc3, 0x9f, 0xff, 0xe5, 0xf0, 0x9e, 0xfe, 0x12, +0x3a, 0x14, 0xaa, 0x06, 0xab, 0x07, 0x12, 0x17, 0xba, 0x74, 0x04, 0x93, 0xfe, 0x74, 0x05, 0x93, +0xff, 0x7c, 0x00, 0x7d, 0x03, 0x12, 0x0c, 0x68, 0xd3, 0xeb, 0x9f, 0xea, 0x9e, 0x40, 0x06, 0x78, +0x75, 0xe6, 0x44, 0x10, 0xf6, 0x05, 0x26, 0x74, 0x0a, 0x25, 0x2a, 0xf5, 0x2a, 0xe4, 0x35, 0x29, +0xf5, 0x29, 0x15, 0x27, 0xe5, 0x27, 0x60, 0x03, 0x02, 0x1b, 0x42, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, +0x89, 0x1d, 0xe4, 0xf5, 0x1e, 0xfe, 0x7f, 0x0c, 0xfd, 0x12, 0x0f, 0xeb, 0x7f, 0x06, 0x12, 0x08, +0xa1, 0x7e, 0x00, 0x7f, 0x06, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x08, 0xa7, 0x78, 0x7c, 0xe6, 0x14, +0x60, 0x26, 0x04, 0x60, 0x03, 0x02, 0x1e, 0x81, 0xe4, 0x78, 0x7b, 0xf6, 0xff, 0x12, 0x3a, 0x36, +0x12, 0x22, 0xbc, 0x78, 0x75, 0xe6, 0x30, 0xe4, 0x03, 0x02, 0x1e, 0x85, 0x7f, 0x5c, 0x12, 0x08, +0xa1, 0x78, 0x7c, 0x76, 0x01, 0x02, 0x1e, 0x79, 0x12, 0x22, 0xbc, 0x78, 0x75, 0xe6, 0xff, 0x30, +0xe4, 0x07, 0xe5, 0x4b, 0x70, 0x03, 0x02, 0x1e, 0x82, 0xef, 0x20, 0xe3, 0x03, 0x02, 0x1e, 0x25, +0x90, 0x00, 0x87, 0xe0, 0x30, 0xe1, 0x69, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x20, 0x12, 0x27, 0x4f, +0xef, 0x60, 0x5d, 0xe5, 0x20, 0x60, 0x59, 0xe4, 0xf5, 0x21, 0x90, 0x00, 0x87, 0x74, 0x02, 0xf0, +0x78, 0x05, 0x14, 0xf2, 0x85, 0x40, 0x82, 0x85, 0x3f, 0x83, 0xe4, 0x93, 0xff, 0xe5, 0x21, 0xd3, +0x9f, 0x50, 0x3d, 0x74, 0x01, 0x7e, 0x00, 0xa8, 0x21, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, +0xce, 0xd8, 0xf9, 0xff, 0xef, 0x55, 0x20, 0x60, 0x23, 0x12, 0x09, 0xa5, 0x74, 0x06, 0x93, 0xff, +0x74, 0x07, 0x93, 0x78, 0x01, 0xcf, 0xf2, 0x08, 0xef, 0xf2, 0x12, 0x09, 0xa5, 0x74, 0x08, 0x93, +0xff, 0x74, 0x09, 0x93, 0x08, 0xcf, 0xf2, 0x08, 0xef, 0xf2, 0x80, 0x04, 0x05, 0x21, 0x80, 0xb4, +0x90, 0x00, 0x87, 0xe0, 0x30, 0xe0, 0x54, 0x75, 0x25, 0x00, 0x75, 0x26, 0x00, 0x75, 0x27, 0x41, +0x75, 0x28, 0x00, 0x75, 0x29, 0x00, 0x75, 0x2a, 0x45, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x5d, 0x12, +0x26, 0x51, 0xe4, 0xf5, 0x1f, 0xe5, 0x1f, 0x12, 0x06, 0x85, 0xe6, 0xf4, 0x60, 0x1b, 0xe5, 0x1f, +0x12, 0x0a, 0xc1, 0xf9, 0xe4, 0xfa, 0x7b, 0xfe, 0xad, 0x1f, 0x12, 0x39, 0xfc, 0xe5, 0x1f, 0x75, +0xf0, 0x2e, 0xa4, 0x24, 0x05, 0xf8, 0x74, 0x01, 0xf2, 0x05, 0x1f, 0xe5, 0x1f, 0xc3, 0x94, 0x02, +0x40, 0xd3, 0x12, 0x28, 0x49, 0x90, 0x00, 0x87, 0x74, 0x01, 0xf0, 0x78, 0x75, 0xe6, 0x30, 0xe5, +0x04, 0x78, 0x7b, 0x76, 0x01, 0x90, 0x00, 0x87, 0xe0, 0xf5, 0x1e, 0x78, 0x79, 0x76, 0x01, 0xe4, +0xf5, 0x1f, 0xe5, 0x1f, 0xc3, 0x94, 0x02, 0x50, 0x19, 0x90, 0x00, 0x87, 0xe0, 0x30, 0xe0, 0x05, +0xaf, 0x1f, 0x12, 0x35, 0xf6, 0x12, 0x2d, 0xdb, 0x05, 0x1f, 0x78, 0x79, 0x74, 0x2e, 0x26, 0xf6, +0x80, 0xe0, 0xa8, 0x1d, 0xac, 0x1c, 0xad, 0x1b, 0x12, 0x07, 0x19, 0xe5, 0x1d, 0x24, 0x06, 0xf9, +0xe4, 0x35, 0x1c, 0xa8, 0x01, 0xfc, 0xad, 0x1b, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x07, 0x1d, 0x78, +0x0c, 0xe2, 0x70, 0x11, 0x78, 0x3a, 0xe2, 0x70, 0x0c, 0x90, 0x00, 0x87, 0x74, 0x03, 0xf0, 0x80, +0x04, 0xe4, 0x78, 0x7c, 0xf6, 0xaf, 0x1e, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, 0x89, 0x1d, 0x43, 0xad, +0x04, 0x90, 0xff, 0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x43, 0x95, 0x80, 0x90, 0xff, 0x41, 0x74, 0x37, +0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0xe4, 0xf5, 0x24, 0xf5, 0x24, 0x12, 0x32, 0xf0, 0xe5, +0x24, 0xc3, 0x9f, 0x50, 0x22, 0xe9, 0x24, 0x0c, 0xf9, 0xe4, 0x3a, 0x12, 0x32, 0xe1, 0xe4, 0xfd, +0x12, 0x34, 0x16, 0x12, 0x32, 0xd7, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x32, 0xd7, 0xe4, 0xfd, +0x12, 0x31, 0x4c, 0x05, 0x24, 0x80, 0xd5, 0x90, 0xff, 0x4a, 0xe4, 0xf0, 0x90, 0xff, 0x50, 0x74, +0x0f, 0xf0, 0x90, 0xff, 0x58, 0xe4, 0xf0, 0x90, 0xff, 0x40, 0x74, 0x08, 0xf0, 0x90, 0xff, 0x43, +0x74, 0x9f, 0xf0, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x12, 0x0b, 0xee, 0x90, 0xff, 0x48, 0xf0, +0x90, 0x00, 0x01, 0x12, 0x0c, 0x07, 0x90, 0xff, 0x42, 0xf0, 0x90, 0x00, 0x02, 0x12, 0x0c, 0x07, +0x90, 0xff, 0x55, 0xf0, 0x90, 0x00, 0x03, 0x12, 0x0c, 0x07, 0x90, 0xff, 0x54, 0xf0, 0x90, 0xff, +0x5c, 0xe4, 0xf0, 0xf5, 0x24, 0x12, 0x32, 0xf0, 0xe5, 0x24, 0xc3, 0x9f, 0x50, 0x5b, 0xe4, 0xf5, +0x25, 0x75, 0x26, 0x64, 0x90, 0xff, 0x50, 0xe0, 0x20, 0xe7, 0x03, 0x43, 0x25, 0x01, 0xe5, 0x25, +0x64, 0x01, 0x60, 0x03, 0xd5, 0x26, 0xed, 0x12, 0x32, 0xfe, 0x12, 0x32, 0xd7, 0x7d, 0x06, 0x12, +0x30, 0x65, 0x90, 0xff, 0x40, 0x74, 0x29, 0xf0, 0x90, 0xff, 0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x12, +0x32, 0xd7, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xab, +0x1e, 0xe5, 0x20, 0xf9, 0x24, 0x02, 0xf5, 0x20, 0xe5, 0x1f, 0xfa, 0x34, 0x00, 0xf5, 0x1f, 0xee, +0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x05, 0x24, 0x80, 0x9c, 0xe4, 0xf5, 0x24, 0x90, 0xff, 0x54, 0xf0, +0x75, 0x25, 0x01, 0xe4, 0xf5, 0x26, 0xf5, 0x27, 0x12, 0x33, 0x07, 0xf5, 0x83, 0x74, 0xff, 0x12, +0x32, 0xd4, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x90, 0xff, 0x55, 0x74, 0x64, 0xf0, 0xe4, 0xf5, 0x26, +0x00, 0x90, 0xff, 0x50, 0xe0, 0x30, 0xe7, 0x07, 0x05, 0x26, 0xe5, 0x26, 0xb4, 0xfa, 0xf1, 0xe5, +0x25, 0x24, 0x02, 0x90, 0xff, 0x55, 0xf0, 0xe4, 0xf5, 0x26, 0x00, 0x00, 0x05, 0x26, 0xe5, 0x26, +0xb4, 0xfa, 0xf7, 0xe4, 0xf5, 0x26, 0x90, 0xff, 0x50, 0xe0, 0x20, 0xe7, 0x09, 0x05, 0x27, 0xe5, +0x27, 0xd3, 0x94, 0x28, 0x50, 0x13, 0x05, 0x26, 0xe5, 0x26, 0xb4, 0x64, 0xe9, 0x12, 0x32, 0xfe, +0x05, 0x25, 0xe5, 0x25, 0xc3, 0x94, 0x64, 0x40, 0xc6, 0x12, 0x33, 0x07, 0x75, 0x83, 0x00, 0xe5, +0x25, 0x12, 0x32, 0xd4, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x32, 0xfe, 0x12, 0x32, 0xf0, 0x05, +0x24, 0xe5, 0x24, 0xc3, 0x9f, 0x50, 0x03, 0x02, 0x1f, 0x90, 0x90, 0xff, 0x50, 0xe4, 0xf0, 0xff, +0x22, 0x8e, 0x1b, 0x8f, 0x1c, 0xe4, 0x78, 0x74, 0xf6, 0x85, 0x1b, 0x51, 0x85, 0x1c, 0x52, 0xe5, +0x1c, 0x24, 0x2c, 0xff, 0xe4, 0x35, 0x1b, 0xfa, 0xa9, 0x07, 0x7b, 0xff, 0x78, 0x70, 0x7c, 0x00, +0x7d, 0x00, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0x78, 0x82, 0x74, 0x01, 0xf2, 0x08, 0x74, +0xcc, 0xf2, 0x12, 0x18, 0xd6, 0x7e, 0x00, 0xe5, 0x1c, 0x24, 0x06, 0xfd, 0xe4, 0x35, 0x1b, 0xfa, +0xa9, 0x05, 0x7b, 0xff, 0x18, 0xe2, 0xfc, 0x08, 0xe2, 0xf8, 0x7d, 0x01, 0x12, 0x0b, 0xc8, 0x90, +0x01, 0xa7, 0xe0, 0xff, 0x12, 0x2f, 0x9f, 0x90, 0x00, 0xb9, 0xe0, 0x64, 0x80, 0x70, 0x04, 0xa3, +0xe0, 0x64, 0x75, 0x70, 0x3d, 0xf5, 0x1e, 0x12, 0x18, 0xd6, 0xe5, 0x1e, 0xc3, 0x9f, 0x50, 0x32, +0xe4, 0xf5, 0x1f, 0x12, 0x18, 0xbf, 0xfd, 0x25, 0x1e, 0x12, 0x17, 0xcc, 0xe5, 0x1f, 0x90, 0x3a, +0x3f, 0x93, 0xfe, 0xef, 0x6e, 0x60, 0x0b, 0xe5, 0x1f, 0xc3, 0x94, 0x0f, 0x50, 0x04, 0x05, 0x1f, +0x80, 0xe1, 0xe5, 0x1f, 0x90, 0x3a, 0x4e, 0x93, 0xff, 0x12, 0x19, 0x03, 0xef, 0xf0, 0x05, 0x1e, +0x80, 0xc5, 0x90, 0x00, 0xb9, 0xe0, 0x64, 0x80, 0x70, 0x04, 0xa3, 0xe0, 0x64, 0x78, 0x70, 0x26, +0xf5, 0x1e, 0x12, 0x18, 0xd6, 0xe5, 0x1e, 0xc3, 0x9f, 0x50, 0x1b, 0x12, 0x18, 0xbf, 0xfd, 0x25, +0x1e, 0x12, 0x17, 0xcc, 0x64, 0x54, 0x60, 0x04, 0xef, 0xb4, 0x56, 0x06, 0x12, 0x19, 0x03, 0x74, +0x15, 0xf0, 0x05, 0x1e, 0x80, 0xdc, 0x7e, 0x00, 0x7d, 0x00, 0x12, 0x18, 0x9f, 0x78, 0x81, 0x74, +0x09, 0xf2, 0x78, 0x72, 0xe6, 0xff, 0x20, 0xe3, 0x06, 0x78, 0x81, 0xe2, 0x44, 0x04, 0xf2, 0xef, +0x20, 0xe2, 0x06, 0x78, 0x81, 0xe2, 0x44, 0x20, 0xf2, 0xe4, 0x78, 0x76, 0xf6, 0x43, 0x95, 0x80, +0x78, 0x72, 0xe6, 0x7f, 0x00, 0x30, 0xe1, 0x02, 0x7f, 0x40, 0xef, 0x44, 0x37, 0x90, 0xff, 0x41, +0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0x75, 0x1d, 0x11, 0xe5, 0x1d, 0xf4, 0x60, 0x0c, 0xe4, +0xfd, 0xaf, 0x1d, 0x12, 0x31, 0x4c, 0xe4, 0xfd, 0x12, 0x21, 0x60, 0x75, 0x1d, 0x16, 0xe5, 0x1d, +0xf4, 0x60, 0x0c, 0xe4, 0xfd, 0xaf, 0x1d, 0x12, 0x31, 0x4c, 0x7d, 0x01, 0x12, 0x21, 0x60, 0x22, +0xaf, 0x1d, 0x12, 0x34, 0x16, 0x7d, 0x08, 0xaf, 0x1d, 0x12, 0x30, 0x65, 0x7d, 0x07, 0xaf, 0x1d, +0x12, 0x30, 0x65, 0x22, 0x8f, 0x23, 0xef, 0x12, 0x06, 0x85, 0xe6, 0xff, 0x70, 0x04, 0xf5, 0x24, +0x80, 0x18, 0x78, 0x7a, 0xe6, 0xfe, 0x14, 0xb5, 0x07, 0x09, 0xee, 0x25, 0xe0, 0x24, 0xfa, 0xf5, +0x24, 0x80, 0x07, 0xef, 0x25, 0xe0, 0x24, 0xfe, 0xf5, 0x24, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x61, +0x12, 0x06, 0x32, 0xe5, 0x24, 0x12, 0x07, 0xa0, 0xfe, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x66, 0x12, +0x07, 0xa4, 0xfe, 0xe4, 0xfc, 0xfd, 0x78, 0x62, 0x12, 0x0f, 0x87, 0xe5, 0x24, 0x25, 0xe0, 0x24, +0x63, 0x12, 0x06, 0x32, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x60, 0x12, 0x07, 0xa4, 0xfe, 0xe5, 0x24, +0x25, 0xe0, 0x24, 0x68, 0x12, 0x07, 0xa4, 0xfe, 0xe4, 0xfc, 0xfd, 0x78, 0x66, 0x12, 0x0f, 0x87, +0x12, 0x05, 0xf0, 0x74, 0x07, 0x93, 0xfe, 0x74, 0x08, 0x78, 0x66, 0x12, 0x09, 0x4e, 0x12, 0x0e, +0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xf0, 0x78, 0x66, 0x12, 0x08, +0x15, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x0c, 0xc0, +0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xf0, 0x74, 0x05, 0x93, 0xfe, 0x74, 0x06, +0x78, 0x62, 0x12, 0x09, 0x4e, 0x12, 0x06, 0x77, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, +0xc3, 0xef, 0x9b, 0xff, 0xee, 0x9a, 0xfe, 0xed, 0x99, 0xfd, 0xec, 0x98, 0xfc, 0x78, 0x6a, 0x12, +0x0f, 0x87, 0x78, 0x6a, 0x12, 0x0f, 0x6e, 0xec, 0x33, 0x50, 0x0b, 0x78, 0x62, 0x12, 0x0f, 0x93, +0x00, 0x00, 0x00, 0x01, 0x80, 0x5b, 0x12, 0x0a, 0x6d, 0x7b, 0x02, 0x12, 0x07, 0x90, 0x12, 0x0e, +0xa2, 0x78, 0x6a, 0x12, 0x0f, 0x7a, 0x12, 0x07, 0x0c, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, +0x07, 0x12, 0x0a, 0x6d, 0x2f, 0xfb, 0xea, 0x3e, 0xfa, 0xe9, 0x3d, 0xf9, 0xe8, 0x3c, 0xf8, 0xd0, +0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, 0x12, 0x0e, 0xa2, 0x78, 0x62, 0x12, 0x0f, 0x87, 0x12, +0x05, 0xf0, 0x78, 0x62, 0x12, 0x08, 0x15, 0xd3, 0x12, 0x0f, 0x4a, 0x40, 0x14, 0x12, 0x05, 0xf0, +0x74, 0x02, 0x93, 0x24, 0xff, 0xff, 0x74, 0x01, 0x93, 0x12, 0x07, 0x34, 0x78, 0x62, 0x12, 0x0f, +0x87, 0x78, 0x62, 0x12, 0x0f, 0x6e, 0xe5, 0x23, 0x12, 0x07, 0xd7, 0x22, 0xe4, 0x78, 0x75, 0xf6, +0x18, 0xe6, 0x14, 0x70, 0x03, 0x02, 0x23, 0x4d, 0x14, 0x70, 0x03, 0x02, 0x23, 0xc7, 0x24, 0x02, +0x60, 0x03, 0x02, 0x23, 0xe9, 0x12, 0x17, 0xba, 0xe4, 0x93, 0x78, 0x78, 0xf6, 0x12, 0x31, 0xd4, +0x12, 0x30, 0x05, 0x78, 0x70, 0xe6, 0xf5, 0x23, 0x75, 0x24, 0x20, 0x76, 0x40, 0x7e, 0x00, 0x7f, +0x12, 0x7d, 0x20, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0xb5, 0x12, 0x0f, 0xeb, 0xe5, 0x24, 0xd3, 0x94, +0x01, 0x40, 0x42, 0x12, 0x23, 0xee, 0xe5, 0x22, 0xc3, 0x78, 0x78, 0x96, 0x50, 0x2f, 0x12, 0x17, +0xba, 0x74, 0x02, 0x93, 0x75, 0xf0, 0xa3, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x17, 0xd5, 0xe0, 0xfc, +0xa3, 0xe0, 0xc3, 0x9f, 0xec, 0x9e, 0x50, 0x08, 0x12, 0x18, 0xc6, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, +0x12, 0x18, 0xc6, 0xc3, 0x13, 0xfe, 0xef, 0x4e, 0xf0, 0x05, 0x22, 0x80, 0xc9, 0xe5, 0x24, 0xc3, +0x13, 0xf5, 0x24, 0x80, 0xb7, 0x78, 0x70, 0xa6, 0x23, 0x78, 0x74, 0x76, 0x01, 0x12, 0x17, 0xba, +0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x25, 0x74, 0x04, 0x93, 0x33, 0xf5, 0x24, 0xe4, 0x78, 0x77, +0xf6, 0xfe, 0xfd, 0x12, 0x18, 0x9f, 0x7e, 0x00, 0x7f, 0x24, 0x7d, 0x00, 0x7b, 0xfe, 0x7a, 0x00, +0x79, 0x5d, 0x12, 0x0f, 0xeb, 0x75, 0x23, 0x04, 0x12, 0x31, 0xd4, 0x12, 0x23, 0xee, 0xe5, 0x22, +0xc3, 0x78, 0x78, 0x96, 0x50, 0x3a, 0x12, 0x17, 0xd5, 0xe0, 0xfe, 0xa3, 0xe0, 0x78, 0x02, 0xce, +0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x12, 0x18, 0x7b, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0x05, +0x12, 0x18, 0x7b, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x09, +0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x05, 0x22, 0x80, 0xbe, +0xd5, 0x23, 0xb8, 0x78, 0x74, 0x76, 0x02, 0x12, 0x31, 0xd4, 0x12, 0x29, 0x1e, 0x78, 0x78, 0xe6, +0xfd, 0xe4, 0xff, 0x12, 0x2e, 0xc1, 0x78, 0x75, 0xe6, 0x30, 0xe1, 0x04, 0x78, 0x77, 0x76, 0x28, +0x78, 0x78, 0xe6, 0xfd, 0xe4, 0xff, 0x02, 0x1b, 0x25, 0xe4, 0x78, 0x74, 0xf6, 0x22, 0x12, 0x29, +0x1e, 0x12, 0x31, 0xd4, 0xe4, 0xf5, 0x22, 0x22, 0x8b, 0x1e, 0x8a, 0x1f, 0x89, 0x20, 0x43, 0xad, +0x04, 0x43, 0x95, 0x80, 0x90, 0xff, 0x41, 0x74, 0x80, 0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, +0xa3, 0xe4, 0xf0, 0x90, 0xff, 0x42, 0x04, 0xf0, 0x90, 0xff, 0x55, 0x74, 0x7d, 0xf0, 0x90, 0xff, +0x54, 0xe4, 0xf0, 0x90, 0xff, 0x5c, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x10, 0xf0, 0xe4, 0xf5, 0x25, +0xf5, 0x26, 0xf5, 0x27, 0xf5, 0x28, 0xf5, 0x24, 0xe4, 0x12, 0x35, 0x33, 0xf4, 0x60, 0x0d, 0xe4, +0xfd, 0x12, 0x31, 0x4c, 0x12, 0x35, 0x3b, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, +0x60, 0x0d, 0xe4, 0xfd, 0x12, 0x31, 0x4c, 0x12, 0x35, 0x25, 0x7d, 0x08, 0x12, 0x30, 0x65, 0xe4, +0xff, 0x00, 0x0f, 0xbf, 0xc8, 0xfb, 0x74, 0x03, 0x12, 0x35, 0x33, 0xf4, 0x60, 0x0d, 0xe4, 0xfd, +0x12, 0x34, 0x16, 0x12, 0x35, 0x3b, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, 0x60, +0x0d, 0x7d, 0x01, 0x12, 0x34, 0x16, 0x12, 0x35, 0x25, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x90, 0xff, +0x43, 0x74, 0x9f, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x07, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0x90, 0xff, +0x40, 0x74, 0x09, 0xf0, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x90, 0xff, 0x43, 0xe0, +0x30, 0xe4, 0xf9, 0x90, 0xff, 0x43, 0x74, 0x9f, 0xf0, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, +0x25, 0x26, 0xf5, 0x26, 0xee, 0x35, 0x25, 0xf5, 0x25, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, +0x25, 0x28, 0xf5, 0x28, 0xee, 0x35, 0x27, 0xf5, 0x27, 0x05, 0x24, 0xe5, 0x24, 0xc3, 0x94, 0x04, +0x50, 0x03, 0x02, 0x24, 0x38, 0xe5, 0x26, 0xae, 0x25, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, +0xd8, 0xf9, 0xff, 0xab, 0x21, 0xaa, 0x22, 0xa9, 0x23, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0xe5, +0x28, 0xae, 0x27, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0xab, 0x21, 0xaa, +0x22, 0xa9, 0x23, 0x90, 0x00, 0x02, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xea, 0x12, 0x35, 0x3b, 0xf4, +0x60, 0x05, 0xe4, 0xfd, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, 0x60, 0x05, 0xe4, 0xfd, 0x12, +0x30, 0x65, 0x22, 0x15, 0x0f, 0x15, 0x0f, 0x15, 0x0f, 0xa8, 0x0f, 0xa6, 0x03, 0x08, 0xa6, 0x02, +0x08, 0xa6, 0x01, 0x15, 0x0f, 0x12, 0x19, 0x0d, 0x78, 0x73, 0xe6, 0x7f, 0x08, 0x30, 0xe0, 0x02, +0x7f, 0x05, 0xa8, 0x0f, 0xa6, 0x07, 0x12, 0x17, 0xc1, 0x12, 0x18, 0x6c, 0x12, 0x0f, 0xbc, 0x78, +0x73, 0xe6, 0x64, 0x03, 0x78, 0x6e, 0x60, 0x08, 0x12, 0x17, 0xc3, 0x12, 0x18, 0x6c, 0x80, 0x0a, +0x12, 0x17, 0xc3, 0xa8, 0x0f, 0x12, 0x18, 0x70, 0x7d, 0x08, 0x12, 0x0f, 0xbc, 0x12, 0x18, 0xe0, +0xff, 0x78, 0x6f, 0xe6, 0x12, 0x18, 0x46, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x18, 0xe8, 0xff, +0x18, 0xe6, 0x12, 0x18, 0x46, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x02, 0x00, 0xe0, 0x60, 0x2e, +0x08, 0xe6, 0xff, 0x12, 0x17, 0xd7, 0x12, 0x18, 0x40, 0x12, 0x26, 0x43, 0x12, 0x17, 0xba, 0x12, +0x18, 0xf0, 0x40, 0x1a, 0x78, 0x6e, 0xe6, 0xff, 0x12, 0x17, 0xd7, 0x12, 0x18, 0x40, 0x12, 0x26, +0x43, 0x12, 0x17, 0xba, 0x12, 0x18, 0xf0, 0x40, 0x05, 0xe4, 0x90, 0x02, 0x00, 0xf0, 0x90, 0x02, +0x00, 0xe0, 0x70, 0x1b, 0x78, 0x6f, 0x06, 0x06, 0x18, 0x06, 0x06, 0x78, 0x76, 0x16, 0x78, 0x72, +0xe6, 0x7f, 0x00, 0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, 0x02, 0x00, 0xef, 0xf0, 0x80, 0x05, 0xe4, +0x90, 0x02, 0x00, 0xf0, 0x78, 0x76, 0xe6, 0x70, 0x0a, 0x90, 0xff, 0x50, 0xf0, 0x90, 0xff, 0x58, +0xf0, 0x80, 0x39, 0x12, 0x17, 0xe5, 0xa8, 0x0f, 0x76, 0x64, 0x90, 0xff, 0x58, 0xe0, 0xff, 0x90, +0xff, 0x50, 0xe0, 0x4f, 0x30, 0xe7, 0x06, 0xa8, 0x0f, 0x16, 0xe6, 0x70, 0xed, 0x12, 0x17, 0xc1, +0xa8, 0x0f, 0x12, 0x18, 0x70, 0x7d, 0x06, 0x12, 0x0f, 0xbc, 0x78, 0x6e, 0x12, 0x17, 0xc3, 0xa8, +0x0f, 0x12, 0x18, 0x70, 0x7d, 0x06, 0x12, 0x0f, 0xbc, 0x12, 0x19, 0x14, 0xe5, 0x0f, 0x24, 0x04, +0xf5, 0x0f, 0x22, 0xe0, 0xfe, 0xa3, 0xe0, 0xc3, 0x9d, 0xff, 0xee, 0x9c, 0xfe, 0x12, 0x3a, 0x14, +0x22, 0x8b, 0x22, 0x8a, 0x23, 0x89, 0x24, 0x12, 0x2c, 0x4e, 0x12, 0x2c, 0xd5, 0x12, 0x32, 0x95, +0x74, 0x79, 0x93, 0xf5, 0x2b, 0xe4, 0xf5, 0x2c, 0x12, 0x32, 0xcd, 0x12, 0x0b, 0xee, 0x70, 0x21, +0x12, 0x32, 0x95, 0x74, 0x98, 0x93, 0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x7f, 0x00, 0x50, +0x02, 0x7f, 0x01, 0x12, 0x27, 0x17, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0x7e, 0x75, 0x2c, 0x03, 0x80, +0x3a, 0x12, 0x32, 0xcd, 0x12, 0x0b, 0xee, 0xff, 0xe5, 0x2b, 0x14, 0x6f, 0x70, 0x2d, 0x12, 0x32, +0x95, 0x74, 0x99, 0x93, 0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0xe5, 0x2b, 0x50, 0x06, 0x25, +0xe0, 0x14, 0xff, 0x80, 0x05, 0x25, 0xe0, 0x24, 0xfe, 0xff, 0x12, 0x27, 0x17, 0xee, 0x8f, 0xf0, +0x12, 0x0d, 0x7e, 0xe5, 0x2b, 0x25, 0xe0, 0x24, 0xfd, 0xf5, 0x2c, 0xe5, 0x2c, 0x60, 0x47, 0x24, +0xff, 0xff, 0xe4, 0x34, 0xff, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xab, 0x22, 0xaa, 0x23, +0xa9, 0x24, 0x8f, 0x82, 0xf5, 0x83, 0x12, 0x0d, 0x46, 0xff, 0xae, 0xf0, 0x75, 0xf0, 0x02, 0xe5, +0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x12, 0x0d, 0x46, 0x2f, 0xff, 0xee, 0x35, 0xf0, 0xfe, +0x12, 0x32, 0x95, 0xd3, 0x74, 0x9b, 0x93, 0x9f, 0x74, 0x9a, 0x93, 0x9e, 0x40, 0x08, 0x12, 0x32, +0xcd, 0x74, 0xff, 0x12, 0x0c, 0x34, 0x22, 0x8f, 0x2c, 0xaf, 0x2d, 0xef, 0x33, 0x95, 0xe0, 0xfe, +0x12, 0x3a, 0x14, 0xab, 0x22, 0xaa, 0x23, 0xa9, 0x24, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, +0x82, 0x85, 0xf0, 0x83, 0x12, 0x0d, 0x46, 0xfd, 0xac, 0xf0, 0xcf, 0xcd, 0xcf, 0xce, 0xcc, 0xce, +0x12, 0x0c, 0x7a, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x22, 0x8b, +0x22, 0x8a, 0x23, 0x89, 0x24, 0xe4, 0xf5, 0x27, 0xf5, 0x0a, 0xf5, 0x25, 0xf5, 0x26, 0xf5, 0x27, +0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0xe4, 0x93, 0xff, 0xe5, 0x25, 0xc3, 0x9f, 0x40, 0x03, 0x02, +0x28, 0x16, 0x12, 0x00, 0x18, 0x74, 0x01, 0x93, 0xf5, 0x28, 0x12, 0x00, 0x12, 0x74, 0x02, 0x93, +0xf5, 0x29, 0x12, 0x00, 0x12, 0x74, 0x04, 0x93, 0xfc, 0x74, 0x05, 0x93, 0xfd, 0xe5, 0x28, 0x25, +0xe0, 0x24, 0x5d, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0xd3, 0x9d, 0xee, 0x9c, 0x40, 0x72, 0x7c, +0x00, 0x7d, 0x05, 0x12, 0x0c, 0x68, 0xe5, 0x29, 0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x24, 0x01, +0xfd, 0x18, 0xe2, 0x34, 0x00, 0xfc, 0x12, 0x0c, 0x7a, 0x8e, 0x2a, 0x8f, 0x2b, 0x12, 0x00, 0x12, +0x74, 0x03, 0x93, 0x30, 0xe7, 0x2b, 0x54, 0x7f, 0xc3, 0x95, 0x2b, 0xff, 0xe4, 0x95, 0x2a, 0xfe, +0x12, 0x3a, 0x14, 0xc3, 0x74, 0x03, 0x9f, 0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x2e, +0xaf, 0x25, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x80, +0x1d, 0x12, 0x00, 0x12, 0x74, 0x03, 0x93, 0xc3, 0x95, 0x2b, 0xe4, 0x95, 0x2a, 0x50, 0x0f, 0xaf, +0x25, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x75, 0x27, +0x01, 0x05, 0x25, 0x02, 0x27, 0x60, 0xe5, 0x26, 0x65, 0x0e, 0x60, 0x08, 0x85, 0x26, 0x0e, 0xe4, +0xf5, 0x0b, 0x80, 0x17, 0x85, 0x0d, 0x82, 0x85, 0x0c, 0x83, 0x74, 0x1e, 0x93, 0xff, 0x05, 0x0b, +0xe5, 0x0b, 0xc3, 0x9f, 0x40, 0x05, 0x15, 0x0b, 0x85, 0x26, 0x0a, 0xab, 0x22, 0xaa, 0x23, 0xa9, +0x24, 0xe5, 0x0a, 0x12, 0x0c, 0x34, 0xaf, 0x27, 0x22, 0xe4, 0xf5, 0x22, 0xf5, 0x23, 0xff, 0xfe, +0x78, 0x33, 0xe2, 0x25, 0xe0, 0xfd, 0x78, 0x05, 0xe2, 0x2d, 0xfd, 0x78, 0x0b, 0xe2, 0xc4, 0x54, +0xf0, 0x2d, 0xfd, 0x78, 0x39, 0xe2, 0xfc, 0xc4, 0x33, 0x54, 0xe0, 0x2d, 0x24, 0xfe, 0x60, 0x1c, +0x24, 0xf0, 0x60, 0x18, 0x14, 0x60, 0x1d, 0x24, 0xf2, 0x60, 0x11, 0x24, 0xfe, 0x60, 0x25, 0x24, +0xf0, 0x60, 0x35, 0x24, 0x02, 0x70, 0x66, 0xe4, 0xfd, 0xff, 0x80, 0x1c, 0x75, 0x22, 0x00, 0x75, +0x23, 0x01, 0x80, 0x59, 0xe4, 0xfd, 0xff, 0x12, 0x31, 0x06, 0x8e, 0x22, 0x8f, 0x23, 0xe4, 0xfd, +0x7f, 0x01, 0x80, 0x0f, 0x7d, 0x01, 0x7f, 0x01, 0x12, 0x31, 0x06, 0x8e, 0x22, 0x8f, 0x23, 0x7d, +0x01, 0xe4, 0xff, 0x12, 0x31, 0x06, 0x80, 0x35, 0x7d, 0x01, 0x7f, 0x01, 0x12, 0x31, 0x06, 0xc0, +0x06, 0xc0, 0x07, 0xe4, 0xfd, 0xff, 0x12, 0x31, 0x06, 0xd0, 0xe0, 0x2f, 0xf5, 0x23, 0xd0, 0xe0, +0x3e, 0xf5, 0x22, 0xe4, 0xfd, 0x7f, 0x01, 0x12, 0x31, 0x06, 0xc0, 0x06, 0xc0, 0x07, 0x7d, 0x01, +0xe4, 0xff, 0x12, 0x31, 0x06, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0xd3, 0xe5, 0x23, +0x9f, 0xe5, 0x22, 0x9e, 0x40, 0x27, 0x78, 0x24, 0x7c, 0x00, 0x7d, 0x00, 0x12, 0x07, 0x19, 0x78, +0x01, 0x7c, 0x00, 0x7d, 0xfe, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x07, 0x1f, 0x78, 0x2f, +0x7c, 0x00, 0x7d, 0xfe, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x24, 0x12, 0x07, 0x1f, 0x22, 0x12, 0x30, +0x05, 0x90, 0xff, 0x4a, 0x74, 0x71, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, 0xff, 0x58, +0xf0, 0x90, 0xff, 0x40, 0xe4, 0xf0, 0x12, 0x19, 0x0d, 0xe4, 0x12, 0x18, 0xfa, 0x78, 0x71, 0xe6, +0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, 0x55, 0x74, 0x28, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x02, 0xf0, +0x43, 0xad, 0x04, 0x12, 0x19, 0x14, 0x90, 0xff, 0x43, 0xe0, 0x20, 0xe4, 0x05, 0x12, 0x34, 0xe3, +0x80, 0xf4, 0x12, 0x19, 0x0d, 0xe4, 0x78, 0x6f, 0xf6, 0x18, 0x76, 0x01, 0x78, 0x78, 0xe6, 0xc3, +0x13, 0x78, 0x76, 0xf6, 0x78, 0x71, 0xe6, 0x90, 0xff, 0x42, 0xf0, 0x18, 0xe6, 0x90, 0xff, 0x48, +0xf0, 0xe5, 0x4b, 0x60, 0x06, 0x90, 0xff, 0x42, 0xe5, 0x4c, 0xf0, 0x78, 0x72, 0xe6, 0x7f, 0x00, +0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, 0x02, 0x00, 0xef, 0xf0, 0x12, 0x17, 0xe5, 0x08, 0x12, 0x17, +0xc3, 0x7d, 0x06, 0x12, 0x30, 0x65, 0x78, 0x6e, 0x12, 0x17, 0xc3, 0x7d, 0x06, 0x12, 0x30, 0x65, +0x78, 0x81, 0xe2, 0xff, 0x90, 0xff, 0x40, 0xf0, 0x78, 0x72, 0xe6, 0x30, 0xe7, 0x26, 0x43, 0xad, +0x04, 0xef, 0xf0, 0x90, 0xff, 0x43, 0xe0, 0x20, 0xe4, 0x05, 0x12, 0x34, 0xe3, 0x80, 0xf4, 0x7b, +0xff, 0x7a, 0x30, 0x79, 0x65, 0x12, 0x25, 0x33, 0x12, 0x18, 0x64, 0xf0, 0x78, 0x76, 0xe6, 0x70, +0xe2, 0x02, 0x31, 0xd4, 0x53, 0xad, 0xfb, 0x12, 0x19, 0x14, 0x22, 0x78, 0xff, 0xe4, 0xf6, 0xd8, 0xfd, 0x90, 0x00, 0x00, 0x7f, 0x00, 0x7e, 0x03, 0xe4, 0xf0, 0xa3, 0xdf, 0xfc, 0xde, 0xfa, 0x75, -0x81, 0x79, 0x75, 0xa0, 0x00, 0x02, 0x2d, 0x73, 0x02, 0x35, 0x40, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, +0x81, 0x83, 0x75, 0xa0, 0x00, 0x02, 0x2a, 0x43, 0x02, 0x33, 0x11, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, -0x20, 0x40, 0x80, 0x90, 0x3b, 0x4d, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, +0x20, 0x40, 0x80, 0x90, 0x3a, 0x31, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0x90, 0x36, 0x0a, 0xe4, 0x93, 0x70, 0x05, 0x43, 0x90, 0x10, 0x80, 0x03, 0x53, 0x90, 0xef, 0x90, 0x36, 0x0c, 0xe4, 0x93, 0xff, 0x7c, 0x01, 0x7d, -0x00, 0x12, 0x35, 0x01, 0x90, 0x36, 0x0d, 0xe4, 0x93, 0xb4, 0x01, 0x07, 0x90, 0xff, 0x10, 0xe0, +0x00, 0x12, 0x32, 0x56, 0x90, 0x36, 0x0d, 0xe4, 0x93, 0xb4, 0x01, 0x07, 0x90, 0xff, 0x10, 0xe0, 0x44, 0x18, 0xf0, 0x7e, 0x01, 0x7f, 0x00, 0x7d, 0x00, 0x7b, 0x01, 0x7a, 0x01, 0x79, 0x00, 0x12, -0x10, 0x98, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x34, 0x39, 0x7d, 0x03, 0x7f, 0x12, 0x12, 0x32, 0x1e, +0x0f, 0xeb, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0x7d, 0x03, 0x7f, 0x12, 0x12, 0x30, 0x65, 0x90, 0xff, 0x1b, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0xff, 0x14, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x36, 0x09, 0xe4, 0x93, 0x90, 0x01, 0xfa, 0xf0, 0x90, 0x36, 0x07, 0xe4, 0x93, 0x90, 0x01, 0xea, 0xf0, 0x90, 0x36, 0x11, 0xe4, 0x93, 0x90, 0x01, 0xed, 0xf0, 0x78, 0xa7, 0x7c, 0x01, 0x7d, 0x01, 0x7b, -0xff, 0x7a, 0x36, 0x79, 0x00, 0x7e, 0x00, 0x7f, 0x03, 0x12, 0x0c, 0x68, 0xe4, 0x90, 0x01, 0xec, -0xf0, 0x90, 0x01, 0xfe, 0x04, 0xf0, 0xe4, 0x78, 0x78, 0xf6, 0x90, 0x00, 0xca, 0xf0, 0xa3, 0xf0, -0x22, 0x8f, 0x1c, 0x8c, 0x1d, 0x8d, 0x1e, 0xe4, 0xff, 0x79, 0x01, 0xe4, 0xf5, 0x1f, 0xfe, 0x12, -0x3b, 0x0c, 0xe5, 0x82, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, 0xe4, 0x93, 0x25, 0xe0, -0x25, 0x1c, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, 0x12, 0x3b, 0x0c, 0x74, 0x04, 0x93, 0xfa, 0x74, -0x05, 0x93, 0xfb, 0xc3, 0xed, 0x9b, 0xec, 0x9a, 0x40, 0x02, 0x05, 0x1f, 0x0e, 0xbe, 0x04, 0xcf, -0x12, 0x3b, 0x0c, 0x74, 0x06, 0x93, 0xfd, 0xe5, 0x1f, 0xc3, 0x9d, 0x50, 0x04, 0xe4, 0xf9, 0x80, -0x04, 0x0f, 0xbf, 0x05, 0xb6, 0x90, 0x00, 0xcd, 0xe0, 0xb5, 0x01, 0x07, 0xe4, 0x90, 0x00, 0xcc, -0xf0, 0x80, 0x28, 0x90, 0x00, 0xcc, 0xe0, 0x04, 0xf0, 0x85, 0x1e, 0x82, 0x85, 0x1d, 0x83, 0x74, -0x23, 0x93, 0xff, 0x90, 0x00, 0xcc, 0xe0, 0xfd, 0x33, 0x95, 0xe0, 0xfc, 0xd3, 0xed, 0x9f, 0x74, -0x80, 0xf8, 0x6c, 0x98, 0x40, 0x05, 0xe4, 0xf0, 0xa3, 0xe9, 0xf0, 0x90, 0x00, 0xcd, 0xe0, 0x7f, -0x00, 0x60, 0x02, 0x7f, 0xaa, 0x22, 0xe4, 0x78, 0x54, 0xf6, 0x08, 0xf6, 0xfe, 0xfd, 0x12, 0x01, -0xb8, 0x12, 0x02, 0xe5, 0xe4, 0xf9, 0xf5, 0x30, 0xf5, 0x2e, 0x75, 0x2f, 0xff, 0x78, 0x6c, 0xe6, -0xff, 0xe9, 0xc3, 0x9f, 0x50, 0x5b, 0xe9, 0x12, 0x00, 0xed, 0xe9, 0x25, 0xe0, 0x25, 0xe0, 0x24, -0x60, 0xf8, 0xe2, 0x2f, 0xf5, 0x32, 0x18, 0xe2, 0x3e, 0xf5, 0x31, 0x12, 0x03, 0x55, 0x78, 0x54, -0xe6, 0xfc, 0x08, 0xe6, 0xfd, 0xef, 0x2d, 0xfb, 0xee, 0x3c, 0xfa, 0xd3, 0xe5, 0x32, 0x9b, 0xe5, -0x31, 0x9a, 0x40, 0x06, 0x75, 0x30, 0x01, 0x18, 0x80, 0x1d, 0xe5, 0x32, 0x2f, 0xff, 0xe5, 0x31, -0x3e, 0xfe, 0xd3, 0xed, 0x9f, 0xec, 0x9e, 0x40, 0x15, 0xe5, 0x30, 0x60, 0x08, 0xe4, 0xf5, 0x30, -0x12, 0x33, 0x63, 0x05, 0x2e, 0x78, 0x54, 0xa6, 0x31, 0x08, 0xa6, 0x32, 0x89, 0x2f, 0x09, 0x80, -0x9c, 0xe5, 0x30, 0x60, 0x03, 0x12, 0x33, 0x63, 0x22, 0xe4, 0xfb, 0x12, 0x03, 0x71, 0xfa, 0xf4, -0x60, 0x62, 0xea, 0x70, 0x0c, 0x12, 0x00, 0x60, 0x74, 0x11, 0x93, 0xf5, 0x2e, 0x74, 0x12, 0x80, -0x1d, 0x78, 0x6c, 0xe6, 0x14, 0xb5, 0x02, 0x0c, 0x12, 0x00, 0x60, 0x74, 0x13, 0x93, 0xf5, 0x2e, -0x74, 0x14, 0x80, 0x0a, 0x12, 0x00, 0x60, 0x74, 0x0f, 0x93, 0xf5, 0x2e, 0x74, 0x10, 0x93, 0xf5, -0x2f, 0x78, 0x0d, 0xe2, 0x70, 0x05, 0x78, 0x3c, 0xe2, 0x60, 0x0e, 0xe5, 0x2f, 0x25, 0xe0, 0xff, -0xe5, 0x2e, 0x12, 0x05, 0xde, 0x8e, 0x2e, 0x8f, 0x2f, 0xea, 0x12, 0x00, 0xed, 0xea, 0x25, 0xe0, -0x12, 0x02, 0xd8, 0xc3, 0xef, 0x95, 0x2f, 0xee, 0x95, 0x2e, 0x50, 0x08, 0xeb, 0x25, 0xe0, 0x24, -0x6d, 0xf8, 0x76, 0xff, 0x0b, 0xeb, 0x64, 0x02, 0x70, 0x91, 0x78, 0x6d, 0xe6, 0xb4, 0xff, 0x0a, -0x78, 0x6f, 0xe6, 0xff, 0xf4, 0x60, 0x03, 0x12, 0x01, 0x97, 0x22, 0xef, 0x54, 0x07, 0xfe, 0x74, +0xff, 0x7a, 0x36, 0x79, 0x00, 0x7e, 0x00, 0x7f, 0x03, 0x12, 0x0b, 0xc8, 0xe4, 0x90, 0x01, 0xec, +0xf0, 0x90, 0x01, 0xfe, 0x04, 0xf0, 0xe4, 0x78, 0x82, 0xf6, 0x90, 0x00, 0xc2, 0xf0, 0xa3, 0xf0, +0x22, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, 0x26, 0xe5, 0x25, 0xfa, 0x34, 0x00, 0xf5, +0x25, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x90, 0x00, 0x02, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, +0x12, 0x0d, 0x46, 0xff, 0xae, 0xf0, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, 0x26, 0xe5, +0x25, 0xfa, 0x34, 0x00, 0xf5, 0x25, 0xee, 0x8f, 0xf0, 0x02, 0x0d, 0xcb, 0x90, 0x00, 0x05, 0xab, +0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x02, 0x0c, 0x07, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, +0x26, 0xe5, 0x25, 0xfa, 0x34, 0x00, 0xf5, 0x25, 0xe4, 0xf5, 0xf0, 0x02, 0x0d, 0xcb, 0xab, 0x1b, +0xaa, 0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x0b, 0x02, 0x0c, 0x07, 0xe5, 0x1e, 0xfe, 0x7c, 0x00, 0xe4, +0x25, 0x21, 0xff, 0xec, 0x3e, 0xfe, 0x22, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x22, 0x75, 0x24, +0x01, 0x85, 0x22, 0x25, 0x85, 0x23, 0x26, 0x22, 0xab, 0x24, 0xaa, 0x25, 0xa9, 0x26, 0x22, 0x8d, +0x82, 0x8c, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0x8f, 0x1b, 0x8c, 0x1c, 0x8d, 0x1d, 0xe4, +0xff, 0x79, 0x01, 0xe4, 0xf5, 0x1e, 0xfe, 0x12, 0x39, 0xef, 0xe5, 0x82, 0x2e, 0xf5, 0x82, 0xe4, +0x35, 0x83, 0xf5, 0x83, 0xe4, 0x93, 0x25, 0xe0, 0x25, 0x1b, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, +0x12, 0x39, 0xef, 0x74, 0x04, 0x93, 0xfa, 0x74, 0x05, 0x93, 0xfb, 0xc3, 0xed, 0x9b, 0xec, 0x9a, +0x40, 0x02, 0x05, 0x1e, 0x0e, 0xbe, 0x04, 0xcf, 0x12, 0x39, 0xef, 0x74, 0x06, 0x93, 0xfd, 0xe5, +0x1e, 0xc3, 0x9d, 0x50, 0x04, 0xe4, 0xf9, 0x80, 0x04, 0x0f, 0xbf, 0x05, 0xb6, 0x90, 0x00, 0xc5, +0xe0, 0xb5, 0x01, 0x07, 0xe4, 0x90, 0x00, 0xc4, 0xf0, 0x80, 0x28, 0x90, 0x00, 0xc4, 0xe0, 0x04, +0xf0, 0x85, 0x1d, 0x82, 0x85, 0x1c, 0x83, 0x74, 0x23, 0x93, 0xff, 0x90, 0x00, 0xc4, 0xe0, 0xfd, +0x33, 0x95, 0xe0, 0xfc, 0xd3, 0xed, 0x9f, 0x74, 0x80, 0xf8, 0x6c, 0x98, 0x40, 0x05, 0xe4, 0xf0, +0xa3, 0xe9, 0xf0, 0x90, 0x00, 0xc5, 0xe0, 0x7f, 0x00, 0x60, 0x02, 0x7f, 0xaa, 0x22, 0xe4, 0x78, +0x62, 0xf6, 0x08, 0xf6, 0xfe, 0xfb, 0x12, 0x08, 0x00, 0xf9, 0xf5, 0x30, 0xf5, 0x2e, 0x75, 0x2f, +0xff, 0x78, 0x7a, 0xe6, 0xff, 0xe9, 0xc3, 0x9f, 0x50, 0x63, 0xe9, 0x12, 0x06, 0x2c, 0xe9, 0x25, +0xe0, 0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x2f, 0xf5, 0x32, 0x18, 0xe2, 0x3e, 0xf5, 0x31, 0x12, +0x09, 0x97, 0x74, 0x04, 0x93, 0xfe, 0x74, 0x05, 0x93, 0xff, 0x78, 0x62, 0xe6, 0xfc, 0x08, 0xe6, +0xfd, 0xef, 0x2d, 0xfb, 0xee, 0x3c, 0xfa, 0xd3, 0xe5, 0x32, 0x9b, 0xe5, 0x31, 0x9a, 0x40, 0x06, +0x75, 0x30, 0x01, 0x18, 0x80, 0x1d, 0xe5, 0x32, 0x2f, 0xff, 0xe5, 0x31, 0x3e, 0xfe, 0xd3, 0xed, +0x9f, 0xec, 0x9e, 0x40, 0x15, 0xe5, 0x30, 0x60, 0x08, 0xe4, 0xf5, 0x30, 0x12, 0x32, 0x15, 0x05, +0x2e, 0x78, 0x62, 0xa6, 0x31, 0x08, 0xa6, 0x32, 0x89, 0x2f, 0x09, 0x80, 0x94, 0xe5, 0x30, 0x60, +0x03, 0x12, 0x32, 0x15, 0x22, 0xe4, 0xfb, 0xeb, 0x12, 0x06, 0x85, 0xe6, 0xfa, 0xf4, 0x60, 0x67, +0xea, 0x70, 0x0c, 0x12, 0x05, 0xf0, 0x74, 0x11, 0x93, 0xf5, 0x2e, 0x74, 0x12, 0x80, 0x1d, 0x78, +0x7a, 0xe6, 0x14, 0xb5, 0x02, 0x0c, 0x12, 0x05, 0xf0, 0x74, 0x13, 0x93, 0xf5, 0x2e, 0x74, 0x14, +0x80, 0x0a, 0x12, 0x05, 0xf0, 0x74, 0x0f, 0x93, 0xf5, 0x2e, 0x74, 0x10, 0x93, 0xf5, 0x2f, 0x78, +0x0c, 0xe2, 0x70, 0x05, 0x78, 0x3a, 0xe2, 0x60, 0x14, 0xe5, 0x2f, 0x25, 0xe0, 0xff, 0xe5, 0x2e, +0x33, 0xfe, 0x7c, 0x00, 0x7d, 0x03, 0x12, 0x0c, 0x7a, 0x8e, 0x2e, 0x8f, 0x2f, 0xea, 0x12, 0x06, +0x2c, 0xea, 0x25, 0xe0, 0x12, 0x07, 0xa0, 0xfe, 0xc3, 0xef, 0x95, 0x2f, 0xee, 0x95, 0x2e, 0x50, +0x06, 0xeb, 0x12, 0x06, 0x85, 0x76, 0xff, 0x0b, 0xeb, 0x64, 0x02, 0x70, 0x8a, 0xe5, 0x41, 0xb4, +0xff, 0x08, 0xe5, 0x45, 0xf4, 0x60, 0x03, 0x12, 0x07, 0x3b, 0x22, 0xef, 0x54, 0x07, 0xfe, 0x74, 0x01, 0xa8, 0x06, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf9, 0xf4, 0xfe, 0xef, 0x54, 0xf0, 0xf5, 0x3e, 0x64, 0x10, 0x70, 0x1e, 0xbd, 0x08, 0x02, 0x7d, 0x02, 0x90, 0xff, 0x12, 0xed, 0x30, 0xe2, 0x05, 0xe0, 0x49, 0xf0, 0x80, 0x03, 0xe0, 0x5e, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x14, @@ -782,193 +740,233 @@ app_bin_816d = [ 0xf5, 0x83, 0x8b, 0x82, 0xed, 0x24, 0xfb, 0x60, 0x14, 0x14, 0x60, 0x20, 0x24, 0xfe, 0x70, 0x2a, 0xe0, 0x5e, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x1e, 0x15, 0x83, 0x80, 0x1a, 0xe0, 0x5e, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x49, 0xf0, 0x22, 0xe0, 0x49, 0xf0, 0xe5, -0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x5e, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, -0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x10, 0x78, 0x45, 0xa6, 0xa3, 0x08, 0xa6, 0xa6, 0x75, 0xa3, 0x08, -0xe6, 0xff, 0x30, 0xe4, 0x07, 0x75, 0xd1, 0xdf, 0x78, 0x77, 0x76, 0x00, 0x78, 0x45, 0xe6, 0x30, -0xe0, 0x40, 0xef, 0x20, 0xe0, 0x39, 0x78, 0x77, 0xe6, 0xff, 0x70, 0x18, 0x90, 0x02, 0xf8, 0xe0, -0xfe, 0xf5, 0xd6, 0x18, 0xee, 0xf6, 0xc3, 0x94, 0x10, 0x50, 0x24, 0x78, 0x78, 0xe6, 0x25, 0xd6, -0xf5, 0xd6, 0x80, 0x1b, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xff, -0x78, 0x76, 0xe6, 0x06, 0x25, 0x0e, 0xf5, 0x82, 0xe4, 0x35, 0x0d, 0xf5, 0x83, 0xef, 0xf0, 0x78, -0x77, 0x06, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xab, 0x07, 0xaa, 0x05, 0xe4, -0x78, 0x67, 0xf6, 0xeb, 0x12, 0x17, 0xae, 0xe0, 0xf5, 0x29, 0xa3, 0xe0, 0xf5, 0x2a, 0x78, 0x62, -0xe6, 0x75, 0x27, 0x00, 0xf5, 0x28, 0xae, 0x27, 0xff, 0x7c, 0x00, 0x7d, 0xfc, 0x12, 0x0d, 0x08, -0xd3, 0xe5, 0x2a, 0x9f, 0xe5, 0x29, 0x9e, 0x40, 0x06, 0x78, 0x67, 0xe6, 0x44, 0x20, 0xf6, 0x12, -0x17, 0x92, 0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x2a, 0x74, 0x04, 0x93, 0x33, 0xf5, 0x29, 0xeb, -0x12, 0x17, 0xe7, 0xe0, 0xfe, 0xa3, 0xe0, 0x25, 0x2a, 0xff, 0xe5, 0x29, 0x3e, 0xfe, 0xeb, 0x12, -0x17, 0xae, 0xe0, 0xfc, 0xa3, 0xe0, 0xd3, 0x9f, 0xec, 0x9e, 0x40, 0x09, 0x78, 0x67, 0xe6, 0x44, -0x02, 0xf6, 0x44, 0x08, 0xf6, 0x0b, 0x1a, 0xea, 0x70, 0x99, 0x22, 0xe4, 0xf5, 0x1c, 0x78, 0x1d, -0x7c, 0x00, 0xfd, 0x7b, 0xff, 0x7a, 0x35, 0x79, 0xfd, 0xfe, 0x7f, 0x02, 0x12, 0x0c, 0x68, 0x75, -0x22, 0x01, 0x75, 0x23, 0x00, 0x75, 0x24, 0xc4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x1d, 0x12, 0x26, -0x24, 0xe5, 0x1d, 0xf4, 0x60, 0x14, 0x90, 0x00, 0xc4, 0x12, 0x33, 0x3b, 0x40, 0x09, 0xd3, 0xef, -0x94, 0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, 0x75, 0x1c, 0x01, 0xe5, 0x1e, 0xf4, 0x60, 0x14, 0x90, -0x00, 0xc6, 0x12, 0x33, 0x3b, 0x40, 0x09, 0xd3, 0xef, 0x94, 0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, -0x75, 0x1c, 0x01, 0x78, 0xb0, 0x7c, 0x01, 0x7d, 0x01, 0x7b, 0x01, 0x7a, 0x00, 0x79, 0xc4, 0x7e, -0x00, 0x7f, 0x04, 0x12, 0x0c, 0x68, 0xaf, 0x1c, 0x22, 0x12, 0x04, 0xd6, 0x60, 0x11, 0xa8, 0x07, -0xe8, 0x24, 0x0b, 0xf8, 0xe2, 0x7f, 0x80, 0x60, 0x02, 0x7f, 0x08, 0x8f, 0x22, 0x80, 0x1e, 0x78, -0x6b, 0xe6, 0xff, 0x24, 0x0b, 0xf8, 0xe2, 0x60, 0x11, 0xa8, 0x07, 0xe8, 0x24, 0x0f, 0xf8, 0xe2, -0x7f, 0x04, 0x60, 0x02, 0x7f, 0x08, 0x8f, 0x22, 0x80, 0x03, 0xe4, 0xf5, 0x22, 0xe5, 0x22, 0xb4, -0x04, 0x0f, 0x12, 0x03, 0x64, 0x04, 0x12, 0x00, 0xe0, 0x78, 0x6b, 0xe6, 0x24, 0x05, 0xf8, 0xe4, -0xf2, 0x78, 0x6b, 0xe6, 0xff, 0x24, 0x06, 0xf8, 0xe5, 0x22, 0xf2, 0xef, 0x04, 0x12, 0x03, 0x6a, -0x24, 0x07, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x7f, 0x06, 0x02, 0x0c, 0x68, 0xef, 0x54, -0x07, 0x90, 0x3b, 0x79, 0x93, 0xfe, 0xf4, 0xf9, 0xef, 0x54, 0xf0, 0xff, 0x64, 0x10, 0x60, 0x11, -0xef, 0x13, 0x13, 0x54, 0x3f, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x34, 0xff, 0xfa, 0xab, 0x82, 0x80, -0x1a, 0xbd, 0x08, 0x02, 0x7d, 0x02, 0x7a, 0xff, 0x7b, 0x12, 0xed, 0x30, 0xe2, 0x05, 0x12, 0x3a, -0x8e, 0x80, 0x03, 0x12, 0x3a, 0x96, 0xeb, 0x1b, 0x70, 0x01, 0x1a, 0xed, 0x30, 0xe1, 0x05, 0x12, -0x3a, 0x8e, 0x80, 0x03, 0x12, 0x3a, 0x96, 0xeb, 0x1b, 0x70, 0x01, 0x1a, 0xed, 0x30, 0xe0, 0x04, -0x12, 0x3a, 0x8e, 0x22, 0x12, 0x3a, 0x96, 0x22, 0x78, 0x68, 0xe6, 0xff, 0x78, 0x68, 0xe6, 0x60, -0x29, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x17, 0x44, 0x50, 0x03, 0xe0, 0x04, 0xf0, 0x12, 0x19, -0x0e, 0x30, 0xe7, 0x08, 0x12, 0x17, 0x44, 0x50, 0x03, 0xe0, 0x04, 0xf0, 0x78, 0x68, 0xe6, 0x6f, -0x60, 0xda, 0xe6, 0xff, 0x12, 0x18, 0xa4, 0xf0, 0x80, 0xd2, 0xe4, 0xff, 0x78, 0x6a, 0xe6, 0xfe, -0xef, 0xc3, 0x9e, 0x50, 0x14, 0x12, 0x18, 0x3c, 0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x12, 0x17, -0xae, 0xec, 0xf0, 0xa3, 0xed, 0xf0, 0x0f, 0x80, 0xe3, 0x22, 0x8f, 0x2d, 0xe4, 0xfd, 0x7f, 0x12, -0x12, 0x34, 0x39, 0xaf, 0x2d, 0x15, 0x2d, 0xef, 0x60, 0x38, 0x75, 0xb1, 0x11, 0x75, 0xb4, 0x63, -0x75, 0xb0, 0x0d, 0xe5, 0xb1, 0x20, 0xe0, 0x22, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x2c, 0xf5, -0x50, 0x03, 0xe0, 0x04, 0xf0, 0x75, 0x91, 0xc1, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0xe3, -0x12, 0x2c, 0xf5, 0x50, 0xde, 0xe0, 0x04, 0xf0, 0x80, 0xd9, 0xe4, 0xf5, 0xb0, 0x75, 0xb1, 0x01, -0x80, 0xc1, 0x7d, 0x01, 0x7f, 0x12, 0x02, 0x34, 0x39, 0x85, 0x40, 0x82, 0x85, 0x3f, 0x83, 0x22, -0x75, 0x89, 0x80, 0x90, 0x00, 0xc3, 0xe0, 0xc3, 0x94, 0xff, 0x22, 0x75, 0x8a, 0xa0, 0xe4, 0x90, -0x00, 0xc0, 0xf0, 0x22, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x48, 0x22, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, -0xc3, 0x94, 0x78, 0xee, 0x94, 0x00, 0x22, 0xe4, 0x93, 0xff, 0x7e, 0x00, 0x7c, 0x00, 0x02, 0x0d, -0x08, 0xe4, 0x78, 0x88, 0xf2, 0x08, 0xf2, 0x90, 0x00, 0xc8, 0xf0, 0x22, 0xab, 0x25, 0xaa, 0x26, -0xa9, 0x27, 0x22, 0x78, 0x54, 0xe6, 0xfa, 0x08, 0xe6, 0xfb, 0xad, 0x2f, 0xaf, 0x2e, 0xef, 0xc3, -0x94, 0x02, 0x50, 0x0e, 0xef, 0x25, 0xe0, 0x24, 0x6d, 0xf8, 0xa6, 0x05, 0xef, 0x12, 0x01, 0xe3, -0x80, 0x24, 0xc3, 0x90, 0x00, 0xb6, 0xe0, 0x9b, 0x90, 0x00, 0xb5, 0xe0, 0x9a, 0x50, 0x06, 0x78, -0x6d, 0xa6, 0x05, 0x80, 0x11, 0xc3, 0x90, 0x00, 0xb8, 0xe0, 0x9b, 0x90, 0x00, 0xb7, 0xe0, 0x9a, -0x50, 0x09, 0x78, 0x6f, 0xa6, 0x05, 0xea, 0xf0, 0xa3, 0xeb, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, -0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0xc0, 0x02, 0xc0, -0x03, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x19, 0x56, 0x12, 0x00, 0x0a, 0x7b, -0xff, 0x7a, 0x2f, 0x79, 0xeb, 0x12, 0x28, 0x8f, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, -0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, -0xd0, 0xe0, 0x32, 0x8f, 0x2a, 0x8d, 0x2b, 0xe5, 0x2b, 0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x0a, 0x12, -0x00, 0xf3, 0xe5, 0x2a, 0x12, 0x05, 0x17, 0x12, 0x34, 0x2a, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x2b, -0x75, 0xf0, 0x2f, 0xa4, 0x24, 0x08, 0x12, 0x00, 0xf3, 0xe5, 0x2a, 0x12, 0x05, 0xb8, 0x12, 0x34, -0x2a, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0x22, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xc3, -0x9f, 0xff, 0xec, 0x9e, 0xfe, 0x12, 0x3b, 0x31, 0x22, 0x12, 0x3a, 0x7e, 0x60, 0x3e, 0xee, 0x64, -0x01, 0x70, 0x18, 0xed, 0x60, 0x07, 0x78, 0x79, 0xe6, 0x4c, 0xf6, 0x80, 0x06, 0xec, 0xf4, 0x78, -0x79, 0x56, 0xf6, 0x78, 0x79, 0xe6, 0x90, 0xff, 0x18, 0xf0, 0x22, 0xaf, 0x06, 0xef, 0x75, 0xf0, -0x04, 0xa4, 0x24, 0x12, 0xff, 0xe5, 0xf0, 0x34, 0xff, 0x8f, 0x82, 0xf5, 0x83, 0xed, 0x60, 0x04, -0xe0, 0x4c, 0xf0, 0x22, 0xe0, 0xff, 0xec, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0xc2, 0xd5, 0xe8, -0x30, 0xe7, 0x0f, 0xb2, 0xd5, 0xe4, 0xc3, 0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, 0x99, 0xf9, 0xe4, -0x98, 0xf8, 0xec, 0x30, 0xe7, 0x17, 0xb2, 0xd5, 0x12, 0x34, 0xb3, 0x12, 0x0f, 0x42, 0xe4, 0xc3, -0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, 0x99, 0xf9, 0xe4, 0x98, 0xf8, 0x80, 0x03, 0x12, 0x0f, 0x42, -0x30, 0xd5, 0x0d, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0xe4, 0x9d, 0xfd, 0xe4, 0x9c, 0xfc, -0x22, 0x12, 0x0c, 0xe6, 0xab, 0x1c, 0xe5, 0x1e, 0x24, 0x0c, 0xf9, 0xe4, 0x35, 0x1d, 0xfa, 0x7e, -0x00, 0xe9, 0x25, 0x25, 0xf9, 0xee, 0x3a, 0xfa, 0x12, 0x0c, 0x8e, 0xff, 0x22, 0xab, 0x1c, 0xaa, -0x1d, 0xa9, 0x1e, 0x90, 0x00, 0x0b, 0x12, 0x0c, 0xa7, 0xff, 0x22, 0x75, 0x8a, 0xa0, 0xe4, 0x90, -0x00, 0xc0, 0xf0, 0x22, 0xab, 0x22, 0xaa, 0x23, 0xa9, 0x24, 0x85, 0x25, 0x82, 0x75, 0x83, 0x00, -0x22, 0x8c, 0x0d, 0x8d, 0x0e, 0x12, 0x3a, 0xbd, 0x44, 0x18, 0x12, 0x3a, 0xb4, 0x90, 0xff, 0x14, -0xe0, 0x44, 0x18, 0xf0, 0x90, 0xff, 0x1b, 0xe0, 0x44, 0x18, 0xf0, 0x75, 0xa3, 0x08, 0xef, 0x44, -0x80, 0xf5, 0xa1, 0x75, 0xa6, 0x28, 0x75, 0xa2, 0xc1, 0xaf, 0x0e, 0x85, 0x0d, 0xd7, 0x8f, 0xd6, -0x75, 0xd5, 0x02, 0x75, 0xd4, 0xf8, 0x75, 0xd2, 0x01, 0x75, 0xd1, 0xdf, 0x53, 0xac, 0xef, 0x22, -0xc2, 0xaf, 0x12, 0x39, 0xc8, 0xe5, 0x9b, 0xb4, 0x5a, 0x16, 0xe5, 0x9a, 0xb4, 0xa5, 0x11, 0xe5, -0x99, 0xb4, 0xf0, 0x0c, 0xe5, 0x98, 0xb4, 0x0f, 0x07, 0x90, 0xff, 0x85, 0xe0, 0x44, 0x20, 0xf0, -0x75, 0x8a, 0x0a, 0xd2, 0xaf, 0x7f, 0x0a, 0x12, 0x35, 0xb3, 0x12, 0x3a, 0xdd, 0x12, 0x10, 0xc4, -0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xc0, 0xf0, 0x80, 0xf3, 0xad, 0x07, 0x7f, 0x3a, 0x12, 0x35, -0xe7, 0x90, 0x00, 0xc1, 0xe4, 0xf0, 0xa3, 0xef, 0xf0, 0x7f, 0x3b, 0x12, 0x35, 0xe7, 0xef, 0xfb, -0x7a, 0x00, 0x90, 0x00, 0xc2, 0xe0, 0xfe, 0xe4, 0x2b, 0xff, 0xea, 0x3e, 0x90, 0x00, 0xc1, 0xf0, -0xa3, 0xef, 0xf0, 0x90, 0x00, 0xc1, 0xe0, 0xb4, 0x80, 0x08, 0xa3, 0xe0, 0xb4, 0x67, 0x03, 0xbd, -0xb6, 0xf1, 0x22, 0xe4, 0x90, 0x00, 0xc0, 0xf0, 0x90, 0x00, 0xc3, 0xf0, 0xef, 0x70, 0x0e, 0x75, -0x88, 0x08, 0xf5, 0x8d, 0xf5, 0x8c, 0xf5, 0x8f, 0xf5, 0x8e, 0xf5, 0x88, 0x22, 0x75, 0x88, 0x08, -0xe4, 0xf5, 0x8d, 0xf5, 0x8c, 0xef, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xe5, 0xf0, 0x44, 0x80, 0xf5, -0x8f, 0x8f, 0x8e, 0x75, 0x88, 0xa0, 0x22, 0x90, 0xff, 0x00, 0x74, 0x02, 0xf0, 0x90, 0xff, 0x04, -0xe4, 0xf0, 0x90, 0xff, 0x03, 0xef, 0xf0, 0x90, 0xff, 0x07, 0xe0, 0xff, 0x22, 0x11, 0x16, 0x00, -0xb6, 0x50, 0x01, 0x0a, 0x14, 0x01, 0x02, 0x05, 0x3c, 0x70, 0x00, 0x00, 0x15, 0x01, 0x02, 0x01, +0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x5e, 0xf0, 0x22, 0xe4, 0xf5, 0x22, 0x12, 0x08, +0xae, 0xe2, 0x60, 0x11, 0xa8, 0x07, 0xe8, 0x24, 0x0a, 0xf8, 0xe2, 0x7f, 0x80, 0x60, 0x02, 0x7f, +0x08, 0x8f, 0x22, 0x80, 0x19, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0a, 0xf8, 0xe2, 0x60, 0x0f, 0xa8, +0x07, 0xe8, 0x24, 0x0e, 0xf8, 0xe2, 0x7f, 0x04, 0x60, 0x02, 0x7f, 0x08, 0x8f, 0x22, 0xe5, 0x22, +0xb4, 0x04, 0x1f, 0x12, 0x0a, 0x15, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xc0, 0x01, 0xa9, 0x07, 0xa8, +0x01, 0x7c, 0x00, 0x7d, 0xfe, 0xd0, 0x01, 0x12, 0x07, 0x1f, 0x78, 0x79, 0xe6, 0x24, 0x04, 0xf8, +0xe4, 0xf2, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x05, 0xf8, 0xe5, 0x22, 0xf2, 0x7a, 0x00, 0xa9, 0x07, +0x7b, 0xfe, 0xef, 0x24, 0x06, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x7f, 0x06, 0x02, 0x0b, +0xc8, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x10, 0x78, 0x53, 0xa6, 0xa3, +0x08, 0xa6, 0xa6, 0x75, 0xa3, 0x08, 0xe6, 0xff, 0x30, 0xe4, 0x07, 0x75, 0xd1, 0xdf, 0x78, 0x81, +0x76, 0x00, 0x78, 0x53, 0xe6, 0x30, 0xe0, 0x40, 0xef, 0x20, 0xe0, 0x39, 0x78, 0x81, 0xe6, 0xff, +0x70, 0x18, 0x90, 0x02, 0xf8, 0xe0, 0xfe, 0xf5, 0xd6, 0x18, 0xee, 0xf6, 0xc3, 0x94, 0x10, 0x50, +0x24, 0x78, 0x82, 0xe6, 0x25, 0xd6, 0xf5, 0xd6, 0x80, 0x1b, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, +0x34, 0x02, 0xf5, 0x83, 0xe0, 0xff, 0x78, 0x80, 0xe6, 0x06, 0x25, 0x50, 0xf5, 0x82, 0xe4, 0x35, +0x4f, 0xf5, 0x83, 0xef, 0xf0, 0x78, 0x81, 0x06, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, +0x32, 0xab, 0x07, 0xaa, 0x05, 0xe4, 0x78, 0x75, 0xf6, 0xeb, 0x12, 0x17, 0xd7, 0xe0, 0xf5, 0x28, +0xa3, 0xe0, 0xf5, 0x29, 0x78, 0x70, 0xe6, 0x75, 0x26, 0x00, 0xf5, 0x27, 0xae, 0x26, 0xff, 0x7c, +0x00, 0x7d, 0xfc, 0x12, 0x0c, 0x68, 0xd3, 0xe5, 0x29, 0x9f, 0xe5, 0x28, 0x9e, 0x40, 0x06, 0x78, +0x75, 0xe6, 0x44, 0x20, 0xf6, 0x12, 0x17, 0xba, 0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x29, 0x74, +0x04, 0x93, 0x33, 0xf5, 0x28, 0xeb, 0x12, 0x18, 0x7d, 0xe0, 0xfe, 0xa3, 0xe0, 0x25, 0x29, 0xff, +0xe5, 0x28, 0x3e, 0xfe, 0xeb, 0x12, 0x17, 0xd7, 0xe0, 0xfc, 0xa3, 0xe0, 0xd3, 0x9f, 0xec, 0x9e, +0x40, 0x09, 0x78, 0x75, 0xe6, 0x44, 0x02, 0xf6, 0x44, 0x08, 0xf6, 0x0b, 0x1a, 0xea, 0x70, 0x99, +0x22, 0xe4, 0xf5, 0x1b, 0x78, 0x1c, 0x7c, 0x00, 0xfd, 0x7b, 0xff, 0x7a, 0x3a, 0x79, 0x65, 0xfe, +0x7f, 0x02, 0x12, 0x0b, 0xc8, 0x75, 0x21, 0x01, 0x75, 0x22, 0x00, 0x75, 0x23, 0xbc, 0x7b, 0x00, +0x7a, 0x00, 0x79, 0x1c, 0x12, 0x23, 0xf8, 0xe5, 0x1c, 0xf4, 0x60, 0x14, 0x90, 0x00, 0xbc, 0x12, +0x32, 0xa5, 0x40, 0x09, 0xd3, 0xef, 0x94, 0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, 0x75, 0x1b, 0x01, +0xe5, 0x1d, 0xf4, 0x60, 0x14, 0x90, 0x00, 0xbe, 0x12, 0x32, 0xa5, 0x40, 0x09, 0xd3, 0xef, 0x94, +0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, 0x75, 0x1b, 0x01, 0x78, 0xb0, 0x7c, 0x01, 0x7d, 0x01, 0x7b, +0x01, 0x7a, 0x00, 0x79, 0xbc, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0xaf, 0x1b, 0x22, 0xad, +0x07, 0x7f, 0x3a, 0x12, 0x35, 0x80, 0x90, 0x00, 0xb9, 0xe4, 0xf0, 0xa3, 0xef, 0xf0, 0x7f, 0x3b, +0x12, 0x35, 0x80, 0xef, 0xfb, 0x7a, 0x00, 0x90, 0x00, 0xba, 0xe0, 0xfe, 0xe4, 0x2b, 0xff, 0xea, +0x3e, 0x90, 0x00, 0xb9, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x00, 0xb9, 0xe0, 0xb4, 0x80, 0x08, 0xa3, +0xe0, 0xb4, 0x67, 0x03, 0xbd, 0xb6, 0xf1, 0x90, 0x00, 0xb9, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x64, +0x77, 0x70, 0x03, 0xee, 0x64, 0x80, 0x60, 0x06, 0xbe, 0x80, 0x08, 0xbf, 0x78, 0x05, 0xed, 0x64, +0xb5, 0x60, 0xe4, 0x90, 0x00, 0xb9, 0xe0, 0xb4, 0x80, 0x0a, 0xa3, 0xe0, 0xb4, 0x78, 0x05, 0xed, +0x64, 0xb8, 0x60, 0xef, 0x22, 0x78, 0x73, 0xe6, 0x30, 0xe0, 0x08, 0x75, 0x27, 0x05, 0x75, 0x28, +0x01, 0x80, 0x06, 0x75, 0x27, 0x08, 0xe4, 0xf5, 0x28, 0xe4, 0xf5, 0x26, 0xe5, 0x26, 0xc3, 0x78, +0x78, 0x96, 0x50, 0x40, 0x12, 0x18, 0xbf, 0x25, 0x26, 0x12, 0x19, 0x06, 0xe0, 0xf5, 0x29, 0xe5, +0x26, 0x54, 0x01, 0xfd, 0xaf, 0x29, 0x12, 0x34, 0x16, 0xad, 0x28, 0xaf, 0x29, 0x12, 0x31, 0x4c, +0xad, 0x27, 0xaf, 0x29, 0x12, 0x30, 0x65, 0x78, 0x73, 0xe6, 0xb4, 0x03, 0x13, 0xe5, 0x26, 0x30, +0xe0, 0x0e, 0xe4, 0xfd, 0xaf, 0x29, 0x12, 0x31, 0x4c, 0x7d, 0x08, 0xaf, 0x29, 0x12, 0x30, 0x65, +0x05, 0x26, 0x80, 0xb8, 0x22, 0xef, 0x54, 0x07, 0x90, 0x3a, 0x5d, 0x93, 0xfe, 0xf4, 0xf9, 0xef, +0x54, 0xf0, 0xff, 0x64, 0x10, 0x60, 0x11, 0xef, 0x13, 0x13, 0x54, 0x3f, 0x24, 0x11, 0xf5, 0x82, +0xe4, 0x34, 0xff, 0xfa, 0xab, 0x82, 0x80, 0x1a, 0xbd, 0x08, 0x02, 0x7d, 0x02, 0x7a, 0xff, 0x7b, +0x12, 0xed, 0x30, 0xe2, 0x05, 0x12, 0x35, 0x56, 0x80, 0x03, 0x12, 0x35, 0x5e, 0xeb, 0x1b, 0x70, +0x01, 0x1a, 0xed, 0x30, 0xe1, 0x05, 0x12, 0x35, 0x56, 0x80, 0x03, 0x12, 0x35, 0x5e, 0xeb, 0x1b, +0x70, 0x01, 0x1a, 0xed, 0x30, 0xe0, 0x04, 0x12, 0x35, 0x56, 0x22, 0x12, 0x35, 0x5e, 0x22, 0xc0, +0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, +0xc0, 0x02, 0xc0, 0x03, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x19, 0x0d, 0x12, +0x00, 0x0a, 0x7b, 0xff, 0x7a, 0x2d, 0x79, 0x5b, 0x12, 0x25, 0x33, 0xd0, 0x07, 0xd0, 0x06, 0xd0, +0x05, 0xd0, 0x04, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, +0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0x8f, 0x2a, 0x8d, 0x2b, 0xe5, 0x2b, 0x75, 0xf0, 0x2e, 0xa4, +0x24, 0x09, 0x12, 0x06, 0x32, 0xe5, 0x2a, 0x12, 0x0a, 0x0e, 0x12, 0x31, 0x3d, 0xc0, 0x06, 0xc0, +0x07, 0xe5, 0x2b, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x07, 0x12, 0x06, 0x32, 0xe5, 0x2a, 0x12, 0x0a, +0xc1, 0x12, 0x31, 0x3d, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0x22, 0xf8, 0xe2, 0xfc, +0x08, 0xe2, 0xc3, 0x9f, 0xff, 0xec, 0x9e, 0xfe, 0x12, 0x3a, 0x14, 0x22, 0x12, 0x35, 0x46, 0x60, +0x3e, 0xee, 0x64, 0x01, 0x70, 0x18, 0xed, 0x60, 0x07, 0x78, 0x83, 0xe6, 0x4c, 0xf6, 0x80, 0x06, +0xec, 0xf4, 0x78, 0x83, 0x56, 0xf6, 0x78, 0x83, 0xe6, 0x90, 0xff, 0x18, 0xf0, 0x22, 0xaf, 0x06, +0xef, 0x75, 0xf0, 0x04, 0xa4, 0x24, 0x12, 0xff, 0xe5, 0xf0, 0x34, 0xff, 0x8f, 0x82, 0xf5, 0x83, +0xed, 0x60, 0x04, 0xe0, 0x4c, 0xf0, 0x22, 0xe0, 0xff, 0xec, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, +0xc2, 0xd5, 0xe8, 0x30, 0xe7, 0x0f, 0xb2, 0xd5, 0xe4, 0xc3, 0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, +0x99, 0xf9, 0xe4, 0x98, 0xf8, 0xec, 0x30, 0xe7, 0x17, 0xb2, 0xd5, 0x12, 0x31, 0xc6, 0x12, 0x0e, +0xa2, 0xe4, 0xc3, 0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, 0x99, 0xf9, 0xe4, 0x98, 0xf8, 0x80, 0x03, +0x12, 0x0e, 0xa2, 0x30, 0xd5, 0x0d, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0xe4, 0x9d, 0xfd, +0xe4, 0x9c, 0xfc, 0x22, 0x78, 0x76, 0xe6, 0xf5, 0x26, 0x78, 0x76, 0xe6, 0x60, 0x13, 0x12, 0x34, +0xe3, 0xe5, 0x26, 0x78, 0x76, 0x66, 0x60, 0xf1, 0xe6, 0xf5, 0x26, 0x12, 0x18, 0x64, 0xf0, 0x80, +0xe8, 0xe4, 0xf5, 0x26, 0xe5, 0x26, 0xc3, 0x78, 0x78, 0x96, 0x50, 0x18, 0xe5, 0x26, 0x12, 0x18, +0x46, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x26, 0x12, 0x17, 0xd7, 0xee, 0xf0, 0xa3, 0xef, 0xf0, +0x05, 0x26, 0x80, 0xe0, 0x22, 0x78, 0x62, 0xe6, 0xfa, 0x08, 0xe6, 0xfb, 0xad, 0x2f, 0xaf, 0x2e, +0xef, 0xc3, 0x94, 0x02, 0x50, 0x10, 0xef, 0x12, 0x06, 0x85, 0xa6, 0x05, 0xef, 0x12, 0x07, 0x04, +0xa6, 0x02, 0x08, 0xa6, 0x03, 0x22, 0xd3, 0xeb, 0x95, 0x44, 0xea, 0x95, 0x43, 0x40, 0x07, 0x8d, +0x41, 0x8a, 0x43, 0x8b, 0x44, 0x22, 0xd3, 0xeb, 0x95, 0x48, 0xea, 0x95, 0x47, 0x40, 0x06, 0x8d, +0x45, 0x8a, 0x47, 0x8b, 0x48, 0x22, 0x8c, 0x4f, 0x8d, 0x50, 0x12, 0x35, 0xb5, 0x44, 0x18, 0x12, +0x35, 0xac, 0x90, 0xff, 0x14, 0xe0, 0x44, 0x18, 0xf0, 0x90, 0xff, 0x1b, 0xe0, 0x44, 0x18, 0xf0, +0x75, 0xa3, 0x08, 0xef, 0x44, 0x80, 0xf5, 0xa1, 0x75, 0xa6, 0x28, 0x75, 0xa2, 0xc1, 0xaf, 0x50, +0x85, 0x4f, 0xd7, 0x8f, 0xd6, 0x75, 0xd5, 0x02, 0x75, 0xd4, 0xf8, 0x75, 0xd2, 0x01, 0x75, 0xd1, +0xdf, 0x53, 0xac, 0xef, 0x22, 0x85, 0x4e, 0x82, 0x85, 0x4d, 0x83, 0x22, 0x75, 0x8a, 0xa0, 0xe4, +0x90, 0x00, 0xb8, 0xf0, 0x22, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x78, 0xee, 0x94, 0x00, +0x22, 0xe4, 0x93, 0xff, 0x7e, 0x00, 0x7c, 0x00, 0x02, 0x0c, 0x68, 0xe4, 0x78, 0x84, 0xf2, 0x08, +0xf2, 0x90, 0x00, 0xc0, 0xf0, 0x22, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x56, 0x22, 0xab, 0x25, 0xaa, +0x26, 0xa9, 0x27, 0x22, 0x12, 0x0c, 0x46, 0xab, 0x1b, 0xe5, 0x1d, 0x24, 0x0c, 0xf9, 0xe4, 0x35, +0x1c, 0xfa, 0x7e, 0x00, 0xe9, 0x25, 0x24, 0xf9, 0xee, 0x3a, 0xfa, 0x12, 0x0b, 0xee, 0xff, 0x22, +0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x0b, 0x12, 0x0c, 0x07, 0xff, 0x22, 0x75, 0x8a, +0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x22, 0xab, 0x21, 0xaa, 0x22, 0xa9, 0x23, 0x85, 0x24, 0x82, +0x22, 0xc2, 0xaf, 0x12, 0x34, 0x45, 0xe5, 0x9b, 0xb4, 0x5a, 0x16, 0xe5, 0x9a, 0xb4, 0xa5, 0x11, +0xe5, 0x99, 0xb4, 0xf0, 0x0c, 0xe5, 0x98, 0xb4, 0x0f, 0x07, 0x90, 0xff, 0x85, 0xe0, 0x44, 0x20, +0xf0, 0x75, 0x8a, 0x0a, 0xd2, 0xaf, 0x7f, 0x0a, 0x12, 0x33, 0x80, 0x12, 0x35, 0xc1, 0x12, 0x10, +0x17, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x80, 0xf3, 0x85, 0x20, 0x82, 0x85, 0x1f, +0x83, 0x22, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x12, 0x0d, 0x1b, 0xff, 0x22, 0xab, 0x1b, 0xaa, +0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x02, 0x12, 0x0d, 0x46, 0xff, 0x22, 0x93, 0xfd, 0xd3, 0x90, 0x00, +0xb6, 0xe0, 0x9d, 0x90, 0x00, 0xb5, 0xe0, 0x9c, 0x22, 0xf2, 0xe4, 0x90, 0x00, 0xb7, 0xf0, 0x22, +0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x90, 0x00, 0xbb, 0xf0, 0xef, 0x70, 0x0e, 0x75, 0x88, 0x08, 0xf5, +0x8d, 0xf5, 0x8c, 0xf5, 0x8f, 0xf5, 0x8e, 0xf5, 0x88, 0x22, 0x75, 0x88, 0x08, 0xe4, 0xf5, 0x8d, +0xf5, 0x8c, 0xef, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xe5, 0xf0, 0x44, 0x80, 0xf5, 0x8f, 0x8f, 0x8e, +0x75, 0x88, 0xa0, 0x22, 0x8f, 0x2c, 0xe4, 0xfd, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0xaf, 0x2c, 0x15, +0x2c, 0xef, 0x60, 0x1b, 0x75, 0xb1, 0x11, 0x75, 0xb4, 0x63, 0x75, 0xb0, 0x0d, 0xe5, 0xb1, 0x20, +0xe0, 0x05, 0x12, 0x34, 0xe3, 0x80, 0xf6, 0xe4, 0xf5, 0xb0, 0x75, 0xb1, 0x01, 0x80, 0xde, 0x7d, +0x01, 0x7f, 0x12, 0x02, 0x31, 0x4c, 0xe4, 0xf5, 0x3c, 0xf5, 0x3d, 0xff, 0x12, 0x0b, 0xee, 0x25, +0x3d, 0xf5, 0x3d, 0xe4, 0x35, 0x3c, 0xf5, 0x3c, 0x90, 0xff, 0xff, 0x12, 0x0c, 0x07, 0x12, 0x0c, +0x34, 0x74, 0xff, 0x29, 0xf9, 0x74, 0xff, 0x3a, 0xfa, 0x0f, 0xbf, 0x09, 0xdf, 0xed, 0x12, 0x0c, +0x34, 0xae, 0x3c, 0xaf, 0x3d, 0x22, 0x12, 0x35, 0x46, 0x60, 0x29, 0x90, 0xff, 0x13, 0xee, 0xd3, +0x94, 0x03, 0x40, 0x11, 0xaf, 0x06, 0xef, 0x75, 0xf0, 0x04, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, +0xf0, 0x35, 0x83, 0xf5, 0x83, 0xed, 0x60, 0x04, 0xe0, 0x4c, 0xf0, 0x22, 0xe0, 0xff, 0xec, 0xf4, +0xfe, 0xef, 0x5e, 0xf0, 0x22, 0x75, 0x9b, 0x5a, 0x75, 0x9a, 0xa5, 0x75, 0x99, 0xf0, 0x75, 0x98, +0x0f, 0x75, 0xac, 0xff, 0x75, 0xad, 0xff, 0x90, 0xff, 0x88, 0x74, 0x40, 0xf0, 0x74, 0xc0, 0xf0, +0x90, 0xff, 0x01, 0x74, 0x01, 0xf0, 0x75, 0x95, 0xf1, 0xe4, 0xf5, 0x96, 0x75, 0x97, 0xc7, 0x22, +0xe4, 0x78, 0x7c, 0xf6, 0x8f, 0x82, 0x8e, 0x83, 0x74, 0x79, 0x93, 0x78, 0x7a, 0xf6, 0xef, 0x24, +0x79, 0xf5, 0x4a, 0xe4, 0x3e, 0xf5, 0x49, 0xef, 0x24, 0x30, 0xf5, 0x40, 0xe4, 0x3e, 0xf5, 0x3f, +0x78, 0x00, 0xe2, 0x54, 0xfe, 0xf2, 0x54, 0xfb, 0xf2, 0x22, 0xef, 0x60, 0x0f, 0x43, 0xac, 0x10, +0x12, 0x35, 0xb5, 0x54, 0xe7, 0x12, 0x35, 0xac, 0xe4, 0xf5, 0xa2, 0x22, 0x12, 0x35, 0xad, 0xa3, +0xe0, 0x44, 0x18, 0xf0, 0xa3, 0xe0, 0x54, 0xe7, 0xf0, 0x75, 0xa2, 0xc1, 0x53, 0xac, 0xef, 0x22, +0xc3, 0xef, 0x94, 0x01, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, +0x11, 0xd3, 0xef, 0x9d, 0xee, 0x9c, 0x40, 0x0a, 0xed, 0x24, 0xff, 0xff, 0xec, 0x34, 0xff, 0xfe, +0x80, 0x00, 0x22, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, 0xe0, 0x04, 0xf0, +0x75, 0x91, 0xc1, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, +0xe0, 0x04, 0xf0, 0x22, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, 0xe0, 0x04, +0xf0, 0x75, 0x91, 0xc3, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, +0x03, 0xe0, 0x04, 0xf0, 0x22, 0xab, 0x1e, 0xaa, 0x1f, 0xa9, 0x20, 0x90, 0x00, 0x01, 0x12, 0x0c, +0x07, 0xff, 0x22, 0x90, 0xff, 0x50, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0xab, 0x1e, 0xaa, 0x1f, 0xa9, +0x20, 0x12, 0x0b, 0xee, 0xff, 0x22, 0xef, 0x54, 0x07, 0x90, 0x3a, 0x5d, 0x93, 0xfc, 0xef, 0xc4, +0x54, 0x0f, 0xfe, 0xef, 0xf4, 0x22, 0x8b, 0x82, 0x8a, 0x83, 0xe0, 0x4e, 0xf0, 0x22, 0x8b, 0x82, +0x8a, 0x83, 0xe0, 0x59, 0xf0, 0x22, 0xef, 0x24, 0x79, 0xf5, 0x0d, 0xe4, 0x3e, 0xf5, 0x0c, 0xef, +0x24, 0x30, 0xf5, 0x09, 0xe4, 0x3e, 0xf5, 0x08, 0xe4, 0xf5, 0x0b, 0xf5, 0x0e, 0xf5, 0x0a, 0x22, +0x90, 0xff, 0x00, 0x74, 0x02, 0xf0, 0x90, 0xff, 0x04, 0xe4, 0xf0, 0x90, 0xff, 0x03, 0xef, 0xf0, +0x90, 0xff, 0x07, 0xe0, 0xff, 0x22, 0xe4, 0x90, 0x00, 0xc5, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0x74, +0x23, 0x93, 0xff, 0xc3, 0x74, 0x40, 0x9f, 0x90, 0x00, 0xc4, 0xf0, 0x22, 0xf0, 0x90, 0xff, 0x10, +0xe0, 0x54, 0xe7, 0xf0, 0x22, 0x90, 0xff, 0x12, 0xe0, 0x54, 0xe7, 0xf0, 0x90, 0xff, 0x11, 0xe0, +0x22, 0x12, 0x2a, 0x88, 0x78, 0x7e, 0x76, 0x00, 0x08, 0x76, 0x28, 0x90, 0x00, 0xc1, 0x74, 0x04, +0xf0, 0xe4, 0xf5, 0x4b, 0x22, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0x74, 0xb5, 0x2f, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0xe0, 0xff, 0x22, 0x12, 0x32, 0x95, 0x74, 0x9c, 0x93, 0xfd, 0x02, 0x00, 0x24, +0xb6, 0x48, 0x01, 0x0a, 0x14, 0x01, 0x02, 0x05, 0x3c, 0x70, 0x00, 0x00, 0x15, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0a, 0x00, 0xc8, 0x03, 0xe8, 0x0f, 0x1e, 0x0c, 0x10, 0x3c, 0x01, 0x00, 0x50, -0x43, 0x51, 0x44, 0x52, 0x45, 0x53, 0x46, 0x54, 0x56, 0x55, 0x41, 0x55, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, 0x28, -0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x01, 0x0a, 0x0a, 0x01, 0x00, 0xc8, -0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, -0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x05, -0x00, 0x80, 0x00, 0x80, 0x00, 0x2d, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, -0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, -0x00, 0x0a, 0x14, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, 0x01, 0x08, 0x09, 0x01, 0x2c, -0x04, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x10, 0x3c, 0x01, 0x00, 0x50, 0x44, 0x41, 0x45, -0x51, 0x46, 0x52, 0x56, 0x53, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, 0x28, 0x05, 0x0b, 0x28, -0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, +0x43, 0x41, 0x44, 0x51, 0x45, 0x52, 0x46, 0x53, 0x56, 0x54, 0x17, 0x54, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x19, 0x28, 0x28, 0x28, 0x28, 0x00, 0x28, +0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x78, 0x2e, 0x90, 0x01, 0x01, 0x0a, 0x0a, 0x85, 0x00, 0x96, +0x02, 0x6c, 0x02, 0x6c, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, +0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, +0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, +0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, +0x28, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x01, 0x18, 0x00, 0x23, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xc8, 0x00, 0xc8, 0x00, 0xc8, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, +0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x1e, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x00, 0x01, +0x08, 0x09, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, +0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, 0x01, 0x00, +0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, +0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, 0x00, +0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, +0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, +0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, +0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, +0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, +0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, +0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, +0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, 0x01, +0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, +0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, +0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, +0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, -0x3c, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x00, -0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, -0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, -0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, 0x01, 0x08, 0x09, 0x01, 0x2c, 0x04, 0x02, 0x03, -0x07, 0x06, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x05, 0x0a, 0x10, 0x3c, 0x01, 0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, -0x56, 0x53, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, -0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, -0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, -0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, -0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, -0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, -0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x07, -0x06, 0x01, 0x2c, 0x04, 0x00, 0x01, 0x08, 0x09, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x07, 0x06, 0x01, -0x2c, 0x04, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x05, 0x0a, 0x10, 0x3c, 0x01, 0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x55, -0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, -0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, -0x01, 0x00, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, -0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x0a, 0x02, 0x85, -0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, +0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, +0xc8, 0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, +0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, +0x00, 0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, 0x03, +0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, +0x01, 0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, +0x1e, 0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, +0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, +0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, +0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, +0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, +0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, -0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, -0x04, 0x00, 0x01, 0x08, 0x09, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x02, -0x03, 0x07, 0x06, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0e, 0x10, +0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, +0x04, 0x00, 0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, +0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0e, 0x10, 0x3c, 0x01, 0x00, 0x64, 0x10, 0x41, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x46, 0x45, 0x44, 0x43, 0x17, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0x22, 0x90, 0x00, 0x00, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, -0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, -0x3c, 0x02, 0x58, 0x07, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, -0x00, 0x02, 0x08, 0xfa, 0x00, 0x64, 0x14, 0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, 0x00, 0x01, -0x0c, 0x0d, 0x00, 0x96, 0x04, 0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x0b, 0x0a, -0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xe4, 0xf5, 0x3c, 0xf5, 0x3d, -0xff, 0x12, 0x0c, 0x8e, 0x25, 0x3d, 0xf5, 0x3d, 0xe4, 0x35, 0x3c, 0xf5, 0x3c, 0x90, 0xff, 0xff, -0x12, 0x0c, 0xa7, 0x12, 0x0c, 0xd4, 0x74, 0xff, 0x29, 0xf9, 0x74, 0xff, 0x3a, 0xfa, 0x0f, 0xbf, -0x09, 0xdf, 0xed, 0x12, 0x0c, 0xd4, 0xae, 0x3c, 0xaf, 0x3d, 0x22, 0x12, 0x3a, 0x7e, 0x60, 0x29, -0x90, 0xff, 0x13, 0xee, 0xd3, 0x94, 0x03, 0x40, 0x11, 0xaf, 0x06, 0xef, 0x75, 0xf0, 0x04, 0xa4, -0x25, 0x82, 0xf5, 0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0xed, 0x60, 0x04, 0xe0, 0x4c, 0xf0, -0x22, 0xe0, 0xff, 0xec, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0x85, 0x21, 0x82, 0x85, 0x20, 0x83, -0x22, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x12, 0x0d, 0xbb, 0xff, 0x22, 0xab, 0x1c, 0xaa, 0x1d, -0xa9, 0x1e, 0x90, 0x00, 0x02, 0x12, 0x0d, 0xe6, 0xff, 0x22, 0x93, 0xfd, 0xd3, 0x90, 0x00, 0xbe, -0xe0, 0x9d, 0x90, 0x00, 0xbd, 0xe0, 0x9c, 0x22, 0x75, 0x9b, 0x5a, 0x75, 0x9a, 0xa5, 0x75, 0x99, -0xf0, 0x75, 0x98, 0x0f, 0x75, 0xac, 0xff, 0x75, 0xad, 0xff, 0x90, 0xff, 0x88, 0x74, 0x40, 0xf0, -0x74, 0xc0, 0xf0, 0x90, 0xff, 0x01, 0x74, 0x01, 0xf0, 0x75, 0x95, 0xf1, 0xe4, 0xf5, 0x96, 0x75, -0x97, 0xc7, 0x22, 0xef, 0x60, 0x0f, 0x43, 0xac, 0x10, 0x12, 0x3a, 0xbd, 0x54, 0xe7, 0x12, 0x3a, -0xb4, 0xe4, 0xf5, 0xa2, 0x22, 0x12, 0x3a, 0xb5, 0xa3, 0xe0, 0x44, 0x18, 0xf0, 0xa3, 0xe0, 0x54, -0xe7, 0xf0, 0x75, 0xa2, 0xc1, 0x53, 0xac, 0xef, 0x22, 0xc3, 0xef, 0x94, 0x01, 0xee, 0x64, 0x80, -0x94, 0x80, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, 0x11, 0xd3, 0xef, 0x9d, 0xee, 0x9c, 0x40, -0x0a, 0xed, 0x24, 0xff, 0xff, 0xec, 0x34, 0xff, 0xfe, 0x80, 0x00, 0x22, 0xe4, 0x78, 0x72, 0xf6, -0x8f, 0x82, 0x8e, 0x83, 0x74, 0x55, 0x93, 0x78, 0x6c, 0xf6, 0xef, 0x24, 0x55, 0xf5, 0x44, 0xe4, -0x3e, 0xf5, 0x43, 0x78, 0x00, 0xe2, 0x54, 0xfe, 0xf2, 0x54, 0xfb, 0xf2, 0x22, 0xab, 0x1f, 0xaa, -0x20, 0xa9, 0x21, 0x90, 0x00, 0x01, 0x12, 0x0c, 0xa7, 0xff, 0x22, 0x90, 0xff, 0x50, 0xf0, 0x90, -0xff, 0x58, 0xf0, 0xab, 0x1f, 0xaa, 0x20, 0xa9, 0x21, 0x12, 0x0c, 0x8e, 0xff, 0x22, 0xef, 0x54, -0x07, 0x90, 0x3b, 0x79, 0x93, 0xfc, 0xef, 0xc4, 0x54, 0x0f, 0xfe, 0xef, 0xf4, 0x22, 0x8b, 0x82, -0x8a, 0x83, 0xe0, 0x4e, 0xf0, 0x22, 0x8b, 0x82, 0x8a, 0x83, 0xe0, 0x59, 0xf0, 0x22, 0xe4, 0x90, -0x00, 0xcd, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0x74, 0x23, 0x93, 0xff, 0xc3, 0x74, 0x40, 0x9f, 0x90, -0x00, 0xcc, 0xf0, 0x22, 0xf0, 0x90, 0xff, 0x10, 0xe0, 0x54, 0xe7, 0xf0, 0x22, 0x90, 0xff, 0x12, -0xe0, 0x54, 0xe7, 0xf0, 0x90, 0xff, 0x11, 0xe0, 0x22, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x03, -0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0x12, 0x2d, 0xb8, -0x78, 0x74, 0x76, 0x00, 0x08, 0x76, 0x28, 0x90, 0x00, 0xc9, 0x74, 0x04, 0xf0, 0x22, 0xef, 0x24, -0x30, 0xf5, 0x09, 0xe4, 0x3e, 0xf5, 0x08, 0xe4, 0xf5, 0x0b, 0xf5, 0x0c, 0xf5, 0x0a, 0x22, 0x74, -0xb7, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xe0, 0xff, 0x22, 0x85, 0x1e, 0x82, 0x85, -0x1d, 0x83, 0x75, 0xf0, 0x07, 0xef, 0x02, 0x10, 0x59, 0x8d, 0x22, 0xaf, 0x22, 0x12, 0x24, 0xe1, -0xaf, 0x22, 0x02, 0x19, 0x89, 0xef, 0x25, 0xe0, 0x24, 0x5f, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, -0x22, 0xee, 0x30, 0xe7, 0x07, 0xc3, 0xe4, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x22, 0x12, 0x33, 0x19, -0x74, 0x78, 0x93, 0xfd, 0x02, 0x05, 0xfc, 0x7f, 0x30, 0x12, 0x35, 0xe7, 0x22, 0x41, 0x00, 0xc8, -0x00, 0x00, 0x78, 0x66, 0xa6, 0x07, 0x22, 0x12, 0x3a, 0xc9, 0x22, 0x11, 0x10, 0x41, 0x51, 0x52, -0x53, 0x54, 0x55, 0x56, 0x46, 0x45, 0x44, 0x43, 0x17, 0x16, 0x11, 0x40, 0x41, 0x50, 0x51, 0x52, -0x53, 0x54, 0x55, 0x46, 0x45, 0x44, 0x43, 0x42, 0x16, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, -0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, +0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, +0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, +0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x07, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, +0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0xfa, 0x00, 0x64, 0x14, 0x02, 0x03, 0x0b, 0x0a, 0x00, +0xc8, 0x04, 0x00, 0x01, 0x0c, 0x0d, 0x00, 0x96, 0x04, 0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, +0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x85, +0x1d, 0x82, 0x85, 0x1c, 0x83, 0x75, 0xf0, 0x07, 0xef, 0x02, 0x0f, 0xac, 0x8d, 0x22, 0xaf, 0x22, +0x12, 0x21, 0x74, 0xaf, 0x22, 0x02, 0x15, 0x54, 0xef, 0x25, 0xe0, 0x24, 0x5d, 0xf8, 0xe2, 0xfe, +0x08, 0xe2, 0xff, 0x22, 0xee, 0x30, 0xe7, 0x07, 0xc3, 0xe4, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x22, +0x75, 0x89, 0x80, 0x90, 0x00, 0xbb, 0xe0, 0xc3, 0x94, 0xff, 0x22, 0x7f, 0x30, 0x12, 0x35, 0x80, +0x22, 0x41, 0x00, 0xc0, 0x00, 0x00, 0x78, 0x74, 0xa6, 0x07, 0x22, 0x12, 0x35, 0xd5, 0x22, 0x11, +0x10, 0x41, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x46, 0x45, 0x44, 0x43, 0x17, 0x16, 0x11, 0x40, +0x41, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x46, 0x45, 0x44, 0x43, 0x42, 0x16, 0x01, 0x02, 0x04, +0x08, 0x10, 0x20, 0x40, 0x80, 0x11, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xb6, 0x02, 0x30, 0x74, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0xb6, - +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xb6, 0x02, 0x40, 0x52, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x8c, ] #endif /*CAPACITIVE_HYNITRON_CST816D_UPDATE_H__*/ diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/constants.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/constants.py index 657aa31a..975bed48 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/constants.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/constants.py @@ -26,9 +26,6 @@ class PROTOCOL: TK_SEND = "TK_SEND" TK_RECV = "TK_RECV" - TKS_SEND = "TKS_SEND" - TKS_RECV = "TKS_RECV" - MESSAGE_SEND = "MESSAGE_SEND" MESSAGE_RECV = "MESSAGE_RECV" @@ -84,48 +81,59 @@ class PROTOCOL: WLKEY_SEND = "WLKEY_SEND" WLKEY_RECV = "WLKEY_RECV" - SILENCETIME2_SEND ="SILENCETIME2_SEND" + SILENCETIME2_SEND = "SILENCETIME2_SEND" SILENCETIME2_RECV = "SILENCETIME2_RECV" - KEYBRD_SEND ="KEYBRD_SEND" + KEYBRD_SEND = "KEYBRD_SEND" KEYBRD_RECV = "KEYBRD_RECV" - SILENCETIMEFS_SEND ="SILENCETIMEFS_SEND" + SILENCETIMEFS_SEND = "SILENCETIMEFS_SEND" SILENCETIMEFS_RECV = "SILENCETIMEFS_RECV" - PP_SEND = "ppfriends_SEND" - PP_RECV = "ppfriends_RECV" + BODYTEMP_SEND ="bodytemp_SEND" + BODYTEMP_RECV ="bodytemp_RECV" - PPFRIENDS_SEND = "ppfriends_match_SEND" - PPFRIENDS_RECV = "ppfriends_match_RECV" + BODYTEMP2_SEND ="bodytemp2_SEND" + BODYTEMP2_RECV ="bodytemp2_RECV" - MFCODE_FRIEND_DEL_REQ_SEND = "MFCODE_FRIEND_DEL_REQ_SEND" - MFCODE_FRIEND_DEL_REQ_RECV = "MFCODE_FRIEND_DEL_REQ_RECV" + BTEMP2_SEND ="btemp2_SEND" + BTEMP2_RECV ="btemp2_RECV" - MFCODE_FRIEND_REQ_SEND = "MFCODE_FRIEND_REQ_SEND" - MFCODE_FRIEND_REQ_RECV = "MFCODE_FRIEND_REQ_RECV" + SCREEN_SHOW_SEND = "SCREEN_SHOW_SEND" + SCREEN_SHOW_RECV = "SCREEN_SHOW_RECV" - MFCODE_FRIEND_SEND = "MFCODE_FRIEND_SEND" - MFCODE_FRIEND_RECV = "MFCODE_FRIEND_RECV" + TKS_SEND = "TKS_SEND" + TKS_SEND = "TKS_SEND" - FACTORY_SEND = "FACTORY_SEND" - FACTORY_RECV = "FACTORY_RECV" + BLOOD_SEND = "blood_SEND" + BLOOD_RECV = "blood_RECV" - RESET_SEND = "RESET_SEND" - RESET_RECV = "RESET_RECV" + BLDSTART_SEND ="bldstart_SEND" + BLDSTART_RECV = "bldstart_RECV" - APPVOICEMSG_SEND = "appvoicemsg_SEND" - APPVOICEMSG_RECV = "appvoicemsg_RECV" + AL_SEND = "AL_SEND" + AL_RECV = "AL_RECV" - SRVTEXTMSG_SEND = "srvtextmsg_SEND" - SRVTEXTMSG_RECV = "srvtextmsg_RECV" + FALLDOWN_SEND = "FALLDOWN_SEND" + FALLDOWN_RECV = "FALLDOWN_RECV" - PPDEVVOICEMSG_SEND = "ppdevvoicemsg_SEND" - PPDEVVOICEMSG_RECV = "ppdevvoicemsg_RECV" + REMOVE_SEND = "REMOVE_SEND" + REMOVE_RECV = "REMOVE_RECV" - PPSRVVOICEMSG_SEND = "ppsrvvoicemsg_SEND" - PPSRVVOICEMSG_RECV = "ppsrvvoicemsg_RECV" + FACTORY_SEND = "FACTORY_SEND" + FACTORY_RECV = "FACTORY_RECV" + + SLEEPTIME_SEND = "SLEEPTIME_SEND" + SLEEPTIME_RECV = "SLEEPTIME_RECV" + + MESSAGE_SOS_SEND = "MESSAGE_SOS_SEND" + MESSAGE_SOS_RECV = "MESSAGE_SOS_RECV" + MSGQ_SEND = "MSGQ_SEND" + MSGQ_RECV = "MSGQ_RECV" + + PROFILE_SEND = "profile_SEND" + PROFILE_RECV = "profile_RECV" JPREG_SEND = "JPREG_SEND" JPREG_RECV = "JPREG_RECV" @@ -191,8 +199,8 @@ class EVENT: SYSTEM_UP = "SYSTEM_UP" START_HEART = "START_HEART" GET_HEART = "GET_HEART" - GET_WEAR = "GET_WEAR" STOP_HEART = "STOP_HEART" + GET_WEAR = "GET_WEAR" START_TEMP = "START_TEMP" STOP_TEMP = "STOP_TEMP" GET_TEMP = "GET_TEMP" diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd_k5.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd_k5.py index 93007d54..e27ab6e4 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd_k5.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd_k5.py @@ -153,7 +153,7 @@ lcd_ctrl = Pin(Pin.GPIO18, Pin.OUT, Pin.PULL_DISABLE, 1) lcd.lcd_init(init_buf, 240, 320, 52000, 1, 4, 0, invalid, displayon, displayoff, None,TESel = True,TEPin = 17) # gpio_backlight = Pin(Pin.GPIO37, Pin.OUT, Pin.PULL_DISABLE, 0) # gpio_backlight.write(1) -PWM_backlight = PWM(PWM.PWM1, PWM.ABOVE_MS, 0, 1) +PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_MS, 0, 1) PWM_backlight.open() LCD_SIZE_W = 240 @@ -229,7 +229,7 @@ style_font_youyuan_black_40.set_text_font_v2("font_40.bin",40,0) style_font_youyuan_20_op = lv.style_t() style_font_youyuan_20_op.init() style_font_youyuan_20_op.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20_op.set_text_font_v2("font_28.bin",28,0) +style_font_youyuan_20_op.set_text_font(lv.K01_font_16_ALL) power_on_screen = lv.obj() print("power_on_screen") @@ -245,5 +245,5 @@ print("power_on_screen init...") lv.scr_load(power_on_screen) utime.sleep_ms(200) print("power_on_screen end...") -PWM_backlight = PWM(PWM.PWM1, PWM.ABOVE_MS, 6, 10) +PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_MS, 6, 10) PWM_backlight.open() diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_1.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_1.py index 8666de66..68ba3fff 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_1.py +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_1.py @@ -1,2 +1,2 @@ -from main_init import main_init -main_init() \ No newline at end of file +import main_init +main_init.main_init() \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_init.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_init.py deleted file mode 100644 index 2dfaebe8..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/main_init.py +++ /dev/null @@ -1,331 +0,0 @@ -import sms -import atcmd -import net -import machine -resp=bytearray(50) -# atcmd.sendSync('AT+log=52,1\r\n',resp,'',200) -# print("AT+log=52,1:{}".format(resp)) -from common import Abstract -class App(object): - def __init__(self): - self.managers = [] - - def append_manager(self, manager): - if isinstance(manager, Abstract): - manager.post_processor_after_instantiation() - self.managers.append(manager) - return self - - def start(self): - for manager in self.managers: - manager.post_processor_before_initialization() - manager.initialization() - manager.post_processor_after_initialization() - - -class watchApp(App): - def __init__(self): - super(watchApp, self).__init__() - self.__ui = None - - def set_ui(self, ui): - self.__ui = ui - - def start(self): - if self.__ui is not None: - self.__ui.start() - super().start() - - - -def main_init(): - import uos - import ql_fs - import utime - res = uos.statvfs("/usr") - res = list(res) - print('总usr空间:{} MB,剩余空间:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) - print("init1:{}".format(utime.localtime())) - import EventMesh - - print("init2:{}".format(utime.localtime())) - from lcd import tp_cst816 - print("init3:{}".format(utime.localtime())) - - from ui_main_menu import MainMenuScreen - # from ui_WatchFaceScreen import WatchFaceScreen - - from appFactoryMode import FactoryModestepScreen,FactoryModeLocationScreen,FactoryModeScreen ,FactoryModeBatTestScreen - import ui as _ui - - from mgr import simFactoryManager,AddPPManager,cameraAlbumManager,setclassTimeManager,setkeyboardManager,testSmsSetIPManager,ConfigStoreManager,sosInfoCallManager,getBootOffManager,getSosFlagManager,CountdownManager, LocationManager, getVolumSizeManager,gethistoryDataManager,getUpLoadDataManager, getplayAudiodStateManager,\ - AddrBookManager,MsgdetailManager,PhoneCallingManager,getOldTimeManager,getStorageDataManager,getBrightnessManager,getHrTimeManager,getTempTimeManager,getLowBatManager - - - # import ui as _ui - print("init4:{}".format(utime.localtime())) - - ui = _ui.UI() - ui.post_processor_after_instantiation() - app = watchApp() - app.set_ui(ui) - app.append_manager(getStorageDataManager()) - - - - - ui.add_screen(_ui.SystemInitScreen()) - EventMesh.publish("load_screen", {"screen": "system_init"}) - print("init5:{}".format(utime.localtime())) - ui.add_screen(MainMenuScreen()) - - ui.add_screen(_ui.deletealbumScreen()) - ui.add_screen(_ui.PopupScreen()) - ui.add_screen(_ui.PhoneScreen()) - ui.add_screen(_ui.HeartrateScreen()) - import ui_setting as _ui_setting - ui.add_screen(_ui_setting.SettingScreen()) - ui.add_screen(_ui.ToolboxScreen()) - ui.add_screen(_ui.StepScreen()) - ui.add_screen(_ui.CountdownScreen()) - ui.add_screen(_ui.StopwatchScreen()) - ui.add_screen(_ui.WeatherScreen()) - ui.add_screen(_ui.Spo2Screen()) - ui.add_screen(_ui.TemperatureScreen()) - ui.add_screen(_ui.ContactsScreen()) - ui.add_screen(_ui.cameraVdieoAnswerScreen()) - ui.add_screen(_ui.vedioCallingCallScreen()) - ui.add_screen(_ui.VedioShowScreen()) - ui.add_screen(_ui.videoOutCallScreen()) - from appWechat import WechatScreen,NewWechatPopupScreen - ui.add_screen(WechatScreen()) - - from alarm import ClkListScreen,ClockManager,PopupAlarmScreen - # from ui_health import HealthScreen - from calculator import calculatorScreen - ui.add_screen(ClkListScreen()) - ui.add_screen(_ui.CountdownEndScreen()) - # ui.add_screen(NewEditClk()) - # ui.add_screen(CLKTimeScreen()) - # ui.add_screen(ClkPeriod()) - # ui.add_screen(_ui_setting.LanguageScreen()) - ui.add_screen(_ui_setting.PowerOnScreen()) - ui.add_screen(_ui_setting.DialswitchScreen()) - # ui.add_screen(_ui.ThemeswitchScreen()) - ui.add_screen(_ui_setting.ImeiScreen()) - ui.add_screen(_ui_setting.AppScreen()) - ui.add_screen(_ui_setting.BrightnessScreen()) - ui.add_screen(_ui_setting.VolumeScreen()) - ui.add_screen(_ui_setting.RestoreScreen()) - ui.add_screen(_ui_setting.PoweroffScreen()) - ui.add_screen(_ui_setting.VersionScreen()) - ui.add_screen(_ui_setting.UpdateScreen()) - ui.add_screen(_ui_setting.AlarmvolumeScreen()) - ui.add_screen(_ui_setting.MsgvolumeScreen()) - ui.add_screen(_ui_setting.PhoneringScreen()) - ui.add_screen(_ui_setting.totalvolumeScreen()) - ui.add_screen(_ui_setting.PoweroffConfirmScreen()) - ui.add_screen(_ui_setting.RestartScreen()) - ui.add_screen(_ui.DialingScreen()) - ui.add_screen(_ui.CallLogScreen()) - ui.add_screen(_ui.UIFINDScreen()) - ui.add_screen(_ui.MsgDetailScreen()) - ui.add_screen(_ui.IncomingCallScreen()) - ui.add_screen(_ui.OnCallScreen()) - ui.add_screen(_ui.MessageFullScreen()) - # ui.add_screen(_ui.PowerOnScreen()) - ui.add_screen(FactoryModeLocationScreen()) - ui.add_screen(FactoryModestepScreen()) - ui.add_screen(FactoryModeScreen()) - ui.add_screen(FactoryModeBatTestScreen()) - ui.add_screen(PopupAlarmScreen()) - ui.add_screen(_ui.LowPowerScreen()) - ui.add_screen(_ui.NewMessageScreen()) - ui.add_screen(_ui.sosScreen()) - ui.add_screen(_ui.noSosDataScreen()) - ui.add_screen(_ui.NoSimScreen()) - ui.add_screen(_ui.NoSimPowerScreen()) - ui.add_screen(_ui.DialingNoPlayPopupScreen()) - ui.add_screen(_ui.NovaliedNumScreen()) - ui.add_screen(_ui.DialNoconnectPopupScreen()) - ui.add_screen(_ui.LowOnePowerScreen()) - ui.add_screen(_ui.wechatFailedScreen()) - ui.add_screen(_ui.NoSimAutoScreen()) - ui.add_screen(_ui.chargeInScreen()) - ui.add_screen(_ui.chargeOutScreen()) - ui.add_screen(_ui.RemoveMessageScreen()) - ui.add_screen(_ui.keyboardScreen()) - ui.add_screen(_ui.classMgrPopupScreen()) - ui.add_screen(calculatorScreen()) - ui.add_screen(_ui.cameraScreen()) - ui.add_screen(_ui.cameraalbumScreen()) - ui.add_screen(_ui.albumPreviewScreen()) - ui.add_screen(_ui.cameraFullScreen()) - ui.add_screen(_ui.restore_confirmScreen()) - ui.add_screen(_ui.down_Screen()) - ui.add_screen(_ui.up_Screen()) - ui.add_screen(_ui.videolistScreen()) - ui.add_screen(_ui.VdieoVoiceScreen()) - ui.add_screen(_ui.VoiceShowScreen()) - ui.add_screen(_ui.voiceInCallScreen()) - ui.add_screen(_ui.videoModeScreen()) - ui.add_screen(_ui.voiceOutCallScreen()) - - from pp_main import allppPopupScreen,delOnePopupScreen,ppListScreen,noppPopupScreen,delppsucessPopupScreen,ppMainScreen,addfaileppPopupScreen,ppMainPopupScreen,addppPopupScreen,addedppPopupScreen,ownaddppPopupScreen - ui.add_screen(ppMainScreen()) - ui.add_screen(ppMainPopupScreen()) - ui.add_screen(addppPopupScreen()) - ui.add_screen(addedppPopupScreen()) - ui.add_screen(ownaddppPopupScreen()) - ui.add_screen(addfaileppPopupScreen()) - ui.add_screen(delppsucessPopupScreen()) - ui.add_screen(noppPopupScreen()) - ui.add_screen(ppListScreen()) - ui.add_screen(delOnePopupScreen()) - ui.add_screen(allppPopupScreen()) - - ui.add_screen(NewWechatPopupScreen()) - # ui.add_screen(HealthScreen()) - # ui.add_screen(_ui.Setting3Screen()) - print("init6:{}".format(utime.localtime())) - - from protocol import RTALK_ProtoCol,TKS_ProtoCol,RCALLING_ProtoCol,AGTALK_ProtoCol,CALLING_ProtoCol,MEMBERS_ProtoCol,JPREG_ProtoCol,ppsrvvoicemsg_ProtoCol,ppdevvoicemsg_ProtoCol,srvtextmsg_ProtoCol,TK_ProtoCol,MESSAGE_ProtoCol,APPVOICEMSG_ProtoCol,restart_ProtoCol,factory_ProtoCol,SILENCETIMEFS_ProtoCol,WLKEY_ProtoCol,SILENCETIME2_ProtoCol,KEYBRD_ProtoCol,LK_ProtoCol,PING_ProtoCol,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,HRSTART_ProtoCol,CENTER_ProtoCol,UPLOAD_ProtoCol,\ - TEMP_ProtoCol,DLT_ProtoCol,WT_ProtoCol,UD_ProtoCol,REMIND_ProtoCol, CR_ProtoCol,KA_ProtoCol,FIND_ProtoCol,POWEROFF_ProtoCol,Time_ProtoCol,\ - pp_ProtoCol,ppfriends_ProtoCol,revpp_ProtoCol,reqpp_ProtoCol,delpp_ProtoCol,ProtoColResolver,PHL_ProtoCol,MONITOR_ProtoCol,bootoff_ProtoCol,WDSTART_ProtoCol,LOWBAT_ProtoCol,sosHome_dial_ProtoCol,SockManager,NetManager - - from protocol import CALLCANCEL_ProtoCol,HANGUP_ProtoCol,JMEMBERS_ProtoCol - - import mgr as mgr - print("init7:{}".format(utime.localtime())) - - - print("init8:{}".format(utime.localtime())) - - - #from ui_WatchFaceScreen import WatchFaceScreen - - - # from test_sms import HRSTART_ProtoCol,getHrTimeManager,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,getBrightnessManager,\ - # getStorageDataManager - print("init9:{}".format(utime.localtime())) - #from usr.ui_wechat import WechatScreen,TK_ProtoCol - - print("init10:{}".format(utime.localtime())) - - - app.append_manager(mgr.DeviceInfoManager()) \ - .append_manager(mgr.BatteryManager()) \ - - # .append_manager(mgr.StopwatchManager()) \ - # .append_manager(mgr.CountdownManager()) \ - app.append_manager(mgr.vedioInforManager()) - app.append_manager(mgr.videoBookManager()) - app.append_manager(setkeyboardManager()) - app.append_manager(ConfigStoreManager()) - app.append_manager(NetManager()) - app.append_manager(LocationManager()) - app.append_manager(AddrBookManager()) - app.append_manager(mgr.MsgManager()) - app.append_manager(MsgdetailManager()) - app.append_manager(mgr.CallLogManager()) - app.append_manager(mgr.getWeatherDataManager()) - app.append_manager(PhoneCallingManager()) - app.append_manager(ClockManager()) - app.append_manager(gethistoryDataManager()) - app.append_manager(getHrTimeManager()) - app.append_manager(getBrightnessManager()) - app.append_manager(getUpLoadDataManager()) - app.append_manager(getVolumSizeManager()) - app.append_manager(getTempTimeManager()) - app.append_manager(getplayAudiodStateManager()) - app.append_manager(getLowBatManager()) - app.append_manager(getBootOffManager()) - app.append_manager(getOldTimeManager()) - app.append_manager(getSosFlagManager()) - app.append_manager(CountdownManager()) - app.append_manager(sosInfoCallManager()) - app.append_manager(testSmsSetIPManager()) - app.append_manager(setclassTimeManager()) - app.append_manager(cameraAlbumManager()) - app.append_manager(AddPPManager()) - app.append_manager(simFactoryManager()) - print("init21:{}".format(utime.localtime())) - - print("init11:{}".format(utime.localtime())) - pcr = ProtoColResolver() - pcr.add_support(LK_ProtoCol()) - pcr.add_support(PING_ProtoCol()) - pcr.add_support(KA_ProtoCol()) - pcr.add_support(UD_ProtoCol()) - pcr.add_support(CR_ProtoCol()) - pcr.add_support(FIND_ProtoCol()) - pcr.add_support(POWEROFF_ProtoCol()) - pcr.add_support(PHL_ProtoCol()) - pcr.add_support(TK_ProtoCol()) - pcr.add_support(TKS_ProtoCol()) - pcr.add_support(MESSAGE_ProtoCol()) - pcr.add_support(APPVOICEMSG_ProtoCol()) - pcr.add_support(srvtextmsg_ProtoCol()) - pcr.add_support(ppdevvoicemsg_ProtoCol()) - pcr.add_support(ppsrvvoicemsg_ProtoCol()) - pcr.add_support(WT_ProtoCol()) - pcr.add_support(REMIND_ProtoCol()) - pcr.add_support(HRSTART_ProtoCol()) - pcr.add_support(HEART_ProtoCol()) - pcr.add_support(OXYGEN_ProtoCol()) - pcr.add_support(OXYGEN_One_ProtoCol()) - pcr.add_support(TEMP_ProtoCol()) - pcr.add_support(DLT_ProtoCol()) - pcr.add_support(UPLOAD_ProtoCol()) - pcr.add_support(MONITOR_ProtoCol()) - # pcr.add_support(CENTER_ProtoCol()) - pcr.add_support(CENTER_ProtoCol()) - pcr.add_support(bootoff_ProtoCol()) - pcr.add_support(WDSTART_ProtoCol()) - pcr.add_support(LOWBAT_ProtoCol()) - pcr.add_support(sosHome_dial_ProtoCol()) - pcr.add_support(Time_ProtoCol()) - pcr.add_support(KEYBRD_ProtoCol()) - pcr.add_support(SILENCETIME2_ProtoCol()) - pcr.add_support(WLKEY_ProtoCol()) - pcr.add_support(SILENCETIMEFS_ProtoCol()) - pcr.add_support(pp_ProtoCol()) - pcr.add_support(delpp_ProtoCol()) - pcr.add_support(reqpp_ProtoCol()) - pcr.add_support(revpp_ProtoCol()) - pcr.add_support(ppfriends_ProtoCol()) - pcr.add_support(factory_ProtoCol()) - pcr.add_support(restart_ProtoCol()) - - pcr.add_support(JPREG_ProtoCol()) - pcr.add_support(MEMBERS_ProtoCol()) - pcr.add_support(JMEMBERS_ProtoCol()) - pcr.add_support(AGTALK_ProtoCol()) - pcr.add_support(CALLING_ProtoCol()) - pcr.add_support(RCALLING_ProtoCol()) - pcr.add_support(RTALK_ProtoCol()) - # pcr.add_support(HANGUP_ProtoCol()) - EventMesh.publish("load_screen", {"screen": "poweron"}) - sm = SockManager() - sm.add_support_resolver(pcr) - app.append_manager(sm) - print("init11.0:{}".format(utime.localtime())) - app.start() - sms_data = sms.getSaveLoc() - if(sms_data != -1): - sms_lacv = sms_data[0][0] - if sms_lacv != 'SM':#每次开机设置一下短信的存储位置 - sms.setSaveLoc('SM', 'SM', 'SM') - print("init12:{}".format(utime.localtime())) - timer_t = net.nitzTime() - print("timer_t:{}".format(timer_t)) - if(timer_t != -1): - timeSecond = int(timer_t[1]) - if timeSecond != 0: - next_alarm_time = utime.localtime(timeSecond) - machine.RTC().datetime((next_alarm_time[0],next_alarm_time[1],next_alarm_time[2],next_alarm_time[6],next_alarm_time[3],next_alarm_time[4],next_alarm_time[5],0)) - - - - - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/pp_main.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/pp_main.py deleted file mode 100644 index a4544cff..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/pp_main.py +++ /dev/null @@ -1,1042 +0,0 @@ -########################## -# //碰碰交友 - -import utime -import osTimer -import lvgl as lv -import EventMesh -from machine import Timer -import voiceCall -import osTimer -import constants -from misc import Power -import pm -import ujson -import audio -import ql_fs -import audio -import sms -from machine import Pin -from lcd import lcd,lcd_ctrl,tp_cst816 -from misc import PWM -import uos -import gc -import _thread -from queue import Queue -import camera -from ui import style_screen,Screen,style_font_youyuan_20,style_font_youyuan_20_default,style_img -LCD_X = 128 -LCD_Y = 128 -ppmain_screen = None -ppmain_img = None -ppmain_name = None -ppmain_call_label = None -ppmain_imgbtn = None -delpp_img = None -delppmain_name = None -delppmain_call_label = None -class ppMainScreen(Screen): - NAME = "pp_main" - - def __init__(self): - super().__init__() - self.check_json = False - self.ppbook = {} - self.meta = None - self.state = 0 - EventMesh.subscribe("set_enter_pp_page",self.set_enter_pp_page) - EventMesh.subscribe("get_enter_pp_page",self.get_enter_pp_page) - - - def initialization(self): - - global ppmain_screen,ppmain_img,ppmain_name ,ppmain_imgbtn,delpp_img - if ppmain_screen == None: - ppmain_screen = lv.obj() - print("ppMainScreen") - ppmain_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - ppmain_call_label = lv.label(ppmain_screen) - ppmain_call_label.set_pos(25, 24) - ppmain_call_label.set_size(LCD_X-25, 40) - ppmain_call_label.set_text("碰碰好友") - ppmain_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - ppmain_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - ppmain_imgbtn = lv.img(ppmain_screen) #64 - ppmain_imgbtn.set_size(20, 20) - ppmain_imgbtn.set_src("U:/static/pp_friend01.png") - ppmain_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - ppmain_imgbtn.set_pos(10, 20) - - ppmain_name = lv.label(ppmain_screen) - ppmain_name.set_pos(0, 0) - ppmain_name.set_size(LCD_X, 60) - ppmain_name.set_text(" ") - ppmain_name.add_flag(lv.obj.FLAG.CLICKABLE) - ppmain_name.set_long_mode(lv.label.LONG.DOT) - ppmain_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - ppmain_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - ppmain_name.add_event_cb(lambda e: EventMesh.callback_wrapper(self.addpp(e)), - lv.EVENT.SHORT_CLICKED, None) - - delpp_img = lv.img(ppmain_screen) - delpp_img.set_pos(5, 60) - delpp_img.set_size(20, 20) - delpp_img.set_src("U:/static/pp_friend04.png") - delpp_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - delppmain_call_label = lv.label(ppmain_screen) - delppmain_call_label.set_pos(35, 64) - delppmain_call_label.set_size(LCD_X-35, 40) - delppmain_call_label.set_text("设备号交友") - delppmain_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delppmain_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - delppmain_name = lv.label(ppmain_screen) - delppmain_name.set_pos(0, 60) - delppmain_name.set_size(LCD_X, 60) - delppmain_name.set_text(" ") - delppmain_name.add_flag(lv.obj.FLAG.CLICKABLE) - delppmain_name.set_long_mode(lv.label.LONG.DOT) - delppmain_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delppmain_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - delppmain_name.add_event_cb(lambda e: EventMesh.callback_wrapper(self.delpp_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - - - self.meta = ppmain_screen - def addpp(self,*argc): - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - else: - data = EventMesh.publish("get_pplist") - if data != None: - self.ppbook = data - if self.ppbook != None: - # print(self.ppbook) - if len(self.ppbook) >= 5: - # print("del self.ppbook new1",self.ppbook) - # phonebook_keys = sorted(self.ppbook.keys())#排序,将升序排序 - # value = phonebook_keys[len(self.ppbook)-1] - - # value_tmp = '' - # if value.find("05:") != -1: - # value_tmp = value.split(":")[1] - # if len(value_tmp) > 0: - # EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_DEL_REQ_SEND,value_tmp) - # print("del self.ppbook new2",self.ppbook,value_tmp,value) - EventMesh.publish("load_screen", {"screen": "allpp_popup"}) - return - else: - EventMesh.publish("load_screen", {"screen": "pp_popup"}) - return - - EventMesh.publish("load_screen", {"screen": "pp_popup"}) - - def set_enter_pp_page(self, event, msg): - self.state = msg - - def get_enter_pp_page(self, event, msg): - - return self.state - - def delpp_cb(self,e): - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - return - else: - EventMesh.publish("load_screen", {"screen": "pp_list"}) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -pp_main_default = lv.style_t() -pp_main_default.init() -pp_main_default.set_radius(5) -pp_main_default.set_bg_color(lv.color_make(0x64,0x64,0x64)) -pp_main_default.set_bg_grad_color(lv.color_make(0x64,0x64,0x64)) -pp_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -pp_main_default.set_bg_opa(255) -pp_main_default.set_border_color(lv.color_make(0x64,0x64,0x64)) -pp_main_default.set_border_width(0) -pp_main_default.set_border_opa(255) -pp_main_default.set_pad_left(0) -pp_main_default.set_pad_right(0) -pp_main_default.set_pad_top(0) -pp_main_default.set_pad_bottom(0) - - -pp_style_font_youyuan_20_gray = lv.style_t() -pp_style_font_youyuan_20_gray.init() -pp_style_font_youyuan_20_gray.set_text_color(lv.color_make(200, 200, 200)) -pp_style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) - -style_alarm_screen_default = lv.style_t() -style_alarm_screen_default.init() -style_alarm_screen_default.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -style_alarm_screen_default.set_border_width(0) -style_alarm_screen_default.set_pad_left(0) -style_alarm_screen_default.set_pad_right(0) -style_alarm_screen_default.set_pad_top(0) -style_alarm_screen_default.set_pad_bottom(0) - -pp_list_screen = None -pp_list_title = None -pp_list_screen1_1 = None -no_add_pp = None -pp_list_screen = lv.obj() -print("pp_list_screen") -pp_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -pp_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - -# clk_list_title_bg= lv.btn(pp_list_screen) -# clk_list_title_bg.set_size(112,25) -# clk_list_title_bg.set_pos(8,5) -# clk_list_title_bg.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN | lv.STATE.DEFAULT) -# clk_list_title_bg.set_ext_click_area(25) - -pp_list_title = lv.label(pp_list_screen) -pp_list_title.set_pos(4, 5) -pp_list_title.set_size(112, 20) -pp_list_title.set_text("好友列表") -pp_list_title.set_long_mode(lv.label.LONG.WRAP) -pp_list_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -pp_list_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - -pp_list_screen1_1 = lv.obj(pp_list_screen) -pp_list_screen1_1.set_pos(0, 35) -pp_list_screen1_1.set_size(128, 128-35) -pp_list_screen1_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -pp_list_screen1_1.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -#暂未添加闹钟 -no_add_pp= lv.label(pp_list_screen1_1) -no_add_pp.set_pos(0, 20) -no_add_pp.set_size(128, 50) -no_add_pp.set_text("未添加好友") -no_add_pp.set_long_mode(lv.label.LONG.WRAP) -no_add_pp.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -no_add_pp.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -class ppListScreen(Screen): - NAME = "pp_list" - def __init__(self): - super().__init__() - self.meta = pp_list_screen - self.clock_list = [] - self.ppbook = {} - self.MXA_clk_num = 10 - self.timer = osTimer() - self.timer1 = osTimer() - self.timer2 = osTimer() - self.check_json = False - self.count = 0 - self.pp_detail_listt_dict = [] - self.ppcontact_detail_list = None - self.is_sliding = 0 - - self.ppcontact_detail_list = lv.obj(pp_list_screen) - self.ppcontact_detail_list.set_pos(0, 25) - self.ppcontact_detail_list.set_size(128, 128-25) - self.ppcontact_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - self.ppcontact_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - for i in range(self.MXA_clk_num): - - _btn = lv.btn(self.ppcontact_detail_list) - _btn.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - _btn.add_style(pp_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - _btn.add_flag(lv.obj.FLAG.CLICKABLE) - _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_pp(e)), - lv.EVENT.SHORT_CLICKED, None) - _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_pp(e)), - lv.EVENT.PRESSING, None) - - _btn_label1 = lv.label(_btn) - _btn_label2 = lv.label(_btn) - _btn_label2.set_long_mode(lv.label.LONG.SCROLL_CIRCULAR) - _btn_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - _btn_label3 = lv.label(_btn) - _btn_label3.set_long_mode(lv.label.LONG.SCROLL_CIRCULAR) - _btn_label3.add_style(pp_style_font_youyuan_20_gray, lv.PART.MAIN | lv.STATE.DEFAULT) - self.pp_detail_listt_dict.append({"_btn":_btn,"_btn_label1":_btn_label1,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3}) - - EventMesh.subscribe("pp_update_data",self.pp_update_data) - - def initialization(self): - EventMesh.publish("set_enter_pp_page",0) - self.is_sliding =0 - global pp_list_screen,pp_list_title,pp_list_screen1_1,no_add_pp - - if self.ppbook != None: - if len(self.ppbook) > 0: - self.btn_create_list_show(1) - else: - self.btn_create_list_show(0) - else: - self.btn_create_list_show(0) - self.count = 0 - self.timer2.start(1 * 1000, 1, self.time_fun) - - def pp_update_data(self,event,msg): - self.timer.start(1 * 1000, 0, self.OutTime_s) - - def OutTime_s(self,e): - data = EventMesh.publish("get_pplist") - if data != None: - self.ppbook = data - self.btn_create_list_show(1) - def time_fun(self,e): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 20: - self.count = 0 - self.timer2.stop() - - def post_processor_before_initialization(self): - data = EventMesh.publish("get_pplist") - if data != None: - self.ppbook = data - if self.ppbook != None: - if len(self.ppbook) == 0: - EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_REQ_SEND) - self.timer1.start(20* 1000, 0, self.NetOutTime_s) - - pass - - def NetOutTime_s(self,e):#网络异常 - data = EventMesh.publish("get_pplist") - if data != None: - self.ppbook = data - if self.ppbook != None: - if len(self.ppbook) == 0: - self.btn_create_list_show(2) - else: - self.btn_create_list_show(1) - else: - self.btn_create_list_show(1) - - def btn_create_list_show(self,state): - EventMesh.publish("publish_message_event_ui",{"func":self.addpp_draw_btn,"data":state}) - - - def addpp_draw_btn(self,state): - global pp_list_screen,pp_list_title,pp_list_screen1_1,no_add_pp - if state == 0: - no_add_pp.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.set_text("正在加载好友中,请稍候...") - self.ppcontact_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - pass - elif state == 2: - no_add_pp.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.set_text("网络异常或未添加好友,请重试") - self.ppcontact_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - pass - elif state == 1: - if len(self.ppbook) > 0: - self.ppcontact_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.add_flag(lv.obj.FLAG.HIDDEN) - j = 0 - num = 0 - phonebook_keys = sorted(self.ppbook.keys()) - print("self.ppbook",self.ppbook) - if len(self.ppbook) > self.MXA_clk_num: - j = len(self.ppbook) - self.MXA_clk_num - for i in range(0,self.MXA_clk_num): - if(j >= len(self.ppbook)): - self.pp_detail_listt_dict[i]["_btn"].add_flag(lv.obj.FLAG.HIDDEN) - continue - name = self.ppbook[phonebook_keys[j]] - key_tmp = phonebook_keys[j] - - #_btn = lv.btn(self.ppcontact_detail_list) - self.pp_detail_listt_dict[i]["_btn"].set_size(120,45) - self.pp_detail_listt_dict[i]["_btn"].set_pos(0,47*i) - - #_btn_label1 = lv.label(_btn) - self.pp_detail_listt_dict[i]["_btn_label1"].set_pos(20, 0) - self.pp_detail_listt_dict[i]["_btn_label1"].set_size(0, 0) - self.pp_detail_listt_dict[i]["_btn_label1"].set_text(key_tmp) - - #_btn_label2 = lv.label(_btn) - self.pp_detail_listt_dict[i]["_btn_label2"].set_pos(10, 0) - self.pp_detail_listt_dict[i]["_btn_label2"].set_size(97, 20) - self.pp_detail_listt_dict[i]["_btn_label2"].set_text(name) - self.pp_detail_listt_dict[i]["_btn_label2"].set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - #_btn_label3 = lv.label(_btn) - self.pp_detail_listt_dict[i]["_btn_label3"].set_pos(10, 25) - self.pp_detail_listt_dict[i]["_btn_label3"].set_size(128-8, 20) - self.pp_detail_listt_dict[i]["_btn_label3"].set_text(key_tmp[3:]) - - self.pp_detail_listt_dict[i]["_btn_label3"].set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - self.pp_detail_listt_dict[i]["_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - j+=1 - - else: - # no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.set_text("未添加好友") - self.ppcontact_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - else: - # no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) - no_add_pp.clear_flag(lv.obj.FLAG.HIDDEN) - self.ppcontact_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - - def edit_pp(self, e):# - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - imei = e.get_target().get_child(0).get_text() - print("pp imei".format(imei)) - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - else: - EventMesh.publish("load_screen", {"screen": "delOnepp_popup","meta":str(imei)}) - - self.is_sliding = 0 - def Close(self): - self.timer2.stop() - self.timer1.stop() - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "pp_main"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "pp_main"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -delNotPopup_screen = None -delNotPopup_call_label = None -delNotPopup_imgbtn = None -delconcelPopup_call_label = None -delNotPopup_call_label = None -delComfriPopup_call_label = None -delComfriPopup_ID = None -delComfriPopup_call_label1= None -delComfriPopup_call_label2 = None -class delOnePopupScreen(Screen):#删除单个好友 - NAME = "delOnepp_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.timer=osTimer() - self.timer_out=osTimer() - self.count = 0 - self.is_sliding = 0 - self.meta_type = "popup" - - def initialization(self): - self.is_sliding = 0 - self.count = 0 - global delNotPopup_screen,delNotPopup_call_label,delComfriPopup_call_label2 ,delComfriPopup_call_label1,delComfriPopup_call_label,delconcelPopup_call_label,delComfriPopup_ID - if delNotPopup_screen == None: - delNotPopup_screen = lv.obj() - print("delNotPopup_screen") - delNotPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - delNotPopup_call_label = lv.label(delNotPopup_screen) - delNotPopup_call_label.set_pos(0, 10) - delNotPopup_call_label.set_size(LCD_X-0, 39) - delNotPopup_call_label.set_text("是否删除该好友?") - delNotPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delNotPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - delComfriPopup_ID = lv.label(delNotPopup_screen) - delComfriPopup_ID.set_pos(0, 40) - delComfriPopup_ID.set_size(128, 48) - delComfriPopup_ID.set_text(" ") - delComfriPopup_ID.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delComfriPopup_ID.add_style(style_font_youyuan_20_default, lv.PART.MAIN | lv.STATE.DEFAULT) - - delComfriPopup_call_label1 = lv.label(delNotPopup_screen) - delComfriPopup_call_label1.set_pos(0, 70) - delComfriPopup_call_label1.set_size(64, 50) - delComfriPopup_call_label1.set_text(" ") - delComfriPopup_call_label1.add_flag(lv.obj.FLAG.CLICKABLE) - delComfriPopup_call_label1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.SHORT_CLICKED, None) - delComfriPopup_call_label1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.PRESSING, None) - - delComfriPopup_call_label2 = lv.label(delNotPopup_screen) - delComfriPopup_call_label2.set_pos(64, 70) - delComfriPopup_call_label2.set_size(64, 50) - delComfriPopup_call_label2.set_text(" ") - delComfriPopup_call_label2.add_flag(lv.obj.FLAG.CLICKABLE) - delComfriPopup_call_label2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)), - lv.EVENT.SHORT_CLICKED, None) - delComfriPopup_call_label2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)), - lv.EVENT.PRESSING, None) - - delComfriPopup_call_label = lv.label(delNotPopup_screen) - delComfriPopup_call_label.set_pos(0, 80) - delComfriPopup_call_label.set_size(64, 48) - delComfriPopup_call_label.set_text("确定") - delComfriPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delComfriPopup_call_label.add_flag(lv.obj.FLAG.CLICKABLE) - delComfriPopup_call_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.SHORT_CLICKED, None) - delComfriPopup_call_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.PRESSING, None) - delComfriPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - delconcelPopup_call_label = lv.label(delNotPopup_screen) - delconcelPopup_call_label.set_pos(64, 80) - delconcelPopup_call_label.set_size(64, 48) - delconcelPopup_call_label.set_text("取消") - delconcelPopup_call_label.add_flag(lv.obj.FLAG.CLICKABLE) - delconcelPopup_call_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)), - lv.EVENT.SHORT_CLICKED, None) - delconcelPopup_call_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)), - lv.EVENT.PRESSING, None) - delconcelPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delconcelPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = delNotPopup_screen - self.timer.start(1*1000,1,self.fun) - delComfriPopup_ID.set_text(str(self.meta_info[3:])) - def confirm(self, e): - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#未联网提示关机 - EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_DEL_REQ_SEND,self.meta_info[3:]) - old_pplist = EventMesh.publish("get_pplist") - del old_pplist[self.meta_info] - print("del old_pplist",old_pplist) - EventMesh.publish("set_pplist",old_pplist) - EventMesh.publish("load_screen", {"screen": "delppok_popup"}) - else: - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - - self.is_sliding =0 - - pass - def concel(self, e): - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 - EventMesh.publish("load_screen", {"screen": "pp_list"}) - self.is_sliding =0 - - pass - - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count > 10: - self.count = 0 - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "pp_list"}) - - def Close(self): - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -allppPopup_screen = None -allppPopup_call_label = None -allppPopup_imgbtn = None -allppPopup_call_label = None -class allppPopupScreen(Screen):#没有加好友弹窗提示 - NAME = "allpp_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.timer=osTimer() - self.meta_type = "popup" - self.count = 0 - - def initialization(self): - self.count = 0 - global allppPopup_screen,allppPopup_call_label ,allppPopup_imgbtn - if allppPopup_screen == None: - allppPopup_screen = lv.obj() - print("allppPopup_screen") - allppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - allppPopup_call_label = lv.label(allppPopup_screen) - allppPopup_call_label.set_pos(0, 40) - allppPopup_call_label.set_size(LCD_X-0, 60) - allppPopup_call_label.set_text("好友个数已达5个,请删除后再添加") - allppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - allppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.meta = allppPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 10: - self.count = 0 - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "pp_main"}) - - def Close(self): - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -noppPopup_screen = None -noppPopup_call_label = None -noppPopup_imgbtn = None -noppPopup_call_label = None -class noppPopupScreen(Screen):#没有加好友弹窗提示 - NAME = "nopp_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.timer=osTimer() - self.timer_out=osTimer() - self.meta_type = "popup" - self.count = 0 - def initialization(self): - self.count = 0 - global noppPopup_screen,noppPopup_call_label ,noppPopup_imgbtn - if noppPopup_screen == None: - noppPopup_screen = lv.obj() - print("noppPopup_screen") - noppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - noppPopup_call_label = lv.label(noppPopup_screen) - noppPopup_call_label.set_pos(0, 54) - noppPopup_call_label.set_size(LCD_X-0, 39) - noppPopup_call_label.set_text("未加好友") - noppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - noppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.meta = noppPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 10: - self.count = 0 - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "pp_main"}) - - def Close(self): - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -delppokPopup_screen = None -delppokPopup_call_label = None -class delppsucessPopupScreen(Screen):#没有加好友弹窗提示 - NAME = "delppok_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.timer=osTimer() - self.timer_out=osTimer() - self.meta_type = "popup" - self.count = 0 - - def initialization(self): - self.count = 0 - global delppokPopup_screen,delppokPopup_call_label - if delppokPopup_screen == None: - delppokPopup_screen = lv.obj() - print("delppok_popup") - delppokPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - delppokPopup_call_label = lv.label(delppokPopup_screen) - delppokPopup_call_label.set_pos(0, 54) - delppokPopup_call_label.set_size(LCD_X-0, 39) - delppokPopup_call_label.set_text("好友删除成功") - delppokPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - delppokPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.meta = delppokPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 5: - self.count = 0 - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "pp_main"}) - - def Close(self): - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -ppPopup_screen = None -ppPopup_call_label = None -ppPopup_imgbtn = None -class ppMainPopupScreen(Screen):#弹窗提示 - NAME = "pp_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.timer=osTimer() - self.timer_out=osTimer() - self.meta_type = "popup" - self.count = 0 - EventMesh.subscribe("close_pp_timer",self.close_pp_timer) - - def initialization(self): - EventMesh.publish("set_enter_pp_page",1) - self.count = 0 - global ppPopup_screen,ppPopup_imgbtn,ppPopup_call_label - if ppPopup_screen == None: - ppPopup_screen = lv.obj() - print("ppPopup_screen") - ppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - ppPopup_call_label = lv.label(ppPopup_screen) - ppPopup_call_label.set_pos(0, 89) - ppPopup_call_label.set_size(LCD_X-0, 39) - ppPopup_call_label.set_text("搜索好友中,请稍候...") - ppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - ppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - ppPopup_imgbtn = lv.img(ppPopup_screen) #64 - ppPopup_imgbtn.set_size(109, 79) - ppPopup_imgbtn.set_src("U:/static/pp_friend02.png") - ppPopup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - ppPopup_imgbtn.set_pos(14, 5) - - self.meta = ppPopup_screen - EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.PP_SEND) #开始碰碰 - self.timer.start(1*1000,1,self.fun) - self.timer_out.start(30*1000,0,self.timeout_fun) - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - - def close_pp_timer(self, event, msg): - self.timer_out.stop() - - def timeout_fun(self,*argc): - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME == "pp_popup": - EventMesh.publish("load_screen", {"screen": "addfailepp_popup"}) - def Close(self): - - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -addppPopup_screen = None -addppPopup_call_label = None -addppPopup_imgbtn = None -addppPopup_ok_label = None -class addppPopupScreen(Screen):#弹窗提示 - NAME = "addpp_popup" - - def __init__(self): - super().__init__() - self.timer=osTimer() - self.meta = None - self.meta_type = "popup" - self.count = 0 - def initialization(self): - EventMesh.publish("close_pp_timer") - self.count = 0 - global addppPopup_screen,addppPopup_imgbtn,addppPopup_call_label,addppPopup_ok_label - if addppPopup_screen == None: - addppPopup_screen = lv.obj() - print("addpp_popup") - addppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - addppPopup_call_label = lv.label(addppPopup_screen) - addppPopup_call_label.set_pos(0, 89) - addppPopup_call_label.set_size(LCD_X-0, 19) - addppPopup_call_label.set_text(" ") - addppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - addppPopup_call_label.add_style(style_font_youyuan_20_default, lv.PART.MAIN | lv.STATE.DEFAULT) - - addppPopup_ok_label = lv.label(addppPopup_screen) - addppPopup_ok_label.set_pos(0, 109) - addppPopup_ok_label.set_size(LCD_X-0, 19) - addppPopup_ok_label.set_text("成功加好友") - addppPopup_ok_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - addppPopup_ok_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - addppPopup_imgbtn = lv.img(addppPopup_screen) #64 - addppPopup_imgbtn.set_size(73, 78) - addppPopup_imgbtn.set_src("U:/static/pp_friend03.png") - addppPopup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - addppPopup_imgbtn.set_pos(27, 5) - - self.meta = addppPopup_screen - print("self.meta_info",self.meta_info) - self.timer.start(1*1000,1,self.fun) - addppPopup_call_label.set_text(str(self.meta_info)) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 5: - self.count = 0 - self.timer.stop() - EventMesh.publish("return_prev_screen") - - def Close(self): - self.count = 0 - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -addedppPopup_screen = None -addedppPopup_call_label = None -class addedppPopupScreen(Screen):#已加过好友弹窗提示 - NAME = "addedpp_popup" - - def __init__(self): - super().__init__() - self.timer=osTimer() - self.meta = None - self.meta_type = "popup" - self.count = 0 - def initialization(self): - EventMesh.publish("close_pp_timer") - self.count = 0 - global addedppPopup_screen,addedppPopup_call_label - if addedppPopup_screen == None: - addedppPopup_screen = lv.obj() - print("addedpp_popup") - addedppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - addedppPopup_call_label = lv.label(addedppPopup_screen) - addedppPopup_call_label.set_pos(0, 54) - addedppPopup_call_label.set_size(LCD_X-0, 50) - addedppPopup_call_label.set_text("已经是好友了") - addedppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - addedppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = addedppPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 5: - self.count = 0 - self.timer.stop() - EventMesh.publish("return_prev_screen") - - def Close(self): - self.count = 0 - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -ownaddppPopup_screen = None -ownaddedppPopup_call_label = None -class ownaddppPopupScreen(Screen):#自己已过好友弹窗提示 - NAME = "ownaddedpp_popup" - - def __init__(self): - super().__init__() - self.timer=osTimer() - self.meta = None - self.meta_type = "popup" - self.count = 0 - def initialization(self): - self.count = 0 - EventMesh.publish("close_pp_timer") - global ownaddppPopup_screen ,ownaddedppPopup_call_label - if ownaddppPopup_screen == None: - ownaddppPopup_screen = lv.obj() - print("ownaddedpp_popup") - ownaddppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - ownaddedppPopup_call_label = lv.label(ownaddppPopup_screen) - ownaddedppPopup_call_label.set_pos(0, 54) - ownaddedppPopup_call_label.set_size(LCD_X-0, 50) - ownaddedppPopup_call_label.set_text("自己已加过好友了") - ownaddedppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - ownaddedppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = ownaddppPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 5: - self.count = 0 - self.timer.stop() - EventMesh.publish("return_prev_screen") - - def Close(self): - self.count = 0 - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - -addfaileppPopup_screen = None -addfaileppPopup_call_label = None -class addfaileppPopupScreen(Screen):#交友失败 - NAME = "addfailepp_popup" - - def __init__(self): - super().__init__() - self.timer=osTimer() - self.meta = None - self.meta_type = "popup" - self.count = 0 - def initialization(self): - self.count = 0 - EventMesh.publish("close_pp_timer") - global addfaileppPopup_screen ,addfaileppPopup_call_label - if addfaileppPopup_screen == None: - addfaileppPopup_screen = lv.obj() - print("addfailepp_popup") - addfaileppPopup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - addfaileppPopup_call_label = lv.label(addfaileppPopup_screen) - addfaileppPopup_call_label.set_pos(0, 54) - addfaileppPopup_call_label.set_size(LCD_X-0, 50) - addfaileppPopup_call_label.set_text("交友失败,请重试") - addfaileppPopup_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - addfaileppPopup_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = addfaileppPopup_screen - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - if self.count > 5: - self.count = 0 - self.timer.stop() - EventMesh.publish("return_prev_screen") - - def Close(self): - self.count = 0 - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/sleep_test.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/sleep_test.py deleted file mode 100644 index 1af3af79..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/sleep_test.py +++ /dev/null @@ -1,54 +0,0 @@ -import uos -import ql_fs -if ql_fs.path_exists("/ext") == False: - ldev = uos.VfsLfs1(32, 32, 32, "ext_fs",0,3) - uos.mount(ldev,'/ext') -res = uos.statvfs("/ext") -res = list(res) -print('总ext空间:{} MB,剩余空间:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) -from lcd import tp_cst816 -from btn_device_ec800m import BtnDevice - -import lvgl as lv -import utime -import osTimer -import pm -import ql_fs -from machine import Pin -from lcd import lcd,lcd_ctrl,tp_cst816,lcd_ctrl -from misc import PWM -import uos -from machine import I2C -from Hsensor import GH3018 -from Gsensor import SC7A20 -btn_device = BtnDevice(tp_cst816) -btn_device.start() -i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE) -WHO_AM_I = bytearray([0x01, 0]) -I2C_SLAVE_ADDR = 0x49 -r_data = bytearray(2) -data = bytearray([0x60A0, 0]) #休眠 -i2c0.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) -def gsensor_cb(self, para): - print("gsensor_cb:{}".format(para)) -gsensor = SC7A20() -print("DeviceInfoManager:1.0") -gsensor.activate() -print("DeviceInfoManager:1.1") -gsensor.init() -print("DeviceInfoManager:2") -gsensor.set_callback(gsensor_cb) -hsensor = GH3018() -hsensor.activate() -hsensor.init() -hsensor.open_blood_oxygen() -utime.sleep(5) -PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1000) -PWM_backlight.open() -hsensor.close() -tp_cst816.suspend() -lcd.lcd_display_off() -#lcd_ctrl.write(0) -lv.autoSleep(1) -pm.autosleep(1) -print("test end2") \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_audio.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_audio.c index 45fc1930..9626a5e4 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_audio.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_audio.c @@ -39,7 +39,7 @@ || defined(BOARD_EC600MCN_LA_POC_ZZD) || defined(BOARD_EC600MCN_LE_POC_ZZD) \ || defined(BOARD_EC600MCN_LE_POC_QS) || defined(BOARD_EC600MCN_LE_VOLTE) || defined(BOARD_EC600MCN_LE_BTZ)\ || defined(BOARD_EC600MCN_MC) || defined(BOARD_EC600MEU_LA) || defined(BOARD_EC600MEU_LA_POC_XBND) \ - || defined(BOARD_EC800MCN_GA) || defined(BOARD_EC800MCN_GA_VOLTE) \ + || defined(BOARD_EC800MCN_GA) || defined(BOARD_EC800MCN_GA_VOLTE) || defined(BOARD_EC600MLA_LA_POC_XBND)\ || defined(BOARD_EC800MCN_GA_ALIPAY) || defined(BOARD_EG810MCN_GA_ALIPAY) \ || defined(BOARD_EC800MCN_GA_SPISD) || defined(BOARD_EC800MCN_GA_MS) || defined(BOARD_EC800MCN_GA_VOEXT)\ || defined(BOARD_EC800MCN_LE) || defined(BOARD_EC800MCN_LE_VOLTE) || defined(BOARD_EC800MCN_LE_VOLVGL)\ @@ -48,7 +48,7 @@ || defined(BOARD_EG810MCN_GB) || defined(BOARD_EG810MCN_GB_VOEXT) \ || defined(BOARD_EG810MCN_LA) || defined(BOARD_EG810MCN_LA_VOLTE) \ || defined(BOARD_EG810MEU_LA) || defined(BOARD_EG810MEU_LA_VOEXT) \ - || defined(PLAT_ASR_1803s) + || defined(PLAT_ASR_1803s) || defined(BOARD_EC800MCN_LE_CPE) || defined(BOARD_EC800MCN_GB_VOEXT) @@ -135,7 +135,7 @@ extern int audio_play_callback(char *ptr, size_t lens, Helios_EnumAudPlayerState #else #if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8850) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05)|| defined(PLAT_Unisoc_8910_R06) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) #define GET_FILE_VFS_PATH(x, y) get_vfs_path(x,y) #else #define GET_FILE_VFS_PATH(x, y) \ @@ -184,6 +184,22 @@ extern int audio_play_callback(char *ptr, size_t lens, Helios_EnumAudPlayerState #endif + +//虚函数,用来解决ASR160X R07在关闭MP3解码库宏控时造成的编译问�? +#if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) \ + || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8910_R06) + +#if (!CONFIG_AUDIO_MP3) || (!defined(CONFIG_AUDIO_MP3)) +__attribute__((weak)) void Helios_mp3_stream_close_flag(unsigned char value) +{ + (void) value; + return; +} +#endif + +#endif +//end + STATIC void delay_us(unsigned int us) { int cnt = 26; @@ -350,6 +366,16 @@ void user_audio_speakerpa_callback(unsigned int event) event = AUDIO_PA_OPEN_DELAY; } #endif + +#if defined(BOARD_EC600MCN_LE_POC_QS) + extern unsigned char ptt_tone_play_end_skip_pa; + if(ptt_tone_play_end_skip_pa) + { + ptt_tone_play_end_skip_pa--; + return; + } +#endif + switch(event) { case AUDIO_PA_CLOSE_NOW: @@ -384,7 +410,7 @@ void user_audio_speakerpa_callback(unsigned int event) set_pa_flag(0); pa_ctrl = 0; Helios_MsgQ_Put(open_pa_q, (const void *)&pa_ctrl, sizeof(uint8_t), HELIOS_NO_WAIT); - on_off = 0; + on_off = 0; break; default: HELIOS_AUDIO_LOG("audio pa error event:%d\r\n",event); @@ -408,7 +434,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mpy_set_audio_read_delay_obj, mpy_set_audio_rea #endif #if defined (PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8850) \ - || defined(PLAT_EIGEN) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_EIGEN)|| defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) \ + || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1803s) STATIC mp_obj_t helios_set_pa(size_t n_args, const mp_obj_t *args) { int ret = 0; @@ -495,6 +522,22 @@ STATIC mp_obj_t helios_user_speakerpa_switch(mp_obj_t self_in, mp_obj_t pa_com) } STATIC MP_DEFINE_CONST_FUN_OBJ_2(helios_user_speakerpa_switch_obj, helios_user_speakerpa_switch); +#if defined(PLAT_Unisoc_8850_R02) && defined(CONFIG_POC) +STATIC mp_obj_t helios_set_audio_data_dump_log(mp_obj_t self_in, mp_obj_t set) +{ + unsigned char enable = 0; + int ret = -1; + if(mp_obj_get_int(enable) < 0 || mp_obj_get_int(enable) > 1) { + mp_raise_ValueError(MP_ERROR_TEXT("invalid parameter")); + } + enable = mp_obj_get_int(set); + ret = Helios_Debug_PCM_Data_Dump_Log_Set(enable); + return mp_obj_new_int(ret); +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_2(helios_set_audio_data_dump_log_obj, helios_set_audio_data_dump_log); +#endif + #if defined(PLAT_Unisoc) STATIC mp_obj_t helios_internal_pa_type(mp_uint_t n_args, const mp_obj_t *args) { @@ -548,7 +591,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(helios_set_audio_callback_obj, helios_set_audio #if !CONFIG_AUDIO_PWM #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined (PLAT_Unisoc_8850) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) \ + || defined(PLAT_ASR_1803s) STATIC mp_obj_t helios_audio_set_channel(mp_obj_t self_in, mp_obj_t dev) { audio_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -630,7 +674,7 @@ STATIC mp_obj_t audio_make_new(const mp_obj_type_t *type, size_t n_args, size_t } asynch_open_pa_init(); #if !CONFIG_AUDIO_PWM -#if !defined(PLAT_EIGEN) +#if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) if (!audio_channel_check(device)) { mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("The current platform does not support device %d."), device); @@ -652,8 +696,10 @@ STATIC mp_obj_t audio_make_new(const mp_obj_type_t *type, size_t n_args, size_t #endif #if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) -#if defined(PLAT_EIGEN) + || defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06)\ + || defined(PLAT_EIGEN_718) || defined(PLAT_ASR_1803s) + +#if defined(PLAT_EIGEN) || defined(PLAT_EIGEN_718) extern int Helios_Audio_SetPaCallback_py(Helios_AudOutputType type, helios_audio_pa_cb_t cb); Helios_Audio_SetPaCallback_py((Helios_AudOutputType)device, user_audio_speakerpa_callback); #else @@ -662,7 +708,7 @@ STATIC mp_obj_t audio_make_new(const mp_obj_type_t *type, size_t n_args, size_t #endif #if !CONFIG_AUDIO_PWM -#if !defined(PLAT_EIGEN) +#if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) if(device == HELIOS_OUTPUT_RECEIVER||device == HELIOS_OUTPUT_SPEAKER||device == HELIOS_OUTPUT_HEADPHONE){ Helios_Audio_SetAudioChannle(device); } @@ -860,7 +906,7 @@ STATIC mp_obj_t helios_play_file_start(size_t n_args, const mp_obj_t *args, mp_m HELIOS_AUDIO_LOG("---- stop audio montage play. ----\r\n"); audio.montage_is_stopping = 1; helios_set_montage_break_flag(1); - #if !defined(PLAT_EIGEN) + #if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) audio_err_handle(); #endif Helios_msleep(200); @@ -1114,7 +1160,7 @@ STATIC mp_obj_t helios_play_file_stop_all(mp_obj_t self_in) int ret = 0; helios_set_montage_break_flag(1); - #if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + #if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) audio_err_handle(); #endif @@ -1171,7 +1217,7 @@ STATIC mp_obj_t helios_play_stream_start(size_t n_args, const mp_obj_t *args, mp int format = 1; format = vals[ARG_format].u_int; int play_len = vals[ARG_len].u_int; -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) if(format <= HELIOS_AUDIO_FORMAT_UNKNOWN || format >= HELIOS_AUDIO_FORMAT_MAX) { mp_raise_ValueError(MP_ERROR_TEXT("Unsupport format!")); @@ -1197,7 +1243,7 @@ STATIC mp_obj_t helios_play_stream_start(size_t n_args, const mp_obj_t *args, mp } } #if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) \ - || defined(PLAT_ASR_1602) + || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8910_R06) Helios_mp3_stream_close_flag(vals[ARG_mode].u_int); #endif MP_THREAD_GIL_EXIT(); @@ -1213,7 +1259,7 @@ STATIC mp_obj_t helios_play_stream_start(size_t n_args, const mp_obj_t *args, mp } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(helios_play_stream_start_obj, 1, helios_play_stream_start); -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) STATIC mp_obj_t helios_pcm_para_set(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { enum { ARG_samplerate, ARG_channels }; @@ -1264,7 +1310,7 @@ STATIC mp_obj_t helios_play_stream_stop(mp_obj_t self_in) Helios_Mutex_Lock(audio.montage_mutex, HELIOS_WAIT_FOREVER); helios_set_montage_break_flag(1); - #if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + #if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) audio_err_handle(); #endif @@ -1310,7 +1356,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_play_stop_obj, helios_audio_play_s /*=============================================================================*/ STATIC mp_obj_t helios_get_audio_state(mp_obj_t self_in) { - #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) int ret = helios_audio_getInitState(); #else int ret = 0; @@ -1398,7 +1444,7 @@ STATIC mp_obj_t helios_set_ToneVolume(mp_obj_t self_in, mp_obj_t volume) STATIC MP_DEFINE_CONST_FUN_OBJ_2(helios_set_ToneVolume_obj, helios_set_ToneVolume); #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) STATIC mp_obj_t helios_play_stream_jump(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { enum { ARG_second, ARG_drection }; @@ -1481,7 +1527,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(helios_play_jump_frame_obj, 1, helios_play_fra #endif #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) #ifndef AUDIO_DTMF_TONE_NEW_SUPPORT STATIC const mp_arg_t tone_allowed_args[] = { { MP_QSTR_tone, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, @@ -1766,10 +1812,26 @@ STATIC mp_obj_t helios_aud_tone_play_stop(mp_obj_t self_in) STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_aud_tone_play_stop_obj, helios_aud_tone_play_stop); +#if defined(BOARD_EC800GCN_LD_XBND) +STATIC mp_obj_t helios_aud_set_tone_gain(mp_obj_t self_in, mp_obj_t gain) { + int tone_gain = mp_obj_get_int(gain); + if (tone_gain < 0 || tone_gain > 0x4000) + { + mp_raise_ValueError(MP_ERROR_TEXT("invalid value,tone gain should be array between [0x0, 0x4000]")); + return mp_obj_new_int(-1); + } + int ret = 0; + ret = Helios_Audio_Set_Tone_Gain(tone_gain); + return mp_obj_new_int(ret); +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_2(helios_aud_set_tone_gain_obj, helios_aud_set_tone_gain); +#endif + #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) STATIC mp_obj_t helios_setGainTabel(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -1802,7 +1864,7 @@ STATIC mp_obj_t helios_setGainTabel(size_t n_args, const mp_obj_t *args, mp_map_ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(helios_setgaintabel_obj, 1, helios_setGainTabel); #endif -#if defined (PLAT_EIGEN) +#if defined (PLAT_EIGEN) || defined(PLAT_EIGEN_718) STATIC mp_obj_t helios_setGainTabel(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -1861,7 +1923,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio___del___obj, helios_audio___del__) //================================montage Handel start===================================================== #if defined (PLAT_Unisoc) || defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ -|| defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) +|| defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) extern int Helios_Audio_MontageFilePlayStart(char *montage_name, char *file_name, Helios_AudPlayerType type, helios_cb_on_player usr_cb, int device); static mp_obj_t helios_play_montage_file_start(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) @@ -2020,7 +2082,7 @@ static mp_obj_t helios_play_montage_file_start(size_t n_args, const mp_obj_t *ar HELIOS_AUDIO_LOG("---- stop audio montage play. ----\r\n"); audio.montage_is_stopping = 1; helios_set_montage_break_flag(1); - #if !defined(PLAT_EIGEN) + #if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) audio_err_handle(); #endif Helios_msleep(200); @@ -2193,7 +2255,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_aud_cache_size_obj, helios_aud_mp3_cache #endif #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) || defined(PLAT_Unisoc_8910_R06) STATIC mp_obj_t mpy_get_audio_file_time_lenth(mp_obj_t self_in, mp_obj_t filename) { char vfs_name[256] = {0}; char *new_data = NULL; @@ -2215,7 +2277,7 @@ STATIC mp_obj_t mpy_get_audio_file_time_lenth(mp_obj_t self_in, mp_obj_t filenam STATIC MP_DEFINE_CONST_FUN_OBJ_2(mpy_get_audio_file_time_lenth_obj, mpy_get_audio_file_time_lenth); #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) STATIC mp_obj_t mpy_audio_pause(mp_obj_t self_in, mp_obj_t enable_obj) { int enable = mp_obj_get_int(enable_obj); if (enable == 1) { @@ -2228,6 +2290,64 @@ STATIC mp_obj_t mpy_audio_pause(mp_obj_t self_in, mp_obj_t enable_obj) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(mpy_audio_pause_obj, mpy_audio_pause); #endif +#if defined(PLAT_ASR_1606) && (defined(BOARD_EC600MCN_LE_POC_QS)|| defined(BOARD_EC600MCN_LA_POC_XBND)) +STATIC mp_obj_t helios_audio_denoise_config(mp_uint_t n_args, const mp_obj_t *args) { + unsigned char cfg = 0; + int ret =-1; + if(n_args == 1) + { + ret = Helios_Audio_Get_Denoise(&cfg); + if(0 != ret) + { + return mp_obj_new_int(-1); + } + return mp_obj_new_int(cfg); + } + else if(n_args == 2) + { + unsigned char check_flag = 0; + Helios_Audio_Check_Denoise_Licenses_Verify(&check_flag); + if(0 == check_flag) + { + return mp_obj_new_int(-2); + } + cfg = mp_obj_get_int(args[1]); + ret = Helios_Audio_Set_Denoise(cfg); + return mp_obj_new_int(ret); + } + return mp_obj_new_int(-1); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(helios_audio_denoise_config_obj, 1, 2, (mp_obj_t)helios_audio_denoise_config); + +STATIC mp_obj_t helios_audio_denoise_check_verify(mp_obj_t self_in) +{ + unsigned char check_flag = 0; + Helios_Audio_Check_Denoise_Licenses_Verify(&check_flag); + return mp_obj_new_int(check_flag); //0-unauthorized 1-authorized +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_denoise_check_verify_obj, helios_audio_denoise_check_verify); + +STATIC mp_obj_t helios_audio_get_denoise_libary_version(mp_obj_t self_in) +{ + char version[64] = {0}; + char data_len = 0; + Helios_Audio_Get_Denoise_Lib_Version(&version); + for(int i=0; i<64; i++) + { + if(version[i]==0) + { + data_len = i; + break; + } + } + return mp_obj_new_str(version, data_len); +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_get_denoise_libary_version_obj, helios_audio_get_denoise_libary_version); + + +#endif const mp_obj_type_t audio_audio_pcm; STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { @@ -2238,6 +2358,14 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_getState), MP_ROM_PTR(&helios_get_audio_state_obj) }, { MP_ROM_QSTR(MP_QSTR_getPlayState), MP_ROM_PTR(&helios_get_audio_play_state_obj) }, { MP_ROM_QSTR(MP_QSTR_getPlayFile), MP_ROM_PTR(&helios_get_audio_playing_file_name_obj) }, +#if defined(PLAT_Unisoc_8850_R02) && defined(CONFIG_POC) + { MP_ROM_QSTR(MP_QSTR_setDataDumpLog), MP_ROM_PTR(&helios_set_audio_data_dump_log_obj) }, +#endif +#if defined(PLAT_ASR_1606) && (defined(BOARD_EC600MCN_LE_POC_QS)|| defined(BOARD_EC600MCN_LA_POC_XBND)) + { MP_ROM_QSTR(MP_QSTR_audDenoiseConfig), MP_ROM_PTR(&helios_audio_denoise_config_obj) }, + { MP_ROM_QSTR(MP_QSTR_audDenoiseCheckVerify), MP_ROM_PTR(&helios_audio_denoise_check_verify_obj) }, + { MP_ROM_QSTR(MP_QSTR_audDenoiseVersion), MP_ROM_PTR(&helios_audio_get_denoise_libary_version_obj) }, +#endif #ifdef AUDIO_DTMF_TONE_NEW_SUPPORT { MP_ROM_QSTR(MP_QSTR_setToneVolume), MP_ROM_PTR(&helios_set_ToneVolume_obj) }, #endif @@ -2250,9 +2378,10 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_playStream), MP_ROM_PTR(&helios_play_stream_start_obj) }, { MP_ROM_QSTR(MP_QSTR_stopPlayStream), MP_ROM_PTR(&helios_play_stream_stop_obj) }, #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined (PLAT_Unisoc_8850) \ - || defined(PLAT_EIGEN) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_EIGEN) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) \ + || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) || defined(PLAT_ASR_1803s) #if !CONFIG_AUDIO_PWM -#if !defined(PLAT_EIGEN) +#if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) { MP_ROM_QSTR(MP_QSTR_set_channel), MP_ROM_PTR(&helios_set_channel_obj) }, #endif #endif @@ -2266,10 +2395,13 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { #endif #endif -#if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8910_R05) \ +#if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) \ || defined(PLAT_ASR_1602) || defined(PLAT_ASR_1803s) || defined(PLAT_Unisoc_8850_R02) { MP_ROM_QSTR(MP_QSTR_aud_tone_play), MP_ROM_PTR(&mp_helios_aud_tone_play_obj) }, { MP_ROM_QSTR(MP_QSTR_aud_tone_play_stop), MP_ROM_PTR(&helios_aud_tone_play_stop_obj) }, +#if defined(BOARD_EC800GCN_LD_XBND) + { MP_ROM_QSTR(MP_QSTR_aud_set_tone_gain), MP_ROM_PTR(&helios_aud_set_tone_gain_obj) }, +#endif #if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1602) #if CONFIG_AUDIO_MP3 { MP_ROM_QSTR(MP_QSTR_aud_cache_clear), MP_ROM_PTR(&helios_aud_clear_cache_obj) }, @@ -2278,24 +2410,24 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { #endif #endif #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_montage_play), MP_ROM_PTR(&helios_play_montage_file_start_obj) }, #endif #if CONFIG_AUDIO { MP_ROM_QSTR(MP_QSTR_FrameJumpNum), MP_ROM_PTR(&helios_play_jump_frame_obj) }, #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_pcmParaSet), MP_ROM_PTR(&helios_pcm_para_obj) }, { MP_ROM_QSTR(MP_QSTR_StreamJump), MP_ROM_PTR(&helios_play_stream_jump_obj) }, { MP_ROM_QSTR(MP_QSTR_StreamPause), MP_ROM_PTR(&helios_play_stream_pause_obj) }, { MP_ROM_QSTR(MP_QSTR_StreamContinue), MP_ROM_PTR(&helios_play_stream_continue_obj) }, { MP_ROM_QSTR(MP_QSTR_StreamSeek), MP_ROM_PTR(&helios_play_stream_seek_obj) }, #endif -#if defined (PLAT_Unisoc) || defined (PLAT_EIGEN) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined (PLAT_EIGEN) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_setGainTabel), MP_ROM_PTR(&helios_setgaintabel_obj) }, #endif #if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1602) \ - || defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + || defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_PCM), MP_ROM_PTR(&audio_audio_pcm) }, #endif @@ -2311,10 +2443,10 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_pause), MP_ROM_PTR(&mpy_audio_pause_obj) }, #endif -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_getFileTimeLenth), MP_ROM_PTR(&mpy_get_audio_file_time_lenth_obj) }, #endif }; @@ -2327,7 +2459,7 @@ const mp_obj_type_t audio_audio_type = { .locals_dict = (mp_obj_dict_t *)&audio_locals_dict, }; -#if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_ASR_1803s) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) #define QL_PCM_BLOCK_FLAG (0x01) #define QL_PCM_NONBLOCK_FLAG (0x02) @@ -2381,11 +2513,9 @@ enum{ PCM_FLAG_WRITE_READ, PCM_FLAG_MAX, }; - - - -//void *Helios_PCM_Open(unsigned int channels, unsigned int samplerate, unsigned int flags); -//int Helios_PCM_Close(void* handle); +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +static int poc_mode_state = 0; +#endif STATIC void machine_pcm_init_helper(machine_pcm_obj_t *self, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_channel, ARG_samplerate, ARG_flags, ARG_mode, ARG_periodcnt}; static const mp_arg_t allowed_args[] = { @@ -2400,7 +2530,7 @@ STATIC void machine_pcm_init_helper(machine_pcm_obj_t *self, size_t n_args, cons mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - if(args[ARG_channel].u_int != 1 && args[ARG_channel].u_int != 2) { + if(args[ARG_channel].u_int > 2) { mp_raise_ValueError(MP_ERROR_TEXT("invalid channels")); } @@ -2432,7 +2562,7 @@ STATIC void machine_pcm_init_helper(machine_pcm_obj_t *self, size_t n_args, cons pcm_info.samplerate = args[ARG_samplerate].u_int; pcm_info.periodcnt = args[ARG_periodcnt].u_int; -#if defined(PLAT_Unisoc) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) if(args[ARG_flags].u_int == PCM_FLAG_WRITE_READ){ Helios_set_pcm_type(HELIOS_PCM_POC, HELIOS_POC_TYPE_FULL_DUPLEX); } @@ -2441,6 +2571,11 @@ STATIC void machine_pcm_init_helper(machine_pcm_obj_t *self, size_t n_args, cons } #endif +#if defined(PLAT_Unisoc_8910_R06) + if (args[ARG_flags].u_int == PCM_FLAG_WRITE_READ) { + mp_raise_ValueError(MP_ERROR_TEXT("not support this mode")); // Unisoc 8910 C2 Audio do nont support duplex mode + } +#endif switch (args[ARG_flags].u_int) { case PCM_FLAG_READ_ONLY: @@ -2478,6 +2613,10 @@ STATIC void machine_pcm_init_helper(machine_pcm_obj_t *self, size_t n_args, cons self->handle_write = Helios_PCM_Open(pcm_info.channels, pcm_info.samplerate, QL_PCM_WRITE_FLAG|args[ARG_mode].u_int); #else self->handle_write = Helios_PCM_Open(&pcm_info, QL_PCM_WRITE_FLAG|args[ARG_mode].u_int); +#endif +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + Helios_start_poc_mode(1); + poc_mode_state = 1; #endif if(NULL == self->handle_write) { mp_raise_ValueError(MP_ERROR_TEXT("pcm open write fail")); @@ -2576,6 +2715,14 @@ STATIC mp_obj_t helios_audio_pcm___del__(mp_obj_t self_in) { uint8_t i = 0; machine_pcm_obj_t *self = MP_OBJ_TO_PTR(self_in); +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + if(self->handle_read && self->handle_write) { + if (poc_mode_state) { + poc_mode_state = 0; + Helios_stop_poc_mode(); + } + } +#endif if(self->handle_read) { Helios_PCM_Close(self->handle_read); @@ -2586,11 +2733,37 @@ STATIC mp_obj_t helios_audio_pcm___del__(mp_obj_t self_in) Helios_PCM_Close(self->handle_write); self->handle_write = NULL; } - + return mp_obj_new_int(0); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_pcm___del___obj, helios_audio_pcm___del__); +#if defined(PLAT_ASR_1606) +STATIC mp_obj_t helios_audio_pcm_get_write_frame_count(mp_obj_t self_in) +{ + int ret = 0; + machine_pcm_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if(self->handle_write) { + ret = Helios_PCM_Get_Write_Frame_Count(self->handle_write); + } + + return mp_obj_new_int(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_pcm_get_write_frame_count_obj, helios_audio_pcm_get_write_frame_count); + +STATIC mp_obj_t helios_audio_pcm_reset_write_buffer(mp_obj_t self_in) +{ + int ret = 0; + machine_pcm_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if(self->handle_write) { + ret = Helios_PCM_Reset_Write_Buffer(self->handle_write); + } + return mp_obj_new_int(ret); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(helios_audio_pcm_reset_write_buffer_obj, helios_audio_pcm_reset_write_buffer); +#endif STATIC const mp_stream_p_t pcm_stream_p = { @@ -2608,6 +2781,10 @@ STATIC const mp_rom_map_elem_t pcm_locals_dict[] = { { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&helios_audio_pcm___del___obj) }, { MP_ROM_QSTR(MP_QSTR_setVolume), MP_ROM_PTR(&helios_set_volume_obj) }, { MP_ROM_QSTR(MP_QSTR_getVolume), MP_ROM_PTR(&helios_get_volume_obj) }, + #if defined(PLAT_ASR_1606) + { MP_ROM_QSTR(MP_QSTR_getWriteFrameCount), MP_ROM_PTR(&helios_audio_pcm_get_write_frame_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_resetWriteBuffer), MP_ROM_PTR(&helios_audio_pcm_reset_write_buffer_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_MONO), MP_ROM_INT(1) }, { MP_ROM_QSTR(MP_QSTR_STEREO), MP_ROM_INT(2) }, { MP_ROM_QSTR(MP_QSTR_READONLY), MP_ROM_INT(PCM_FLAG_READ_ONLY) }, diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_handle.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_handle.c index a6735501..5d1be36a 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_handle.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_handle.c @@ -655,7 +655,7 @@ static int ql_audio_play_morefiles(char *montage_file, char *files, montage_play if (montage_is_break || (0 != ret)) { HELIOS_AUDIO_LOG("montage_is_break : %d ret : %d\n", montage_is_break, ret); - #if !defined(PLAT_EIGEN) + #if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) if(montage_is_break == 0) { audio_err_handle(); @@ -791,7 +791,7 @@ err1: -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_ASR_1606) || defined(PLAT_Unisoc_8910_R06) // 根据MPEG版本和Layer来定义比特率的查找表 static int mp3_bitrates[2][3][16] = { diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_queue.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_queue.c index e6017cf2..87f47735 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_queue.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_queue.c @@ -134,7 +134,7 @@ int audio_queue_is_full(AUDIO_QUEUE_T *Q) #if defined (PLAT_Unisoc) || defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) extern int Helios_Audio_MontageFilePlayStart(char *montage_name, char *file_name, Helios_AudPlayerType type, helios_cb_on_player usr_cb, uint8_t device); #endif void helios_audio_play_queue(void) @@ -188,7 +188,7 @@ void helios_audio_play_queue(void) if (audio_type == AUDIO_TTS) { #if defined (PLAT_ASR) || defined (PLAT_Unisoc) || defined (PLAT_ASR_1606) || defined (PLAT_ASR_1609) \ - || defined (PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined (PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) extern void Helios_Set_MP_TTS_Callback(c_callback_t* callback); Helios_Set_MP_TTS_Callback(&audio.audio_queue[i].audio_data[front].mp_cb); ret = Helios_TTS_Start(mode, data, strlen(data)); @@ -211,7 +211,7 @@ void helios_audio_play_queue(void) HELIOS_AUDIO_QUEUE_LOG("Helios_Audio_FilePlayStart, ret = %d\r\n", ret); } #if defined (PLAT_Unisoc) || defined (PLAT_ASR) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_EIGEN) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_EIGEN_718) || defined(PLAT_Unisoc_8910_R06) else if (audio_type == AUDIO_MONTAGE) { ret = Helios_Audio_MontageFilePlayStart(mondata, data, HELIOS_AUDIO_PLAY_TYPE_LOCAL, audio_play_callback, device); @@ -268,7 +268,8 @@ void helios_audio_queue_play_task(void *argv) case AUDIO_FINISH_EVENT: HELIOS_AUDIO_QUEUE_LOG("----AUDIO_FINISH_EVENT---\r\n"); memset(audio_playing_file_name, 0, sizeof(audio_playing_file_name)); - #if !defined (PLAT_Unisoc) && !defined(PLAT_EIGEN) && !defined(PLAT_Unisoc_8850) && !defined(PLAT_Unisoc_8910_R05) && !defined(PLAT_Unisoc_8850_R02) + #if !defined (PLAT_Unisoc) && !defined(PLAT_EIGEN) && !defined(PLAT_Unisoc_8850) && !defined(PLAT_Unisoc_8910_R05) && !defined(PLAT_Unisoc_8910_R06) && !defined(PLAT_Unisoc_8850_R02) \ + && !defined(PLAT_EIGEN_718) #ifndef CONFIG_AUDIO Helios_Audio_StreamPlayStop(); #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_record.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_record.c index ea5bc50b..293afe17 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_record.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_record.c @@ -69,7 +69,7 @@ static c_callback_t *callback_cur; //extern int device; #if defined(PLAT_ASR) || defined(PLAT_Unisoc) || defined(PLAT_ASR_1606) || defined(PLAT_ASR_1609) || defined(PLAT_Unisoc_8850) \ - || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) + || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_ASR_1602) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) #define GET_FILE_VFS_PATH(x, y) get_vfs_path(x,y) #else #define GET_FILE_VFS_PATH(x, y) \ @@ -1052,7 +1052,7 @@ STATIC const mp_rom_map_elem_t audio_locals_dict_table[] = { #if MICROPY_QPY_AUDIO_AUDIO { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&mp_helios_record_file_play_obj) }, #endif -#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) +#if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8850) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8850_R02) || defined(PLAT_Unisoc_8910_R06) { MP_ROM_QSTR(MP_QSTR_PCM), MP_ROM_INT(HELIOS_AUDIO_FORMAT_PCM) }, { MP_ROM_QSTR(MP_QSTR_WAV), MP_ROM_INT(HELIOS_AUDIO_FORMAT_WAVPCM) }, { MP_ROM_QSTR(MP_QSTR_AMRNB), MP_ROM_INT(HELIOS_AUDIO_FORMAT_AMRNB) }, diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_tts.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_tts.c index 5382892c..a9b74162 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_tts.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/audio_tts.c @@ -405,7 +405,7 @@ STATIC mp_obj_t audio_tts_play(size_t n_args, const mp_obj_t *args, mp_map_t *kw HELIOS_TTS_LOG("---- stop audio montage play. ----\r\n"); helios_set_montage_break_flag(1); audio.montage_is_stopping = 1; - #if !defined(PLAT_EIGEN) + #if !defined(PLAT_EIGEN) && !defined(PLAT_EIGEN_718) extern int audio_err_handle(void); audio_err_handle(); #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.c index 27d71d54..5c26e259 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.c @@ -85,6 +85,10 @@ extern void qpy_ble_msg_proc(void *msg); #if MICROPY_QPY_MODULE_POC extern void qpy_poc_msg_proc ( void *msg ); #endif //end MICROPY_QPY_MODULE_POC + +#if MICROPY_QPY_MODULE_LWM2M +extern void qpy_lwm2m_msg_proc(void *param); +#endif //end MICROPY_QPY_MODULE_LWM2M /* * Create a task&queue that handles callback tasks exclusively */ @@ -324,7 +328,7 @@ void qpy_callback_deal_thread(void * args_in) } arg = mp_obj_new_list(3, audio_cb); mp_sched_schedule_ex(&cb_msg->callback, arg); - #if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) + #if defined(PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) if (RECORE_TYPE_STREAM == cb_msg->record_type) { MP_THREAD_GIL_EXIT(); @@ -492,15 +496,7 @@ void qpy_callback_deal_thread(void * args_in) } break; #endif - #if MICROPY_QPY_MODULE_GPIO_ENCODER - case CALLBACK_TYPE_ID_ENCODER: - { - st_CallBack_Encoder *cb_msg = (st_CallBack_Encoder *)msg.msg; - arg = mp_obj_new_int(cb_msg->spin_direct); - mp_sched_schedule_ex(&cb_msg->callback, arg); - } - break; - #endif + #if MICROPY_QPY_MODULE_BT case CALLBACK_TYPE_ID_BT: { @@ -625,7 +621,8 @@ void qpy_callback_deal_thread(void * args_in) } #endif #endif - #if defined(BOARD_EC600MCN_LA_POC_XBND) || defined(BOARD_EC600MCN_LE_POC_XBND) || defined(BOARD_EC600MEU_LA_POC_XBND) + #if defined(BOARD_EC600MCN_LA_POC_XBND) || defined(BOARD_EC600MCN_LE_POC_XBND) || defined(BOARD_EC600MEU_LA_POC_XBND) \ + || defined(BOARD_EC600MLA_LA_POC_XBND) case CALLBACK_TYPE_ID_POCSPEAK: { st_CallBack_PocSpeak *pocspeak_msg = (st_CallBack_PocSpeak *)msg.msg; @@ -663,6 +660,27 @@ void qpy_callback_deal_thread(void * args_in) break; } +#endif +#if MICROPY_QPY_SENSOR_VC9202 + + case CALLBACK_TYPE_ID_VC9202: + { + st_CallBack_Sensor_VC9202 *cb_msg = (st_CallBack_Sensor_VC9202 *)msg.msg; + mp_obj_t vc9202_list[3] = { + mp_obj_new_int(cb_msg->work_mode), + mp_obj_new_int(cb_msg->value), + mp_obj_new_int(cb_msg->measure_mode), + }; + arg = mp_obj_new_list(3, vc9202_list); + mp_sched_schedule_ex(&cb_msg->callback, arg); + } + break; +#endif +#if MICROPY_QPY_MODULE_LWM2M + case CALLBACK_TYPE_ID_LWM2M:{ + qpy_lwm2m_msg_proc(msg.msg); + break; + } #endif case CALLBACK_TYPE_ID_NONE: default: diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.h b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.h index a56a2aee..c8449190 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.h +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/callbackdeal.h @@ -81,9 +81,9 @@ enum { #if CONFIG_juphoon CALLBACK_TYPE_ID_JRTC, #endif -#if MICROPY_QPY_MODULE_GPIO_ENCODER - CALLBACK_TYPE_ID_ENCODER, -#endif +// #if MICROPY_QPY_MODULE_GPIO_ENCODER +// CALLBACK_TYPE_ID_ENCODER, +// #endif #if MICROPY_QPY_MODULE_BT CALLBACK_TYPE_ID_BT, #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c index 64615c4e..79e04f20 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c +++ b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/source/modlvgl.c @@ -21332,8 +21332,10 @@ STATIC const mp_lv_struct_t mp_lv_font_70_bold = { }; #endif #if LV_FONT_BINQI_POC_DEMO +#if 0 /* Quecpython Bob.Xian 2024/4/19 [reason: Avoiding compilation errors] */ extern lv_font_t lv_14_ali; extern lv_font_t lv_11_siyuan_light; +#endif /* #if 0 */ STATIC const mp_lv_struct_t mp_lv_14_ali = { { &mp_lv_font_t_type }, (lv_font_t*)&lv_14_ali @@ -27123,7 +27125,96 @@ STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_bg_grad_stop_obj, 2, mp_lv * lvgl extension definition for: * void lv_style_set_bg_img_src(lv_style_t *style, const void *value) */ + +#ifdef BOARD_EC600GCN_LA_CDD +#include "helios_flash.h" + +#define IMG_IDEN_START "IMG_S" +#define IMG_IDEN_END "IMG_E" + +typedef struct { + char img_name[16]; + uint32_t size; + uint32_t offset; +}Img_Struct; + +lv_img_dsc_t background = { + .header.cf = LV_IMG_CF_TRUE_COLOR, + .header.always_zero = 0, + .header.reserved = 0, + .header.w = 320, + .header.h = 240, + .data_size = 76800 * LV_COLOR_SIZE / 8, + .data = NULL, +}; + + +STATIC int customer_img_get_bg_img(Img_Struct* data, uint8_t num) { + if(data == NULL) return -1; + HeliosFlashPartiCtx *img_addr = Helios_Flash_GetPartiCtx("bg_image"); + QPY_LVGL_LOG("customer_image = %x\n",img_addr->addr); + + uint8_t *addr = (uint8_t*)(img_addr->addr); + + if (strncmp((char*)addr, IMG_IDEN_START, strlen(IMG_IDEN_START)) != 0) { + QPY_LVGL_LOG("bg_img identification error\n"); + return -1; + } + + uint8_t img_num = *(addr+strlen(IMG_IDEN_START)); + QPY_LVGL_LOG("img_num[%d], need num[%d]\n", img_num, num); + if(num >= img_num) return -1; + + char img_iden_name[8] = {0}; + sprintf(img_iden_name, "img_%d", num); + QPY_LVGL_LOG("img_iden_name is %s\n", img_iden_name); + Img_Struct* img_s = (Img_Struct*)(addr+strlen(IMG_IDEN_START)+1); + + QPY_LVGL_LOG("flash1_name[%s], size[%d], offset[%d]\n", img_s[0].img_name, img_s[0].size, img_s[0].offset); + QPY_LVGL_LOG("flash2_name[%s], size[%d], offset[%d]\n", img_s[1].img_name, img_s[1].size, img_s[1].offset); + + if(0 != strncmp(img_s[num].img_name, img_iden_name, strlen(img_iden_name))) { + QPY_LVGL_LOG("Corresponding file ID error, please check customer_img partition content\n"); + return -1; + } + + memcpy(data, img_s + num, sizeof(Img_Struct)); + QPY_LVGL_LOG("img_name[%s], size[%d], offset[%d]\n", data->img_name, data->size, data->offset); + + return 0; + +} +STATIC mp_obj_t mp_lv_style_set_bg_img_src(size_t mp_n_args, const mp_obj_t *mp_args, void *lv_func_ptr) +{ + (void)mp_n_args; + static uint8_t img_flag = 0; + lv_style_t *style = mp_write_ptr_lv_style_t(mp_args[0]); + //const void *value = (const void *)mp_to_ptr(mp_args[1]); + uint8_t num = (uint8_t)mp_obj_get_int(mp_args[1]); + + Img_Struct bg_s = {0}; + if(0 != customer_img_get_bg_img(&bg_s, num)) { + QPY_LVGL_LOG("img data get fail\n"); + return mp_const_none; + } + + HeliosFlashPartiCtx *img_addr = Helios_Flash_GetPartiCtx("bg_image"); + QPY_LVGL_LOG("img_addr = %x\n",img_addr->addr); + uint8_t *addr = (uint8_t*)img_addr->addr; + + if(img_flag == 0) { + img_flag = 1; + background.data = addr + bg_s.offset; + ((void (*)(lv_style_t *, const void *))lv_func_ptr)(style, &background); + } + + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_bg_img_src_obj, 2, mp_lv_style_set_bg_img_src, lv_style_set_bg_img_src); + +#else STATIC mp_obj_t mp_lv_style_set_bg_img_src(size_t mp_n_args, const mp_obj_t *mp_args, void *lv_func_ptr) { (void)mp_n_args; @@ -27136,7 +27227,9 @@ STATIC mp_obj_t mp_lv_style_set_bg_img_src(size_t mp_n_args, const mp_obj_t *mp_ STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_bg_img_src_obj, 2, mp_lv_style_set_bg_img_src, lv_style_set_bg_img_src); - + +#endif + /* Reusing lv_style_set_opa for lv_style_set_bg_img_opa */ STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_bg_img_opa_obj, 2, mp_lv_style_set_opa, lv_style_set_bg_img_opa); @@ -27297,7 +27390,7 @@ STATIC const mp_lv_struct_t mp_lv_font_60_main_menu = { (lv_font_t*)&lv_font_60_main_menu }; #endif -#ifdef PROJECT_NAME_G3_K01 +#ifdef PROJECT_NAME_G3_K01_font STATIC const mp_lv_struct_t mp_K01_font_16_ALL = { { &mp_lv_font_t_type }, (lv_font_t*)&K01_font_16_ALL @@ -27570,6 +27663,35 @@ static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_ return false; } +#ifdef CONFIG_LVGL_USE_FREETYPE +STATIC mp_obj_t mp_lv_style_set_freetype_text_font(size_t mp_n_args, const mp_obj_t *mp_args, void *lv_func_ptr) +{ + char bin_name[128] = {0}; + /*Create a font*/ + static lv_ft_info_t info; + + (void)mp_n_args; + lv_style_t *style = mp_write_ptr_lv_style_t(mp_args[0]); + memcpy(bin_name, (void *)mp_obj_str_get_str(mp_args[1]), strlen((char *)mp_obj_str_get_str(mp_args[1]))); + int weight = mp_obj_get_int(mp_args[2]); + int font_style = mp_obj_get_int(mp_args[3]); // FT_FONT_STYLE_NORMAL + + QPY_LVGL_LOG("----bin_name: %s, weight: %d, style: %d\n", bin_name, weight, font_style); + info.name = bin_name; + info.weight = weight; + info.style = font_style; + info.mem = NULL; + if(!lv_ft_font_init(&info)) { + QPY_LVGL_LOG("create failed."); + } + + ((void (*)(lv_style_t *, const lv_font_t *))lv_func_ptr)(style, info.font); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_freetype_text_font_obj, 4, mp_lv_style_set_freetype_text_font, lv_style_set_text_font); +#endif + //Helios_Flash_Get_addr STATIC mp_obj_t mp_lv_style_set_text_font_v2(size_t mp_n_args, const mp_obj_t *mp_args, void *lv_func_ptr) { @@ -27973,7 +28095,7 @@ STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_arc_opa_obj, 2, mp_lv_styl /* Reusing lv_style_set_bg_img_src for lv_style_set_arc_img_src */ -STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_arc_img_src_obj, 2, mp_lv_style_set_bg_img_src, lv_style_set_arc_img_src); +//STATIC MP_DEFINE_CONST_LV_FUN_OBJ_VAR(mp_lv_style_set_arc_img_src_obj, 2, mp_lv_style_set_bg_img_src, lv_style_set_arc_img_src); #endif @@ -28193,6 +28315,9 @@ STATIC const mp_rom_map_elem_t mp_lv_style_t_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_set_text_opa), MP_ROM_PTR(&mp_lv_style_set_text_opa_obj) }, { MP_ROM_QSTR(MP_QSTR_set_text_font), MP_ROM_PTR(&mp_lv_style_set_text_font_obj) }, { MP_ROM_QSTR(MP_QSTR_set_text_font_v2), MP_ROM_PTR(&mp_lv_style_set_text_font_v2_obj) }, +#ifdef CONFIG_LVGL_USE_FREETYPE + { MP_ROM_QSTR(MP_QSTR_set_freetype_text_font), MP_ROM_PTR(&mp_lv_style_set_freetype_text_font_obj) }, +#endif { MP_ROM_QSTR(MP_QSTR_set_text_letter_space), MP_ROM_PTR(&mp_lv_style_set_text_letter_space_obj) }, { MP_ROM_QSTR(MP_QSTR_set_text_line_space), MP_ROM_PTR(&mp_lv_style_set_text_line_space_obj) }, { MP_ROM_QSTR(MP_QSTR_set_text_decor), MP_ROM_PTR(&mp_lv_style_set_text_decor_obj) }, @@ -28226,7 +28351,7 @@ STATIC const mp_rom_map_elem_t mp_lv_style_t_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_set_arc_color), MP_ROM_PTR(&mp_lv_style_set_arc_color_obj) }, // { MP_ROM_QSTR(MP_QSTR_set_arc_color_filtered), MP_ROM_PTR(&mp_lv_style_set_arc_color_filtered_obj) }, { MP_ROM_QSTR(MP_QSTR_set_arc_opa), MP_ROM_PTR(&mp_lv_style_set_arc_opa_obj) }, - { MP_ROM_QSTR(MP_QSTR_set_arc_img_src), MP_ROM_PTR(&mp_lv_style_set_arc_img_src_obj) }, + //{ MP_ROM_QSTR(MP_QSTR_set_arc_img_src), MP_ROM_PTR(&mp_lv_style_set_arc_img_src_obj) }, #endif #if LV_USE_FLEX != 0 { MP_ROM_QSTR(MP_QSTR_set_flex_flow), MP_ROM_PTR(&mp_lv_style_set_flex_flow_obj) }, @@ -30488,7 +30613,7 @@ STATIC MP_DEFINE_CONST_LV_FUN_OBJ_STATIC_VAR(mp_lv_dpx_obj, 1, mp_lv_pct, lv_dpx MP_THREAD_GIL_EXIT(); while(1) { -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) if(lv_handler.blockFlag == true && 0 == Helios_LPM_WakeLock_GetLockActiveNum()) #else if(lv_handler.blockFlag == true) @@ -31431,7 +31556,7 @@ STATIC mp_obj_t mp_lv_tick_inc(size_t mp_n_args, const mp_obj_t *mp_args) STATIC mp_obj_t mp_lv_block(size_t mp_n_args, const mp_obj_t *mp_args) { uint32_t block_flag = (uint32_t)mp_obj_get_int(mp_args[0]); -#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) +#if defined (PLAT_Unisoc) || defined(PLAT_Unisoc_8910_R05) || defined(PLAT_Unisoc_8910_R06) QPY_LVGL_LOG("lv block set [%d], wakelock_activeNum[%d]\n", block_flag, Helios_LPM_WakeLock_GetLockActiveNum()); #else QPY_LVGL_LOG("lv block set [%d]\n", block_flag); @@ -33145,7 +33270,7 @@ STATIC const mp_rom_map_elem_t lvgl_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_font_28_dial), MP_ROM_PTR(&mp_lv_font_28_dial) }, { MP_ROM_QSTR(MP_QSTR_font_60_main_menu), MP_ROM_PTR(&mp_lv_font_60_main_menu) }, #endif -#if PROJECT_NAME_G3_K01 +#if PROJECT_NAME_G3_K01_font { MP_ROM_QSTR(MP_QSTR_K01_font_16_ALL), MP_ROM_PTR(&mp_K01_font_16_ALL) }, { MP_ROM_QSTR(MP_QSTR_K01_font_30_DIAL), MP_ROM_PTR(&mp_K01_font_30_DIAL) }, #endif diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui.py deleted file mode 100644 index fb334fab..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui.py +++ /dev/null @@ -1,10190 +0,0 @@ -import utime -import osTimer -import lvgl as lv -import EventMesh -from machine import Timer -import voiceCall -import osTimer -import constants -from misc import Power -import pm -import ujson -import audio -import ql_fs -import audio -import sms -from machine import Pin -from lcd import lcd,lcd_ctrl,tp_cst816 -from misc import PWM -import uos -import gc -import _thread -from queue import Queue -import camera -from machine import RTC -import jrtc -LCD_X = 128 -LCD_Y = 128 -def audio_cb(event): - if event == 0: - EventMesh.publish("set_audio_state", 1) - print('audio-play start.') - elif event == 7: - EventMesh.publish("set_audio_state", 0) - print('audio-play finish.') -CALL_LOG_MAX = 50 -aud = audio.Audio(0) -aud.setCallback(audio_cb) -# -----------------------------------------style create-------------------------------------- -style_screen = lv.style_t() -style_screen.init() -style_screen.set_radius(0) -style_screen.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -style_screen.set_bg_opa(255) -style_screen.set_border_width(0) -style_screen.set_pad_left(0) -style_screen.set_pad_right(0) -style_screen.set_pad_top(0) -style_screen.set_pad_bottom(0) - -style_white_screen = lv.style_t() -style_white_screen.init() -style_white_screen.set_radius(0) -style_white_screen.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_white_screen.set_bg_opa(255) -style_white_screen.set_border_width(0) -style_white_screen.set_pad_left(0) -style_white_screen.set_pad_right(0) -style_white_screen.set_pad_top(0) -style_white_screen.set_pad_bottom(0) - -style_bar = lv.style_t() -style_bar.init() -style_bar.set_radius(10) -style_bar.set_bg_color(lv.color_make(0xA0, 0xA0, 0xA0)) -style_bar.set_bg_grad_color(lv.color_make(0xA0, 0xA0, 0xA0)) -style_bar.set_bg_grad_dir(lv.GRAD_DIR.VER) -style_bar.set_bg_opa(255) -style_bar.set_pad_left(0) -style_bar.set_pad_right(0) -style_bar.set_pad_top(0) -style_bar.set_pad_bottom(0) - -style_font_youyuan_20_default = lv.style_t() -style_font_youyuan_20_default.init() -style_font_youyuan_20_default.set_text_color(lv.color_make(0xff, 0xff, 0xff)) - -style_bar_indic = lv.style_t() -style_bar_indic.init() -style_bar_indic.set_radius(10) -style_bar_indic.set_bg_color(lv.color_make(0xff, 0x61, 0x3a)) -style_bar_indic.set_bg_grad_color(lv.color_make(0xff, 0x61, 0x3a)) -style_bar_indic.set_bg_grad_dir(lv.GRAD_DIR.VER) -style_bar_indic.set_bg_opa(255) -# 默认白色 - -style_font_youyuan_20 = lv.style_t() -style_font_youyuan_20.init() -style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -#style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) -style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) - -style_font_youyuan_40 = lv.style_t() -style_font_youyuan_40.init() -style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_40.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) -#黑色 -style_font_youyuan_20_black = lv.style_t() -style_font_youyuan_20_black.init() -style_font_youyuan_20_black.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_youyuan_20_black.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_20_black.set_text_font_v2("font_28.bin",28,0) - -style_font_youyuan_70_black = lv.style_t() -style_font_youyuan_70_black.init() -style_font_youyuan_70_black.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) -style_font_youyuan_70_black.set_text_font(lv.K01_font_30_DIAL) - - -style_font_youyuan_28 = lv.style_t() -style_font_youyuan_28.init() -style_font_youyuan_28.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_28.set_text_font(lv.K01_font_16_ALL) - -style_font_youyuan_20_red = lv.style_t() -style_font_youyuan_20_red.init() -style_font_youyuan_20_red.set_text_color(lv.color_make(0xff, 0x00, 0x00)) -style_font_youyuan_20_red.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_20_red.set_text_font_v2("font_28.bin",28,0) - -style_font_youyuan_20_gray = lv.style_t() -style_font_youyuan_20_gray.init() -style_font_youyuan_20_gray.set_text_color(lv.color_make(128, 128, 128)) -style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) - - -style_font_youyuan_20_yellow = lv.style_t() -style_font_youyuan_20_yellow.init() -style_font_youyuan_20_yellow.set_text_color(lv.color_make(242, 246, 35)) -style_font_youyuan_20_yellow.set_text_font(lv.K01_font_16_ALL) - -style_img = lv.style_t() -style_img.init() -style_img.set_img_opa(255) - -style_line = lv.style_t() -style_line.init() -style_line.set_line_width(2) -style_line.set_line_color(lv.color_make(0xff, 0xff, 0xff)) - - -style_list = lv.style_t() -style_list.init() -style_list.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -style_list.set_radius(0) -style_list.set_bg_opa(255) -style_list.set_border_width(0) -style_list.set_pad_left(0) -style_list.set_pad_right(0) -style_list.set_pad_top(0) - -style_list_scro = lv.style_t() -style_list_scro.init() -style_list_scro.set_bg_opa(0) - -# create style style_btn -style_btn = lv.style_t() -style_btn.init() -style_btn.set_bg_opa(0) -style_btn.set_shadow_opa(0) -style_btn.set_border_width(0) - - -style_wechat_btn = lv.style_t() -style_wechat_btn.init() -style_wechat_btn.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) -style_wechat_btn.set_border_width(0) -style_wechat_btn.set_shadow_opa(0) - -style_press_btn = lv.style_t() -style_press_btn.init() -style_press_btn.set_radius(0) -style_press_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_press_btn.set_bg_opa(255) -style_press_btn.set_border_width(0) -style_press_btn.set_pad_left(0) -style_press_btn.set_pad_right(0) -style_press_btn.set_pad_top(0) -style_press_btn.set_pad_bottom(0) - -style_contact_btn = lv.style_t() -style_contact_btn.init() -style_contact_btn.set_radius(0) -style_contact_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_contact_btn.set_bg_opa(255) -style_contact_btn.set_border_width(0) -style_contact_btn.set_pad_left(0) -style_contact_btn.set_pad_right(0) -style_contact_btn.set_pad_top(0) -style_contact_btn.set_pad_bottom(0) - - -style_common_bg_rect_btn_pressed = lv.style_t() -style_common_bg_rect_btn_pressed.init() -style_common_bg_rect_btn_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) -style_common_bg_rect_btn_pressed.set_bg_opa(100) -style_common_bg_rect_btn_pressed.set_border_width(0) -style_common_bg_rect_btn_pressed.set_shadow_opa(0) - -style_contact_btn_pressed = lv.style_t() -style_contact_btn_pressed.init() -style_contact_btn_pressed.set_radius(0) -style_contact_btn_pressed.set_bg_color(lv.color_make(0xff,0xff,0xff)) -style_contact_btn_pressed.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -style_contact_btn_pressed.set_bg_grad_dir(lv.GRAD_DIR.HOR) -style_contact_btn_pressed.set_bg_opa(217) -style_contact_btn_pressed.set_border_color(lv.color_make(0x21,0x95,0xf6)) -style_contact_btn_pressed.set_border_width(0) -style_contact_btn_pressed.set_border_opa(255) -style_contact_btn_pressed.set_text_color(lv.color_make(0x00,0x00,0x00)) - - -style_screen_btn_1_main_main_default = lv.style_t() -style_screen_btn_1_main_main_default.init() -style_screen_btn_1_main_main_default.set_radius(5) -style_screen_btn_1_main_main_default.set_bg_color(lv.color_make(0x64,0x64,0x64)) -style_screen_btn_1_main_main_default.set_bg_grad_color(lv.color_make(0x64,0x64,0x64)) -style_screen_btn_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_btn_1_main_main_default.set_bg_opa(255) -style_screen_btn_1_main_main_default.set_border_color(lv.color_make(0x64,0x64,0x64)) -style_screen_btn_1_main_main_default.set_border_width(0) -style_screen_btn_1_main_main_default.set_border_opa(255) - -style_circle = lv.style_t() -style_circle.init() -style_circle.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_circle.set_radius(0x7FFF) - - - -from common import Abstract - -class Screen(Abstract): - meta_type = "UI" - def __init__(self): - self.meta = None - self.meta_info = None - - # self.bg_img = None - - # def set_bg_img(self, _fp): - # print("bg _fp = {} NAME = {} bg_img = {}".format(_fp, self.NAME, self.bg_img)) - # if self.bg_img: - # self.bg_img.set_src(_fp) - - def load_screen(self, e, msg): - print("msg = {}".format(msg)) - EventMesh.publish("load_screen", msg) - - - - def load(self): - pass - - def get_meta(self): - return self.meta - - def Close(self): - pass - def lcd_on(self): - pass - def lcd_off(self): - pass - def done_left_to_right(self): - pass - - def done_right_to_left(self): - pass - - def done_bottom_to_top(self): - pass - - def done_top_to_bottom(self): - pass - - def done_return(self): - pass - - def done_click(self): - pass - - def done_error(self): - pass - def handle_message_event(self,data): - pass - def publish_message_event(self,data): - EventMesh.publish("publish_message_event_ui", data) - - - -PHONE_CALL_MAX_DATA = 22 - -phone_line_points = [{"x":0,"y":0},{"x":0,"y":40}] -phone_screen = None -phone_line = None -phone_label = None -phone_one = None -phone_two = None -phone_three = None -phone_four = None -phone_five = None -phone_six = None -phone_seven = None -phone_eight = None -phone_nine = None -phone_start = None -phone_zero = None -phone_hash = None -phone_call = None -phone_call_btn = None -phone_contact = None -phone_contact_btn = None -phone_delete = None -phone_delete_btn = None - -# create style style_screen_ta_1_main_main_default -style_screen_phone_ta_1_main_main_default = lv.style_t() -style_screen_phone_ta_1_main_main_default.init() -style_screen_phone_ta_1_main_main_default.set_radius(0) -style_screen_phone_ta_1_main_main_default.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_phone_ta_1_main_main_default.set_bg_grad_color(lv.color_make(0xff,0xff,0xff)) -style_screen_phone_ta_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_phone_ta_1_main_main_default.set_bg_opa(255) -style_screen_phone_ta_1_main_main_default.set_border_color(lv.color_make(0x00,0x00,0x00)) -style_screen_phone_ta_1_main_main_default.set_border_width(0) -style_screen_phone_ta_1_main_main_default.set_border_opa(255) -style_screen_phone_ta_1_main_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_phone_ta_1_main_main_default.set_text_letter_space(0) -style_screen_phone_ta_1_main_main_default.set_text_align(lv.TEXT_ALIGN.CENTER) -style_screen_phone_ta_1_main_main_default.set_pad_left(0) -style_screen_phone_ta_1_main_main_default.set_pad_right(0) -style_screen_phone_ta_1_main_main_default.set_pad_top(0) -style_screen_phone_ta_1_main_main_default.set_pad_bottom(0) - - - -style_screen_phone_ta_1_main_scrollbar_default = lv.style_t() -style_screen_phone_ta_1_main_scrollbar_default.init() -style_screen_phone_ta_1_main_scrollbar_default.set_radius(0) -style_screen_phone_ta_1_main_scrollbar_default.set_bg_color(lv.color_make(0x21,0x95,0xf6)) -style_screen_phone_ta_1_main_scrollbar_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -style_screen_phone_ta_1_main_scrollbar_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_phone_ta_1_main_scrollbar_default.set_bg_opa(255) - -style_screen_ta_1_main_main_focused = lv.style_t() -style_screen_ta_1_main_main_focused.init() -style_screen_ta_1_main_main_focused.set_radius(0) -style_screen_ta_1_main_main_focused.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_ta_1_main_main_focused.set_bg_grad_color(lv.color_make(0xff,0xff,0xff)) -style_screen_ta_1_main_main_focused.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_ta_1_main_main_focused.set_bg_opa(255) -style_screen_ta_1_main_main_focused.set_border_color(lv.color_make(0x00,0x00,0x00)) -style_screen_ta_1_main_main_focused.set_border_width(0) -style_screen_ta_1_main_main_focused.set_border_opa(255) -style_screen_ta_1_main_main_focused.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_ta_1_main_main_focused.set_pad_left(0) -style_screen_ta_1_main_main_focused.set_pad_right(0) -style_screen_ta_1_main_main_focused.set_pad_top(0) -style_screen_ta_1_main_main_focused.set_pad_bottom(0) - - - - - -class PhoneScreen(Screen): - NAME = "Phone" - - def __init__(self): - - super().__init__() - self.meta = None - self.phone_num = '' - self.phone_list = [] - self.button = 0 - self.timer = osTimer() - self.timer_cb = 0 - self.count = 0 - - - - def initialization(self): - self.phone_num='' - self.phone_list = [] - global phone_screen ,phone_line,phone_label,phone_one,phone_two,phone_three,phone_four,phone_five,phone_six,phone_seven,phone_eight,phone_nine,phone_start,\ - phone_zero,phone_hash,phone_call,phone_call_btn,phone_contact,phone_contact_btn,phone_delete,phone_delete_btn - - size_x = 36 #按钮大小 - size_y = 22 - start_x = 5 - start_y = 25 - - offset_y = 4 - if phone_screen == None: - phone_screen = lv.obj() - print("phone_screen") - phone_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - # phone_line = lv.line(phone_screen) - # phone_line.set_points(phone_line_points,2) - # phone_line.set_pos(125,5) - # phone_line.set_size(2,18) - # phone_line.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # phone_line.add_style(style_line,0) - phone_label = lv.textarea(phone_screen) - phone_label.set_one_line(True) # 关闭1行模式 - phone_label.set_size(128, 30) # 设置宽高 - phone_label.set_pos(0, 5) # 设置宽高 - # calculator_label.set_style_base_dir(lv.BASE_DIR.RTL,0)#LV_BASE_DIR_LTR - # phone_label.align(lv.ALIGN.CENTER,0,0) # 设置位置LV_ALIGN_LEFT_MID CENTER LV_ALIGN_TOP_RIGHT - phone_label.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) #不显示滚动条 - phone_label.set_cursor_click_pos(False) - phone_label.set_password_show_time(0) - phone_label.set_cursor_pos(0x7fff) - phone_label.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - # add style for screen_ta_1 - phone_label.add_style(style_screen_ta_1_main_main_focused, lv.PART.MAIN|lv.STATE.FOCUSED) - - # add style for screen_ta_1 - phone_label.add_style(style_screen_phone_ta_1_main_scrollbar_default, lv.PART.SCROLLBAR|lv.STATE.DEFAULT) - - - - # add style for screen_ta_1 - phone_label.add_style(style_screen_phone_ta_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - # phone_label = lv.label(phone_screen) - # phone_label.set_pos(0, 5) - # phone_label.set_size(128, 20) - # phone_label.set_text(" ") - # phone_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - # phone_label.set_long_mode(lv.label.LONG.CLIP) - # phone_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - - phone_one = lv.img(phone_screen) - phone_one.set_src("U:/static/IMAGE_NUMBER_KEY1_ICON.png") - phone_one.add_flag(lv.obj.FLAG.CLICKABLE) - phone_one.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_one.set_pos(start_x, start_y) - phone_one.set_size(size_x, size_y) - - phone_two = lv.img(phone_screen) - phone_two.set_size(size_x, size_y) - phone_two.set_src("U:/static/IMAGE_NUMBER_KEY2_ICON.png") - phone_two.add_flag(lv.obj.FLAG.CLICKABLE) - phone_two.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_two.set_pos(start_x+size_x+5*1, start_y) - - phone_three = lv.img(phone_screen) - phone_three.set_size(size_x, size_y) - phone_three.set_src("U:/static/IMAGE_NUMBER_KEY3_ICON.png") - phone_three.add_flag(lv.obj.FLAG.CLICKABLE) - phone_three.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_three.set_pos(start_x+size_x*2+5*2, start_y) - - phone_four = lv.img(phone_screen) - phone_four.set_size(size_x, size_y) - phone_four.set_src("U:/static/IMAGE_NUMBER_KEY4_ICON.png") - phone_four.add_flag(lv.obj.FLAG.CLICKABLE) - phone_four.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_four.set_pos(start_x, start_y+size_y+offset_y) - - phone_five = lv.img(phone_screen) - phone_five.set_size(size_x, size_y) - phone_five.set_src("U:/static/IMAGE_NUMBER_KEY5_ICON.png") - phone_five.add_flag(lv.obj.FLAG.CLICKABLE) - phone_five.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_five.set_pos(start_x+size_x+5*1, start_y+size_y+offset_y) - - phone_six = lv.img(phone_screen) - phone_six.set_size(size_x, size_y) - phone_six.set_src("U:/static/IMAGE_NUMBER_KEY6_ICON.png") - phone_six.add_flag(lv.obj.FLAG.CLICKABLE) - phone_six.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_six.set_pos(start_x+size_x*2+5*2, start_y+size_y+offset_y) - - phone_seven = lv.img(phone_screen) - phone_seven.set_size(size_x, size_y) - phone_seven.set_src("U:/static/IMAGE_NUMBER_KEY7_ICON.png") - phone_seven.add_flag(lv.obj.FLAG.CLICKABLE) - phone_seven.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_seven.set_pos(start_x, start_y+size_y*2+offset_y*2) - - phone_eight = lv.img(phone_screen) - phone_eight.set_size(size_x, size_y) - phone_eight.set_src("U:/static/IMAGE_NUMBER_KEY8_ICON.png") - phone_eight.add_flag(lv.obj.FLAG.CLICKABLE) - phone_eight.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_eight.set_pos(start_x+size_x+5*1, start_y+size_y*2+offset_y*2) - - phone_nine = lv.img(phone_screen) - phone_nine.set_size(size_x, size_y) - phone_nine.set_src("U:/static/IMAGE_NUMBER_KEY9_ICON.png") - phone_nine.add_flag(lv.obj.FLAG.CLICKABLE) - phone_nine.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_nine.set_pos(start_x+size_x*2+5*2, start_y+size_y*2+offset_y*2) - - # phone_start = lv.img(phone_screen) - # phone_start.set_size(size_x, size_y) - # phone_start.set_src("U:/static/IMAGE_NUMBER_KEYSTAR_ICON.png") - # phone_start.add_flag(lv.obj.FLAG.CLICKABLE) - # phone_start.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - # phone_start.set_pos(start_x, start_y+size_y*3) - - phone_delete = lv.img(phone_screen) - phone_delete.set_size(size_x, size_y) - phone_delete.set_src("U:/static/IMAGE_BUTTON_DELKEY.png") - phone_delete.add_flag(lv.obj.FLAG.CLICKABLE) - phone_delete.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_delete.set_pos(start_x, start_y+size_y*3+offset_y*3) - - - - phone_zero = lv.img(phone_screen) - phone_zero.set_size(size_x, size_y) - phone_zero.set_src("U:/static/IMAGE_NUMBER_KEY0_ICON.png") - phone_zero.add_flag(lv.obj.FLAG.CLICKABLE) - phone_zero.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_zero.set_pos(start_x+size_x+5*1, start_y+size_y*3+offset_y*3) - - phone_call = lv.img(phone_screen) - phone_call.set_size(size_x, size_y) - phone_call.set_src("U:/static/IMAGE_BUTTON_DIAL.png") - phone_call.add_flag(lv.obj.FLAG.CLICKABLE) - phone_call.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - phone_call.set_pos(start_x+size_x*2+5*2, start_y+size_y*3+offset_y*3) - - - - self.meta = phone_screen - - phone_one.add_event_cb(lambda e: EventMesh.callback_wrapper(self.one(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_two.add_event_cb(lambda e: EventMesh.callback_wrapper(self.two(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_three.add_event_cb(lambda e: EventMesh.callback_wrapper(self.three(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_four.add_event_cb(lambda e: EventMesh.callback_wrapper(self.four(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_five.add_event_cb(lambda e: EventMesh.callback_wrapper(self.five(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_six.add_event_cb(lambda e: EventMesh.callback_wrapper(self.six(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None) - - phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), - lv.EVENT.LONG_PRESSED, None)#长按显示+ - - phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.endpressed_start(e)), - lv.EVENT.RELEASED, None)#释放按键 - - phone_eight.add_event_cb(lambda e: EventMesh.callback_wrapper(self.eight(e)), - lv.EVENT.SHORT_CLICKED, None) - phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None) - - phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), - lv.EVENT.LONG_PRESSED, None)#长按显示+ - - phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.nine_endpressed_start(e)), - lv.EVENT.RELEASED, None)#释放按键 - - # phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero(e)), - # lv.EVENT.SHORT_CLICKED, None) - - phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None)#短按显示* - - phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), - lv.EVENT.LONG_PRESSED, None)#长按显示+ - - phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero_endpressed_start(e)), - lv.EVENT.RELEASED, None)#释放按键 - - phone_call.add_event_cb(lambda e: EventMesh.callback_wrapper(self.call(e)), - lv.EVENT.SHORT_CLICKED, None) - # phone_contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.contact(e)), - # lv.EVENT.SHORT_CLICKED, None) - phone_delete.add_event_cb(lambda e: EventMesh.callback_wrapper(self.delete(e)), - lv.EVENT.SHORT_CLICKED, None) - - # phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - # lv.EVENT.SHORT_CLICKED, None)#短按显示* - - # phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), - # lv.EVENT.LONG_PRESSED, None)#长按显示+ - - # phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.endpressed_start(e)), - # lv.EVENT.RELEASED, None)#释放按键 - - - # phone_hash.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hash(e)), - # lv.EVENT.SHORT_CLICKED, None) - - - self.phone_num='' - self.phone_list = [] - self.count = 0 - if phone_label != None: - phone_label.set_pos(0, 0) - phone_label.set_size(0, 0) - phone_label.set_text(" ") - #phone_label.set_text(" ") - # print("self.phone_list :{} self.phone_num:{}".format(self.phone_list,self.phone_num)) - if self.timer_cb == 0: - self.timer_cb = 1 - # self.timer.start(1000,1,self.refresh_line) - - - def refresh_line(self,e): - return - if self.count > 2 : - self.count = 1 - if self.count%2 == 0: - phone_line.clear_flag(lv.obj.FLAG.HIDDEN) - else: - phone_line.add_flag(lv.obj.FLAG.HIDDEN) - self.count+=1 - def one(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("1") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def two(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("2") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def three(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("3") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def four(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("4") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def five(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("5") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def six(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("6") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def seven(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("7") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def eight(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("8") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def nine(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA: - #self.phone_list.pop(0) - return - self.phone_list.append("9") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def zero(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - self.phone_list.append("0") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def start(self,e): - self.button = 0 - - def pressed_start(self,e): - self.button = 1 - def Close(self): - self.timer_cb = 0 - self.timer.stop() - - def nine_endpressed_start(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - - if self.button == 1:#长按 - self.phone_list.append("#") - else:#短按 - self.phone_list.append("9") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - - def zero_endpressed_start(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - - if self.button == 1:#长按 - self.phone_list.append("+") - else:#短按 - self.phone_list.append("0") - - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def endpressed_start(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - - if self.button == 1:#长按 - self.phone_list.append("*") - else:#短按 - self.phone_list.append("7") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def hash(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - self.phone_list.append("#") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - - def delete(self,e): - if len(self.phone_list) != 0: - self.phone_list.pop() - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def contact(self,e): - EventMesh.publish("load_screen", {"screen": "contacts"}) - - def call(self,e): - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: - self.name = None - self.phonebook = {} - self.number_tmp = {} - if len(self.phone_list) != 0: - data = EventMesh.publish("get_phonebook_list") - if data != None: - check = data[0] - self.phonebook = data[1] - # print("check :{}".format(check)) - if check == 1:#检查通讯录 - phonebook_keys = sorted(self.phonebook.keys()) - b = str(self.phone_num) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - j = 0 - if b == True: - for i in range(len(self.phonebook)): #字典 key value - #'001:张三':15521469561 - name = self.phonebook[phonebook_keys[j]] - name_value = phonebook_keys[j] - number_tmp = str(self.phone_num) - # print("name :{} number_tmp:{}".format(name,number_tmp)) - if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 - number_f= name_value - name_s = number_f.split(':') - name_s = name_s[1] - self.name = name_s - break - j+=1 - else: - self.name = self.phone_num - else: - self.name = self.phone_num - - EventMesh.publish("save_phonenum",self.phone_num) - EventMesh.publish("save_phonename",self.name)# - EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) - else: - EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"}) - else:#未插卡 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - - - def show_num(self): - #print("self.phone_num ",self.phone_num,self.phone_list) - global phone_label - phone_label.set_pos(0, 5) - phone_label.set_size(128, 30) - phone_label.set_text(self.phone_num) - - def lcd_on(self): - if self.timer_cb != 0: - self.timer_cb = 0 - self.timer.start(1000,1,self.refresh_line) - - def lcd_off(self): - self.timer_cb = 1 - self.timer.stop() - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -call_log_screen = None -contacts_cont_list = None -call_log_title = None -none_call_log_title = None -call_log_cont_list_screen = None -CALLLOG_FLAG = 0 -class CallLogScreen(Screen): - NAME = "call_log" - - def __init__(self): - super().__init__() - self.CALL_LOG_MAX = CALL_LOG_MAX - self.meta = None - self.log_list = [] - self.read_call_log = {} - self.check_json = 0 - self.call_log_detail_list = None - self.call_log_detail_list_dict = [] - self.timer = osTimer() - EventMesh.subscribe("call_log_update_show_list", self.call_log_update_show_list) - - def post_processor_before_initialization(self): - read_call_log = EventMesh.publish("get_call_log_list") - if read_call_log != None: - self.check_json = read_call_log[0] - self.read_call_log = read_call_log[1] - - - - def call_log_update_show_list(self, event, msg): - read_call_log = EventMesh.publish("get_call_log_list") - if read_call_log != None: - # print("read_call_log:{}".format(read_call_log)) - self.check_json = read_call_log[0] #文件是否存在 - self.read_call_log = read_call_log[1]#通话记录数据 - self.timer.start(500,0,self.reciving) - - def reciving(self,e): - self.btn_create() - - def initialization(self): - global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title ,call_log_cont_list_screen - if call_log_screen == None: - call_log_screen = lv.obj() - print("call_log_screen") - call_log_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - call_log_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - call_log_cont_list_screen = lv.obj(call_log_screen) - call_log_cont_list_screen.set_pos(0, 30) - call_log_cont_list_screen.set_size(LCD_X, LCD_Y-30) - call_log_cont_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - call_log_cont_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - call_log_title = lv.label(call_log_screen) - call_log_title.set_pos(0, 5) - call_log_title.set_size(LCD_X, 20) - call_log_title.set_long_mode(lv.label.LONG.WRAP) - call_log_title.set_text("通话记录") - call_log_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - call_log_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - none_call_log_title = lv.label(call_log_cont_list_screen) - none_call_log_title.set_pos(0, (LCD_Y-30)//2-20) - none_call_log_title.set_size(LCD_X, 20) - none_call_log_title.set_long_mode(lv.label.LONG.WRAP) - none_call_log_title.set_text(" ") - none_call_log_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - none_call_log_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - #self.call_log_detail_list = lv.obj(call_log_screen) - self.call_log_detail_list = lv.obj(call_log_cont_list_screen) - self.call_log_detail_list.set_pos(0, 0) - self.call_log_detail_list.set_size(LCD_X, LCD_Y-30+1) - self.call_log_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - self.call_log_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - for i in range(self.CALL_LOG_MAX): - _btn = lv.btn(self.call_log_detail_list) - _btn.add_flag(lv.obj.FLAG.CLICKABLE) - _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), - lv.EVENT.SHORT_CLICKED, None) - _btn.add_flag(lv.obj.FLAG.HIDDEN) - _btn_label2 = lv.label(_btn) - - _btn_label3 = lv.label(_btn) - _btn_label4 = lv.label(_btn) - _btn_label4.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - _btn_label5 = lv.label(_btn) - _btn_label6 = lv.label(_btn) - _btn_label6.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - self.call_log_detail_list_dict.append({"_btn":_btn,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3, - "_btn_label4":_btn_label4,"_btn_label5":_btn_label5,"_btn_label6":_btn_label6}) - self.meta = call_log_screen - - - read_call_log = EventMesh.publish("get_call_log_list") - # print("read_call_log:{}".format(read_call_log)) - if read_call_log != None: - self.check_json = read_call_log[0] #文件是否存在 - self.read_call_log = read_call_log[1]#通话记录数据 - if self.check_json == True and self.read_call_log != {}: - none_call_log_title.set_text(" ") - else: - none_call_log_title.set_text("暂无记录") - self.btn_create() - - def btn_create(self): - EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_screen,"data":0}) - - def btn_create_screen(self,data): - global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title ,call_log_cont_list_screen - h = 0 - if call_log_screen != None: - if self.check_json == True and len(self.read_call_log) != 0: - - none_call_log_title.set_text(" ") - self.call_log_detail_list.clear_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - # self.call_log_detail_list.delete()#先删除一次控件 - # self.call_log_detail_list = lv.obj(call_log_cont_list_screen) - # self.call_log_detail_list.set_pos(0, 0) - # self.call_log_detail_list.set_size(240, 271) - # self.call_log_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # self.call_log_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - sort_tmp = self.read_call_log.values() - sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 - # print("self.call_log :{} \r\n sort_new:{}\r\n".format(self.read_call_log,sort_new)) - - for sort_new_tmp in sort_new: #字典 key value - - num_count = sort_new_tmp["count"]#获取通话次数 - num_name = sort_new_tmp["name"]#获取名称 - num_phonnum = sort_new_tmp["number"]#获取电话号码 - num_time = sort_new_tmp["time"]#获取电话号码 - - # print("num_count :{} num_name:{} num_time:{}".format(num_count,num_name,num_time)) - #_btn = lv.btn(self.call_log_detail_list) - self.call_log_detail_list_dict[h]["_btn"].set_size(LCD_X,45) - self.call_log_detail_list_dict[h]["_btn"].set_pos(0,47*h) - self.call_log_detail_list_dict[h]["_btn"].set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) - # self.call_log_detail_list_dict[h]["_btn"].add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - self.call_log_detail_list_dict[h]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), - lv.EVENT.SHORT_CLICKED, None) - - - #_btn_label2 = lv.label(_btn) - self.call_log_detail_list_dict[h]["_btn_label2"].set_pos(0, 0) - self.call_log_detail_list_dict[h]["_btn_label2"].set_size(0, 20) - self.call_log_detail_list_dict[h]["_btn_label2"].set_text(num_phonnum) - #_btn_label2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - # - #_btn_label3 = lv.label(_btn) - self.call_log_detail_list_dict[h]["_btn_label3"].set_pos(0, 0) - self.call_log_detail_list_dict[h]["_btn_label3"].set_size(0, 0) - self.call_log_detail_list_dict[h]["_btn_label3"].set_text("(" + str(num_count) + ")") - # _btn_label3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - #_btn_label4 = lv.label(_btn) - self.call_log_detail_list_dict[h]["_btn_label4"].set_pos(0, 20) - self.call_log_detail_list_dict[h]["_btn_label4"].set_size(LCD_X-15, 21) - self.call_log_detail_list_dict[h]["_btn_label4"].set_text(num_phonnum) - self.call_log_detail_list_dict[h]["_btn_label4"].set_long_mode(lv.label.LONG.CLIP) - # self.call_log_detail_list_dict[h]["_btn_label4"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - #_btn_label5 = lv.label(_btn) - self.call_log_detail_list_dict[h]["_btn_label5"].set_pos(0, 5) - self.call_log_detail_list_dict[h]["_btn_label5"].set_size(0, 0) - self.call_log_detail_list_dict[h]["_btn_label5"].set_text(num_name) - # _btn_label5.set_long_mode(lv.obj.LONG.DOT) - # _btn_label5.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - #_btn_label6 = lv.label(_btn) - self.call_log_detail_list_dict[h]["_btn_label6"].set_pos(0, 0) - self.call_log_detail_list_dict[h]["_btn_label6"].set_size(LCD_X-15, 20) - self.call_log_detail_list_dict[h]["_btn_label6"].set_text(num_name) - self.call_log_detail_list_dict[h]["_btn_label6"].set_long_mode(lv.label.LONG.CLIP) - # self.call_log_detail_list_dict[h]["_btn_label6"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.call_log_detail_list_dict[h]["_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - #self.call_log_detail_list_dict[h]["_btn"].scroll_to_view(lv.ANIM.OFF) - h = h + 1 - for i in range(self.CALL_LOG_MAX): - if i >= h : - self.call_log_detail_list_dict[i]["_btn"].add_flag(lv.obj.FLAG.HIDDEN)#隐藏多余 - else: - if call_log_cont_list_screen != None: - none_call_log_title.set_text("暂无记录") - self.call_log_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - - def calling(self,e): - code = e.get_code() - if code == lv.EVENT.SHORT_CLICKED: - global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title - # print("e.get_text():{} {}".format(e.get_target().get_child(0).get_text(),e.get_target().get_child(3).get_text())) - phonnum = str(e.get_target().get_child(0).get_text()) - phnoname = e.get_target().get_child(3).get_text() - # print("phonnum :{} _msg:{}".format(phonnum,phnoname)) - - - self.name = None - self.phonebook = {} - - self.call_log = {} - self.call_log_value = {} - self.read_call_log = {} - self.number_tmp = {} - - data = EventMesh.publish("get_phonebook_list") - if data != None: - check = data[0] - self.phonebook = data[1] - # print("check :{}".format(check)) - if check == 1:#检查通讯录 - phonebook_keys = sorted(self.phonebook.keys()) - b = str(phonnum) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - j = 0 - if b == True: - for i in range(len(self.phonebook)): #字典 key value - #'001:':15521469561 - name = self.phonebook[phonebook_keys[j]] - name_value = phonebook_keys[j] - number_tmp = str(phonnum) - # print("name :{} number_tmp:{}".format(name,number_tmp)) - if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 - number_f= name_value - name_s = number_f.split(':') - name_s = name_s[1] - self.name = name_s - break - j+=1 - else: - self.name = phnoname - else: - self.name = phnoname - - if self.name == None: - self.name = phnoname - if len(phonnum) > 0: - EventMesh.publish("save_phonename",self.name)# - EventMesh.publish("save_phonenum",phonnum)#保存电话号码用于界面显示获取 - #voiceCall.callStart(str(phonnum)) - EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) - else: - EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"})#无效的号码 请重新输入 - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -# ------------------------------拨打电话-------------dialing screen---------------------------------------------------------- - -dialing_screen = None -dialing_img = None -dialing_name = None -dialing_call_label = None -hangup_imgbtn = None -class DialingScreen(Screen): - NAME = "dialing" - - def __init__(self): - super().__init__() - self.timer = osTimer() - self.meta = None - self.meta_type = "popup" - self.call_log = {} - self.call_log_value = {} - self.read_call_log = {} - self.number_tmp = {} - self.CALL_LOG_MAX = CALL_LOG_MAX - def initialization(self): - EventMesh.publish("set_UI_high_priority", 1) - global dialing_screen,dialing_img,dialing_name ,hangup_imgbtn - if dialing_screen == None: - dialing_screen = lv.obj() - print("dialing_screen") - dialing_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - # dialing_img = lv.img(dialing_screen) - # dialing_img.set_pos(80, 20) - # dialing_img.set_size(64, 64) - # dialing_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") - # dialing_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_name = lv.label(dialing_screen) - dialing_name.set_pos(0, 14) - dialing_name.set_size(LCD_X, 20) - dialing_name.set_text(" ") - dialing_name.set_long_mode(lv.label.LONG.DOT) - dialing_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - dialing_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_call_label = lv.label(dialing_screen) - dialing_call_label.set_pos(0, 43) - dialing_call_label.set_size(LCD_X, 40) - dialing_call_label.set_text("正在等待对方接\n听电话") - dialing_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - dialing_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - hangup_imgbtn = lv.img(dialing_screen) #64 - hangup_imgbtn.set_size(32, 32) - hangup_imgbtn.set_src("U:/static/hang_up.png") - hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - hangup_imgbtn.set_pos(48, 90) - hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = dialing_screen - if dialing_name != None: - name = EventMesh.publish("get_phonename")#获取拨打电话名称 - dialing_name.set_text(name)#名称 - def post_processor_after_initialization(self): - pass - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_sos_timer") - EventMesh.publish("set_hangup_mode", 1) - voiceCall.callEnd() - EventMesh.publish("set_interrup_incall",0) - EventMesh.publish("set_UI_high_priority",0) - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - self.timer.stop() - - def call_end(self,*argc): - - call_state = EventMesh.publish("get_call_state")# - print("call_end!!!!!!!!",call_state) - if call_state != None: - if call_state == 0:#未打通 - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_return(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - - - -no_sim_popup_screen = None -no_sim_popup_screen_title1 = None -no_sim_popup_screen_title2 = None -#未插卡 -class NoSimScreen(Screen):# - NAME = "no_sim_popup_screen" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global no_sim_popup_screen,no_sim_popup_screen_title1,no_sim_popup_screen_title2 - if no_sim_popup_screen == None : - no_sim_popup_screen = lv.obj() - print("no_sim_popup_screen") - no_sim_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_popup_screen_title1 = lv.label(no_sim_popup_screen) - no_sim_popup_screen_title1.set_pos(0, 40) - no_sim_popup_screen_title1.set_size(LCD_X, 40) - no_sim_popup_screen_title1.set_text("无SIM卡或") - no_sim_popup_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_popup_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_popup_screen_title2 = lv.label(no_sim_popup_screen) - no_sim_popup_screen_title2.set_pos(0, 60) - no_sim_popup_screen_title2.set_size(LCD_X, 40) - no_sim_popup_screen_title2.set_text("无网络") - no_sim_popup_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_popup_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = no_sim_popup_screen - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - -wechat_failed_popup_screen = None -wechat_failed_popup_title1 = None -wechat_failed_popup_title2 = None -#未插卡 -class wechatFailedScreen(Screen):#录音失败提示 - NAME = "wechat_failed_popup_screen" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global wechat_failed_popup_screen,wechat_failed_popup_title1,wechat_failed_popup_title2 - if wechat_failed_popup_screen == None : - wechat_failed_popup_screen = lv.obj() - print("wechat_failed_popup_screen") - wechat_failed_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - wechat_failed_popup_title1 = lv.label(wechat_failed_popup_screen) - wechat_failed_popup_title1.set_pos(0, 40) - wechat_failed_popup_title1.set_size(LCD_X, 40) - wechat_failed_popup_title1.set_text("录音太短") - wechat_failed_popup_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - wechat_failed_popup_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - wechat_failed_popup_title2 = lv.label(wechat_failed_popup_screen) - wechat_failed_popup_title2.set_pos(0, 60) - wechat_failed_popup_title2.set_size(LCD_X, 40) - wechat_failed_popup_title2.set_text("请重试!") - wechat_failed_popup_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - wechat_failed_popup_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = wechat_failed_popup_screen - - def done_left_to_right(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - def done_right_to_left(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - def done_bottom_to_top(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - def done_top_to_bottom(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - def done_return(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - - def btn1_release(self): - EventMesh.publish("load_screen",{"screen":"wechat"}) - - def btn8_press(self): - EventMesh.publish("load_screen",{"screen":"main_menu"}) - - - -no_valied_num_screen = None -no_valied_num_screen_title1 = None -no_valied_num_screen_title2 = None -#=无效的号码 请重新输入 -class NovaliedNumScreen(Screen):# - NAME = "no_valied_num_screen" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer_count = 0 - self.timer=osTimer() - - def initialization(self): - global no_valied_num_screen,no_valied_num_screen_title1,no_valied_num_screen_title2 - if no_valied_num_screen == None : - no_valied_num_screen = lv.obj() - print("no_valied_num_screen") - no_valied_num_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_valied_num_screen_title1 = lv.label(no_valied_num_screen) - no_valied_num_screen_title1.set_pos(0, 20) - no_valied_num_screen_title1.set_size(128, 20) - no_valied_num_screen_title1.set_text("无效的号码,") - no_valied_num_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_valied_num_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - no_valied_num_screen_title2 = lv.label(no_valied_num_screen) - no_valied_num_screen_title2.set_pos(0, 50) - no_valied_num_screen_title2.set_size(128, 40) - no_valied_num_screen_title2.set_text("请重新输入") - no_valied_num_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_valied_num_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = no_valied_num_screen - def post_processor_after_initialization(self): - self.timer_count = 0 - self.timer.start(5000,1,self.timeout_exit) - - def timeout_exit(self,e): - self.timer_count+=1 - if self.timer_count >= 2: - self.timer_count = 0 - EventMesh.publish("return_prev_screen") - - def Close(self): - self.timer.stop() - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - - - -no_sim_power_screen = None -no_sim_power_screen_title = None -no_sim_power_screen_label =None -no_sim_power_screen_comfirm =None -no_sim_power_screen_cancel = None -no_sim_power_screen_img = None - -#未插卡,长按关机 -class NoSimPowerScreen(Screen):# - NAME = "no_sim_power_screen" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global no_sim_power_screen,no_sim_power_screen_img,no_sim_power_screen_title,no_sim_power_screen_comfirm,no_sim_power_screen_cancel,no_sim_power_screen_label - if no_sim_power_screen == None : - no_sim_power_screen = lv.obj() - print("no_sim_power_screen") - no_sim_power_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_power_screen_title = lv.label(no_sim_power_screen) - no_sim_power_screen_title.set_pos(0, 5) - no_sim_power_screen_title.set_size(128, 40) - no_sim_power_screen_title.set_text("无SIM卡,无法拨打") - no_sim_power_screen_title.set_long_mode(lv.label.LONG.WRAP) - no_sim_power_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_power_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - # no_sim_power_screen_img = lv.img(no_sim_power_screen) - # no_sim_power_screen_img.set_pos(49, 30) - # no_sim_power_screen_img.set_size(30, 30) - # no_sim_power_screen_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - # no_sim_power_screen_img.set_src("U:/static/setting_poweroff.png") - - - no_sim_power_screen_label = lv.label(no_sim_power_screen) - no_sim_power_screen_label.set_pos(0, 45) - no_sim_power_screen_label.set_size(128, 20) - no_sim_power_screen_label.set_text("是否关机?") - no_sim_power_screen_label.set_long_mode(lv.label.LONG.WRAP) - no_sim_power_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_power_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - no_sim_power_screen_comfirm = lv.img(no_sim_power_screen) - no_sim_power_screen_comfirm.set_size(88, 23) - no_sim_power_screen_comfirm.set_pos(20, 65) - no_sim_power_screen_comfirm.set_src("U:/static/off_icon.png") - no_sim_power_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_power_screen_comfirm.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_power_screen_comfirm_btn = lv.img(no_sim_power_screen) - no_sim_power_screen_comfirm_btn.set_size(88, 35) - no_sim_power_screen_comfirm_btn.set_pos(20, 55) - no_sim_power_screen_comfirm_btn.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_power_screen_comfirm_btn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - - poweroff_confirm_label = lv.label(no_sim_power_screen_comfirm) - poweroff_confirm_label.set_text("确定") - poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 0) - poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_power_screen_cancel = lv.img(no_sim_power_screen) - no_sim_power_screen_cancel.set_size(88, 23) - no_sim_power_screen_cancel.set_pos(20, 95) - no_sim_power_screen_cancel.set_src("U:/static/cancel_icon.png") - no_sim_power_screen_cancel.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_power_screen_cancel.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_power_screen_cancel_btn = lv.img(no_sim_power_screen) - no_sim_power_screen_cancel_btn.set_size(88, 38) - no_sim_power_screen_cancel_btn.set_pos(20, 90) - no_sim_power_screen_cancel_btn.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_power_screen_cancel_btn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - poweroff_return_label = lv.label(no_sim_power_screen_cancel) - poweroff_return_label.set_text("取消") - poweroff_return_label.align(lv.ALIGN.CENTER, 0, 0) - poweroff_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_sim_power_screen_cancel.set_ext_click_area(20) - - self.meta = no_sim_power_screen - no_sim_power_screen_comfirm_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.SHORT_CLICKED, None) - - no_sim_power_screen_cancel_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.cancel(e)), - lv.EVENT.SHORT_CLICKED, None) - - def confirm(self,e): - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) - - def cancel(self,e): - EventMesh.publish("return_prev_screen") - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - -dialing_popup_screen = None -dialing_popup_img = None -dialing_popup_name = None -dialing_popup_hangup_imgbtn = None -class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 - NAME = "dialing_noplay_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer1 = osTimer() - self.time_count = 0 - self.timer2 = osTimer() - self.CALL_LOG_MAX = CALL_LOG_MAX - self.read_call_log = {} - - def initialization(self): - EventMesh.publish("set_UI_high_priority", 1) - global dialing_popup_screen,dialing_popup_img,dialing_popup_name ,dialing_popup_call,dialing_popup_hangup_imgbtn - if dialing_popup_screen == None: - dialing_popup_screen = lv.obj() - print("dialing_popup_screen") - dialing_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - # dialing_popup_img = lv.img(dialing_popup_screen) - # dialing_popup_img.set_pos(32, 5) - # dialing_popup_img.set_size(64, 64) - # dialing_popup_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") - # dialing_popup_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_popup_name = lv.label(dialing_popup_screen) - dialing_popup_name.set_pos(0, 15) - dialing_popup_name.set_size(LCD_X, 20) - dialing_popup_name.set_text(" ") - dialing_popup_name.set_long_mode(lv.label.LONG.DOT) - dialing_popup_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - dialing_popup_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_popup_call = lv.label(dialing_popup_screen) - dialing_popup_call.set_pos(0, 50) - dialing_popup_call.set_size(LCD_X, 20) - dialing_popup_call.set_text("正在拨号中") - dialing_popup_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - dialing_popup_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_popup_hangup_imgbtn = lv.img(dialing_popup_screen) - dialing_popup_hangup_imgbtn.set_size(32, 32) - dialing_popup_hangup_imgbtn.set_src("U:/static/hang_up.png") - dialing_popup_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - dialing_popup_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - dialing_popup_hangup_imgbtn.set_pos(48, 90) - dialing_popup_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = dialing_popup_screen - if dialing_popup_name != None: - name = EventMesh.publish("get_phonename")#获取拨打电话名称 - dialing_popup_name.set_text(name)#名称 - - def post_processor_after_initialization(self): - self.time_count = 0 - # print("创建通话记录 post_processor_before_initialization\n") - utime.sleep_ms(200)#不加延时会切屏 - #获取字符串 - name = EventMesh.publish("get_phonename")#获取拨打电话名称 - content = EventMesh.publish("get_phonenum")#获取电话号码 - time = EventMesh.publish("screen_get_time")#获取系统时间 - - # ["15692025051","2","12:59","哥gdh符合双方和开发商开发好看的思考"], - # 格式:{"电话号码":{"timesec":'时间戳',"number":'电话号码',"name":'名字',"time":'时间',"count":'通话次数'}} - # dialing_content.set_text(content)#电话号码 - num = 0 - - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - # print("time_tmp:{}".format(time_tmp)) - read_call_log = EventMesh.publish("get_call_log_list") - check_json = read_call_log[0] - - if check_json == True: - self.read_call_log = read_call_log[1] - b = content in self.read_call_log.keys()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - if b == True:#查找是否有相同的电话号码 有就直接读出来的次数上加一 没有则从1开始加起 - number_tmp = {} - number_tmp = self.read_call_log[content] #通话次数加一 - num_tmp_t = number_tmp["count"] - # print("number_tmp:{} self.read_call_log.value:{}".format(number_tmp,self.read_call_log.values())) - else : - num_tmp_t = 0 - num = num_tmp_t - else: - num = 0 #通话次数 - - sort_tmp = {} - sort_tmp = self.read_call_log.values() - sort_new = {} - sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 - - i = 0 - # 49 50 - if len(self.read_call_log) >= self.CALL_LOG_MAX: - for sort_new_tmp in sort_new: #字典 key value - i+=1 # 1 - if i >= self.CALL_LOG_MAX:#大于50条把最后一条删除掉只保留前面50调最新的数据 - key_tmp = sort_new_tmp["number"] - del self.read_call_log[key_tmp] - tmp = {} - tmp["count"]= num+1 #通话次数 - tmp["time"]= "{}:{}".format("%02d"%(time[0][0]),"%02d"%(time[0][1]))#通湖时间 - tmp["name"]= name #名称 - tmp["timesec"]= time_tmp #时间戳 - tmp["number"] = content - - self.read_call_log[content] = tmp - with open("/usr/static/storage_file/Call_log.json","w",encoding="utf-8") as fd: - ujson.dump(self.read_call_log,fd) - print("创建通话记录") - EventMesh.publish("set_call_log_list", [1,self.read_call_log]) - EventMesh.publish("call_log_update_show_list") - - self.timer1.start(1000, 1, self.timeout_hangup) - self.timer2.start(2000, 0, self.timeout_call) - - def timeout_call(self,e): - phone_num = EventMesh.publish("get_phonenum") - voiceCall.callStart(phone_num) - - def timeout_hangup(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.time_count+=1 - if self.time_count >= 5:#5s内没有打通则不在继续拨打关闭 - self.time_count = 0 - self.timer1.stop() - EventMesh.publish("set_UI_high_priority", 0) - sos_flag = EventMesh.publish("get_sos_flag") - print("sos_flag!!!!!!!!!!!!!!!!:",sos_flag) - if sos_flag == 1: - EventMesh.publish("set_sos_info_call") - - EventMesh.publish("load_screen", {"screen": "dial_no_connect_popup"}) - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - voiceCall.callEnd() - sos_flag = EventMesh.publish("get_sos_flag") - if sos_flag == 1: - EventMesh.publish("close_sos_timer") - EventMesh.publish("set_sos_flag",0) - EventMesh.publish("set_sos_num",0) - EventMesh.publish("set_hangup_mode",0) - EventMesh.publish("set_interrup_incall",0) - EventMesh.publish("set_UI_high_priority",0) - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - self.timer1.stop() - self.timer2.stop() - - def done_return(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - -dial_no_connect_popup = None -dialing_connect_call = None -class DialNoconnectPopupScreen(Screen):#你所拨打的电话暂时无法接通 - NAME = "dial_no_connect_popup" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer = osTimer() - self.time_count = 0 - - def initialization(self): - global dial_no_connect_popup,dialing_connect_call - if dial_no_connect_popup == None: - dial_no_connect_popup = lv.obj() - print("dial_no_connect_popup") - dial_no_connect_popup.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - dialing_connect_call = lv.label(dial_no_connect_popup) - dialing_connect_call.set_pos(0, 40) - dialing_connect_call.set_size(128, 88) - dialing_connect_call.set_text("你好,你所拨打的\n电话暂时无法接\n通,请稍后再拨") - dialing_connect_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - dialing_connect_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = dial_no_connect_popup - - def post_processor_after_initialization(self): - self.time_count = 0 - self.timer.start(1000, 1, self.timeout_hangup) - - def timeout_hangup(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.time_count+=1 - if self.time_count >= 5: - self.time_count = 0 - self.timer.stop() - EventMesh.publish("return_prev_screen") - - def Close(self): - self.timer.stop() - # EventMesh.publish("set_sos_info_call") - - - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - -message_popup_screen = None -message_popup_title = None -#信息弹窗 -class NewMessageScreen(Screen): - NAME = "message_popup" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global message_popup_screen,message_popup_title - if message_popup_screen == None : - message_popup_screen = lv.obj() - print("message_popup_screen") - message_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - message_popup_title = lv.label(message_popup_screen) - message_popup_title.set_pos(0, 40) - message_popup_title.set_size(128, 40) - message_popup_title.set_text("你有新的消息") - message_popup_title.set_long_mode(lv.label.LONG.WRAP) - message_popup_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - message_popup_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = message_popup_screen - EventMesh.publish("set_sms_clear_all_data",10) - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - def done_click(self): - EventMesh.publish("load_screen", {"screen": "popup"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -message_full_screen = None -message_full_label = None -message_full_confirm = None -message_full_cancel = None -#信息弹窗 -class MessageFullScreen(Screen): - NAME = "message_full" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - EventMesh.subscribe("remove_all_sms_cb",self.remove_all_sms_cb) - - def initialization(self): - global message_full_screen,message_full_label,message_full_confirm,message_full_cancel - if message_full_screen == None : - message_full_screen = lv.obj() - print("message_full_screen") - message_full_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - message_full_label = lv.label(message_full_screen) - message_full_label.set_pos(0, 10) - message_full_label.set_size(128, 40) - message_full_label.set_text("信息已满,是否清除所有?") - message_full_label.set_long_mode(lv.label.LONG.WRAP) - message_full_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - message_full_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - message_full_confirm = lv.label(message_full_screen) - message_full_confirm.set_text("确认") - message_full_confirm.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - message_full_confirm.set_size(64, 63) - message_full_confirm.set_pos(0,65) - message_full_confirm.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - message_full_confirm.add_flag(lv.obj.FLAG.CLICKABLE) - # message_full_confirm.set_ext_click_area(63) - - message_full_cancel = lv.label(message_full_screen) - message_full_cancel.set_text("取消") - message_full_cancel.set_size(64, 63) - message_full_cancel.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - message_full_cancel.set_pos(64,65) - message_full_cancel.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - message_full_cancel.add_flag(lv.obj.FLAG.CLICKABLE) - # message_full_cancel.set_ext_click_area(63) - self.meta = message_full_screen - - message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None) - message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None) - - - def remove_all_sms_cb(self, event, msg): - sms.deleteMsg(1,4) - - def confirm(self, e): - print("sms confirm!!!!!!!!") - # self.timer.start(2*1000,0,self.clear_data) - EventMesh.publish("load_screen", {"screen": "remove_message_popup"}) - EventMesh.publish_async("remove_all_sms_cb","",1*1024) - - def concel(self, e): - EventMesh.publish("return_prev_screen") - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -remove_message_popup_screen = None -remove_message_popup_title = None -#信息弹窗 -class RemoveMessageScreen(Screen):#删除短信弹窗框 - NAME = "remove_message_popup" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer = osTimer() - - def initialization(self): - global remove_message_popup_screen,remove_message_popup_title - if remove_message_popup_screen == None : - remove_message_popup_screen = lv.obj() - print("message_popup_screen") - remove_message_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - message_popup_title = lv.label(remove_message_popup_screen) - message_popup_title.set_pos(0, 40) - message_popup_title.set_size(120, 50) - message_popup_title.set_text("正在删除中...\n请稍候") - message_popup_title.set_long_mode(lv.label.LONG.WRAP) - message_popup_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - message_popup_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = remove_message_popup_screen - self.timer.start(1000,1,self.timer_cb) - def timer_cb(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - msg_nums = sms.getMsgNums() - # print("timer_cb remove!!!!!!!!!",msg_nums) - if msg_nums == 0: - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "popup"}) - - def Close(self): - self.timer.stop() - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - def done_click(self): - EventMesh.publish("load_screen", {"screen": "popup"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - - -############短信############################### -MSG_FLAG = 0 -MSG_MAX = 5 #最大显示短信内容条数 -def msg_cb(args): - index = args[1] - storage = args[2] - print("index:{}".format(index)) - sms_data = sms.getSaveLoc() - sms_max = sms_data[0][2] - if index != -1: - tmp = sms.searchTextMsg(index) - detail = tmp[1]#内容 - if detail.find("SETIP:") != -1:#寻找是否有这个字符串 - tmp_test = detail.split("SETIP:")[1] - if tmp_test.find(":") != -1: - new_ip = tmp_test.split(':')[0] - print("tmp_test:{} new_ip:{}".format(tmp_test,new_ip)) - new_com = tmp_test.split(':')[1] - # new_md5 = detail.split(':')[3] - if len(new_ip) > 0 and len(new_com) > 0: - EventMesh.publish("set_new_ip_com", [new_ip,new_com,tmp[0]])#设置关机时间 - # EventMesh.publish("set_new_ip_com", [new_ip,new_com,new_md5])#设置关机时间 - - if index >= sms_max-1: - EventMesh.publish("load_screen", {"screen": "message_full"}) - else: - EventMesh.publish("load_screen", {"screen": "message_popup"}) - -sms.setCallback(msg_cb) -style_sms_bg_btn = lv.style_t() -style_sms_bg_btn.init() -style_sms_bg_btn.set_radius(5) -style_sms_bg_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_sms_bg_btn.set_bg_grad_color(lv.color_make(0xff, 0xff, 0xff)) -style_sms_bg_btn.set_bg_opa(255) -style_sms_bg_btn.set_border_color(lv.color_make(0xff, 0xff, 0xff)) -style_sms_bg_btn.set_border_opa(255) -style_sms_bg_btn.set_pad_left(0) -style_sms_bg_btn.set_pad_right(0) -style_sms_bg_btn.set_pad_top(0) -style_sms_bg_btn.set_pad_bottom(0) - - -msg_list_screen = None -msg_top_title = None -msg_cont_detail = None -msg_list_t = None -msg_list_t_done_img = None -no_msg_text = None -msg_cont_list_screen = None - -class PopupScreen(Screen): - NAME = "popup" - - def __init__(self): - super().__init__() - # -------------------------------------------popup_menu screen---------------------------------------------------------- - self.meta = None - self.msg_detail = {} - self.msg_nums = 0 - self.msg_nums_old = 0 - self.sms_detail_list = None - self.sms_detail_list_dict = [] - self.sms_data = [] #最新短信内容 - def post_processor_before_initialization(self): - pass - # self.msg_nums = sms.getMsgNums() #获取短信条数 - # if self.msg_nums_old != self.msg_nums: - # self.sms_data = [] - # self.msg_nums_old = self.msg_nums - - def initialization(self): - global msg_list_screen,msg_top_title,msg_cont_detail,msg_list_t,msg_list_t_done_img,no_msg_text,msg_cont_list_screen - print("PopupScreen:initialization1") - if msg_list_screen == None : - msg_list_screen = lv.obj() - print("msg_list_screen") - msg_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - msg_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - - msg_top_title = lv.label(msg_list_screen) - msg_top_title.set_pos(0, 5) - msg_top_title.set_size(LCD_X, 20) - msg_top_title.set_text("信息") - msg_top_title.set_long_mode(lv.label.LONG.WRAP) - msg_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - msg_top_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - msg_cont_list_screen = lv.obj(msg_list_screen) - msg_cont_list_screen.set_pos(0, 30) - msg_cont_list_screen.set_size(LCD_X, LCD_Y-30) - msg_cont_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - msg_cont_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - msg_list_t_done_img = lv.img(msg_cont_list_screen) - msg_list_t_done_img.set_pos(39, 10) - msg_list_t_done_img.set_size(50, 44) - msg_list_t_done_img.set_src("U:/static/IMAGE_NOTICE_NONE.png") - msg_list_t_done_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_msg_text = lv.label(msg_cont_list_screen) - no_msg_text.set_pos(0, 75) - no_msg_text.set_size(LCD_X, 20) - no_msg_text.set_text("暂无信息") - no_msg_text.set_long_mode(lv.label.LONG.WRAP) - no_msg_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_msg_text.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.sms_detail_list = lv.obj(msg_cont_list_screen) - self.sms_detail_list.set_pos(0, 0) - self.sms_detail_list.set_size(LCD_X, 129) - self.sms_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - self.sms_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - for i in range(MSG_MAX): - msg_btn = lv.btn(self.sms_detail_list) - msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - msg_btn.add_flag(lv.obj.FLAG.HIDDEN) - _btn_label2 = lv.label(msg_btn) - _btn_label3 = lv.label(msg_btn) - _btn_label4 = lv.label(msg_btn) - _btn_label4.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - _btn_label5 = lv.label(msg_btn) - _btn_label5.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - self.sms_detail_list_dict.append({"msg_btn":msg_btn,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3, - "_btn_label4":_btn_label4,"_btn_label5":_btn_label5}) - self.meta = msg_list_screen - - - self.msg_nums = sms.getMsgNums() - if self.msg_nums_old != self.msg_nums: - self.sms_data = [] - self.msg_nums_old = self.msg_nums - - self.btn_create(1) - print("PopupScreen:initialization2") - - # def sms_create_list(self,event,msg): - # self.msg_nums = sms.getMsgNums() - # self.btn_create(1) - - def sms_deal_phone_number(self,args): - data=enumerate(args) - data_str1="" - data_str2="" - data_str3="" - for index,value in data: - if index % 2 == 0: - data_str1=data_str1+value - else: - data_str2=data_str2+value - for i in range(0,len(data_str1)): - data_str3=data_str3+data_str2[i] - data_str3=data_str3+data_str1[i] - return data_str3 - def sms_get_message_info(self,index): - """ - :param index :短信索引值 - :tyoe index :整形 - - :return :元组类型 - 元组内容: - (message_ref,message_total_num,message_seq,sub_message_data,pdu_tye,sub_message_len) - - :message_ref :短信参考标识,同一个标识表明为同一条短信 - :message_total_num :此条长短信总条数 - :message_seq :此条短信在长短信中的序号 - :sub_message_data :词条短信的内容 - :pdu_tye :PDU类型,bit 6标记是否包含用户报文头,长短信需要 - :sub_message_len :此条短信内容长度 - - """ - message0=sms.searchPduMsg(index) - #print("sms_get_message_info:message0:{}".format(message0)) - if message0 == -1: - return -1 - - sca_num = int(message0[0:2],16) - 1 - data_len = 2 - addr_type= message0[data_len:data_len+1*2] - data_len = data_len+1*2 - - sca = message0[data_len:data_len+sca_num*2] - # 电话号码高低位需要转换 - sca = self.sms_deal_phone_number(sca) - - # if sca_num % 2 == 1: - # print("Get SCA phone {}".format(sca[:-1])) - # else: - # print("Get SCA phone {}".format(sca)) - - data_len = data_len+sca_num*2 - - pdu_tye = int(message0[data_len:data_len+1*2],16) - data_len = data_len+1*2 - - oa_num = int(message0[data_len:data_len+1*2],16) - data_len = data_len+1*2 - oa_addr_type = message0[data_len:data_len+1*2] - data_len = data_len+1*2 - - if oa_num % 2 == 1: - oa_num_t = int((oa_num + 1)/2) - else: - oa_num_t = int((oa_num )/2) - - oa = message0[data_len:data_len+oa_num_t*2] - # 电话号码高低位需要转换 - oa = self.sms_deal_phone_number(oa) - - # if oa_num % 2 == 1: - # print("Get OA phone {}".format(oa[:-1])) - # else: - # print("get OA phone {}".format(oa)) - - data_len = data_len+oa_num_t*2 - pid = message0[data_len:data_len+1*2] - - data_len = data_len+1*2 - dcs = message0[data_len:data_len+1*2] - data_len = data_len+1*2 - scts = message0[data_len:data_len+7*2] - data_len = data_len+7*2 - sub_message_len = int(message0[data_len:data_len+1*2],16) - data_len = data_len+1*2 - sub_message_head = message0[data_len:data_len+6*2] - data_len = data_len+6*2 - - # 或短信用户数据 - sub_message_data = message0[data_len:data_len+sub_message_len*2] - - #长短信 - if ((pdu_tye & 0x40 ) >> 6) == 1: - #长短信,处理长短信用户报文头 - message_ref = int(sub_message_head[6:8],16) - message_total_num = int(sub_message_head[8:10],16) - message_seq = int(sub_message_head[10:12],16) - return [message_ref,message_total_num,message_seq,pdu_tye,sub_message_len,message0] - else: - # 短短信 - return [0,1,1,pdu_tye,sub_message_len,message0] - - def btn_create(self,msg): - EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_screen,"data":msg}) - - def btn_create_screen(self,msg): - global msg_list_screen,msg_top_title,msg_cont_detail,msg_list_t,msg_list_t_done_img,no_msg_text,msg_cont_list_screen - count = 0 - j = 0 - print("self.msg_nums:{}".format(self.msg_nums)) - if self.msg_nums > 0 : - - - #隐藏短信控件,加提示信息 - if msg_cont_list_screen != None: - msg_list_t_done_img.clear_flag(lv.obj.FLAG.HIDDEN) - no_msg_text.clear_flag(lv.obj.FLAG.HIDDEN) - self.sms_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - no_msg_text.set_text("正在加载···") - if self.sms_detail_list != None: - self.sms_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - SMS_lis={} - SMS_lis_count = 0 - #self.sms_data = [] #短信数组 - if self.sms_data == [] : - for i in range(self.msg_nums): - EventMesh.publish("system_sleep_rest")#防止黑屏 - message=self.sms_get_message_info(self.msg_nums-i-1) - if message == -1: - break - #print("self.msg_nums:{} message:{} {} {}".format(self.msg_nums-i-1,message[0],message[1],message[2])) - #message:[253, 3, 1, 100, 140, '751F4EA776EE524D6D4'] - if message[1]>1 :#长短信 - if message[0] in SMS_lis:#存在列表 - SMS_lis[message[0]].append(message) - - else :#列表是新的 - SMS_lis[message[0]] = [message]#新增列表 - #print("SMS_lis:{}".format(SMS_lis)) - #SMS_lis[message[0]].append(message)#新增列表数据 - if len(SMS_lis[message[0]]) == message[1]:#存满一条 - SMS_lis_tmp = SMS_lis[message[0]] - data = "" - message_pdu = [] - for k in range(len(SMS_lis_tmp)): - for j in range(len(SMS_lis_tmp)): #排序 - if SMS_lis_tmp[j][2] == k+1: - message_pdu = sms.decodePdu(SMS_lis_tmp[j][5],20) - if(message_pdu!=-1): - data += message_pdu[1] - break - #print("data:{}".format(data)) - data_tmp = [] - data_tmp.append(message_pdu[0]) - data_tmp.append(data) - self.sms_data.append(data_tmp) - SMS_lis_count += 1 - if(SMS_lis_count >= MSG_MAX): - break - else : - SMS_lis_count += 1 - message_pdu = sms.decodePdu(message[5],20) - data = message_pdu[1] - data_tmp = [] - data_tmp.append(message_pdu[0]) - data_tmp.append(data) - self.sms_data.append(data_tmp) - print("data:{}".format(data)) - if(SMS_lis_count >= MSG_MAX): - break - MSG_nums = len (self.sms_data) - for i in range(MSG_MAX): - if i >= MSG_nums : - self.sms_detail_list_dict[i]["msg_btn"].add_flag(lv.obj.FLAG.HIDDEN) - continue - tmp = self.sms_data[i] - if tmp != -1: - #msg_btn = lv.btn(self.sms_detail_list) - self.sms_detail_list_dict[i]["msg_btn"].set_size(LCD_X,45) - self.sms_detail_list_dict[i]["msg_btn"].set_pos(0,47*count) - self.sms_detail_list_dict[i]["msg_btn"].add_style(style_sms_bg_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - # self.sms_detail_list_dict[i]["msg_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), - # lv.EVENT.SHORT_CLICKED, None) - - title = tmp[0] - # print("title:{}".format(title)) - #_btn_label2 = lv.label(msg_btn) - self.sms_detail_list_dict[i]["_btn_label2"].set_pos(0, 0) - self.sms_detail_list_dict[i]["_btn_label2"].set_size(0, 0) - self.sms_detail_list_dict[i]["_btn_label2"].set_text(title) - # _btn_label2.set_long_mode(lv.label.LONG.DOT) - # _btn_label2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - # - detail = tmp[1] - #_btn_label3 = lv.label(msg_btn) - self.sms_detail_list_dict[i]["_btn_label3"].set_pos(0, 0) - self.sms_detail_list_dict[i]["_btn_label3"].set_size(0, 0) - self.sms_detail_list_dict[i]["_btn_label3"].set_text(detail) - # _btn_label3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - detail1 = tmp[1] - #_btn_label4 = lv.label(msg_btn) - self.sms_detail_list_dict[i]["_btn_label4"].set_pos(5, 24) - self.sms_detail_list_dict[i]["_btn_label4"].set_size(LCD_X-15, 21) - self.sms_detail_list_dict[i]["_btn_label4"].set_text(detail1) - self.sms_detail_list_dict[i]["_btn_label4"].set_long_mode(lv.label.LONG.DOT) - # self.sms_detail_list_dict[i]["_btn_label4"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - title1 = tmp[0] - #_btn_label5 = lv.label(msg_btn) - self.sms_detail_list_dict[i]["_btn_label5"].set_pos(5, 5) - self.sms_detail_list_dict[i]["_btn_label5"].set_size(LCD_X-15, 20) - self.sms_detail_list_dict[i]["_btn_label5"].set_text(title1) - self.sms_detail_list_dict[i]["_btn_label5"].set_long_mode(lv.label.LONG.DOT) - self.sms_detail_list_dict[i]["_btn_label5"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.sms_detail_list_dict[i]["msg_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - #if msg == 1: - #self.sms_detail_list_dict[i]["msg_btn"].scroll_to_view(lv.ANIM.OFF) - - count = count + 1 - else : - self.sms_detail_list_dict[i]["msg_btn"].add_flag(lv.obj.FLAG.HIDDEN) - #显示控件 - if msg_list_t_done_img != None: - msg_list_t_done_img.add_flag(lv.obj.FLAG.HIDDEN) - no_msg_text.add_flag(lv.obj.FLAG.HIDDEN) - self.sms_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) - else: - if msg_cont_list_screen != None: - msg_list_t_done_img.clear_flag(lv.obj.FLAG.HIDDEN) - no_msg_text.clear_flag(lv.obj.FLAG.HIDDEN) - no_msg_text.set_text("暂无信息") - if self.sms_detail_list != None: - self.sms_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - - - def sms_cb(self,e): - code = e.get_code() - if code == lv.EVENT.SHORT_CLICKED: - print("tp test!!!!!!!!!!!!!!") - #上传标题和内容 - _name = e.get_target().get_child(0).get_text() - EventMesh.publish("save_msg_name", _name) - content = e.get_target().get_child(1).get_text() - EventMesh.publish("save_msg_content", content) - - #显示详细页面 - EventMesh.publish("load_screen", {"screen": "msg_detail"}) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -style_white_screen = lv.style_t() -style_white_screen.init() -style_white_screen.set_radius(0) -style_white_screen.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -style_white_screen.set_bg_opa(255) -style_white_screen.set_border_width(0) -style_white_screen.set_pad_left(0) -style_white_screen.set_pad_right(0) -style_white_screen.set_pad_top(0) -style_white_screen.set_pad_bottom(0) - -#灰色背景黑色字 - -style_font_20_black_bg_gray = lv.style_t() -style_font_20_black_bg_gray.init() -style_font_20_black_bg_gray.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -#style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) -style_font_20_black_bg_gray.set_bg_color(lv.color_make(0xe1,0xdb,0xdb)) -style_font_20_black_bg_gray.set_text_font(lv.K01_font_16_ALL) - - -msg_detail_screen = None -msg_detail_title = None -msg_detail_cont = None -class MsgDetailScreen(Screen): - NAME = "msg_detail" - - def __init__(self): - super().__init__() - self.meta = None - - self.name = "" - self.contetn = "" - - - def initialization(self): - global msg_detail_screen,msg_detail_title,msg_detail_cont,msg_detail_cont_obj - if msg_detail_screen == None: - msg_detail_screen = lv.obj() - print("msg_detail_screen") - msg_detail_screen.add_style(style_white_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - msg_detail_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - msg_detail_title = lv.label(msg_detail_screen) - msg_detail_title.set_pos(0, 10) - msg_detail_title.set_size(128, 20) - msg_detail_title.set_long_mode(lv.label.LONG.WRAP) - msg_detail_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - msg_detail_title.add_style(style_font_20_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) - - msg_detail_cont_obj = lv.obj(msg_detail_screen) - msg_detail_cont_obj.set_pos(0, 30) - msg_detail_cont_obj.set_size(128, 98) - msg_detail_cont_obj.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - msg_detail_cont_obj.add_style(style_white_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - msg_detail_cont = lv.label(msg_detail_cont_obj) - msg_detail_cont.set_pos(5, 5) - msg_detail_cont.set_width(118) - msg_detail_cont.set_style_text_align(lv.TEXT_ALIGN.LEFT, 5) - msg_detail_cont.add_style(style_font_20_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = msg_detail_screen - #获取字符串 - msg_detail_cont_obj.scroll_to(0, 0, lv.ANIM.OFF) - - self.name = EventMesh.publish("get_msg_name") - self.content = EventMesh.publish("get_msg_content") - msg_detail_title.set_text(self.name) - # tmp_y=(len(self.content)//15+1)*28 - # msg_detail_cont.set_size(240, tmp_y) - msg_detail_cont.set_text(self.content) - - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "popup"}) - - def hangup(self,e): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "popup"}) - - - -# -------------------------------------------heartrate screen---------------------------------------------------------- -heartrate_screen = None -heartrate_label = None -heartrate_done_img = None -heartrate_start_label = None -heartrate_bpm_label = None -heartrate_done_label = None -heartrate_line_bg_img = None -hr_line1 = None -hr_line2 = None -hr_line3 = None -hr_line4 = None -hr_line5 = None -hr_line6 = None -hr_line7 = None -heartrate_reset_btn_img = None - -style_line_red = lv.style_t() -style_line_red.init() -style_line_red.set_line_width(10) -style_line_red.set_line_color(lv.color_make(0xff, 0x00, 0x00)) - -hr_line_points = [{"x":0,"y":0},{"x":0,"y":0}] - -class HeartrateScreen(Screen): - NAME = "heartrate" - - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.point = 0 - self.heart_value = 0 - - def initialization(self): - global heartrate_screen,heartrate_label,heartrate_reset_btn_img,hr_line1,hr_line2,hr_line3,hr_line4,hr_line5,hr_line6,hr_line7,heartrate_line_bg_img,heartrate_done_img ,heartrate_start_label,heartrate_bpm_label ,heartrate_done_label - if heartrate_screen == None: - heartrate_screen = lv.obj() - print("heartrate_screen") - heartrate_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - heartrate_label = lv.label(heartrate_screen) - heartrate_label.set_pos(0, 20) - heartrate_label.set_size(240, 40) - heartrate_label.set_text("心率") - heartrate_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - heartrate_label.set_long_mode(lv.label.LONG.WRAP) - heartrate_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - heartrate_line_bg_img = lv.img(heartrate_screen) - heartrate_line_bg_img.set_pos(5, 60) - heartrate_line_bg_img.set_size(230, 120) - heartrate_line_bg_img.set_src("U:/static/hr_line_bg.png") - - - heartrate_done_img = lv.img(heartrate_screen) - heartrate_done_img.set_pos(20, 249) - heartrate_done_img.set_src("U:/static/hr_gif_03.png") - - heartrate_reset_btn_img = lv.img(heartrate_screen) - heartrate_reset_btn_img.set_pos(0, 192) - heartrate_reset_btn_img.set_src("U:/static/reset_hr_btn.png") - heartrate_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - heartrate_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) - - heartrate_start_label = lv.label(heartrate_screen) - heartrate_start_label.set_size(240,40) - heartrate_start_label.set_pos(0,200) - heartrate_start_label.set_text(" ") - heartrate_start_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - heartrate_start_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - heartrate_start_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - - hr_line1 = lv.line(heartrate_screen) - hr_line1.set_points(hr_line_points,2) - hr_line1.set_pos(25,60) - hr_line1.set_size(10,0) - hr_line1.add_style(style_line_red,0) - - hr_line2 = lv.line(heartrate_screen) - hr_line2.set_points(hr_line_points,2) - hr_line2.set_pos(53,60) - hr_line2.set_size(10,0) - hr_line2.add_style(style_line_red,0) - - hr_line3 = lv.line(heartrate_screen) - hr_line3.set_points(hr_line_points,2) - hr_line3.set_pos(80,60) - hr_line3.set_size(10,0) - hr_line3.add_style(style_line_red,0) - - hr_line4 = lv.line(heartrate_screen) - hr_line4.set_points(hr_line_points,2) - hr_line4.set_pos(109,60) - hr_line4.set_size(10,0) - hr_line4.add_style(style_line_red,0) - - hr_line5 = lv.line(heartrate_screen) - hr_line5.set_points(hr_line_points,2) - hr_line5.set_pos(136,60) - hr_line5.set_size(10,0) - hr_line5.add_style(style_line_red,0) - - hr_line6 = lv.line(heartrate_screen) - hr_line6.set_points(hr_line_points,2) - hr_line6.set_pos(164,60) - hr_line6.set_size(10,0) - hr_line6.add_style(style_line_red,0) - - hr_line7 = lv.line(heartrate_screen) - hr_line7.set_points(hr_line_points,2) - hr_line7.set_pos(192,60) - hr_line7.set_size(10,0) - hr_line7.add_style(style_line_red,0) - - heartrate_bpm_label = lv.label(heartrate_screen) - heartrate_bpm_label.set_size(120, 40) - heartrate_bpm_label.set_pos(120, 270) - heartrate_bpm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - heartrate_bpm_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - heartrate_done_label = lv.label(heartrate_screen) - heartrate_done_label.set_size(240, 40) - heartrate_done_label.set_pos(0, 270) - heartrate_done_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - heartrate_done_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - heartrate_done_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - self.meta = heartrate_screen - heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.SHORT_CLICKED, None) - heartrate_done_label.set_text(" ") - heartrate_bpm_label.set_text("-- bpm") - heartrate_start_label.set_text("正在测量中.") - EventMesh.publish("set_hr_state",1)#1代表手动进入测试界面 - - EventMesh.publish(constants.EVENT.START_HEART) - - def post_processor_after_initialization(self): - self.point = 0 - self.heart_value = 0 - self.show_history_data() - self.restart_up(0) - - def restart_up(self,e): - global heartrate_done_label,heartrate_bpm_label,heartrate_start_label,heartrate_reset_btn_img - self.timer.start(1*500, 1, self.start_measure) - heartrate_bpm_label.set_text("-- bpm") - if heartrate_reset_btn_img != None: - heartrate_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - self.point = 0 - self.heart_value = 0 - - heartrate_done_label.set_text(" ") - heartrate_bpm_label.set_text("-- bpm") - heartrate_start_label.set_text("正在测量中.") - EventMesh.publish("set_hr_state",1)#1代表手动进入测试界面 - - EventMesh.publish(constants.EVENT.START_HEART) - - def show_history_data(self): - global hr_line1,hr_line2,hr_line3,hr_line4,hr_line5,hr_line6,hr_line7 - read_data = {} - read_data = EventMesh.publish("get_history_hr_value") - print("hr history read_data",read_data) - if read_data != None: - count = len(read_data) - if count != 0: - if count >= 7: - for i in range(count): - value = read_data["0{}".format(i+1)] - if value < 30: - value = 30 - if value >= 210: - value = 210 - line_value = value - 30 #180-80 = 100 160-100 = 60 - line_value = int(line_value*0.58)+1 - if line_value >= 100: - line_value = 100 - #print("hr hist",line_value) - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if i == 0: - hr_line1.set_points(hr_line_points,2) - hr_line1.set_pos(25,160-line_value) - hr_line1.set_size(10,line_value) - if i == 1: - hr_line2.set_points(hr_line_points,2) - hr_line2.set_pos(53,160-line_value) - hr_line2.set_size(10,line_value) - - if i == 2: - hr_line3.set_points(hr_line_points,2) - hr_line3.set_pos(80,160-line_value) - hr_line3.set_size(10,line_value) - - if i == 3: - hr_line4.set_points(hr_line_points,2) - hr_line4.set_pos(109,160-line_value) - hr_line4.set_size(10,line_value) - - if i == 4: - hr_line5.set_points(hr_line_points,2) - hr_line5.set_pos(136,160-line_value) - hr_line5.set_size(10,line_value) - - if i == 5: - hr_line6.set_points(hr_line_points,2) - hr_line6.set_pos(164,160-line_value) - hr_line6.set_size(10,line_value) - - if i == 6: - hr_line7.set_points(hr_line_points,2) - hr_line7.set_pos(192,160-line_value) - hr_line7.set_size(10,line_value) - else: - value = read_data["0{}".format(count)] - if value < 30: - value = 30 - if value >= 180: - value = 180 - line_value = value - 30 #180-80 = 100 160-100 = 60 - line_value = int(line_value*0.58)+1 - # - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if count == 1: - hr_line1.set_points(hr_line_points,2) - hr_line1.set_pos(25,160-line_value) - hr_line1.set_size(10,line_value) - if count == 2: - hr_line2.set_points(hr_line_points,2) - hr_line2.set_pos(53,160-line_value) - hr_line2.set_size(10,line_value) - - if count == 3: - hr_line3.set_points(hr_line_points,2) - hr_line3.set_pos(80,160-line_value) - hr_line3.set_size(10,line_value) - - if count == 4: - hr_line4.set_points(hr_line_points,2) - hr_line4.set_pos(109,160-line_value) - hr_line4.set_size(10,line_value) - - if count == 5: - hr_line5.set_points(hr_line_points,2) - hr_line5.set_pos(136,160-line_value) - hr_line5.set_size(10,line_value) - - if count == 6: - hr_line6.set_points(hr_line_points,2) - hr_line6.set_pos(164,160-line_value) - hr_line6.set_size(10,line_value) - - if count == 7: - hr_line7.set_points(hr_line_points,2) - hr_line7.set_pos(192,160-line_value) - hr_line7.set_size(10,line_value) - - - def start_measure(self,*args): - global heartrate_screen,heartrate_label,heartrate_done_img ,heartrate_reset_btn_img,heartrate_start_label,heartrate_bpm_label ,heartrate_done_label - self.point = self.point + 1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - print("self.heart_value:{}".format(self.heart_value)) - if self.point >= 2: - if self.heart_value < 40: - self.heart_value = 0 - if self.heart_value != 0: - heartrate_bpm_label.set_text("{} bpm".format(self.heart_value)) - else: - heartrate_bpm_label.set_text("-- bpm") - - if self.point%4 == 0 : - heartrate_start_label.set_text("正在测量中..") - heartrate_done_img.set_src("U:/static/hr_gif_02.png") - if self.point%4 == 1 : - heartrate_start_label.set_text("正在测量中...") - heartrate_done_img.set_src("U:/static/hr_gif_01.png") - if self.point%4 == 2 : - heartrate_start_label.set_text("正在测量中.") - heartrate_done_img.set_src("U:/static/hr_gif_02.png") - - if self.point%4 == 3 : - heartrate_start_label.set_text("正在测量中.") - heartrate_done_img.set_src("U:/static/hr_gif_03.png") - - - - if self.point > 120: #测20s - heartrate_done_img.set_src("U:/static/hr_gif_03.png") - self.heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if self.heart_value > 50: - EventMesh.publish("set_old_hr_data",self.heart_value) - EventMesh.publish("set_history_hr_value",self.heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,self.heart_value) - heartrate_reset_btn_img.clear_flag(lv.obj.FLAG.HIDDEN) - - heartrate_start_label.set_text("测量结束,点击重测") - if self.heart_value != 0: - heartrate_bpm_label.set_text("{} bpm".format(self.heart_value)) - # heartrate_done_label.set_text("测量完成") - else: - heartrate_bpm_label.set_text("-- bpm") - - self.show_history_data() - - self.timer.stop() - self.point = 0 - EventMesh.publish("set_hr_state",0)#0代表关闭测试 - print("stop debug9") - EventMesh.publish(constants.EVENT.STOP_HEART) - - def Close(self): - self.timer.stop() - get_hr_state = EventMesh.publish("get_hr_state") - get_spo2_state = EventMesh.publish("get_spo2_state") - if get_hr_state == 1 or get_spo2_state == 1: - EventMesh.publish("set_hr_state",0)#0代表关闭测试 - print("stop debug10") - EventMesh.publish(constants.EVENT.STOP_HEART) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -# -------------------------------------------toolbox screen---------------------------------------------------------- - -toolbox_screen = None -toolbox_text_img = None -toolbox_cont = None -toolbox_step_img = None -toolbox_weather_img = None -toolbox_alarm_img = None -# toolbox_sms_img = None -toolbox_countdown_img = None -toolbox_stopwatch_img = None - -toolbox_cont_style = lv.style_t() -toolbox_cont_style.init() -toolbox_cont_style.set_radius(0) -toolbox_cont_style.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -toolbox_cont_style.set_bg_grad_color(lv.color_make(0x00, 0x00, 0x00)) -toolbox_cont_style.set_bg_grad_dir(lv.GRAD_DIR.VER) -toolbox_cont_style.set_bg_opa(255) -toolbox_cont_style.set_border_width(0) -toolbox_cont_style.set_pad_left(0) -toolbox_cont_style.set_pad_right(0) -toolbox_cont_style.set_pad_top(0) -toolbox_cont_style.set_pad_bottom(0) - -class ToolboxScreen(Screen): - NAME = "toolbox" - - def __init__(self): - super().__init__() - self.is_sliding = 0 - self.meta = None - - def initialization(self): - global toolbox_screen,toolbox_text_img,toolbox_cont,toolbox_step_img,toolbox_weather_img ,toolbox_alarm_img ,\ - toolbox_countdown_img,toolbox_stopwatch_img - if toolbox_screen == None: - tool_set_y = 5 - tool_set_y_offset = 40 - toolbox_screen = lv.obj() - print("toolbox_screen") - toolbox_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - toolbox_screen.set_scrollbar_mode(0) - - # toolbox_text_img = lv.img(toolbox_screen) - # toolbox_text_img.set_pos(75, 10) - # toolbox_text_img.set_size(90, 30) - # toolbox_text_img.set_src("U:/static/tool/tool_text.png") - # toolbox_text_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - # toolbox_title = lv.label(toolbox_screen) - # toolbox_title.set_pos(0, 5) - # toolbox_title.set_size(128, 20) - # toolbox_title.set_text("工具箱") - # toolbox_title.set_long_mode(lv.label.LONG.WRAP) - # toolbox_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - # toolbox_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_cont = lv.obj(toolbox_screen) - toolbox_cont.set_pos(0, 5) - toolbox_cont.set_size(128, 123) - toolbox_cont.add_style(toolbox_cont_style,lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_step_img_btn_1 = lv.btn(toolbox_cont) - toolbox_step_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_step_img_btn_1.set_size(120,35) - toolbox_step_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_step_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_step_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - - toolbox_step_img = lv.img(toolbox_cont) - toolbox_step_img.set_pos(5, tool_set_y) - toolbox_step_img.set_size(25, 25) - # toolbox_step_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_step_img.set_src("U:/static/IMAGE_SECMENU_STEP.png") - toolbox_step_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_step_img_label = lv.label(toolbox_cont) - toolbox_step_img_label.set_pos(35, tool_set_y+5) - toolbox_step_img_label.set_size(128-35, 35) - toolbox_step_img_label.set_text("计步") - toolbox_step_img_label.set_long_mode(lv.label.LONG.WRAP) - # toolbox_step_img_label.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_step_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_step_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - tool_set_y+=tool_set_y_offset - - toolbox_weather_img_btn_1 = lv.btn(toolbox_cont) - toolbox_weather_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_weather_img_btn_1.set_size(120,35) - toolbox_weather_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_weather_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_weather_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - toolbox_weather_img = lv.img(toolbox_cont) - toolbox_weather_img.set_pos(5, tool_set_y) - toolbox_weather_img.set_size(25, 25) - # toolbox_weather_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_weather_img.set_src("U:/static/IMAGE_SECMENU_WEATHER.png") - toolbox_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_weather_img_label = lv.label(toolbox_cont) - toolbox_weather_img_label.set_pos(35, tool_set_y+5) - toolbox_weather_img_label.set_size(128-35, 35) - toolbox_weather_img_label.set_text("天气") - toolbox_weather_img_label.set_long_mode(lv.label.LONG.WRAP) - # toolbox_weather_img_label.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_weather_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_weather_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - tool_set_y+=tool_set_y_offset - - toolbox_alarm_img_btn_1 = lv.btn(toolbox_cont) - toolbox_alarm_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_alarm_img_btn_1.set_size(120,35) - toolbox_alarm_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_alarm_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_alarm_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - toolbox_alarm_img = lv.img(toolbox_cont) - toolbox_alarm_img.set_pos(5, tool_set_y) - toolbox_alarm_img.set_size(25, 25) - # toolbox_alarm_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_alarm_img.set_src("U:/static/IMAGE_SECMENU_ALARM.png") - toolbox_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_alarm_img_label = lv.label(toolbox_cont) - toolbox_alarm_img_label.set_pos(35, tool_set_y+5) - toolbox_alarm_img_label.set_size(128-35, 35) - toolbox_alarm_img_label.set_text("闹钟") - toolbox_alarm_img_label.set_long_mode(lv.label.LONG.WRAP) - # toolbox_alarm_img_label.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_alarm_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_alarm_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - # tool_set_y+=90 - # toolbox_sms_img = lv.img(toolbox_cont) - # toolbox_sms_img.set_pos(4, tool_set_y) - # toolbox_sms_img.set_size(232, 80) - # toolbox_sms_img.add_flag(lv.obj.FLAG.CLICKABLE) - # toolbox_sms_img.set_src("U:/static/tool/sms_setting.png") - # toolbox_sms_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - tool_set_y+=tool_set_y_offset - - toolbox_countdown_img_btn_1 = lv.btn(toolbox_cont) - toolbox_countdown_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_countdown_img_btn_1.set_size(120,35) - toolbox_countdown_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_countdown_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_countdown_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - toolbox_countdown_img = lv.img(toolbox_cont) - toolbox_countdown_img.set_pos(5, tool_set_y) - toolbox_countdown_img.set_size(25, 25) - # toolbox_countdown_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_countdown_img.set_src("U:/static/IMAGE_SECMENU_COUNTDOWN.png") - toolbox_countdown_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_countdown_img_label = lv.label(toolbox_cont) - toolbox_countdown_img_label.set_pos(35, tool_set_y+5) - toolbox_countdown_img_label.set_size(128-35, 35) - toolbox_countdown_img_label.set_text("倒计时") - toolbox_countdown_img_label.set_long_mode(lv.label.LONG.WRAP) - # toolbox_countdown_img_label.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_countdown_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_countdown_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - tool_set_y+=tool_set_y_offset - toolbox_stopwatch_img_btn_1 = lv.btn(toolbox_cont) - toolbox_stopwatch_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_stopwatch_img_btn_1.set_size(120,35) - toolbox_stopwatch_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_stopwatch_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_stopwatch_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - toolbox_stopwatch_img = lv.img(toolbox_cont) - toolbox_stopwatch_img.set_pos(5, tool_set_y) - toolbox_stopwatch_img.set_size(25, 25) - # toolbox_stopwatch_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_stopwatch_img.set_src("U:/static/IMAGE_SECMENU_STOPWATCH.png") - toolbox_stopwatch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_stopwatch_img_label = lv.label(toolbox_cont) - toolbox_stopwatch_img_label.set_pos(35, tool_set_y+5) - toolbox_stopwatch_img_label.set_size(128-35, 35) - toolbox_stopwatch_img_label.set_text("秒表") - toolbox_stopwatch_img_label.set_long_mode(lv.label.LONG.WRAP) - - toolbox_stopwatch_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_stopwatch_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_stopwatch_img_label_btn = lv.label(toolbox_cont) - toolbox_stopwatch_img_label_btn.set_pos(0, tool_set_y) - toolbox_stopwatch_img_label_btn.set_size(128, 45) - toolbox_stopwatch_img_label_btn.set_text(" ") - toolbox_stopwatch_img_label_btn.set_long_mode(lv.label.LONG.WRAP) - # toolbox_stopwatch_img_label_btn.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_stopwatch_img_label_btn.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - tool_set_y+=tool_set_y_offset - toolbox_calcut_img_btn_1 = lv.btn(toolbox_cont) - toolbox_calcut_img_btn_1.set_pos(int(0),int(tool_set_y-5)) - toolbox_calcut_img_btn_1.set_size(120,35) - toolbox_calcut_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - toolbox_calcut_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_calcut_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - toolbox_calcut_img = lv.img(toolbox_cont) - toolbox_calcut_img.set_pos(5, tool_set_y) - toolbox_calcut_img.set_size(25, 25) - # toolbox_countdown_img.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_calcut_img.set_src("U:/static/menu_calcut.png") - toolbox_calcut_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_calcut_img_label = lv.label(toolbox_cont) - toolbox_calcut_img_label.set_pos(35, tool_set_y+5) - toolbox_calcut_img_label.set_size(128-35, 35) - toolbox_calcut_img_label.set_text("计算器") - toolbox_calcut_img_label.set_long_mode(lv.label.LONG.WRAP) - # toolbox_countdown_img_label.add_flag(lv.obj.FLAG.CLICKABLE) - toolbox_calcut_img_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - toolbox_calcut_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - toolbox_step_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "step")), lv.EVENT.SHORT_CLICKED, None) - toolbox_weather_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "weather")), lv.EVENT.SHORT_CLICKED, None) - toolbox_alarm_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) - # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.SHORT_CLICKED, None) - toolbox_countdown_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e,"countdown")), lv.EVENT.SHORT_CLICKED, None) - toolbox_stopwatch_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) - - toolbox_calcut_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "calculator")), lv.EVENT.SHORT_CLICKED, None) - - # toolbox_step_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "step")), lv.EVENT.SHORT_CLICKED, None) - # toolbox_weather_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "weather")), lv.EVENT.SHORT_CLICKED, None) - # toolbox_alarm_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) - # # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.SHORT_CLICKED, None) - # toolbox_countdown_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) - # toolbox_stopwatch_img_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) - - - toolbox_step_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "step")), lv.EVENT.PRESSING, None) - toolbox_weather_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "weather")), lv.EVENT.PRESSING, None) - toolbox_alarm_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "clk_list")), lv.EVENT.PRESSING, None) - # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.SHORT_CLICKED, None) - toolbox_countdown_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "countdown")), lv.EVENT.PRESSING, None) - toolbox_stopwatch_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) - toolbox_calcut_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "calculator")), lv.EVENT.PRESSING, None) - - # toolbox_step_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e,"step")), lv.EVENT.PRESSING, None) - # toolbox_weather_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "weather")), lv.EVENT.PRESSING, None) - # toolbox_alarm_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "clk_list")), lv.EVENT.PRESSING, None) - # # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.SHORT_CLICKED, None) - # toolbox_countdown_img_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "countdown")), lv.EVENT.PRESSING, None) - # toolbox_stopwatch_img_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_tool_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) - - self.meta = toolbox_screen - - def ui_tool_cb(self, e, msg): - code = e.get_code() - EventMesh.publish("publish_message_event_ui",{"func":self.ui_tool_cb_do,"data":[code,msg]}) - def ui_tool_cb_do(self, data): - #code = e.get_code() - - code = data[0] - msg = data[1] - - #print("code!!!!!!!!",code,msg) - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - print("2self.is_sliding",self.is_sliding) - - self.is_sliding =0 - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_bottom_to_top(self): - #print("done_bottom_to_top") - self.is_sliding = 0 - pass - - def done_top_to_bottom(self): - #print("done_top_to_bottom") - self.is_sliding = 0 - pass - def done_left_to_right(self): - #print("done_left_to_right") - self.is_sliding = 0 - pass - def done_right_to_left(self): - #print("done_right_to_left") - self.is_sliding = 0 - pass - -incoming_call_screen = None -incoming_call_img = None -incoming_call_name_label = None -incoming_call_answer = None -incoming_call_hangup = None -# CALL_LOG_MAX = 50 -class IncomingCallScreen(Screen): - NAME = "incoming_call" - - def __init__(self): - super().__init__() - self.CALL_LOG_MAX = CALL_LOG_MAX - self.read_data = {} - self.meta_type = "popup" - self.aud = audio.Audio(0) - self.call_timer = osTimer() - self.name = None - self.phonebook = {} - self.pro_state = 0 - self.meta = None - - - self.call_log = {} - self.call_log_value = {} - self.read_call_log = {} - self.number_tmp = {} - - def initialization(self): - global incoming_call_screen,incoming_call_img,incoming_call_name_label,incoming_call_answer ,incoming_call_hangup - if incoming_call_screen == None : - # -------------------------------------------incoming_call screen---------------------------------------------------------- - incoming_call_screen = lv.obj() - print("incoming_call_screen") - incoming_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - incoming_call_img = lv.img(incoming_call_screen) - incoming_call_img.set_pos(48, 10) - incoming_call_img.set_size(32, 32) - incoming_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") - incoming_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - incoming_call_name_label = lv.label(incoming_call_screen) - incoming_call_name_label.set_pos(0, 50) - incoming_call_name_label.set_text(" ") - incoming_call_name_label.set_size(128, 40) - incoming_call_name_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - incoming_call_name_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - incoming_call_answer = lv.img(incoming_call_screen) - incoming_call_answer.set_size(32, 32) - incoming_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) - incoming_call_answer.set_pos(84, 85) - incoming_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - incoming_call_answer.set_src("U:/static/answer.png") - - incoming_call_hangup = lv.img(incoming_call_screen) - incoming_call_hangup.set_size(32, 32) - incoming_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) - incoming_call_hangup.set_pos(11, 85) - incoming_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - incoming_call_hangup.set_src("U:/static/hang_up.png") - incoming_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)), - lv.EVENT.SHORT_CLICKED, None) - incoming_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = incoming_call_screen - EventMesh.publish("set_UI_high_priority", 1) - - - def post_processor_after_initialization(self): - global incoming_call_screen,incoming_call_img,incoming_call_name_label,incoming_call_answer ,incoming_call_hangup - utime.sleep_ms(200)#不加延时会切屏 - data = EventMesh.publish("get_phonebook_list") - if data != None: - check = data[0] - self.phonebook = data[1] - if check == 1:#先检查通讯录 - phonebook_keys = sorted(self.phonebook.keys()) - b = self.meta_info in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - j = 0 - if b == True: - for i in range(len(self.phonebook)): #字典 key value - #'001:邓雪英':15521469561 - name = self.phonebook[phonebook_keys[j]] - name_value = phonebook_keys[j] - number_tmp = str(self.meta_info) - # print("name :{} number_tmp:{}".format(name,number_tmp)) - if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 - number_f= name_value - name_s = number_f.split(':') - name_s = name_s[1] - self.name = name_s - self.pro_state = 1 - break - j+=1 - else: - self.name = str(self.meta_info) - self.pro_state = 0 - else: - self.name = str(self.meta_info) - self.pro_state = 0 - - read_call_log = EventMesh.publish("get_call_log_list") - check_call_log_json = read_call_log[0] - self.read_call_log = read_call_log[1] - if self.pro_state == 0 and check_call_log_json == 1:#电话本没有就在通话记录查找电话号码并且文件存在是查找 - - sort_tmp = self.read_call_log.values() - for sort_new_tmp in sort_tmp: #字典 key value - number = sort_new_tmp["number"] - find_ok = self.meta_info in number - # print("find_ok:{} sort_tmp :{} self.meta_info:{}\r\n".format(find_ok,number,self.meta_info)) - if find_ok == True: - name_value = sort_new_tmp["name"]#查找到相同的电话号码就退出break - self.name = name_value - break - - if self.name == None: - self.name = str(self.meta_info) - - # incoming_call_label.set_text(str(self.meta_info)) - incoming_call_name_label.set_text(self.name) - EventMesh.publish("save_phonename",self.name) - time = EventMesh.publish("screen_get_time")#获取系统时间 - - # ["15692025051","2","12:59","哥gdh符合双方和开发商开发好看的思考"], - # 格式:{"电话号码":{"timesec":'时间戳',"number":'电话号码',"name":'名字',"time":'时间',"count":'通话次数'}} - self.num = 0 - - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - # print("time_tmp:{}".format(time_tmp)) - read_call_log = EventMesh.publish("get_call_log_list") - check_json = read_call_log[0] - - if check_json == True: - self.read_call_log = read_call_log[1] - print("读取通话记录") - b = str(self.meta_info) in self.read_call_log.keys()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 - - if b == True:#查找是否有相同的电话号码 有就直接读出来的次数上加一 没有则从1开始加起 - number_tmp = {} - number_tmp = self.read_call_log[str(self.meta_info)] #通话次数加一 - num_tmp_t = number_tmp["count"]#读取本地保存的通话次数 - else : - num_tmp_t = 0 - self.num = num_tmp_t - else: - self.num = 0 #通话次数 - - sort_tmp = {} - sort_tmp = self.read_call_log.values() - sort_new = {} - sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 - i = 0 - if len(self.read_call_log) >= self.CALL_LOG_MAX: - for sort_new_tmp in sort_new: #字典 key value - i+=1 # 1 - if i >= self.CALL_LOG_MAX:#大于50条把最后一条删除掉只保留前面50调最新的数据 - key_tmp = sort_new_tmp["number"] - del self.read_call_log[key_tmp] - - tmp = {} - self.num = self.num +1 - if self.num > 99: - self.num = 99 - tmp["count"]= self.num #通话次数 - tmp["time"]= "{}:{}".format("%02d"%(time[0][0]),"%02d"%(time[0][1]))#通话时间 - tmp["name"]= self.name #名称 - tmp["timesec"]= time_tmp #时间戳 - tmp["number"] = self.meta_info - - self.read_call_log[self.meta_info] = tmp - with open("/usr/static/storage_file/Call_log.json","w",encoding="utf-8") as fd: - ujson.dump(self.read_call_log,fd) - print("创建通话记录") - EventMesh.publish("set_call_log_list", [1,self.read_call_log]) - EventMesh.publish("call_log_update_show_list") - - self.call_timer.start(6000, 1, self.call_timer_cb) - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def call_timer_cb(self,e): - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def answer(self,e): - self.call_timer.stop() - self.aud.stop() - EventMesh.publish("set_UI_high_priority", 0) - voiceCall.callAnswer() - - def Close(self): - self.call_timer.stop() - self.aud.stop() - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - self.aud.stop() - self.call_timer.stop() - voiceCall.callEnd() - EventMesh.publish("set_interrup_incall",0) - EventMesh.publish("set_UI_high_priority",0) - - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME != "dialing_noplay_popup": - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - pass - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - pass - - def done_left_to_right(self): - pass - - def done_right_to_left(self): - pass - - def done_bottom_to_top(self): - pass - - def done_top_to_bottom(self): - pass - - def done_return(self): - pass - - -on_call_screen = None -on_call_obj =None -on_call_label_name = None -on_call_second_label = None -on_call_volum_label = None -on_call_tab_label = None -on_call_hangup = None -on_call_bar = None -on_call_volum_reduce = None -on_call_volum_add = None -on_call_phone_one = None -on_call_phone_two = None -on_call_phone_three = None -on_call_phone_four = None -on_call_phone_five = None -on_call_phone_six = None -on_call_phone_seven = None -on_call_phone_eight = None -on_call_phone_nine = None -on_call_phone_start = None -on_call_phone_zero = None -on_call_screen_tab = None -on_call_phone_hash = None -on_call_phone_return =None -on_call_screen_tab_label =None -on_call_phone_return_btn = None -ON_CALL_MAX_DATA = 9 -class OnCallScreen(Screen): - NAME = "on_call" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count_sec = 0 - self.timer = osTimer() - self.aud = audio.Audio(0) - # self.aud.set_pa(Pin.GPIO43) - self.read_data = {} - self.volum_size = 8 - self.open_volum = 0 - self.phone_num = '' - self.phone_list = [] - self.button = 0 - - def initialization(self): - EventMesh.publish("set_UI_high_priority", 1) - global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup ,on_call_volum_label,on_call_tab_label,on_call_bar,on_call_obj,\ - on_call_volum_reduce,on_call_volum_add,on_call_phone_one ,on_call_phone_two ,on_call_phone_three,on_call_phone_four,on_call_phone_five,\ - on_call_phone_six,on_call_phone_seven,on_call_screen_tab_label ,on_call_phone_return,on_call_phone_eight ,on_call_phone_nine ,on_call_phone_start ,\ - on_call_phone_zero ,on_call_phone_hash,on_call_phone_return_btn,\ - on_call_screen_tab - if on_call_screen ==None : - size_x = 36 #按钮大小 - size_y = 22 - start_x = 5 - start_y = 25 - offset_y = 4 - - on_call_screen = lv.obj() - on_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_obj = lv.obj(on_call_screen) - on_call_obj.set_size(128,128) - on_call_obj.set_pos(0,0) - on_call_obj.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - print("on_call_screen") - - on_call_label_name = lv.label(on_call_obj) - on_call_label_name.set_pos(0, 5) - on_call_label_name.set_size(128, 40) - on_call_label_name.set_text(" ") - on_call_label_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - on_call_label_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - on_call_second_label = lv.label(on_call_obj) - on_call_second_label.set_pos(0, 35) - on_call_second_label.set_size(128, 20) - on_call_second_label.set_text("00:00") - on_call_second_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - on_call_second_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - on_call_bar = lv.bar(on_call_obj) - on_call_bar.set_pos(28, 65) - on_call_bar.set_size(72, 12) - on_call_bar.set_style_anim_time(1000, lv.PART.INDICATOR | lv.STATE.DEFAULT) - on_call_bar.set_mode(lv.bar.MODE.NORMAL) - on_call_bar.set_value(50, lv.ANIM.OFF) - on_call_bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_bar.add_style(style_bar_indic, lv.PART.INDICATOR | lv.STATE.DEFAULT) - - on_call_volum_reduce = lv.img(on_call_obj) - on_call_volum_reduce.set_size(18, 18) - # on_call_volum_reduce.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_volum_reduce.set_pos(5, 62) - on_call_volum_reduce.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_volum_reduce.set_src("U:/static/REDUCE_VOLUM_ICON.png") - # on_call_volum_reduce.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), - # lv.EVENT.SHORT_CLICKED, None) - - on_call_volum_reduce_btn = lv.img(on_call_obj) - on_call_volum_reduce_btn.set_size(80, 40) - on_call_volum_reduce_btn.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_volum_reduce_btn.set_pos(48, 50) - on_call_volum_reduce_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)), - lv.EVENT.SHORT_CLICKED, None) - - - on_call_volum_add = lv.img(on_call_obj) - on_call_volum_add.set_size(18, 18) - # on_call_volum_add.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_volum_add.set_pos(105, 62) - on_call_volum_add.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_volum_add.set_src("U:/static/VOLUM_ADD_ICON.png") - # on_call_volum_add.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)), - # lv.EVENT.SHORT_CLICKED, None) - - on_call_volum_add_btn = lv.img(on_call_obj) - on_call_volum_add_btn.set_size(40, 40) - on_call_volum_add_btn.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_volum_add_btn.set_pos(0, 50) - on_call_volum_add_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), - lv.EVENT.SHORT_CLICKED, None) - - - on_call_volum_label = lv.label(on_call_obj) - on_call_volum_label.set_pos(0, 100) - on_call_volum_label.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_volum_label.set_size(48, 28) - on_call_volum_label.set_text("静音") - on_call_volum_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - on_call_volum_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_volum_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.open_volum_show(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_hangup = lv.img(on_call_obj) - on_call_hangup.set_size(32, 32) - on_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_hangup.set_pos(48, 90) - on_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_hangup.set_src("U:/static/hang_up.png") - on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_tab_label = lv.label(on_call_obj) - on_call_tab_label.set_pos(80, 100) - on_call_tab_label.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_tab_label.set_size(48, 28) - on_call_tab_label.set_text("键盘") - on_call_tab_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - on_call_tab_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_tab_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_call_tab_show(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_screen_tab = lv.obj(on_call_screen) - on_call_screen_tab.set_size(128,128) - on_call_screen_tab.set_pos(0,0) - on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) - on_call_screen_tab.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - on_call_screen_tab_label = lv.label(on_call_screen_tab) - on_call_screen_tab_label.set_pos(40, 5) - on_call_screen_tab_label.set_size(0, 20) - on_call_screen_tab_label.set_text(" ") - on_call_screen_tab_label.set_long_mode(lv.label.LONG.CLIP) - on_call_screen_tab_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_screen_tab_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - on_call_phone_return = lv.img(on_call_screen_tab) - on_call_phone_return.set_src("U:/static/RED_RETURN_PNG.png") - on_call_phone_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_return.set_pos(0, 5) - on_call_phone_return.set_size(18, 18) - - on_call_phone_return_btn = lv.img(on_call_screen_tab) - on_call_phone_return_btn.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_return_btn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_return_btn.set_pos(0, 0) - on_call_phone_return_btn.set_size(50, 25) - on_call_phone_return_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_return_show(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_one = lv.img(on_call_screen_tab) - on_call_phone_one.set_src("U:/static/IMAGE_NUMBER_KEY1_ICON.png") - on_call_phone_one.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_one.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_one.set_pos(start_x, start_y) - on_call_phone_one.set_size(size_x, size_y) - - on_call_phone_two = lv.img(on_call_screen_tab) - on_call_phone_two.set_size(size_x, size_y) - on_call_phone_two.set_src("U:/static/IMAGE_NUMBER_KEY2_ICON.png") - on_call_phone_two.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_two.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_two.set_pos(start_x+size_x+5*1, start_y) - - on_call_phone_three = lv.img(on_call_screen_tab) - on_call_phone_three.set_size(size_x, size_y) - on_call_phone_three.set_src("U:/static/IMAGE_NUMBER_KEY3_ICON.png") - on_call_phone_three.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_three.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_three.set_pos(start_x+size_x*2+5*2, start_y) - - on_call_phone_four = lv.img(on_call_screen_tab) - on_call_phone_four.set_size(size_x, size_y) - on_call_phone_four.set_src("U:/static/IMAGE_NUMBER_KEY4_ICON.png") - on_call_phone_four.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_four.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_four.set_pos(start_x, start_y+size_y+offset_y) - - on_call_phone_five = lv.img(on_call_screen_tab) - on_call_phone_five.set_size(size_x, size_y) - on_call_phone_five.set_src("U:/static/IMAGE_NUMBER_KEY5_ICON.png") - on_call_phone_five.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_five.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_five.set_pos(start_x+size_x+5*1, start_y+size_y+offset_y) - - on_call_phone_six = lv.img(on_call_screen_tab) - on_call_phone_six.set_size(size_x, size_y) - on_call_phone_six.set_src("U:/static/IMAGE_NUMBER_KEY6_ICON.png") - on_call_phone_six.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_six.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_six.set_pos(start_x+size_x*2+5*2, start_y+size_y+offset_y) - - on_call_phone_seven = lv.img(on_call_screen_tab) - on_call_phone_seven.set_size(size_x, size_y) - on_call_phone_seven.set_src("U:/static/phone_seven_icon.png") - on_call_phone_seven.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_seven.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_seven.set_pos(start_x, start_y+size_y*2+offset_y*2) - - on_call_phone_eight = lv.img(on_call_screen_tab) - on_call_phone_eight.set_size(size_x, size_y) - on_call_phone_eight.set_src("U:/static/IMAGE_NUMBER_KEY8_ICON.png") - on_call_phone_eight.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_eight.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_eight.set_pos(start_x+size_x+5*1, start_y+size_y*2+offset_y*2) - - on_call_phone_nine = lv.img(on_call_screen_tab) - on_call_phone_nine.set_size(size_x, size_y) - on_call_phone_nine.set_src("U:/static/phnone_nine_icon.png") - on_call_phone_nine.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_nine.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_nine.set_pos(start_x+size_x*2+5*2, start_y+size_y*2+offset_y*2) - - - on_call_phone_xing = lv.img(on_call_screen_tab) - on_call_phone_xing.set_size(size_x, size_y) - on_call_phone_xing.set_src("U:/static/xing_icon.png") - on_call_phone_xing.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_xing.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_xing.set_pos(start_x, start_y+size_y*3+offset_y*3) - - - on_call_phone_zero = lv.img(on_call_screen_tab) - on_call_phone_zero.set_size(size_x, size_y) - on_call_phone_zero.set_src("U:/static/IMAGE_NUMBER_KEY0_ICON.png") - on_call_phone_zero.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_zero.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_zero.set_pos(start_x+size_x+5*1, start_y+size_y*3+offset_y*3) - - - on_call_phone_jing = lv.img(on_call_screen_tab) - on_call_phone_jing.set_size(size_x, size_y) - on_call_phone_jing.set_src("U:/static/jing_icon.png") - on_call_phone_jing.add_flag(lv.obj.FLAG.CLICKABLE) - on_call_phone_jing.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - on_call_phone_jing.set_pos(start_x+size_x*2+5*2, start_y+size_y*3+offset_y*3) - - - - - - self.meta = on_call_screen - on_call_phone_jing.add_event_cb(lambda e: EventMesh.callback_wrapper(self.jingpressed_start(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_xing.add_event_cb(lambda e: EventMesh.callback_wrapper(self.xingpressed_start(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_one.add_event_cb(lambda e: EventMesh.callback_wrapper(self.one(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_two.add_event_cb(lambda e: EventMesh.callback_wrapper(self.two(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_three.add_event_cb(lambda e: EventMesh.callback_wrapper(self.three(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_four.add_event_cb(lambda e: EventMesh.callback_wrapper(self.four(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_five.add_event_cb(lambda e: EventMesh.callback_wrapper(self.five(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_six.add_event_cb(lambda e: EventMesh.callback_wrapper(self.six(e)), - lv.EVENT.SHORT_CLICKED, None) - on_call_phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.endpressed_start(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_eight.add_event_cb(lambda e: EventMesh.callback_wrapper(self.eight(e)), - lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.nine_endpressed_start(e)), - lv.EVENT.SHORT_CLICKED, None) - - # phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero(e)), - # lv.EVENT.SHORT_CLICKED, None) - - on_call_phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None)#短按显示* - - on_call_phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), - lv.EVENT.LONG_PRESSED, None)#长按显示+ - - on_call_phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero_endpressed_start(e)), - lv.EVENT.RELEASED, None)#释放按键 - - - - name = EventMesh.publish("get_phonename") - on_call_label_name.set_text(name) - # on_call_label.set_text(str(self.meta_info)) - on_call_second_label.set_text("00:00") - self.phone_num = '' - self.phone_list = [] - self.button = 0 - self.mute_state = 0 - on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT) - voiceCall.mute(2,0,0) - - def show_num(self): - global on_call_screen_tab_label - #print("phone self.phone_num ",self.phone_num,self.phone_list) - on_call_screen_tab_label.set_size(128-30, 20) - on_call_screen_tab_label.set_pos(20, 5) - on_call_screen_tab_label.set_text(self.phone_num) - def one(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - - voiceCall.startDtmf("1",100) - self.phone_list.append("1") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def two(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("2",100) - self.phone_list.append("2") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def three(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - voiceCall.startDtmf("3",100) - self.phone_list.append("3") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def four(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - voiceCall.startDtmf("4",100) - self.phone_list.append("4") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def five(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("5",100) - self.phone_list.append("5") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def six(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("6",100) - self.phone_list.append("6") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def seven(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("7",100) - self.phone_list.append("7") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def eight(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("8",100) - self.phone_list.append("8") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def nine(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA: - self.phone_list.pop(0) - #return - voiceCall.startDtmf("9",100) - self.phone_list.append("9") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def zero(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 - self.phone_list.pop(0) - #return - voiceCall.startDtmf("0",100) - self.phone_list.append("0") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def zero_endpressed_start(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - - if self.button == 1:#长按 - self.phone_list.append("+") - voiceCall.startDtmf("+",100) - else:#短按 - self.phone_list.append("0") - voiceCall.startDtmf("0",100) - - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def nine_endpressed_start(self,e): - if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 - #self.phone_list.pop(0) - return - - # if self.button == 1:#长按 - # self.phone_list.append("#") - # voiceCall.startDtmf("#",100) - # else:#短按 - self.phone_list.append("9") - voiceCall.startDtmf("9",100) - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def start(self,e): - self.button = 0 - - def pressed_start(self,e): - self.button = 1 - def Close(self): - self.timer_cb = 0 - self.timer.stop() - - def xingpressed_start(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 - self.phone_list.pop(0) - #return - - # if self.button == 1:#长按 - # voiceCall.startDtmf("*",100) - # self.phone_list.append("*") - # else:#短按 - voiceCall.startDtmf("*",100) - self.phone_list.append("*") - - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def jingpressed_start(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 - self.phone_list.pop(0) - #return - - # if self.button == 1:#长按 - # voiceCall.startDtmf("*",100) - # self.phone_list.append("*") - # else:#短按 - voiceCall.startDtmf("#",100) - self.phone_list.append("#") - - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def endpressed_start(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 - self.phone_list.pop(0) - #return - - # if self.button == 1:#长按 - # voiceCall.startDtmf("*",100) - # self.phone_list.append("*") - # else:#短按 - voiceCall.startDtmf("7",100) - self.phone_list.append("7") - - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def hash(self,e): - if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 - self.phone_list.pop(0) - #return - voiceCall.startDtmf("#",100) - self.phone_list.append("#") - self.phone_num = ''.join(self.phone_list) - self.show_num() - - def add_show_hidden(self): - on_call_volum_add.add_flag(lv.obj.FLAG.HIDDEN) - on_call_volum_reduce.add_flag(lv.obj.FLAG.HIDDEN) - on_call_bar.add_flag(lv.obj.FLAG.HIDDEN) - - def clear_show_hidden(self): - on_call_volum_add.clear_flag(lv.obj.FLAG.HIDDEN) - on_call_volum_reduce.clear_flag(lv.obj.FLAG.HIDDEN) - on_call_bar.clear_flag(lv.obj.FLAG.HIDDEN) - - def open_volum_show(self, e): - global on_call_screen_tab,on_call_screen,on_call_obj - if self.mute_state == 0:#默认是开启 - self.mute_state = 1 - voiceCall.mute(2,1,0) - on_call_volum_label.set_style_text_color(lv.color_make(0, 169, 242), lv.STATE.DEFAULT) - else: - on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT) - self.mute_state = 0 - voiceCall.mute(2,0,0) - # self.aud.setVolume(0) - # if self.open_volum_state == 1: - # self.open_volum_state = 0 - # else: - # self.open_volum_state = 1 - # if self.open_volum_state == 1: - # self.add_show_hidden() - # else: - # self.clear_show_hidden() - - - def on_call_tab_show(self, e): - global on_call_screen_tab,on_call_screen,on_call_obj - if on_call_screen_tab != None: - self.phone_num = '' - self.phone_list = [] - self.show_num() - on_call_screen_tab.clear_flag(lv.obj.FLAG.HIDDEN) - on_call_obj.add_flag(lv.obj.FLAG.HIDDEN) - - - def on_return_show(self, e): - global on_call_screen_tab,on_call_screen,on_call_obj - if on_call_screen_tab != None: - on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) - on_call_obj.clear_flag(lv.obj.FLAG.HIDDEN) - - def add_volum_size(self, e): - self.volum_size+=2 - if self.volum_size >= 11: - self.volum_size = 11 - self.show_bar(1) - - def reduce_volum_size(self, e): - - self.volum_size -= 2 - if self.volum_size < 0: - self.volum_size = 0 - self.show_bar(1) - - def show_bar(self,msg): - on_call_bar.set_value((100 // 11) * self.volum_size, lv.ANIM.OFF) - if msg == 1: - self.aud.setVolume(self.volum_size) - EventMesh.publish("set_volum_size",self.volum_size) - - def post_processor_after_initialization(self): - global on_call_screen_tab,on_call_obj - self.count_sec = 0 - self.timer.start(1000,1,self.refresh) - self.read_data = EventMesh.publish("get_storage_data") - # print("self.read_data:{}".format(self.read_data)) - num = EventMesh.publish("get_volum_size") - if num == None: - self.volum_size = 8 - else: - self.volum_size = num - self.aud.setVolume(self.volum_size) - self.show_bar(0) - self.open_volum = 0 - self.phone_num = '' - self.phone_list = [] - self.button = 0 - if on_call_obj != None: - on_call_obj.clear_flag(lv.obj.FLAG.HIDDEN) - if on_call_screen_tab != None: - on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) - self.show_num() - - - def refresh(self,e): - # print("call_in") - global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup - min = self.count_sec/60 - sec = self.count_sec%60 - if min > 99: - total = "%03d:%02d"%(min,sec) - else: - total = "%02d:%02d"%(min,sec) - on_call_second_label.set_text(str(total)) - self.count_sec+=1 - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - self.timer.stop() - voiceCall.callEnd() - EventMesh.publish("set_interrup_incall",0) - EventMesh.publish("set_UI_high_priority",0) - - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME != "dialing_noplay_popup": - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - self.timer.stop() - - def btn1_release(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - #EventMesh.publish("load_screen", {"screen": "main_menu"}) -# -------------------------------------------step screen----------------------------------------------------------# - -step_screen = None -step_label = None -step_label_01 = None -step_img = None -class StepScreen(Screen): - NAME = "step" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - - def initialization(self): - global step_screen,step_label ,step_label_01 ,step_img - if step_screen == None: - step_screen = lv.obj() - print("step_screen") - step_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - step_label = lv.label(step_screen) - step_label.set_pos(10, 10) - step_label.set_size(128-10, 20) - step_label.set_text("今日步数") - step_label.set_long_mode(lv.label.LONG.WRAP) - step_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - step_label_01 = lv.label(step_screen) - step_label_01.set_pos(0, 50) - step_label_01.set_size(128, 20) - step_label_01.set_text("0æ­¥") - step_label_01.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - step_label_01.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - step_img = lv.img(step_screen) - step_img.set_pos(49, 80) - step_img.set_size(20, 33) - step_img.set_src("U:/static/IMAGE_STEP.png") - step_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = step_screen - - step = EventMesh.publish("get_old_step_value") - step_label_01.set_text("{} æ­¥".format(step)) - self.timer.start(1000, 1, self.revcing) - - def revcing(self, *args, **kwargs): - global step_screen,step_label ,step_label_01 ,step_img - step = EventMesh.publish("get_old_step_value") - step_label_01.set_text("{} æ­¥".format(step)) - - def Close(self): - self.timer.stop() - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -# -------------------------------------------weather screen---------------------------------------------------------- - -weather_screen = None -weather_img = None -no_weather_img = None -weather_tem_label = None -no_weather_degree = None -weather_detail_label = None -weather_location_label = None -no_connect_label = None -no_connect_label1 = None -class WeatherScreen(Screen): - NAME = "weather" - - def __init__(self): - super().__init__() - self.meta = None - self.weather_data = {} - EventMesh.subscribe("updata_weather_show", self.update_weather_data) - - def initialization(self): - global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,\ - weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 - if weather_screen == None : - weather_screen = lv.obj() - print("weather_screen") - weather_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - weather_img = lv.img(weather_screen) - weather_img.set_pos(10, 10) - weather_img.set_size(45, 40) - weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_weather_img = lv.img(weather_screen) - no_weather_img.set_pos(10, 10) - no_weather_img.set_size(45, 40) - no_weather_img.set_src("U:/static/update.png") - no_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - weather_tem_label = lv.label(weather_screen) - weather_tem_label.set_pos(65, 11) - weather_tem_label.set_size(45, 20) - weather_tem_label.set_text("_ _") - weather_tem_label.set_long_mode(lv.label.LONG.WRAP) - weather_tem_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - weather_tem_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_weather_degree = lv.img(weather_screen) - no_weather_degree.set_pos(88, 15) - no_weather_degree.set_size(11, 11) - no_weather_degree.set_src("U:/static/degree.png") - no_weather_degree.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - weather_detail_label = lv.label(weather_screen) - weather_detail_label.set_pos(65, 30) - weather_detail_label.set_size(50, 50) - weather_detail_label.set_text("-/-") - weather_detail_label.set_long_mode(lv.label.LONG.WRAP) - weather_detail_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - weather_detail_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - # weather_location_label = lv.label(weather_screen) - # weather_location_label.set_pos(0, 60) - # weather_location_label.set_size(128, 50) - # weather_location_label.set_text("--") - # weather_location_label.set_long_mode(lv.label.LONG.WRAP) - # weather_location_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - # weather_location_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_connect_label = lv.label(weather_screen) - no_connect_label.set_pos(0, 60) - no_connect_label.set_size(128, 20) - no_connect_label.set_text("找不到服务器") - no_connect_label.set_long_mode(lv.label.LONG.WRAP) - no_connect_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_connect_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_connect_label1 = lv.label(weather_screen) - no_connect_label1.set_pos(0, 90) - no_connect_label1.set_size(128, 20) - no_connect_label1.set_text("请联网后重试") - no_connect_label1.set_long_mode(lv.label.LONG.WRAP) - no_connect_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_connect_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = weather_screen - EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.WT_SEND) #开始WT定位 - - def post_processor_after_initialization(self): - EventMesh.publish("updata_weather_show") - - - def update_weather_data(self, event, msg): - global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,\ - weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 - connect = EventMesh.publish(constants.EVENT.GET_CONNECT) #获取网络状态 - self.weather_data = EventMesh.publish("get_weather_data") - if weather_screen != None: - if connect != 0 and self.weather_data != None: - no_data = self.weather_data[8] - if no_data != 0 : - no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) - weather_img.clear_flag(lv.obj.FLAG.HIDDEN) - # no_connect_label.set_text(" ") - no_connect_label1.set_text(" ") - # print("self.weather_data:{}".format(self.weather_data)) - type = self.weather_data[3] - if type == None: - weather_img.set_src("U:/static/update.png")#天气类型 - else: - weather_img.set_src("U:/static/{}_weather.png".format(type))#天气类型 - - temp = self.weather_data[4] - if temp == None: - no_weather_degree.set_pos(88, 15) - weather_tem_label.set_text("_ _") - else: - if len(str(temp)) > 2: - no_weather_degree.set_pos(100, 15) - else: - no_weather_degree.set_pos(88, 15) - weather_tem_label.set_text("{}".format(temp)) - - date = self.weather_data[0] - if date != '{}': - date_month = date.split('-')[1] - date_day = date.split('-')[2] - weather_detail_label.set_text("{}/{}".format(date_month,date_day))#天气更新时间 - else: - weather_detail_label.set_text("-/-") - - city = self.weather_data[7] - if city != '{}': - no_connect_label.set_text("{}".format(city))#城市 - else: - no_connect_label.set_text("--") - else:#已联网未获取到天气数据 - # no_connect_label.set_text(" ") - no_weather_degree.set_pos(88, 15) - weather_detail_label.set_text("-/-") - weather_tem_label.set_text("_ _") - no_weather_degree.set_pos(88, 15) - no_connect_label.set_text("未获取网络数据") - no_connect_label1.set_text("请稍候重试") - - else: - weather_detail_label.set_text("-/-") - weather_tem_label.set_text("_ _") - no_weather_degree.set_pos(88, 15) - no_weather_img.clear_flag(lv.obj.FLAG.HIDDEN) - weather_img.add_flag(lv.obj.FLAG.HIDDEN) - no_connect_label.set_text("找不到服务器") - no_connect_label1.set_text("请联网后重试") - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -import audio -from machine import Pin - - - - -# -----------------------------联系人--------------contacts screen---------------------------------------------------------- - -CONTACT_FLAG = 0 -contacts_screen = None -contacts_cont = None -contacts_top_title = None -contact_none_label = None -contacts_screen_list_screen = None -class ContactsScreen(Screen): - NAME = "contacts" - - def __init__(self): - super().__init__() - # -------------------------------------------popup_menu screen---------------------------------------------------------- - self.meta = None - self.phonebook = {} - self.count = 0 - self.phone_num_count = 0 - self.phone_num = {} - self.name = [] - self.check_json = 0 - self.timer = osTimer() - self.contact_detail_list = None - EventMesh.subscribe("contact_updata_list_show", self.btn_create_list) - self.MXA_phone_num = 50 #最大显示号码个数 - self.contact_detail_listt_dict = [] - self.calling_btn = [] - self.is_sliding = 0 - - def post_processor_before_initialization(self): - data = EventMesh.publish("get_phonebook_list") - if data != None: - self.check_json = data[0] - self.phonebook = data[1] - self.count = 0 - - def initialization(self): - self.is_sliding = 0 - global contacts_screen,contacts_cont,contacts_top_title,contact_none_label,contacts_screen_list_screen - if contacts_screen == None: - contacts_screen = lv.obj() - print("contacts_screen") - contacts_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - contacts_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - contacts_screen_list_screen = lv.obj(contacts_screen) - contacts_screen_list_screen.set_pos(0, 30) - contacts_screen_list_screen.set_size(LCD_X, LCD_Y-30) - contacts_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - contacts_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - contacts_top_title = lv.label(contacts_screen) - contacts_top_title.set_pos(0, 5) - contacts_top_title.set_size(LCD_X, 20) - contacts_top_title.set_text("联系人") - contacts_top_title.set_long_mode(lv.label.LONG.WRAP) - contacts_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - contacts_top_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - contact_none_label = lv.label(contacts_screen_list_screen) - contact_none_label.set_pos(0, 20) - contact_none_label.set_size(LCD_X, 40) - contact_none_label.set_text("无联系人,请在手\n机APP上添加") - contact_none_label.set_long_mode(lv.label.LONG.WRAP) - contact_none_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - contact_none_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.contact_detail_list = lv.obj(contacts_screen_list_screen) - self.contact_detail_list.set_pos(0, 0) - self.contact_detail_list.set_size(LCD_X, LCD_Y-30+1) - self.contact_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - self.contact_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - for i in range(self.MXA_phone_num): - contact_btn = lv.btn(self.contact_detail_list) - contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), lv.EVENT.PRESSING, None) - contact_btn.add_flag(lv.obj.FLAG.HIDDEN) - # contact_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) - - contact_btn_label_1 = lv.label(contact_btn) - contact_btn_label_1.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - contact_btn_label_2 = lv.label(contact_btn) - # contact_btn_label_2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - contact_btn_label_3 = lv.label(contact_btn) - contact_btn_label_3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - self.contact_detail_listt_dict.append({"contact_btn":contact_btn,"contact_btn_label_1":contact_btn_label_1,"contact_btn_label_2":contact_btn_label_2,"contact_btn_label_3":contact_btn_label_3}) - self.meta = contacts_screen - self.count = 0 - self.btn_create_list_show(0) - - def btn_create_list(self,event,msg): - self.post_processor_before_initialization() - self.timer.start(1 * 1000, 0, self.OutTime_s) - - def OutTime_s(self,e): - self.btn_create_list_show(1) - - def btn_create_list_show(self,state): - EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_list_show_screen,"data":state}) - - def btn_create_list_show_screen(self,state): - global contacts_screen,contacts_cont,contacts_top_title,contact_none_label,contacts_screen_list_screen - print("btn_create_list_show_screen!!!!!!!!!!!") - if contacts_screen == None: - return - #读取json文件中的键作为label文本; - if self.check_json == True and len(self.phonebook) != 0: - self.contact_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) - contact_none_label.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - j =0 - print("self.phonebook sorted :{} len(self.phonebook) :{}".format(sorted(self.phonebook.keys()),len(self.phonebook))) - phonebook_keys = sorted(self.phonebook.keys()) - - - if len(self.phonebook) > self.MXA_phone_num: - j = len(self.phonebook) - self.MXA_phone_num - for i in range(self.MXA_phone_num): #字典 key value - if(j >= len(self.phonebook)): - self.contact_detail_listt_dict[i]["contact_btn"].add_flag(lv.obj.FLAG.HIDDEN) - continue - name = self.phonebook[phonebook_keys[j]] - key_tmp = phonebook_keys[j] - - print("name :{} key_tmp:{}".format(name,key_tmp)) - - #contact_btn = lv.btn(self.contact_detail_list) - self.contact_detail_listt_dict[i]["contact_btn"].set_size(LCD_X,45) - self.contact_detail_listt_dict[i]["contact_btn"].set_pos(0,47*i ) - self.contact_detail_listt_dict[i]["contact_btn"].set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) - # add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - # contact_btn.add_style(style_contact_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) - # self.contact_detail_listt_dict[i]["contact_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), - # lv.EVENT.SHORT_CLICKED, None) - - #contact_btn_label_1 = lv.label(contact_btn) - self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_pos(0, 0) - self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_X-15, 16) - self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_text(key_tmp[4:]) - self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.CLIP) - # self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) - # self.contact_detail_listt_dict[i]["contact_btn_label_1"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - #contact_btn_label_2 = lv.label(contact_btn) - self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_pos(0, 0) - self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_size(0, 0) - self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_text(key_tmp) - - - #contact_btn_label_3 = lv.label(contact_btn) - self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 20) - self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_X-15, 16) - self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_text(name) - self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.CLIP) - # self.contact_detail_listt_dict[i]["contact_btn_label_3"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.contact_detail_listt_dict[i]["contact_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - #self.contact_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) - j+=1 - - if state == 1: - self.contact_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) - - else: - if contacts_screen_list_screen != None: - contact_none_label.clear_flag(lv.obj.FLAG.HIDDEN) #显示空文本 - if self.contact_detail_list != None: - self.contact_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - - - def calling_cb(self,e): - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 - msg_text = e.get_target().get_child(1).get_text() - EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) - else: - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - - self.is_sliding =0 - - - def calling(self,msg_text): - _msg = msg_text - print("contacts:calling_cb1:{}".format(_msg)) - # print("_msg:{}".format(_msg)) - msg_tmp = _msg.split(':') - msg_tmp = msg_tmp[1] - EventMesh.publish("save_phonename", msg_tmp) - - phone_num = self.phonebook[_msg] - EventMesh.publish("save_phonenum", phone_num) - - # phone_num_tmp = int(phone_num) - - EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - -# -------------------------------------------temperature screen---------------------------------------------------------- - -temperature_screen = None -temperature_bg_img = None -temperature_body_label = None -temperature_degree_img = None -temperature_value_label = None -temperature_wrist_label = None -temperature_wrist_degree_img = None -temperature_wrist_value_label = None -temperature_measure_end_label = None -temperature_measure_countdown_label = None -temp_reset_btn_img = None -temp_line1 = None -temp_line2 = None -temp_line3 = None -temp_line4 = None -temp_line5 = None -temp_line6 = None -temp_line7 = None -temperature_label = None -temperature_line_bg_img = None -temperature_done_img = None -temperature_start_label=None -temperature_bpm_label = None -temperature_done_label = None -temperature_keep_label = None - -style_line_blue = lv.style_t() -style_line_blue.init() -style_line_blue.set_line_width(10) -style_line_blue.set_line_color(lv.color_make(35, 141, 255)) - -class TemperatureScreen(Screen): - NAME = "temperature" - - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.point = 0 - self.temp_value = 0 - - def initialization(self): - global temperature_screen,temperature_keep_label,temperature_label,temp_reset_btn_img,temp_line1,temp_line2,temp_line3,temp_line4,temp_line5,\ - temp_line6,temp_line7,temperature_line_bg_img,temperature_done_img ,temperature_start_label,temperature_bpm_label ,temperature_done_label - if temperature_screen == None: - temperature_screen = lv.obj() - print("temp_screen") - temperature_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - temperature_label = lv.label(temperature_screen) - temperature_label.set_pos(0, 10) - temperature_label.set_size(240, 40) - temperature_label.set_text("体温") - temperature_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - temperature_label.set_long_mode(lv.label.LONG.WRAP) - temperature_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - temperature_line_bg_img = lv.img(temperature_screen) - temperature_line_bg_img.set_pos(5, 50) - temperature_line_bg_img.set_size(230, 120) - temperature_line_bg_img.set_src("U:/static/temp_line_bg.png") - - - temperature_done_img = lv.img(temperature_screen) - temperature_done_img.set_pos(20, 226) - temperature_done_img.set_src("U:/static/temp_gif03.png") - - temp_reset_btn_img = lv.img(temperature_screen) - temp_reset_btn_img.set_pos(0, 182) - temp_reset_btn_img.set_src("U:/static/reset_hr_btn.png") - temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - temp_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) - - temperature_start_label = lv.label(temperature_screen) - temperature_start_label.set_size(240,40) - temperature_start_label.set_pos(0,190) - temperature_start_label.set_text(" ") - temperature_start_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - temperature_start_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - temperature_start_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - # hr_line_points1 = [{"x":0,"y":0},{"x":0,"y":30}] - # hr_line_points2 = [{"x":0,"y":0},{"x":0,"y":47}] - # hr_line_points3 = [{"x":0,"y":0},{"x":0,"y":67}] - # hr_line_points4 = [{"x":0,"y":0},{"x":0,"y":85}] - # hr_line_points5 = [{"x":0,"y":0},{"x":0,"y":100}] - # hr_line_points6 = [{"x":0,"y":0},{"x":0,"y":100}] - # hr_line_points7 = [{"x":0,"y":0},{"x":0,"y":100}] - - temp_line1 = lv.line(temperature_screen) - temp_line1.set_points(hr_line_points,2) - temp_line1.set_pos(29,120) - temp_line1.set_size(10,0) - temp_line1.add_style(style_line_blue,0) - - temp_line2 = lv.line(temperature_screen) - temp_line2.set_points(hr_line_points,2) - temp_line2.set_pos(57,103) - temp_line2.set_size(10,0) - temp_line2.add_style(style_line_blue,0) - - temp_line3 = lv.line(temperature_screen) - temp_line3.set_points(hr_line_points,2) - temp_line3.set_pos(84,82) - temp_line3.set_size(10,0) - temp_line3.add_style(style_line_blue,0) - - temp_line4 = lv.line(temperature_screen) - temp_line4.set_points(hr_line_points,2) - temp_line4.set_pos(110,66) - temp_line4.set_size(10,0) - temp_line4.add_style(style_line_blue,0) - - temp_line5 = lv.line(temperature_screen) - temp_line5.set_points(hr_line_points,2) - temp_line5.set_pos(140,50) - temp_line5.set_size(10,0) - temp_line5.add_style(style_line_blue,0) - - temp_line6 = lv.line(temperature_screen) - temp_line6.set_points(hr_line_points,2) - temp_line6.set_pos(167,50) - temp_line6.set_size(10,0) - temp_line6.add_style(style_line_blue,0) - - temp_line7 = lv.line(temperature_screen) - temp_line7.set_points(hr_line_points,2) - temp_line7.set_pos(195,50) - temp_line7.set_size(10,0) - temp_line7.add_style(style_line_blue,0) - - temperature_bpm_label = lv.label(temperature_screen) - temperature_bpm_label.set_size(120, 40) - temperature_bpm_label.set_pos(100, 244) - temperature_bpm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - temperature_bpm_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - temperature_keep_label = lv.label(temperature_screen) - temperature_keep_label.set_size(140, 40) - temperature_keep_label.set_pos(100, 280) - temperature_keep_label.set_text(" ") - temperature_keep_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - temperature_keep_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - - temperature_degree_img = lv.img(temperature_screen) - temperature_degree_img.set_pos(156, 242) - temperature_degree_img.set_size(11, 11) - temperature_degree_img.set_src("U:/static/degree.png") - temperature_degree_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.meta = temperature_screen - temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.SHORT_CLICKED, None) - - temperature_bpm_label.set_text("- -") - temperature_start_label.set_text("正在测量中.") - - - def post_processor_after_initialization(self): - self.restart_up(0) - - def restart_up(self,e): - global temperature_done_label,temperature_keep_label,temperature_bpm_label,temperature_start_label,temp_reset_btn_img - temperature_bpm_label.set_text("- -") - temperature_keep_label.set_text(" ") - temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - self.point = 0 - temperature_bpm_label.set_text("- -") - temperature_start_label.set_text("正在测量中.") - EventMesh.publish("set_temp_state",1) - EventMesh.publish(constants.EVENT.START_TEMP) - self.show_history_data() - self.timer.start(1*500, 1, self.start_measure) - - def show_history_data(self): - global temp_line1,temp_line2,temp_line3,temp_line4,temp_line5,temp_line6,temp_line7 - read_data = {} - read_data = EventMesh.publish("get_history_temp_value") - print("hr history read_data",read_data) - if read_data != None: - count = len(read_data) - if count != 0: - if count >= 7: - for i in range(count): - value = read_data["0{}".format(i+1)] - value_temp = int(value) - if value <= 30: - line_value = int(value_temp) - elif value <= 34: - line_value = int((value_temp-30)*4.25)+30 - elif value <= 38: - line_value = int((value_temp-34)*5)+47 - elif value <= 42: - line_value = int((value_temp-38)*4)+67 - elif value < 46: - line_value = int((value_temp-42)*3.75)+85 - else: - value = 46 - line_value = 100 - - - if line_value >= 100: - line_value = 100 - #print("hr hist",line_value) - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if i == 0: - temp_line1.set_points(hr_line_points,2) - temp_line1.set_pos(29,150-line_value) - temp_line1.set_size(10,line_value) - if value >= 37.3: - temp_line1.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line1.set_style_line_color(lv.color_make(35,141,255),0) - if i == 1: - temp_line2.set_points(hr_line_points,2) - temp_line2.set_pos(57,150-line_value) - temp_line2.set_size(10,line_value) - if value >= 37.3: - temp_line2.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line2.set_style_line_color(lv.color_make(35,141,255),0) - - if i == 2: - temp_line3.set_points(hr_line_points,2) - temp_line3.set_pos(84,150-line_value) - temp_line3.set_size(10,line_value) - if value >= 37.3: - temp_line3.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line3.set_style_line_color(lv.color_make(35,141,255),0) - if i == 3: - temp_line4.set_points(hr_line_points,2) - temp_line4.set_pos(112,150-line_value) - temp_line4.set_size(10,line_value) - if value >= 37.3: - temp_line4.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line4.set_style_line_color(lv.color_make(35,141,255),0) - if i == 4: - temp_line5.set_points(hr_line_points,2) - temp_line5.set_pos(140,150-line_value) - temp_line5.set_size(10,line_value) - if value >= 37.3: - temp_line5.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line5.set_style_line_color(lv.color_make(35,141,255),0) - - if i == 5: - temp_line6.set_points(hr_line_points,2) - temp_line6.set_pos(167,150-line_value) - temp_line6.set_size(10,line_value) - if value >= 37.3: - temp_line6.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line6.set_style_line_color(lv.color_make(35,141,255),0) - - if i == 6: - temp_line7.set_points(hr_line_points,2) - temp_line7.set_pos(195,150-line_value) - temp_line7.set_size(10,line_value) - if value >= 37.3: - temp_line7.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line7.set_style_line_color(lv.color_make(35,141,255),0) - else: - value = read_data["0{}".format(count)] - value_temp = int(value) - if value <= 30: - line_value = int(value_temp) - elif value <= 34: - line_value = int((value_temp-30)*4.25)+30 - elif value <= 38: - line_value = int((value_temp-34)*5)+47 - elif value <= 42: - line_value = int((value_temp-38)*4)+67 - elif value < 46: - line_value = int((value_temp-42)*3.75)+85 - else: - value = 46 - line_value = 100 - - - if line_value >= 100: - line_value = 100 - # - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if count == 1: - temp_line1.set_points(hr_line_points,2) - temp_line1.set_pos(29,150-line_value) - temp_line1.set_size(10,line_value) - if value >= 37.3: - temp_line1.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line1.set_style_line_color(lv.color_make(35,141,255),0) - - if count == 2: - temp_line2.set_points(hr_line_points,2) - temp_line2.set_pos(57,150-line_value) - temp_line2.set_size(10,line_value) - if value >= 37.3: - temp_line2.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line2.set_style_line_color(lv.color_make(35,141,255),0) - - if count == 3: - temp_line3.set_points(hr_line_points,2) - temp_line3.set_pos(84,150-line_value) - temp_line3.set_size(10,line_value) - if value >= 37.3: - temp_line3.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line3.set_style_line_color(lv.color_make(35,141,255),0) - - - if count == 4: - temp_line4.set_points(hr_line_points,2) - temp_line4.set_pos(112,150-line_value) - temp_line4.set_size(10,line_value) - if value >= 37.3: - temp_line4.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line4.set_style_line_color(lv.color_make(35,141,255),0) - - if count == 5: - temp_line5.set_points(hr_line_points,2) - temp_line5.set_pos(140,150-line_value) - temp_line5.set_size(10,line_value) - if value >= 37.3: - temp_line5.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line5.set_style_line_color(lv.color_make(35,141,255),0) - - if count == 6: - temp_line6.set_points(hr_line_points,2) - temp_line6.set_pos(167,150-line_value) - temp_line6.set_size(10,line_value) - if value >= 37.3: - temp_line6.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line6.set_style_line_color(lv.color_make(35,141,255),0) - - if count == 7: - temp_line7.set_points(hr_line_points,2) - temp_line7.set_pos(195,150-line_value) - temp_line7.set_size(10,line_value) - if value >= 37.3: - temp_line7.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - temp_line7.set_style_line_color(lv.color_make(35,141,255),0) - - def start_measure(self,*args): - global temperature_label,temperature_keep_label,temperature_done_img ,temp_reset_btn_img,temperature_start_label,temperature_bpm_label ,temperature_done_label - self.point = self.point + 1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - - temp = EventMesh.publish(constants.EVENT.GET_TEMP) - tmp = str(temp).split('.')[0] + '.' + str(temp).split('.')[1][:1]#获取小数点后一位 舍去小数点最后一位 - print("self.temp:{}".format(temp)) - if self.point >= 2: - if temp != 0: - temperature_bpm_label.set_text("{}".format(tmp)) - else: - temperature_bpm_label.set_text("- -") - - if self.point%4 == 0 : - temperature_start_label.set_text("正在测量中..") - temperature_done_img.set_src("U:/static/temp_gif02.png") - if self.point%4 == 1 : - temperature_start_label.set_text("正在测量中...") - temperature_done_img.set_src("U:/static/temp_gif01.png") - if self.point%4 == 2 : - temperature_start_label.set_text("正在测量中.") - temperature_done_img.set_src("U:/static/temp_gif02.png") - - if self.point%4 == 3 : - temperature_start_label.set_text("正在测量中.") - temperature_done_img.set_src("U:/static/temp_gif03.png") - - tmp_f = str(temp).split('.')[0] - tmp_f_tmp = int(tmp_f) - - tmp_d = str(temp).split('.')[1][:1] - tmp_d_tmp = int(tmp_d) - if self.point >= 2: - if temp >= 37.3: - temperature_keep_label.set_text("体温偏高") - temperature_keep_label.set_style_text_color(lv.color_make(0xff, 0x00, 0x00), lv.STATE.DEFAULT) - else: - temperature_keep_label.set_text("体温正常") - temperature_keep_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - if self.point > 120 : #测2min - - if temp >= 37.3: - temperature_done_img.set_src("U:/static/temp_high.png") - else: - temperature_done_img.set_src("U:/static/temp_gif03.png") - temp_reset_btn_img.clear_flag(lv.obj.FLAG.HIDDEN) - temperature_start_label.set_text("测量结束,点击重测") - - EventMesh.publish("set_history_temp_value",temp) - self.show_history_data() - self.timer.stop() - self.point = 0 - EventMesh.publish("set_temp_state",0) - EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp]) - EventMesh.publish(constants.EVENT.STOP_TEMP) - - - print("stop debug9") - - def Close(self): - self.timer.stop() - EventMesh.publish("set_temp_state",0) - EventMesh.publish(constants.EVENT.STOP_TEMP) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - - -line_points = [{"x":0,"y":0},{"x":240,"y":0}] -spo2_screen = None -spo2_label_0 = None -spo2_done_img = None -spo2_label = None -spo2_label_1 = None -spo2_line = None -spo2_last_time = None -spo2_last_value = None -spo2_line1 = None -spo2_line2 = None -spo2_line3 = None -spo2_line4 = None -spo2_line5 = None -spo2_line6 = None -spo2_line7 = None -spo2_reset_btn_img = None -spo2_label = None -spo2_line_bg_img = None -spo2_done_img = None -spo2_done_label = None -spo2_value_label = None -spo2_start_label = None - -style_line_red = lv.style_t() -style_line_red.init() -style_line_red.set_line_width(10) -style_line_red.set_line_color(lv.color_make(0xff, 0x00, 0x00)) - -spo2_line_points = [{"x":0,"y":0},{"x":0,"y":0}] - -class Spo2Screen(Screen): - NAME = "spo2" - - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.point = 0 - self.spo2_value = 0 - - def initialization(self): - global spo2_screen,spo2_label,spo2_value_label,spo2_reset_btn_img,spo2_done_img,spo2_line_bg_img,spo2_line1,spo2_line2,\ - spo2_line3,spo2_line4,spo2_line5,spo2_line6,spo2_line7,spo2_line_bg_img ,spo2_start_label ,spo2_done_label - if spo2_screen == None: - spo2_screen = lv.obj() - print("spo2_screen") - spo2_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - spo2_label = lv.label(spo2_screen) - spo2_label.set_pos(0, 20) - spo2_label.set_size(240, 40) - spo2_label.set_text("血氧") - spo2_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - spo2_label.set_long_mode(lv.label.LONG.WRAP) - spo2_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - spo2_line_bg_img = lv.img(spo2_screen) - spo2_line_bg_img.set_pos(5, 60) - spo2_line_bg_img.set_size(230, 120) - spo2_line_bg_img.set_src("U:/static/spo2_line_bg.png") - - - spo2_done_img = lv.img(spo2_screen) - spo2_done_img.set_pos(20, 240) - spo2_done_img.set_src("U:/static/spo2_gif04.png") - - spo2_reset_btn_img = lv.img(spo2_screen) - spo2_reset_btn_img.set_pos(0, 192) - spo2_reset_btn_img.set_src("U:/static/reset_hr_btn.png") - spo2_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - spo2_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) - - spo2_start_label = lv.label(spo2_screen) - spo2_start_label.set_size(240,40) - spo2_start_label.set_pos(0,200) - spo2_start_label.set_text(" ") - spo2_start_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - spo2_start_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - spo2_start_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - - spo2_line1 = lv.line(spo2_screen) - spo2_line1.set_points(spo2_line_points,2) - spo2_line1.set_pos(25,60) - spo2_line1.set_size(10,0) - spo2_line1.add_style(style_line_red,0) - - spo2_line2 = lv.line(spo2_screen) - spo2_line2.set_points(spo2_line_points,2) - spo2_line2.set_pos(53,60) - spo2_line2.set_size(10,0) - spo2_line2.add_style(style_line_red,0) - - spo2_line3 = lv.line(spo2_screen) - spo2_line3.set_points(spo2_line_points,2) - spo2_line3.set_pos(80,60) - spo2_line3.set_size(10,0) - spo2_line3.add_style(style_line_red,0) - - spo2_line4 = lv.line(spo2_screen) - spo2_line4.set_points(spo2_line_points,2) - spo2_line4.set_pos(109,60) - spo2_line4.set_size(10,0) - spo2_line4.add_style(style_line_red,0) - - spo2_line5 = lv.line(spo2_screen) - spo2_line5.set_points(spo2_line_points,2) - spo2_line5.set_pos(136,60) - spo2_line5.set_size(10,0) - spo2_line5.add_style(style_line_red,0) - - spo2_line6 = lv.line(spo2_screen) - spo2_line6.set_points(spo2_line_points,2) - spo2_line6.set_pos(164,60) - spo2_line6.set_size(10,0) - spo2_line6.add_style(style_line_red,0) - - spo2_line7 = lv.line(spo2_screen) - spo2_line7.set_points(spo2_line_points,2) - spo2_line7.set_pos(192,60) - spo2_line7.set_size(10,0) - spo2_line7.add_style(style_line_red,0) - - spo2_value_label = lv.label(spo2_screen) - spo2_value_label.set_size(110, 40) - spo2_value_label.set_pos(130, 270) - spo2_value_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - spo2_value_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) - - - self.meta = spo2_screen - spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.SHORT_CLICKED, None) - - def post_processor_after_initialization(self): - self.point = 0 - self.spo2_value = 0 - self.show_history_data() - self.restart_up(0) - - def restart_up(self,e): - global spo2_value_label,heartrate_bpm_label,spo2_start_label,spo2_reset_btn_img - self.timer.start(1*500, 1, self.start_measure) - if spo2_reset_btn_img != None: - spo2_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - self.point = 0 - - spo2_value_label.set_text("- -%") - spo2_start_label.set_text("正在测量中.") - EventMesh.publish("set_spo2_state",1)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN) - - def show_history_data(self): - global spo2_line1,spo2_line2,spo2_line3,spo2_line4,spo2_line5,spo2_line6,spo2_line7 - read_data = {} - read_data = EventMesh.publish("get_history_spo2_value") - print("hr get_history_spo2_value",read_data) - if read_data != None: - count = len(read_data) - if count != 0: - if count >= 7: - for i in range(count): - value = read_data["0{}".format(i+1)] - if value < 80: - value = 80 - if value >= 100: - value = 100 - if value <= 85: - value = value - 80 - line_value = int(value*6) - elif value <= 90: - value = value-85 - line_value = int((17/5)*value)+30 - elif value <= 95: - value = value-90 - line_value = int((21/5)*value)+47 - elif value <= 100: - value = value-95 - line_value = int((16/5)*value)+68 - - - if line_value >= 100: - line_value = 100 - #print("hr hist",line_value) - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if i == 0: - spo2_line1.set_points(hr_line_points,2) - spo2_line1.set_pos(25,160-line_value) - spo2_line1.set_size(10,line_value) - if i == 1: - spo2_line2.set_points(hr_line_points,2) - spo2_line2.set_pos(53,160-line_value) - spo2_line2.set_size(10,line_value) - - if i == 2: - spo2_line3.set_points(hr_line_points,2) - spo2_line3.set_pos(80,160-line_value) - spo2_line3.set_size(10,line_value) - - if i == 3: - spo2_line4.set_points(hr_line_points,2) - spo2_line4.set_pos(109,160-line_value) - spo2_line4.set_size(10,line_value) - - if i == 4: - spo2_line5.set_points(hr_line_points,2) - spo2_line5.set_pos(136,160-line_value) - spo2_line5.set_size(10,line_value) - - if i == 5: - spo2_line6.set_points(hr_line_points,2) - spo2_line6.set_pos(164,160-line_value) - spo2_line6.set_size(10,line_value) - - if i == 6: - spo2_line7.set_points(hr_line_points,2) - spo2_line7.set_pos(192,160-line_value) - spo2_line7.set_size(10,line_value) - else: - value = read_data["0{}".format(count)] - if value < 80: - value = 80 - if value >= 100: - value = 100 - - if value <= 85: - value = value - 80 - line_value = int(value*6) - elif value <= 90: - value = value-85 - line_value = int((17/5)*value)+30 - elif value <= 95: - value = value-90 - line_value = int((21/5)*value)+47 - elif value <= 100: - value = value-95 - line_value = int((16/5)*value)+68 - - - if line_value >= 100: - line_value = 100 - # - hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] - if count == 1: - spo2_line1.set_points(hr_line_points,2) - spo2_line1.set_pos(25,160-line_value) - spo2_line1.set_size(10,line_value) - if count == 2: - spo2_line2.set_points(hr_line_points,2) - spo2_line2.set_pos(53,160-line_value) - spo2_line2.set_size(10,line_value) - - if count == 3: - spo2_line3.set_points(hr_line_points,2) - spo2_line3.set_pos(80,160-line_value) - spo2_line3.set_size(10,line_value) - - if count == 4: - spo2_line4.set_points(hr_line_points,2) - spo2_line4.set_pos(109,160-line_value) - spo2_line4.set_size(10,line_value) - - if count == 5: - spo2_line5.set_points(hr_line_points,2) - spo2_line5.set_pos(136,160-line_value) - spo2_line5.set_size(10,line_value) - - if count == 6: - spo2_line6.set_points(hr_line_points,2) - spo2_line6.set_pos(164,160-line_value) - spo2_line6.set_size(10,line_value) - - if count == 7: - spo2_line7.set_points(hr_line_points,2) - spo2_line7.set_pos(192,160-line_value) - spo2_line7.set_size(10,line_value) - - - def start_measure(self,*args): - global spo2_screen,spo2_label,spo2_start_label,spo2_value_label,spo2_done_img ,spo2_reset_btn_img - self.point = self.point + 1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if self.point >= 2: - if self.spo2_value != 0: - spo2_value_label.set_text("{}%".format(self.spo2_value)) - else: - spo2_value_label.set_text("- - %") - - if self.point%4 == 0 : - spo2_start_label.set_text("正在测量中..") - spo2_done_img.set_src("U:/static/spo2_gif03.png") - - if self.point%4 == 1 : - spo2_start_label.set_text("正在测量中...") - spo2_done_img.set_src("U:/static/spo2_gif02.png") - - if self.point%4 == 2 : - spo2_start_label.set_text("正在测量中.") - spo2_done_img.set_src("U:/static/spo2_gif01.png") - - if self.point%4 == 3 : - spo2_start_label.set_text("正在测量中.") - spo2_done_img.set_src("U:/static/spo2_gif04.png") - - - - if self.point > 120: #测20s - spo2_done_img.set_src("U:/static/spo2_gif04.png") - self.spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if self.spo2_value >= 85: - EventMesh.publish("set_old_spo2_data",self.spo2_value) - EventMesh.publish("set_history_spo2_value",self.spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,self.spo2_value) - spo2_reset_btn_img.clear_flag(lv.obj.FLAG.HIDDEN) - - - if self.spo2_value != 0: - spo2_start_label.set_text("测量结束,点击重测") - spo2_value_label.set_text("{}%".format(self.spo2_value)) - # heartrate_done_label.set_text("测量完成") - else: - spo2_value_label.set_text("- - %") - spo2_start_label.set_text("测量异常,点击重测") - - self.show_history_data() - - self.timer.stop() - self.point = 0 - EventMesh.publish("set_spo2_state",0)#0代表关闭测试 - print("stop debug9") - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - - def Close(self): - self.timer.stop() - get_hr_state = EventMesh.publish("get_hr_state") - get_spo2_state = EventMesh.publish("get_spo2_state") - if get_hr_state == 1 or get_spo2_state == 1: - EventMesh.publish("set_spo2_state",0)#0代表关闭测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "health"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -# -------------------------------------------countdown screen---------------------------------------------------------- -countdown_screen = None -countdown_title = None -countdown_hour = None -countdown_mao = None -countdown_mao = None -countdown_mao1 = None -countdown_sec = None -countdown_hour_up = None -countdown_hour_up_btn = None -countdown_hour_down = None -countdown_hour_down_btn = None -countdown_min_up = None -countdown_min_up_btn = None -countdown_min_down = None -countdown_min_down_btn = None -countdown_sec_up = None -countdown_sec_up_btn = None -countdown_sec_down = None -countdown_sec_down_btn = None -countdown_reset_img = None -countdown_reset_imgbtn = None -countdown_start_img = None -countdown_start_imgbtn = None -countdown_stop_img = None -countdown_min = None -class CountdownScreen(Screen): - NAME = "countdown" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.sec = 0 - self.min = 0 - self.hour = 0 - self.total = 0 - self.flag = 1 - self.g_state = 0 - self.g_end = 0 - self.total = 0 - self.time_tmp = 0 - self.timer_cb = 0 - EventMesh.subscribe("close_count_show_info", self.close_count_show_info) - - def initialization(self): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - if countdown_screen == None : - countdown_screen = lv.obj() - print("countdown_screen") - countdown_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_title = lv.label(countdown_screen) - countdown_title.set_pos(0, 5) - countdown_title.set_size(128, 20) - countdown_title.set_text("倒计时") - countdown_title.set_long_mode(lv.label.LONG.WRAP) - countdown_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - countdown_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_hour = lv.label(countdown_screen) - countdown_hour.set_pos(19, 50) - countdown_hour.set_size(40, 30) - countdown_hour.set_text("00") - countdown_hour.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_hour.set_long_mode(lv.label.LONG.WRAP) - countdown_hour.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - countdown_mao = lv.label(countdown_screen) - countdown_mao.set_pos(45, 50) - countdown_mao.set_size(20, 20) - countdown_mao.set_text(":") - countdown_mao.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_mao.set_long_mode(lv.label.LONG.WRAP) - countdown_mao.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - - countdown_min = lv.label(countdown_screen) - countdown_min.set_pos(55, 50) - countdown_min.set_size(40, 30) - countdown_min.set_text("00") - countdown_min.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_min.set_long_mode(lv.label.LONG.WRAP) - countdown_min.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - countdown_mao1 = lv.label(countdown_screen) - countdown_mao1.set_pos(81, 50) - countdown_mao1.set_size(20, 20) - countdown_mao1.set_text(":") - countdown_mao1.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_mao1.set_long_mode(lv.label.LONG.WRAP) - countdown_mao1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - - countdown_sec = lv.label(countdown_screen) - countdown_sec.set_pos(91, 50) - countdown_sec.set_size(128-91, 20) - countdown_sec.set_text("00") - countdown_sec.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_sec.set_long_mode(lv.label.LONG.WRAP) - countdown_sec.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - countdown_hour_up = lv.img(countdown_screen) - countdown_hour_up.set_size(17, 15) - countdown_hour_up.set_pos(19, 30) - countdown_hour_up.set_src("U:/static/time_up.png") - countdown_hour_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_hour_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_hour_up_btn= lv.img(countdown_screen) - countdown_hour_up_btn.set_size(45, 40) - countdown_hour_up_btn.set_pos(0, 25) - countdown_hour_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - - countdown_hour_down = lv.img(countdown_screen) - countdown_hour_down.set_size(17, 15) - countdown_hour_down.set_pos(19, 70) - countdown_hour_down.set_src("U:/static/time_down.png") - countdown_hour_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_hour_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_hour_down_btn= lv.img(countdown_screen) - countdown_hour_down_btn.set_size(45, 40) - countdown_hour_down_btn.set_pos(0, 65) - countdown_hour_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - - countdown_min_up = lv.img(countdown_screen) - countdown_min_up.set_size(17, 15) - countdown_min_up.set_pos(53+2, 30) - countdown_min_up.set_src("U:/static/time_up.png") - countdown_min_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_min_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_min_up_btn= lv.img(countdown_screen) - countdown_min_up_btn.set_size(36, 40) - countdown_min_up_btn.set_pos(45, 25) - countdown_min_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - - - countdown_min_down = lv.img(countdown_screen) - countdown_min_down.set_size(17, 15) - countdown_min_down.set_pos(53+2, 70) - countdown_min_down.set_src("U:/static/time_down.png") - countdown_min_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_min_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_min_down_btn= lv.img(countdown_screen) - countdown_min_down_btn.set_size(36, 40) - countdown_min_down_btn.set_pos(45, 65) - countdown_min_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - - countdown_sec_up = lv.img(countdown_screen) - countdown_sec_up.set_size(17, 15) - countdown_sec_up.set_pos(91, 30) - countdown_sec_up.set_src("U:/static/time_up.png") - countdown_sec_up.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_sec_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_sec_up_btn = lv.img(countdown_screen) - countdown_sec_up_btn.set_size(128-81, 40) - countdown_sec_up_btn.set_pos(81, 25) - countdown_sec_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - countdown_sec_down = lv.img(countdown_screen) - countdown_sec_down.set_size(17, 15) - countdown_sec_down.set_pos(91, 70) - countdown_sec_down.set_src("U:/static/time_down.png") - countdown_sec_down.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_sec_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_sec_down_btn = lv.img(countdown_screen) - countdown_sec_down_btn.set_size(128-81, 40) - countdown_sec_down_btn.set_pos(81, 65) - countdown_sec_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) - - countdown_reset_img = lv.img(countdown_screen) - countdown_reset_img.set_size(50, 18) - countdown_reset_img.set_src("U:/static/stopwatch_reset.png") - countdown_reset_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_reset_img.set_pos(8, 100) - - countdown_reset_imgbtn = lv.img(countdown_screen) - countdown_reset_imgbtn.set_size(66, 23) - countdown_reset_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_reset_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_reset_imgbtn.set_pos(0, 105) - - - - countdown_start_img = lv.img(countdown_screen) - countdown_start_img.set_size(50, 18) - countdown_start_img.set_src("U:/static/stopwatch_play.png") - countdown_start_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_start_img.set_pos(66, 100) - - countdown_start_imgbtn = lv.img(countdown_screen) - countdown_start_imgbtn.set_size(128-66, 23) - countdown_start_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - countdown_start_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_start_imgbtn.set_pos(66, 105) - - - - countdown_stop_img = lv.img(countdown_screen) - countdown_stop_img.set_size(50, 18) - countdown_stop_img.set_src("U:/static/stopwatch_stop.png") - countdown_stop_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_stop_img.set_pos(66, 100) - countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - - countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - - countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) - - self.meta = countdown_screen - - countdown_sec_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sec_up(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_sec_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sec_down(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_min_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.min_up(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_min_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.min_down(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_hour_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hour_up(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_hour_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hour_down(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None) - countdown_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reset(e)), - lv.EVENT.SHORT_CLICKED, None) - # countdown_stop_imgbtn.add_event_cb(lambda e: self.stop(e), - # lv.EVENT.SHORT_CLICKED, None) - date_tmp = utime.localtime() - self.time_tmp = utime.mktime(date_tmp) - - if self.g_state == 1: - if self.timer_cb == 1: - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - self.timer.start(1000,1,self.fun) - def post_processor_after_initialization(self): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - if self.g_state == 0: - countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_min_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_min_down.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_sec.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_min.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_hour.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_title.clear_flag(lv.obj.FLAG.HIDDEN) - self.g_end = 0 - self.total = 0 - self.hour = 0 - self.min = 0 - self.sec = 0 - EventMesh.publish("reset_time_countdown") - self.show_value() - - def sec_up(self,e): - EventMesh.publish("add_countdown_sec") - self.sec = EventMesh.publish("get_countdown_sec") - print("sec_up:",self.sec) - self.show_value() - - def sec_down(self,e): - EventMesh.publish("reduce_countdown_sec") - self.sec = EventMesh.publish("get_countdown_sec") - print("sec_down:",self.sec) - self.show_value() - - def min_up(self,e): - EventMesh.publish("add_countdown_min") - self.min = EventMesh.publish("get_countdown_min") - print("min_up:",self.min) - self.show_value() - - def min_down(self,e): - EventMesh.publish("reduce_countdown_min") - self.min = EventMesh.publish("get_countdown_min") - print("min_down:",self.min) - self.show_value() - - def hour_up(self,e): - EventMesh.publish("add_countdown_hour") - self.hour = EventMesh.publish("get_countdown_hour") - - print("hour_up:",self.hour) - self.show_value() - - def hour_down(self,e): - EventMesh.publish("reduce_countdown_hour") - self.hour = EventMesh.publish("get_countdown_hour") - print("hour_down:",self.hour) - self.show_value() - - - - def start(self,e): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - self.total = self.hour*60*60 + self.min*60 + self.sec - print("--00:",self.total,self.hour,self.min,self.sec,self.g_state) - if self.g_state == 1: - self.g_state = 2 - self.stop() - elif self.g_state == 2: - self.g_state = 1 - if self.total > 0: - date_tmp = utime.localtime() - timeSecond = utime.mktime(date_tmp) - print("start self.timeSecond:{}".format(timeSecond)) - EventMesh.publish("set_countdown_all_time", [self.total,timeSecond]) - if self.g_state != 2: - self.g_state = 1 - self.g_end = 0 - date_tmp = utime.localtime() - self.timeSecond = utime.mktime(date_tmp) - self.show_value() - self.timer.start(1000,1,self.fun) - countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_min_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_min_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_start_img.add_flag(lv.obj.FLAG.HIDDEN) - countdown_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - - def stop(self): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - print("in stop") - countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_min_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_min_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_up.add_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_down.add_flag(lv.obj.FLAG.HIDDEN) - countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) - - self.g_end = 0 - self.timer.stop() - # self.show_value() - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def fun(self,e): - date_tmp = utime.localtime() - self.time_tmp = utime.mktime(date_tmp) - total_sec = self.time_tmp - self.timeSecond - # print("total_sec:{} self.time_tmp:{} self.timeSecond:{} self.total:{}".format(total_sec,self.time_tmp,self.timeSecond,self.total)) - if self.total > 0: - self.total = self.total - total_sec - self.timeSecond = self.time_tmp - - - self.hour = self.total//3600 - self.min = self.total%3600//60 - self.sec = self.total%60 - - - # print("self.total:{} self.time_tmp:{} self.timeSecond:{} test_hour:{} test_min:{} test_sec:{}".format(self.total,self.time_tmp,self.timeSecond,test_hour,test_min,test_sec)) - self.show_value() - # print("Close self.timeSecond:22") - EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) - if self.total <= 0: - self.g_state = 0 - self.g_end = 1 - self.hour = 0 - self.min = 0 - self.sec = 0 - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - self.timer.stop() - self.show_value() - EventMesh.publish("load_screen", {"screen": "countdown_end"}) - - # self.total = self.total - 1 - - # self.sec = self.sec - 1 - # if self.sec < 0: - # self.sec = 59 - - def Close(self): - time = EventMesh.publish("get_countdown_all_time") - if time > 0 and self.g_state == 1: - self.timer_cb = 1 - date_tmp = utime.localtime() - self.timeSecond = utime.mktime(date_tmp) - EventMesh.publish("set_countdown_off_state", [1,self.g_state]) - # print("Close self.timeSecond:{}".format(self.timeSecond)) - EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) - self.timer.stop() - else: - msg_tmp = EventMesh.publish("get_countdown_off_state") - self.g_state = msg_tmp[1] - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - - def close_count_show_info(self, event, msg): - self.reset(0) - - def reset(self,e): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - # print("in reset") - self.timer.stop() - self.hour = 0 - self.min = 0 - self.sec = 0 - self.g_state = 0 - self.g_end = 0 - self.total = 0 - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - EventMesh.publish("reset_time_countdown") - countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) - - countdown_hour_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_hour_down.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_min_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_min_down.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_up.clear_flag(lv.obj.FLAG.HIDDEN) - countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) - self.show_value() - - - def show_value(self): - global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ - countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ - countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ - countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ - countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min - - countdown_sec.set_text(str("%02d"%(self.sec))) - countdown_min.set_text(str("%02d"%(self.min))) - countdown_hour.set_text(str("%02d"%(self.hour))) - - def lcd_on(self): - print("lcd_on self.timer_cb:{}".format(self.timer_cb)) - time = EventMesh.publish("get_countdown_all_time") - - if time > 0 and self.g_state != 0: - if self.g_state == 1: - if self.timer_cb != 0: - self.timer_cb = 0 - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - total_sec = time_tmp - self.timeSecond - # print("total_sec:{} self.time_tmp:{} self.timeSecond:{} self.total:{}".format(total_sec,self.time_tmp,self.timeSecond,self.total)) - if self.total > 0: - self.total = self.total - total_sec - self.timeSecond = self.time_tmp - self.hour = self.total//3600 - self.min = self.total%3600//60 - self.sec = self.total%60 - self.show_value() - self.timer.start(1000,1,self.fun) - else: - msg_tmp = EventMesh.publish("get_countdown_off_state") - self.g_state = msg_tmp[1] - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - - else: - self.reset(0) - msg_tmp = EventMesh.publish("get_countdown_off_state") - self.g_state = msg_tmp[1] - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - - def lcd_off(self): - time = EventMesh.publish("get_countdown_all_time") - if time > 0 and self.g_state == 1: - self.timer_cb = 1 - date_tmp = utime.localtime() - self.timeSecond = utime.mktime(date_tmp) - EventMesh.publish("set_countdown_off_state", [1,self.g_state]) - EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) - self.timer.stop() - else: - EventMesh.publish("set_countdown_off_state", [0,self.g_state]) - - def done_return(self): - if self.g_state == 0: - self.timer.stop() - if self.g_end == 1: - EventMesh.publish("load_screen", {"screen": "countdown"}) - else: - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn1_release(self): - if self.g_state == 0: - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn8_press(self): - if self.g_state == 0: - self.timer.stop() - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -#结束倒计时显示图标 -countdown_end_screen = None -countdown_end_img = None -countdown_end_label = None -class CountdownEndScreen(Screen): - NAME = "countdown_end" - - def __init__(self): - super().__init__() - self.meta = None - self.FIND_timer=osTimer() - self.aud = audio.Audio(0) - self.FIND_timer_count = 0 - self.meta_type = "popup" - - def initialization(self): - global countdown_end_screen ,countdown_end_img ,countdown_end_label - if countdown_end_screen == None: - countdown_end_screen = lv.obj() - print("countdown_end_screen") - countdown_end_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_end_img = lv.img(countdown_end_screen) - countdown_end_img.set_size(38, 57) - countdown_end_img.set_pos(45, 20) - countdown_end_img.set_src("U:/static/time_finish.png") - countdown_end_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - countdown_end_label = lv.label(countdown_end_screen) - countdown_end_label.set_pos(0, 90) - countdown_end_label.set_size(128, 38) - countdown_end_label.set_text("时间到") - countdown_end_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - countdown_end_label.set_long_mode(lv.label.LONG.WRAP) - countdown_end_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = countdown_end_screen - self.FIND_timer_count = 0 - EventMesh.publish("close_count_show_info") - self.FIND_timer.start(3000, 1, self.FIND_timer_cb) - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #播放声音 - - def FIND_timer_cb(self, *args): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.FIND_timer_count += 1 - if self.FIND_timer_count >= 4: #120秒 - self.stop_FIND() - EventMesh.publish("load_screen", {"screen": "countdown"}) - return - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') - - def stop_FIND(self) : - self.FIND_timer.stop() - self.aud.stopAll() - - def Close(self): - self.stop_FIND() - - def done_left_to_right(self): - self.stop_FIND() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def done_right_to_left(self): - self.stop_FIND() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def done_bottom_to_top(self): - self.stop_FIND() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def done_top_to_bottom(self): - self.stop_FIND() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def done_return(self): - self.stop_FIND() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "countdown"}) - - def done_click(self): - self.stop_FIND() - EventMesh.publish("load_screen", {"screen": "countdown"}) - - def btn1_release(self): - self.stop_FIND() - EventMesh.publish("load_screen", {"screen": "countdown"}) - - def btn8_press(self): - self.stop_FIND() - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -# -------------------------------------------stopwatch screen---------------------------------------------------------- - - -stopwatch_screen = None -stopwatch_title = None -stopwatch_label_min = None -stopwatch_mao = None -stopwatch_label_sec = None -stopwatch_mao1 = None -stopwatch_label_ms = None -stopwatch_reset_img = None -stopwatch_reset_imgbtn = None -stopwatch_start_img = None -stopwatch_start_imgbtn = None -stopwatch_stop_img = None -class StopwatchScreen(Screen): - NAME = "stopwatch" - - def __init__(self): - super().__init__() - self.meta = None - self.ms_value = 0 - self.sec_value = 0 - self.min_value = 0 - self.s_state = 0 - self.total_time = 0 - self.TimeSecond = 0 - self.timer = osTimer() - - def initialization(self): - global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ - stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img,stopwatch_start_img ,\ - stopwatch_start_imgbtn, stopwatch_stop_img - if stopwatch_screen == None : - stopwatch_screen = lv.obj() - print("stopwatch_screen") - stopwatch_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - stopwatch_title = lv.label(stopwatch_screen) - stopwatch_title.set_pos(0, 5) - stopwatch_title.set_size(128, 20) - stopwatch_title.set_text("秒表") - stopwatch_title.set_long_mode(lv.label.LONG.WRAP) - stopwatch_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - stopwatch_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - stopwatch_label_min = lv.label(stopwatch_screen) - stopwatch_label_min.set_pos(33, 50) - stopwatch_label_min.set_size(20, 30) - stopwatch_label_min.set_text("00") - stopwatch_label_min.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_label_min.set_long_mode(lv.label.LONG.WRAP) - stopwatch_label_min.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - stopwatch_mao = lv.label(stopwatch_screen) - stopwatch_mao.set_pos(53, 50) - stopwatch_mao.set_size(12, 30) - stopwatch_mao.set_text(":") - stopwatch_mao.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_mao.set_long_mode(lv.label.LONG.WRAP) - stopwatch_mao.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - - stopwatch_label_sec = lv.label(stopwatch_screen) - stopwatch_label_sec.set_pos(59, 50) - stopwatch_label_sec.set_size(20, 30) - stopwatch_label_sec.set_text("00") - stopwatch_label_sec.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_label_sec.set_long_mode(lv.label.LONG.WRAP) - stopwatch_label_sec.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - stopwatch_mao1 = lv.label(stopwatch_screen) - stopwatch_mao1.set_pos(80, 50) - stopwatch_mao1.set_size(12, 30) - stopwatch_mao1.set_text(".") - stopwatch_mao1.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_mao1.set_long_mode(lv.label.LONG.WRAP) - stopwatch_mao1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - - stopwatch_label_ms = lv.label(stopwatch_screen) - stopwatch_label_ms.set_pos(85, 50) - stopwatch_label_ms.set_size(12, 30) - stopwatch_label_ms.set_text("0") - stopwatch_label_ms.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_label_ms.set_long_mode(lv.label.LONG.WRAP) - stopwatch_label_ms.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) - - - - - stopwatch_reset_img = lv.img(stopwatch_screen) - stopwatch_reset_img.set_size(50, 18) - stopwatch_reset_img.set_src("U:/static/stopwatch_reset.png") - stopwatch_reset_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_reset_img.set_pos(8, 90) - - stopwatch_reset_imgbtn = lv.img(stopwatch_screen) - stopwatch_reset_imgbtn.set_size(62, 33) - stopwatch_reset_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - stopwatch_reset_imgbtn.set_pos(0, 85) - - - stopwatch_start_img = lv.img(stopwatch_screen) - stopwatch_start_img.set_size(50, 18) - stopwatch_start_img.set_src("U:/static/stopwatch_play.png") - stopwatch_start_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_start_img.set_pos(66, 90) - - - stopwatch_start_imgbtn = lv.img(stopwatch_screen) - stopwatch_start_imgbtn.set_size(128-62, 33) - stopwatch_start_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - stopwatch_start_imgbtn.set_pos(62, 85) - - - stopwatch_stop_img = lv.img(stopwatch_screen) - stopwatch_stop_img.set_size(50, 18) - stopwatch_stop_img.set_src("U:/static/stopwatch_stop.png") - stopwatch_stop_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - stopwatch_stop_img.set_pos(66, 90) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - stopwatch_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), - lv.EVENT.SHORT_CLICKED, None) - - stopwatch_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reset(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = stopwatch_screen - - if self.s_state == 0: - self.reset(0) - if self.s_state == 1: - date_tmp = utime.localtime() - timeSecond = utime.mktime(date_tmp) - reduce = timeSecond - self.TimeSecond - self.total_time = self.total_time+reduce - if self.total_time >= 99*60: - self.total_time = 99*60 - self.ms_value = 0 - stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - self.show_value() - else: - self.timer.start(100,1,self._fun) - - - def start(self, e): - global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ - stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_start_img ,\ - stopwatch_start_imgbtn, stopwatch_stop_img - print("stopwatch start:{}".format(self.s_state)) - #self.timer.start(100, 1, self._fun) - - if self.s_state == 1: - self.s_state = 2 - self.paused() - elif self.s_state == 2: - self.s_state = 1 - if self.s_state != 2: - self.s_state = 1 - if self.total_time >= 99*60: - self.ms_value = 0 - self.sec_value = 0 - self.min_value = 0 - self.total_time = 0 - self.show_value() - self.timer.start(100,1,self._fun) - stopwatch_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_start_img.add_flag(lv.obj.FLAG.HIDDEN) - # print("ms_value start:{} {} {}".format(self.ms_value,self.sec_value,self.min_value)) - - - - def paused(self): - global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ - stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_start_img ,\ - stopwatch_start_imgbtn, stopwatch_stop_img - print("stopwatch pause") - stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - self.timer.stop() - self.show_value() - - def reset(self,e): - global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ - stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_start_img ,\ - stopwatch_start_imgbtn, stopwatch_stop_img - print("stopwatch reset") - - self.sec_value = 0 - self.min_value = 0 - self.ms_value = 0 - self.s_state = 0 - self.total_time = 0 - stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - self.timer.stop() - self.show_value() - - def _fun(self,e): - self.ms_value += 1 - if self.ms_value > 9: - self.ms_value = 0 - self.sec_value += 1 - self.total_time+=1 - if self.sec_value > 59: - self.sec_value = 0 - if self.total_time >= 99*60: - self.total_time = 99*60 - self.timer.stop() - stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - - self.show_value() - - def show_value(self): - global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ - stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_start_img ,\ - stopwatch_start_imgbtn, stopwatch_stop_img - if self.total_time >= 99*60: - self.total_time = 99*60 - self.ms_value = 0 - test_s = self.total_time % 60 - test_m = self.total_time//60 - # print("test_s:{} test_m:{} self.total_time:{}".format(test_s,test_m,self.total_time)) - - stopwatch_label_ms.set_text(str("%d"%(self.ms_value))) - stopwatch_label_sec.set_text(str("%02d"%(test_s))) - # stopwatch_label_sec.set_text("{}:{}.{}".format("%02d"%(test_m),"%02d"%(test_s),"%d"%(self.ms_value))) - stopwatch_label_min.set_text(str("%02d"%(test_m))) - - def Close(self): - if self.s_state == 1: - self.timer.stop() - date_tmp = utime.localtime() - self.TimeSecond = utime.mktime(date_tmp) - - def lcd_on(self): - if self.s_state == 1: - date_tmp = utime.localtime() - timeSecond = utime.mktime(date_tmp) - reduce = timeSecond - self.TimeSecond - self.total_time = self.total_time+reduce - total = self.total_time // 60 - if total >= 99: - self.total_time = 99*60 - self.timer.stop() - self.s_state = 0 - self.ms_value = 0 - stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) - self.show_value() - else: - - print("stopwatch reset start:{}".format(self.s_state)) - #self.timer.start(100, 1, self._fun) - self.show_value() - self.timer.start(100,1,self._fun) - stopwatch_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) - stopwatch_start_img.add_flag(lv.obj.FLAG.HIDDEN) - # print("ms_value start:{} {} {}".format(self.ms_value,self.sec_value,self.min_value)) - - pass - - def lcd_off(self): - if self.s_state == 1: - date_tmp = utime.localtime() - timeSecond = utime.mktime(date_tmp) - self.TimeSecond = timeSecond - self.timer.stop() - pass - - def done_return(self): - if self.s_state == 0: - self.timer.stop() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn1_release(self): - if self.s_state == 0: - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "toolbox"}) - - def btn8_press(self): - if self.s_state == 0: - self.timer.stop() - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -FIND_screen = None -watchface_mpsignal_img = None -class UIFINDScreen(Screen): - NAME = "FIND" - def __init__(self): - super().__init__() - self.aud = audio.Audio(0) - self.FIND_timer = osTimer() - self.FIND_timer_count = 0 - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global FIND_screen ,findphone_img - - if FIND_screen ==None: - FIND_screen = lv.obj() - print("FIND_screen") - FIND_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - FIND_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - findphone_img = lv.img(FIND_screen) - findphone_img.set_pos(int(15),int(10)) - findphone_img.set_size(98,66) - findphone_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - findphone_img.add_flag(lv.obj.FLAG.CLICKABLE) - findphone_img.set_src("U:/static/find_phone.png") - findphone_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - - findphone_img_label = lv.label(FIND_screen) - findphone_img_label.set_pos(int(0),int(90)) - findphone_img_label.set_size(128,66) - findphone_img_label.set_text("点击关闭屏幕") - findphone_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - findphone_img_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - - - self.meta = FIND_screen - - - def post_processor_after_initialization(self): - utime.sleep_ms(200)#不加延时会切屏 - self.FIND_timer_count = 0 - print("self.FIND_timer_count:{}".format(self.FIND_timer_count)) - self.FIND_timer.start(2000, 1, self.FIND_timer_cb) - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #播放声音 - - def FIND_timer_cb(self, *args): - EventMesh.publish("system_sleep_rest") - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') - self.FIND_timer_count += 1 - if self.FIND_timer_count > 20: #120秒 - self.stop_FIND() - - def stop_FIND(self) : - self.FIND_timer.stop() - self.aud.stop() #播放声音 - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - print("self.FIND_timer_Close") - self.FIND_timer.stop() - self.aud.stop() #播放声音 - - def done_left_to_right(self): - self.stop_FIND() - - def done_right_to_left(self): - self.stop_FIND() - def done_bottom_to_top(self): - self.stop_FIND() - - def done_top_to_bottom(self): - self.stop_FIND() - - def done_return(self): - self.stop_FIND() - - def done_click(self): - self.stop_FIND() - - - def btn1_release(self): - self.stop_FIND() - - - def btn8_press(self): - self.stop_FIND() - -Lowpower_screen = None -Lowpower_screen_img = None -class LowPowerScreen(Screen): - NAME = "LOW_POWER" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - def initialization(self): - global Lowpower_screen ,Lowpower_screen_img - if Lowpower_screen == None : - Lowpower_screen = lv.obj() - print("Lowpower_screen") - Lowpower_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - Lowpower_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - Lowpower_screen_img = lv.img(Lowpower_screen) - Lowpower_screen_img.set_pos(int(24),int(10)) - Lowpower_screen_img.set_size(80,80) - Lowpower_screen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - Lowpower_screen_img.add_flag(lv.obj.FLAG.CLICKABLE) - Lowpower_screen_img.set_src("U:/static/low_power.png") - Lowpower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - - Lowpower_screen_img_label = lv.label(Lowpower_screen) - Lowpower_screen_img_label.set_pos(int(0),int(100)) - Lowpower_screen_img_label.set_size(128,28) - Lowpower_screen_img_label.set_text("电量低") - Lowpower_screen_img_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - Lowpower_screen_img_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) - - self.meta = Lowpower_screen - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_click(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -LowOnePower_screen = None -LowOnePower_screen_img = None -LowOnePower_screen_label2 = None -LowOnePower_screen_label1 = None -class LowOnePowerScreen(Screen): #0%的电池电量 - NAME = "LOW_ONE_POWER" - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - - def initialization(self): - global LowOnePower_screen ,LowOnePower_screen_img ,LowOnePower_screen_label2,LowOnePower_screen_label1 - if LowOnePower_screen == None : - LowOnePower_screen = lv.obj() - print("LowOnePower_screen") - LowOnePower_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - LowOnePower_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - LowOnePower_screen_img = lv.img(LowOnePower_screen) - LowOnePower_screen_img.set_pos(int(47),int(5)) - LowOnePower_screen_img.set_size(30,49) - LowOnePower_screen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - LowOnePower_screen_img.add_flag(lv.obj.FLAG.CLICKABLE) - LowOnePower_screen_img.set_src("U:/static/0_BAT.png") - LowOnePower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - - LowOnePower_screen_label1 = lv.label(LowOnePower_screen) - LowOnePower_screen_label1.set_pos(0, 55) - LowOnePower_screen_label1.set_size(128, 73) - LowOnePower_screen_label1.set_text("电池电量过低\n部分功能不能正常\n使用,5s过后强制关机") - LowOnePower_screen_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - LowOnePower_screen_label1.set_long_mode(lv.label.LONG.WRAP) - LowOnePower_screen_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - # LowOnePower_screen_label2 = lv.label(LowOnePower_screen) - # LowOnePower_screen_label2.set_pos(0, 70) - # LowOnePower_screen_label2.set_size(128, 58) - # LowOnePower_screen_label2.set_text("部分功能不能正常\n使用,5s过后强制关机") - # LowOnePower_screen_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - # LowOnePower_screen_label2.set_long_mode(lv.label.LONG.WRAP) - # LowOnePower_screen_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - self.meta = LowOnePower_screen - - def post_processor_after_initialization(self): - self.timer.start(5000,0,self.fun) - - - - def fun(self,e): - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_click(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - -sos_screen = None -sos_screen_label = None -sos_screen_label_p = None - -#sos求组提示界面 -class sosScreen(Screen): - NAME = "SOS_POPUP" - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - self.count = 0 - - def initialization(self): - global sos_screen ,sos_screen_label - if sos_screen == None : - sos_screen = lv.obj() - print("SOS_POPUP") - sos_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - sos_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - # sos_screen_label = lv.label(sos_screen) - # sos_screen_label.set_pos(0, 5) - # sos_screen_label.set_size(128, 20) - # sos_screen_label.set_text("SOS") - # sos_screen_label.add_style(style_font_youyuan_20_red, lv.PART.MAIN | lv.STATE.DEFAULT) - # sos_screen_label.set_long_mode(lv.label.LONG.WRAP) - # sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - sos_screen_label = lv.label(sos_screen) - sos_screen_label.set_text("是否拨打求助电话") - sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - sos_screen_label.set_size(128, 20) - sos_screen_label.set_pos(0,2) - sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - sos_screen_label = lv.label(sos_screen) - sos_screen_label.set_text("无操作10s后\n自动拨打") - sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - sos_screen_label.set_size(128, 40) - sos_screen_label.set_pos(0,25) - sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - sos_screen_confirm_img = lv.img(sos_screen) - sos_screen_confirm_img.set_size(88, 23) - sos_screen_confirm_img.set_pos(20, 65) - sos_screen_confirm_img.set_src("U:/static/off_icon.png") - sos_screen_confirm_img.add_flag(lv.obj.FLAG.CLICKABLE) - sos_screen_confirm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - sos_screen_confirm_label = lv.label(sos_screen_confirm_img) - sos_screen_confirm_label.set_text("确定") - sos_screen_confirm_label.align(lv.ALIGN.CENTER, 0, 0) - sos_screen_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - sos_screen_return = lv.img(sos_screen) - sos_screen_return.set_size(88, 23) - sos_screen_return.set_pos(20, 98) - sos_screen_return.set_src("U:/static/cancel_icon.png") - sos_screen_return.add_flag(lv.obj.FLAG.CLICKABLE) - sos_screen_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - sos_screen_return_label = lv.label(sos_screen_return) - sos_screen_return_label.set_text("取消") - sos_screen_return_label.align(lv.ALIGN.CENTER, 0, 0) - sos_screen_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - sos_screen_return_label.set_ext_click_area(20) - - self.meta = sos_screen - sos_screen_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_comfirm_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - - sos_screen_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_cancel_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - - def timer_comfirm_cb(self,e): - EventMesh.publish("set_sos_flag", 1) - - def timer_cancel_cb(self,e): - EventMesh.publish("return_prev_screen") - - def post_processor_before_initialization(self): - self.count = 0 - self.timer.start(5000,1,self.timer_cb_onescond) - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count >= 2: - self.count = 0 - EventMesh.publish("set_sos_flag", 1) - - def Close(self): - self.timer.stop() - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - pass - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - pass - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - pass - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - pass - def done_return(self): - EventMesh.publish("return_prev_screen") - pass - def done_click(self): - #EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - - pass - def btn1_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass - -charge_in_screen = None -charge_in_screen_label = None - -#没有设置紧急联系人的号码 -class chargeInScreen(Screen): - NAME = "charge_in" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count = 0 - self.timer = osTimer() - - def initialization(self): - global charge_in_screen ,charge_in_screen_label - if charge_in_screen == None : - charge_in_screen = lv.obj() - print("charge_in_screen") - charge_in_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - charge_in_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - charge_in_screen_label = lv.label(charge_in_screen) - charge_in_screen_label.set_pos(0, 50) - charge_in_screen_label.set_size(128, 20) - charge_in_screen_label.set_text(" ") - charge_in_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - charge_in_screen_label.set_long_mode(lv.label.LONG.WRAP) - charge_in_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = charge_in_screen - - - def post_processor_after_initialization(self): - global charge_in_screen_label - self.count = 0 - self.timer.start(1000,1,self.timer_cb_onescond) - charge_in_screen_label.set_text("正在充电") - - def Close(self): - self.timer.stop() - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count >= 5: - self.count = 0 - EventMesh.publish("return_prev_screen") - - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - pass - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - pass - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - pass - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - pass - def done_return(self): - EventMesh.publish("return_prev_screen") - pass - def done_click(self): - EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass - - -charge_out_screen = None -charge_out_screen_label = None - -# -class chargeOutScreen(Screen): - NAME = "charge_out" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count = 0 - self.timer = osTimer() - - - def initialization(self): - global charge_out_screen ,charge_out_screen_label - if charge_out_screen == None : - charge_out_screen = lv.obj() - print("charge_out_screen") - charge_out_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - charge_out_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - charge_out_screen_label = lv.label(charge_out_screen) - charge_out_screen_label.set_pos(0, 50) - charge_out_screen_label.set_size(128, 20) - charge_out_screen_label.set_text(" ") - charge_out_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - charge_out_screen_label.set_long_mode(lv.label.LONG.WRAP) - charge_out_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = charge_out_screen - - - - def post_processor_after_initialization(self): - global charge_out_screen_label - self.count = 0 - self.timer.start(1000,1,self.timer_cb_onescond) - charge_out_screen_label.set_text("充电已移出") - - def Close(self): - self.timer.stop() - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count >= 5: - self.count = 0 - EventMesh.publish("return_prev_screen") - - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - pass - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - pass - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - pass - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - pass - def done_return(self): - EventMesh.publish("return_prev_screen") - pass - def done_click(self): - EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass - -no_sos_screen = None -no_sos_screen_label = None - -#没有设置紧急联系人的号码 -class noSosDataScreen(Screen): - NAME = "NO_SOS_POPUP" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count = 0 - self.timer = osTimer() - - def initialization(self): - global no_sos_screen ,no_sos_screen_label - if no_sos_screen == None : - no_sos_screen = lv.obj() - print("NO_SOS_POPUP") - no_sos_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - no_sos_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - no_sos_screen_label = lv.label(no_sos_screen) - no_sos_screen_label.set_pos(0, 40) - no_sos_screen_label.set_size(128, 80) - no_sos_screen_label.set_text("请在手机app上设\n置紧急联系人号码") - no_sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_sos_screen_label.set_long_mode(lv.label.LONG.WRAP) - no_sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = no_sos_screen - def post_processor_before_initialization(self): - self.count = 0 - self.timer.start(1000,1,self.timer_cb_onescond) - - def Close(self): - self.timer.stop() - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count >= 10: - self.count = 0 - EventMesh.publish("return_prev_screen") - - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - pass - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - pass - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - pass - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - pass - def done_return(self): - EventMesh.publish("return_prev_screen") - pass - def done_click(self): - EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - - pass - def btn1_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass -key_borad_screen = None -key_borad_screen_label = None - -#键盘弹窗 -class keyboardScreen(Screen):#键盘弹窗 - NAME = "keyboard_popup" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count = 0 - self.timer = osTimer() - - def initialization(self): - global key_borad_screen ,no_sos_screen_label - if key_borad_screen == None : - key_borad_screen = lv.obj() - print("keyboard_popup") - key_borad_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - key_borad_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - key_borad_screen_label = lv.label(key_borad_screen) - key_borad_screen_label.set_pos(0, 40) - key_borad_screen_label.set_size(128, 80) - key_borad_screen_label.set_text("如使用拨号盘,\n请在手机app上开启") - key_borad_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - key_borad_screen_label.set_long_mode(lv.label.LONG.WRAP) - key_borad_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = key_borad_screen - def post_processor_before_initialization(self): - self.count = 0 - self.timer.start(1000,1,self.timer_cb_onescond) - - def Close(self): - self.timer.stop() - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count >= 5: - self.count = 0 - EventMesh.publish("return_prev_screen") - - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") - pass - def done_right_to_left(self): - EventMesh.publish("return_prev_screen") - pass - def done_bottom_to_top(self): - EventMesh.publish("return_prev_screen") - pass - def done_top_to_bottom(self): - EventMesh.publish("return_prev_screen") - pass - def done_return(self): - EventMesh.publish("return_prev_screen") - pass - def done_click(self): - EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - - pass - def btn1_press(self): - EventMesh.publish("return_prev_screen") - pass - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass - -no_sim_auto_screen = None -no_sim_auto_screen_title = None -no_sim_auto_screen_label =None -no_sim_auto_screen_comfirm =None -no_sim_autor_screen_cancel = None -no_sim_auto_screen_img = None -no_sim_confirm_label = None - -#未插卡,长按关机 -class NoSimAutoScreen(Screen):#无sim卡是否关机 - NAME = "no_sim_auto_screen" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer = osTimer() - self.count = 0 - - def initialization(self): - global no_sim_auto_screen,no_sim_confirm_label,no_sim_cancel_label,no_sim_auto_screen_img,no_sim_auto_screen_title,no_sim_auto_screen_comfirm,no_sim_auto_screen_cancel,no_sim_auto_screen_label - if no_sim_auto_screen == None : - no_sim_auto_screen = lv.obj() - print("no_sim_power_screen") - no_sim_auto_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_auto_screen_title = lv.label(no_sim_auto_screen) - no_sim_auto_screen_title.set_pos(0, 5) - no_sim_auto_screen_title.set_size(128, 40) - no_sim_auto_screen_title.set_text("无SIM卡,无操作\n30s后自动关机") - no_sim_auto_screen_title.set_long_mode(lv.label.LONG.WRAP) - no_sim_auto_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_auto_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - # no_sim_auto_screen_img = lv.img(no_sim_auto_screen) - # no_sim_auto_screen_img.set_pos(49, 40) - # no_sim_auto_screen_img.set_size(30, 30) - # no_sim_auto_screen_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - # no_sim_auto_screen_img.set_src("E:/static/setting_poweroff.png") - - - no_sim_auto_screen_label = lv.label(no_sim_auto_screen) - no_sim_auto_screen_label.set_pos(0, 40) - no_sim_auto_screen_label.set_size(128, 20) - no_sim_auto_screen_label.set_text("是否关机?") - no_sim_auto_screen_label.set_long_mode(lv.label.LONG.WRAP) - no_sim_auto_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - no_sim_auto_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - no_sim_auto_screen_comfirm = lv.img(no_sim_auto_screen) - no_sim_auto_screen_comfirm.set_size(88, 23) - no_sim_auto_screen_comfirm.set_pos(20, 64) - no_sim_auto_screen_comfirm.set_src("U:/static/off_icon.png") - no_sim_auto_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_auto_screen_comfirm.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_confirm_label = lv.label(no_sim_auto_screen_comfirm) - no_sim_confirm_label.set_text("确定") - no_sim_confirm_label.align(lv.ALIGN.CENTER, 0, 0) - no_sim_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - no_sim_auto_screen_cancel = lv.img(no_sim_auto_screen) - no_sim_auto_screen_cancel.set_size(88, 23) - no_sim_auto_screen_cancel.set_pos(20, 95) - no_sim_auto_screen_cancel.set_src("U:/static/cancel_icon.png") - no_sim_auto_screen_cancel.add_flag(lv.obj.FLAG.CLICKABLE) - no_sim_auto_screen_cancel.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - no_sim_cancel_label = lv.label(no_sim_auto_screen_cancel) - no_sim_cancel_label.set_text("取消") - no_sim_cancel_label.align(lv.ALIGN.CENTER, 0, 0) - no_sim_cancel_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - no_sim_auto_screen_cancel.set_ext_click_area(20) - - self.meta = no_sim_auto_screen - no_sim_auto_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), - lv.EVENT.SHORT_CLICKED, None) - - no_sim_auto_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.cancel(e)), - lv.EVENT.SHORT_CLICKED, None) - self.timer.start(1*1000,1,self.fun) - self.count = 0 - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.count+=1 - if self.count > 30: - self.count = 0 - self.timer.stop() - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) - - - def Close(self): - self.count = 0 - self.timer.stop() - - def confirm(self,e): - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) - - def cancel(self,e): - EventMesh.publish("return_prev_screen") - - def done_return(self): - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - - -system_init_screen = None -system_init_label = None -class SystemInitScreen(Screen): - #系统初始化中... - NAME = "system_init" - - def __init__(self): - super().__init__() - self.meta = None - self.system_init_timer=osTimer() - self.system_init_timer_count = 0 - self.meta_type = "popup" - - def initialization(self): - global system_init_screen ,system_init_label - if system_init_screen == None: - system_init_screen = lv.obj() - print("SystemInitScreen") - system_init_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - system_init_label = lv.label(system_init_screen) - system_init_label.set_pos(0, 50) - system_init_label.set_size(128, 20) - system_init_label.set_text("系统初始化中") - system_init_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - system_init_label.set_long_mode(lv.label.LONG.WRAP) - system_init_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - self.meta = system_init_screen - self.system_init_timer_count = 0 - self.system_init_timer.start(1000, 1, self.system_init_timer_cb) - - def system_init_timer_cb(self, *args): - EventMesh.publish("system_sleep_rest")#防止黑屏 - self.system_init_timer_count += 1 - if self.system_init_timer_count > 4: - self.system_init_timer_count = 1 - if system_init_screen != None: - - system_init_label_str = "系统初始化中" - if self.system_init_timer_count == 1: - system_init_label.set_text("系统初始化中.") - elif self.system_init_timer_count == 2: - system_init_label.set_text("系统初始化中..") - elif self.system_init_timer_count == 3: - system_init_label.set_text("系统初始化中...") - else: - system_init_label.set_text("系统初始化中....") - - def Close(self): - self.system_init_timer.stop() - -style_font_youyuan_30 = lv.style_t() -style_font_youyuan_30.init() -style_font_youyuan_30.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) -style_font_youyuan_30.set_text_font(lv.K01_font_30_DIAL) - -class_mgr_popup_screen = None -class_mgr_popup_label = None -class_mgr_popup_time1_text = None -class classMgrPopupScreen(Screen):#上课禁用时间界面 - #上课禁用 - NAME = "class_time" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - - def initialization(self): - global class_mgr_popup_screen ,class_mgr_popup_label ,class_mgr_popup_time1_text - if class_mgr_popup_screen == None: - class_mgr_popup_screen = lv.obj() - print("class_mgr_popup_screen") - class_mgr_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - class_mgr_popup_time1_text = lv.label(class_mgr_popup_screen) - class_mgr_popup_time1_text.set_pos(0, 15) - class_mgr_popup_time1_text.set_size(128, 71) - class_mgr_popup_time1_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - class_mgr_popup_time1_text.set_text(" ") - class_mgr_popup_time1_text.add_style(style_font_youyuan_30, lv.PART.MAIN|lv.STATE.DEFAULT) - - class_mgr_popup_label = lv.label(class_mgr_popup_screen) - class_mgr_popup_label.set_pos(0, 60) - class_mgr_popup_label.set_size(128, 50) - class_mgr_popup_label.set_text("现在是上课时间点,禁用手表功能") - class_mgr_popup_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - class_mgr_popup_label.set_long_mode(lv.label.LONG.WRAP) - class_mgr_popup_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - self.meta = class_mgr_popup_screen - - sos_flag = EventMesh.publish("get_sos_flag") - if sos_flag == 1: - EventMesh.publish("close_sos_timer") - EventMesh.publish("set_sos_flag",0) - EventMesh.publish("set_sos_num",0) - EventMesh.publish("set_hangup_mode",0) - - data = RTC().datetime() - hour = data[4] - min = data[5] - class_mgr_popup_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) - EventMesh.publish("set_UI_high_priority", 1) - self.timer.start(1*1000,1,self.fun) - - def lcd_on(self): - self.timer.start(1*1000,1,self.fun) - - def lcd_off(self): - self.timer.stop() - - def Close(self): - EventMesh.publish("set_UI_high_priority", 0) - - def fun(self,*argc): - global class_mgr_popup_time1_text - data = RTC().datetime() - hour = data[4] - min = data[5] - class_mgr_popup_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) - - - def btn1_release(self): - state = EventMesh.publish("get_cur_class_time_state") - print("state:{}".format(state)) - if state != None: - if state == 0: - EventMesh.publish("load_screen", {"screen": "main_menu"}) - return - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - - def btn8_press(self): - state = EventMesh.publish("get_cur_class_time_state") - print("state:{}".format(state)) - if state != None: - if state == 0: - EventMesh.publish("load_screen", {"screen": "main_menu"}) - return - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - -# -------------------------------------------down screen---------------------------------------------------------- -down_show_screen = lv.obj() -print("restart_screen") -down_show_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -down_show_bright_img = lv.img(down_show_screen)#亮度 -down_show_bright_img.set_size(25, 25) -down_show_bright_img.set_pos(13, 90) -down_show_bright_img.set_src("U:/static/menu_bright.png") -down_show_bright_img.add_flag(lv.obj.FLAG.CLICKABLE) -down_show_bright_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -down_show_volume_img = lv.img(down_show_screen)#音量 -down_show_volume_img.set_size(25, 25) -down_show_volume_img.set_pos(13+25+13, 90) -down_show_volume_img.set_src("U:/static/menu_volume.png") -down_show_volume_img.add_flag(lv.obj.FLAG.CLICKABLE) -down_show_volume_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -down_show_setting_img = lv.img(down_show_screen)#设置 -down_show_setting_img.set_size(25, 25) -down_show_setting_img.set_pos(13+25+13+25+13, 90) -down_show_setting_img.set_src("U:/static/ui_setting.png") -down_show_setting_img.add_flag(lv.obj.FLAG.CLICKABLE) -down_show_setting_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - -down_show_mpsignal_img = lv.img(down_show_screen) -down_show_mpsignal_img.set_pos(int(10),int(5)) -down_show_mpsignal_img.set_size(22,12) -down_show_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -down_show_mpsignal_img.set_src("U:/static/mpsignal5.png") -down_show_mpsignal_img.add_style(style_img, lv.PART.MAIN|lv.STATE.DEFAULT) - -down_showt_battery_img = lv.img(down_show_screen) -down_showt_battery_img.set_pos(int(102),int(5)) -down_showt_battery_img.set_size(24,12)#16 8 -down_showt_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -down_showt_battery_img.set_src("U:/static/vbat_0.png") -down_showt_battery_img.add_style(style_img, lv.PART.MAIN|lv.STATE.DEFAULT) - - -power_line_points = [{"x":0,"y":0},{"x":0,"y":0}] -power_line_red = lv.style_t() -power_line_red.init() -power_line_red.set_line_width(0)#23 宽度 -power_line_red.set_line_color(lv.color_make(0xff, 0xff, 0xff)) - -down_showt_battery_line = lv.line(down_show_screen) -down_showt_battery_line.set_points(power_line_points,2) -down_showt_battery_line.set_pos(int(110),int(6)) -down_showt_battery_line.set_size(0,10)#高度12 -down_showt_battery_line.add_style(power_line_red,0) - -data = RTC().datetime() -hour = data[4] -min = data[5] - -week = data[3] - -date0 = data[0] -date1 = data[1] -date2 = data[2] -def get_week(msg): - if msg == 1: - return '一' - elif msg == 2: - return '二' - elif msg == 3: - return '三' - elif msg == 4: - return '四' - elif msg == 5: - return '五' - elif msg == 6: - return '六' - elif msg == 7 or msg == 0: - return '日' -down_showt_time1_text = lv.label(down_show_screen) -down_showt_time1_text.set_pos(0, 35) -down_showt_time1_text.set_size(128, 71) -down_showt_time1_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -down_showt_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) -# watchface1_time1_text.set_text("%02d:%02d"%(hour,min)) -down_showt_time1_text.add_style(style_font_youyuan_70_black, lv.PART.MAIN|lv.STATE.DEFAULT) -#日期 -down_show_date_span = lv.label(down_show_screen) -down_show_date_span.set_pos(0, 62) -down_show_date_span.set_size(128, 20) -down_show_date_span.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -down_show_date_span.set_text("%02d/%02d 星期%s"%(date1,date2,get_week(week))) -down_show_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - -# volum_bar_1 = lv.bar(down_show_screen) -# volum_bar_1.set_pos(int(10),int(65)) -# volum_bar_1.set_size(108,15) -# volum_bar_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# volum_bar_1.set_style_anim_time(1000, 0) -# volum_bar_1.set_mode(lv.bar.MODE.NORMAL) -# volum_bar_1.set_value(100, lv.ANIM.OFF) -# volum_bar_1.add_flag(lv.obj.FLAG.HIDDEN) -# # create style style_screen_bar_1_main_main_default -# style_screen_bar_1_main_main_default = lv.style_t() -# style_screen_bar_1_main_main_default.init() -# style_screen_bar_1_main_main_default.set_radius(10) -# style_screen_bar_1_main_main_default.set_bg_color(lv.color_make(0x00,0x00,0x00)) -# style_screen_bar_1_main_main_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -# style_screen_bar_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_bar_1_main_main_default.set_bg_opa(60) - -# # add style for screen_bar_1 -# volum_bar_1.add_style(style_screen_bar_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# # create style style_screen_bar_1_main_indicator_default -# style_screen_bar_1_main_indicator_default = lv.style_t() -# style_screen_bar_1_main_indicator_default.init() -# style_screen_bar_1_main_indicator_default.set_radius(10) -# style_screen_bar_1_main_indicator_default.set_bg_color(lv.color_make(0x80,0x80,0x80)) -# style_screen_bar_1_main_indicator_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -# style_screen_bar_1_main_indicator_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_bar_1_main_indicator_default.set_bg_opa(255) - -# # add style for screen_bar_1 -# volum_bar_1.add_style(style_screen_bar_1_main_indicator_default, lv.PART.INDICATOR|lv.STATE.DEFAULT) - -# volum_slider_1 = lv.slider(down_show_screen) -# volum_slider_1.set_pos(int(19),int(70)) -# volum_slider_1.set_size(90,5) -# volum_slider_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# volum_slider_1.set_range(0, 100) -# volum_slider_1.set_value(0, False) -# volum_slider_1.add_flag(lv.obj.FLAG.HIDDEN) -# create style style_screen_slider_1_main_main_default -# style_screen_slider_1_main_main_default = lv.style_t() -# style_screen_slider_1_main_main_default.init() -# style_screen_slider_1_main_main_default.set_radius(30) -# style_screen_slider_1_main_main_default.set_bg_color(lv.color_make(237,30,121)) -# style_screen_slider_1_main_main_default.set_bg_grad_color(lv.color_make(237,30,121)) -# style_screen_slider_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_slider_1_main_main_default.set_bg_opa(0) -# style_screen_slider_1_main_main_default.set_outline_color(lv.color_make(237,30,121)) -# style_screen_slider_1_main_main_default.set_outline_width(0) -# style_screen_slider_1_main_main_default.set_outline_opa(0) - -# # add style for screen_slider_1 -# volum_slider_1.add_style(style_screen_slider_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# create style style_screen_slider_1_main_indicator_default -# style_screen_volum_slider_1_main_indicator_default = lv.style_t() -# style_screen_volum_slider_1_main_indicator_default.init() -# style_screen_volum_slider_1_main_indicator_default.set_radius(30) -# style_screen_volum_slider_1_main_indicator_default.set_bg_color(lv.color_make(237,30,121)) -# style_screen_volum_slider_1_main_indicator_default.set_bg_grad_color(lv.color_make(237,30,121)) -# style_screen_volum_slider_1_main_indicator_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_volum_slider_1_main_indicator_default.set_bg_opa(255) - -# # add style for screen_slider_1 -# volum_slider_1.add_style(style_screen_volum_slider_1_main_indicator_default, lv.PART.INDICATOR|lv.STATE.DEFAULT) - -# # create style style_screen_slider_1_main_knob_default -# style_screen_volum_slider_1_main_knob_default = lv.style_t() -# style_screen_volum_slider_1_main_knob_default.init() -# style_screen_volum_slider_1_main_knob_default.set_radius(30) -# style_screen_volum_slider_1_main_knob_default.set_bg_color(lv.color_make(237,30,121)) -# style_screen_volum_slider_1_main_knob_default.set_bg_grad_color(lv.color_make(237,30,121)) -# style_screen_volum_slider_1_main_knob_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_volum_slider_1_main_knob_default.set_bg_opa(255) - -# # add style for screen_slider_1 -# volum_slider_1.add_style(style_screen_volum_slider_1_main_knob_default, lv.PART.KNOB|lv.STATE.DEFAULT) - - - -# brightress_slider_1 = lv.slider(down_show_screen) -# brightress_slider_1.set_pos(int(19),int(70)) -# brightress_slider_1.set_size(90,5) -# brightress_slider_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# brightress_slider_1.set_range(0, 100) -# brightress_slider_1.set_value(0, False) -# brightress_slider_1.add_flag(lv.obj.FLAG.HIDDEN) -# create style style_screen_slider_1_main_main_default -# style_screen_slider_1_main_main_default = lv.style_t() -# style_screen_slider_1_main_main_default.init() -# style_screen_slider_1_main_main_default.set_radius(30) -# style_screen_slider_1_main_main_default.set_bg_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_main_default.set_bg_grad_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_slider_1_main_main_default.set_bg_opa(0) -# style_screen_slider_1_main_main_default.set_outline_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_main_default.set_outline_width(0) -# style_screen_slider_1_main_main_default.set_outline_opa(0) - -# # add style for screen_slider_1 -# brightress_slider_1.add_style(style_screen_slider_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# # create style style_screen_slider_1_main_indicator_default -# style_screen_slider_1_main_indicator_default = lv.style_t() -# style_screen_slider_1_main_indicator_default.init() -# style_screen_slider_1_main_indicator_default.set_radius(30) -# style_screen_slider_1_main_indicator_default.set_bg_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_indicator_default.set_bg_grad_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_indicator_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_slider_1_main_indicator_default.set_bg_opa(255) - -# # add style for screen_slider_1 -# brightress_slider_1.add_style(style_screen_slider_1_main_indicator_default, lv.PART.INDICATOR|lv.STATE.DEFAULT) - -# # create style style_screen_slider_1_main_knob_default -# style_screen_slider_1_main_knob_default = lv.style_t() -# style_screen_slider_1_main_knob_default.init() -# style_screen_slider_1_main_knob_default.set_radius(30) -# style_screen_slider_1_main_knob_default.set_bg_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_knob_default.set_bg_grad_color(lv.color_make(247,147,30)) -# style_screen_slider_1_main_knob_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -# style_screen_slider_1_main_knob_default.set_bg_opa(255) - -# # add style for screen_slider_1 -# brightress_slider_1.add_style(style_screen_slider_1_main_knob_default, lv.PART.KNOB|lv.STATE.DEFAULT) - -class down_Screen(Screen):#下滑界面 - NAME = "down_screen" - - def __init__(self): - super().__init__() - self.rtc = RTC() - self.timer = osTimer() - self.meta = down_show_screen - - # brightress_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.change_bright(e)), lv.EVENT.VALUE_CHANGED, None) - # brightress_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.change_bright(e)), lv.EVENT.RELEASED, None) - # volum_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.VALUE_CHANGED, None) - # volum_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.RELEASED, None) - - down_show_bright_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"brightness")), lv.EVENT.SHORT_CLICKED, None) - down_show_volume_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"totalvolume")), lv.EVENT.SHORT_CLICKED, None) - down_show_setting_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"setting")), lv.EVENT.SHORT_CLICKED, None) - - down_show_bright_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"brightness")), lv.EVENT.PRESSING, None) - down_show_volume_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"totalvolume")), lv.EVENT.PRESSING, None) - down_show_setting_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e,"setting")), lv.EVENT.PRESSING, None) - - def img_cb(self,e,msg): - code = e.get_code() - indev = lv.indev_get_act() - lv.indev_t.wait_release(indev) - dir = lv.indev_t.get_gesture_dir(indev) - # LV_DIR_TOP - if code == lv.EVENT.GESTURE: - if dir == lv.DIR.BOTTOM: - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - elif code == lv.EVENT.SHORT_CLICKED: - if msg == "brightness": - # volum_slider_1.add_flag(lv.obj.FLAG.HIDDEN) - # brightress_slider_1.clear_flag(lv.obj.FLAG.HIDDEN) - EventMesh.publish("load_screen", {"screen": "brightness"}) - elif msg == "totalvolume": - # brightress_slider_1.add_flag(lv.obj.FLAG.HIDDEN) - # volum_slider_1.clear_flag(lv.obj.FLAG.HIDDEN) - EventMesh.publish("load_screen", {"screen": "totalvolume"}) - else: - if msg == 'setting': - EventMesh.publish("load_screen", {"screen": "setting"}) - pass - - - - def initialization(self): - print("down_screen") - - #获取信号 - signal = EventMesh.publish("screen_get_sig") - if signal: - self.__signal(None, signal) - # 获取电池电量 - battery = EventMesh.publish("screen_get_battery") - if battery: - self.__battery(None, battery) - - self.__time(None, None) - self.timer.start(2000,1,self.time_out) - def img_cb(self, e, msg): - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - - def time_out(self,*argc): - signal = EventMesh.publish("screen_get_sig") - if signal: - self.__signal(None, signal) - # 获取电池电量 - battery = EventMesh.publish("screen_get_battery") - if battery: - self.__battery(None, battery) - - self.__time(None, None) - pass - - def __time(self, event, msg): - #时间 - rtc_time = self.rtc.datetime() - month = rtc_time[1] - day = rtc_time[2] - year = rtc_time[0] - # week = ("星期%s"%(self.get_week(rtc_time[3]))) - week_data = rtc_time[3] - # time = [rtc_time[4], rtc_time[5]] - - down_showt_time1_text.set_text("{}:{}".format("%02d"%(rtc_time[4]),"%02d"%(rtc_time[5]))) - down_show_date_span.set_text("%02d/%02d 星期%s"%(month,day,get_week(week))) - - def __signal(self, event, msg): - #print("__signal_cb:",str(msg)) - # 信号强度值范围0 ~ 31,值越大表示信号强度越好 - #print("__signal_cb:{}".format(msg//8)) - if msg: - if msg >= 0 and msg<=31 : - down_show_mpsignal_img.set_src("U:/static/mpsignal{}.png".format(msg//8+1)) - else : - down_show_mpsignal_img.set_src("U:/static/mpsignal5.png") - - def __battery(self, event, msg): - #print("__battery_cb:",str(msg)) - #print(msg) - if msg[0] == '1': - down_showt_battery_line.set_pos(int(0),int(0)) - down_showt_battery_line.set_size(0,0) - down_showt_battery_line.set_style_line_width(0,lv.PART.MAIN) - down_showt_battery_img.set_src("U:/static/charge_ing.png") - # watchface1_res_stat_charge_in_img.set_src("U:/static/charge_in.png") - else: - down_showt_battery_img.set_src("U:/static/vbat_0.png") - level = msg[1] - if level >= 99: - level = 100 - line_len = int(level*(20/100)) - if level <= 5: - level = 5 - - line_points = [ - {"x":0, "y":0}, - {"x":line_len, "y":0}, - ] - down_showt_battery_line.set_size(int(line_len),int(2)) - down_showt_battery_line.set_pos(int(103),int(11)) - down_showt_battery_line.set_points(line_points, 2) - down_showt_battery_line.set_style_line_width(10,lv.PART.MAIN) - - if line_len <= 3: - down_showt_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - down_showt_battery_line.set_style_line_color(lv.color_make(0xff,0xff,0xff),0) - pass - - def Close(self): - self.timer.stop() - - def done_bottom_to_top(self): - # print("done_bottom_to_top") - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_top_to_bottom(self): - pass - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -up_show_screen = lv.obj() -print("up_show_screen") -up_show_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -up_show_bg_img = lv.img(up_show_screen)#亮度 -up_show_bg_img.set_size(61, 61) -up_show_bg_img.set_pos(33, 40) -up_show_bg_img.set_src("U:/static/up_show_step.png") -up_show_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -up_show_bg_img_label = lv.label(up_show_screen) -up_show_bg_img_label.set_pos(0, 10) -up_show_bg_img_label.set_size(128, 20) -up_show_bg_img_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -up_show_bg_img_label.set_text("计步") -up_show_bg_img_label.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - -up_show_bg_img_label1 = lv.label(up_show_screen) -up_show_bg_img_label1.set_pos(0, 108) -up_show_bg_img_label1.set_size(128, 20) -up_show_bg_img_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -up_show_bg_img_label1.set_text("0æ­¥") -up_show_bg_img_label1.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - - - - -class up_Screen(Screen):#上滑界面 - NAME = "up_screen" - - def __init__(self): - super().__init__() - self.rtc = RTC() - self.timer = osTimer() - self.meta = up_show_screen - - def initialization(self): - print("up_screen") - - step = EventMesh.publish("get_old_step_value") - self.__stepValue(None, step) - self.timer.start(1000,1,self.time_out) - - def time_out(self,*argc): - step = EventMesh.publish("get_old_step_value") - self.__stepValue(None, step) - pass - - - def __stepValue(self, event, msg): - if msg == None: - up_show_bg_img_label1.set_text("0æ­¥") - else: - up_show_bg_img_label1.set_text(str(msg)+"æ­¥") - - - def Close(self): - self.timer.stop() - - def done_bottom_to_top(self): - # print("done_bottom_to_top") - pass - - def done_top_to_bottom(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - -camera_popup_screen = None -camera_popup_label = None -camera_img_test = None -def camCapturecallback(result_list): - print("camCapturecallback",result_list) - if result_list[0] == 0:#保存成功 - file = str(result_list[1]) - tmp = file.split('/')[3] - tmp = tmp.split("_camera")[0] - time = int(tmp) - album_data = int(EventMesh.publish("get_camera_num")) - if album_data >= 1: - album_data=1 - print("album_data",album_data) - EventMesh.publish("set_camera_num",album_data+1) - EventMesh.publish("save_album_succ",1) - pass - pass -#gpio_CAM_PWDN = Pin(Pin.GPIO42, Pin.OUT, Pin.PULL_DISABLE, 0) -dec = camera.camCapture(0,240,320,1,128,128) -dec.callback(camCapturecallback) - -camera_full_popup_screen = None -camera_full_label_popup_screen = None -class cameraFullScreen(Screen):#相册已满 - # - NAME = "camera_full" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - - def initialization(self): - global camera_full_popup_screen ,camera_full_label_popup_screen - - - if camera_full_popup_screen == None: - camera_full_popup_screen = lv.obj() - print("camera_full") - camera_full_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - camera_full_label_popup_screen = lv.label(camera_full_popup_screen) - camera_full_label_popup_screen.set_pos(0, 50) - camera_full_label_popup_screen.set_size(128, 40) - camera_full_label_popup_screen.set_text("相册已满,删除即可拍照") - camera_full_label_popup_screen.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - camera_full_label_popup_screen.set_long_mode(lv.label.LONG.WRAP) - camera_full_label_popup_screen.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - self.meta = camera_full_popup_screen - - - def done_click(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - -delete_album_popup_screen = None -delete_album_label_popup_screen = None -class deletealbumScreen(Screen):#删除图片 - # - NAME = "delete_album" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - - - def initialization(self): - global delete_album_popup_screen ,delete_album_label_popup_screen - - - if delete_album_popup_screen == None: - delete_album_popup_screen = lv.obj() - print("delete_album_popup_screen") - delete_album_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - delete_album_label_popup_screen = lv.label(delete_album_popup_screen) - delete_album_label_popup_screen.set_pos(0, 50) - delete_album_label_popup_screen.set_size(128, 40) - delete_album_label_popup_screen.set_text("删除成功") - delete_album_label_popup_screen.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - delete_album_label_popup_screen.set_long_mode(lv.label.LONG.WRAP) - delete_album_label_popup_screen.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - self.meta = delete_album_popup_screen - - - def done_click(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass -import jrtc -class cameraScreen(Screen):#相机拍照二级界面 - # - NAME = "camera" - - def __init__(self): - super().__init__() - self.meta = None - self.preview1 = None - self.timer = osTimer() - self.timer2 = osTimer() - self.timer3 = osTimer() - self.camera_num = 0 - EventMesh.subscribe("save_album_succ",self.save_album_succ) - - def initialization(self): - global camera_popup_screen ,camera_popup_label,camera_img_test - # dec = camera.camCapture(0,240,320,1,128,128) - # dec.callback(camCapturecallback) - #gpio_CAM_PWDN.write(0) - state = dec.open() - dec.set_rotate(3) - - if camera_popup_screen == None: - camera_popup_screen = lv.obj() - print("camera_popup_screen") - camera_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - camera_img_test = lv.img(camera_popup_screen) - # img_test.set_src("U:/hang_up.png") - ret = dec.set_img(camera_img_test) - - camera_img_test.align(lv.ALIGN.CENTER, 0, 0) - camera_img_test.set_size(128,128) - - - camera_camera_btn = lv.img(camera_popup_screen) - camera_camera_btn.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_btn.set_pos(48, 90) - camera_camera_btn.set_size(30,30) - camera_camera_btn.set_src("U:/static/camera_btn.png") - # camera_camera_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_camera_album_btn = lv.img(camera_popup_screen) - camera_camera_album_btn.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_album_btn.set_pos(100, 10) - camera_camera_album_btn.set_size(20,20) - camera_camera_album_btn.set_src("U:/static/camera_album_btn.png") - # camera_camera_album_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_album_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_camera_return_btn = lv.img(camera_popup_screen) - camera_camera_return_btn.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_return_btn.set_pos(0, 10) - camera_camera_return_btn.set_size(18,18) - camera_camera_return_btn.set_src("U:/static/RED_RETURN_PNG.png") - # camera_camera_return_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_album_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_camera_return_btn_label = lv.label(camera_popup_screen) - camera_camera_return_btn_label.set_pos(0, 0) - camera_camera_return_btn_label.set_size(40, 40) - camera_camera_return_btn_label.set_text(" ") - camera_camera_return_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_return_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_return_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_camera_album_btn_label = lv.label(camera_popup_screen) - camera_camera_album_btn_label.set_pos(80, 0) - camera_camera_album_btn_label.set_size(48, 40) - camera_camera_album_btn_label.set_text(" ") - camera_camera_album_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_album_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_album_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_camera_btn_label = lv.label(camera_popup_screen) - camera_camera_btn_label.set_pos(40, 88) - camera_camera_btn_label.set_size(50, 40) - camera_camera_btn_label.set_text(" ") - camera_camera_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) - camera_camera_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_click(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_popup_label = lv.label(camera_popup_screen) - camera_popup_label.set_pos(0, 40) - camera_popup_label.set_size(128, 20) - camera_popup_label.set_text("保存成功") - camera_popup_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - camera_popup_label.set_long_mode(lv.label.LONG.WRAP) - camera_popup_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - camera_popup_label.add_flag(lv.obj.FLAG.HIDDEN) - - self.meta = camera_popup_screen - - - - album_data = EventMesh.publish("get_camera_num") - if int(album_data) >= 1:#相册已满 - # EventMesh.publish("load_screen", {"screen": "camera_full"}) - pass - if camera_popup_label != None: - camera_popup_label.add_flag(lv.obj.FLAG.HIDDEN) - self.timer.start(1*1000,1,self.fun) - - def save_album_succ(self,event,msg): - global camera_popup_label - if camera_popup_label != None: - if msg == 1: - camera_popup_label.clear_flag(lv.obj.FLAG.HIDDEN) - else: - camera_popup_label.add_flag(lv.obj.FLAG.HIDDEN) - - self.timer3.start(1*2000,0,self.save_suc_album)#延迟1s保存图片 - pass - - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - - def camera_click(self,e): - self.timer3.stop() - EventMesh.publish("save_album_succ",2) - album_data = EventMesh.publish("get_camera_num") - if album_data != None: - if int(album_data) >= 1:#相册已满 - EventMesh.publish("load_screen", {"screen": "camera_full"}) - return - self.timer2.start(1*1000,0,self.save_album)#延迟1s保存图片 - - def camera_album_click(self,e): - EventMesh.publish("load_screen", {"screen": "camera_album"}) - - def camera_return_click(self,e): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - self.timer.stop() - self.timer2.stop() - self.timer3.stop() - # dec.remove_img() - state = dec.close() - #gpio_CAM_PWDN.write(1) - print("close camera {}!!!!!!!".format(state)) - - def save_suc_album(self,*argc): - EventMesh.publish("save_album_succ",2) - # def done_click(self): - # self.timer2.start(1*1000,0,self.save_album)#延迟1s保存图片 - # pass - def save_album(self,*argc): - album_data = EventMesh.publish("get_camera_num") - if int(album_data) <= 1: - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - dec.start(128,128, "static/album/1_camera") - else: - EventMesh.publish("load_screen", {"screen": "camera_full"}) - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - -camera_album_popup_screen = None -camera_album_popup_label = None -camera_album_popup_img = None -imgbt_contanier = None -camera_album_popup_img1 = None -camera_album_popup_img2 = None -camera_album_popup_img3 = None -camera_album_popup_img4 = None -camera_album_popup_img5 = None -class cameraalbumScreen(Screen):#相册 - # - NAME = "camera_album" - - def __init__(self): - super().__init__() - self.meta = None - - def initialization(self): - global camera_album_popup_screen ,camera_album_popup_label,camera_album_popup_img1,camera_album_popup_img2,camera_album_popup_img3,camera_album_popup_img4,camera_album_popup_img5 - - if camera_album_popup_screen == None: - camera_album_popup_screen = lv.obj() - print("camera_album_popup_screen") - camera_album_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - camera_album_popup_label = lv.label(camera_album_popup_screen) - camera_album_popup_label.set_pos(0, 60) - camera_album_popup_label.set_size(128, 20) - camera_album_popup_label.set_text("还没有照片") - camera_album_popup_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - camera_album_popup_label.set_long_mode(lv.label.LONG.WRAP) - camera_album_popup_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - camera_album_popup_img1 = lv.img(camera_album_popup_screen) - camera_album_popup_img1.set_pos(0, 0) - camera_album_popup_img1.set_size(128, 128) - - # camera_album_popup_img1.add_flag(lv.obj.FLAG.HIDDEN) - # camera_album_popup_img1.add_flag(lv.obj.FLAG.CLICKABLE) - # # camera_album_popup_img1.set_zoom(256) - # camera_album_popup_img1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,0)), lv.EVENT.SHORT_CLICKED, None) - - camera_album_popup_img2 = lv.img(camera_album_popup_screen) - camera_album_popup_img2.set_pos(51, 100) - camera_album_popup_img2.set_size(25, 25) - camera_album_popup_img2.add_flag(lv.obj.FLAG.CLICKABLE) - camera_album_popup_img2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,0)), lv.EVENT.SHORT_CLICKED, None) - - camera_album_popup_img3 = lv.img(camera_album_popup_screen) - camera_album_popup_img3.set_pos(0, 10) - camera_album_popup_img3.set_size(18,18) - camera_album_popup_img3.add_flag(lv.obj.FLAG.CLICKABLE) - camera_album_popup_img3.set_src("U:/static/RED_RETURN_PNG.png") - camera_album_popup_img3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) - - self.meta = camera_album_popup_screen - read_album = 0 - read_album = EventMesh.publish("get_camera_num") - print("read_album",read_album) - if int(read_album) != 0: - camera_album_popup_img1.clear_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img1.set_src("U:/static/album/1_camera.jpg") #'U:/6_camera.jpeg'"U:/static/album/1_camera.jpg" - camera_album_popup_img2.clear_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img2.set_src("U:/static/album_delete.png") - camera_album_popup_label.add_flag(lv.obj.FLAG.HIDDEN) - else: - camera_album_popup_img1.add_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img2.add_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_label.clear_flag(lv.obj.FLAG.HIDDEN) - - - def click_album(self,e,i): - if i == 0: - check_img = ql_fs.path_exists("/usr/static/album/1_camera.jpg") - if check_img == True :#图片存在 - uos.remove("/usr/static/album/1_camera.jpg")#删除单张图片 - album_data = int(EventMesh.publish("get_camera_num")) - - EventMesh.publish("set_camera_num",album_data-1) - - EventMesh.publish("load_screen", {"screen": "delete_album"}) - return - - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - # read_album = {} - # read_album = EventMesh.publish("get_camera_num") - # if len(read_album) != 0 and i < len(read_album): - # sort_new = {} - # sort_new = sorted(read_album.keys()) - # key = sort_new[i] - # value = int(read_album[key]["timeSec"]) - # self.meta_info = value - # print(self.meta_info,i) - # EventMesh.publish("load_screen", {"screen": "album_preview","meta": self.meta_info})#点击进入相册预览大图显示 - # print(i) - pass - - def Close(self): - pass - - def done_click(self): - - pass - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - -album_preview_popup_screen = None -album_preview_popup_img = None -album_preview_popup_delet_con_label = None -album_preview_popup_delet_con_label = None -album_preview_popup_delet_label = None -class albumPreviewScreen(Screen):#点击预览 - # - NAME = "album_preview" - - def __init__(self): - super().__init__() - self.meta = None - - def initialization(self): - global album_preview_popup_screen ,album_preview_popup_delet_label,album_preview_popup_img,album_preview_popup_delet_can_label,album_preview_popup_delet_con_label - - if album_preview_popup_screen == None: - album_preview_popup_screen = lv.obj() - print("album_preview_popup_screen") - album_preview_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - album_preview_popup_img = lv.img(album_preview_popup_screen) - album_preview_popup_img.set_pos(0, 0) - album_preview_popup_img.set_size(120,120) - # album_preview_popup_img.set_zoom(400) - - album_preview_popup_delet_label = lv.label(album_preview_popup_screen) - album_preview_popup_delet_label.set_pos(0, 65) - album_preview_popup_delet_label.set_size(128, 20) - album_preview_popup_delet_label.set_text("是否删除") - album_preview_popup_delet_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - album_preview_popup_delet_label.set_long_mode(lv.label.LONG.WRAP) - album_preview_popup_delet_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - album_preview_popup_delet_con_label = lv.label(album_preview_popup_screen) - album_preview_popup_delet_con_label.set_pos(0, 95) - album_preview_popup_delet_con_label.set_size(64, 33) - album_preview_popup_delet_con_label.set_text("确定") - album_preview_popup_delet_con_label.add_flag(lv.obj.FLAG.CLICKABLE) - album_preview_popup_delet_con_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - album_preview_popup_delet_con_label.set_long_mode(lv.label.LONG.WRAP) - album_preview_popup_delet_con_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - album_preview_popup_delet_can_label = lv.label(album_preview_popup_screen) - album_preview_popup_delet_can_label.set_pos(64, 95) - album_preview_popup_delet_can_label.set_size(64, 33) - album_preview_popup_delet_can_label.set_text("取消") - album_preview_popup_delet_can_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - album_preview_popup_delet_can_label.set_long_mode(lv.label.LONG.WRAP) - album_preview_popup_delet_can_label.add_flag(lv.obj.FLAG.CLICKABLE) - album_preview_popup_delet_can_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - self.meta = album_preview_popup_screen - album_num_tmp = None - album_num_tmp = int(self.meta_info) - print(album_num_tmp) - album_preview_popup_delet_can_label.add_event_cb(lambda e:EventMesh.callback_wrapper(self.cancel_pop(e)),lv.EVENT.SHORT_CLICKED,None) - album_preview_popup_delet_con_label.add_event_cb(lambda e:EventMesh.callback_wrapper(self.confirm_pop(e)),lv.EVENT.SHORT_CLICKED,None) - - album_preview_popup_img.set_src("U:/static/album/%d_camera.jpg"%(album_num_tmp))#'U:/6_camera.jpeg' - - def cancel_pop(self,e):#取消删除 - EventMesh.publish("load_screen", {"screen": "main_menu"})#点击回到相册界面 - pass - - def confirm_pop(self,e):#确认删除 - # album_num = int(self.meta_info.split(':')[1]) - # album_num_tmp = None - # album_num_tmp = int(self.meta_info) - # print(album_num_tmp) - - # check_img = ql_fs.path_exists("/usr/static/album/%d_camera.jpg"%(album_num_tmp)) - # if check_img == True :#图片存在 - # uos.remove("/usr/static/album/%d_camera.jpg"%(album_num_tmp))#删除单张图片 - # read_album = {} - # read_album = EventMesh.publish("get_camera_num")#删除的同时把数据部分也清掉 - # print("img is exit1",read_album) - # if read_album != {}: - # key_tmp = album_num_tmp - # del read_album[key_tmp]#删除内容 - # EventMesh.publish("set_camera_num",read_album) - # print("img is exit2",read_album) - # pass - # else:#图片不存在 - # print("img is not exit") - # pass - EventMesh.publish("load_screen", {"screen": "camera_album"})#点击回到相册界面 - pass - - def Close(self): - pass - - def done_click(self): - pass - - def done_return(self): - - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - -voice_answer_screen = None -voice_answer_label = None -voice_answer_btn1 = None -voice_answer_btn_label1 = None -class VdieoVoiceScreen(Screen):#语音接听画面 - # - NAME = "voice_answer" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - self.count = 0 - - def initialization(self): - global voice_answer_screen ,video_answer_btn_label1 - self.count = 0 - if voice_answer_screen == None: - voice_answer_screen = lv.obj() - print("voice_answer_screen") - voice_answer_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_answer_btn_label1 = lv.label(voice_answer_screen) - video_answer_btn_label1.set_pos(0, 50) - video_answer_btn_label1.set_text("正在接听中...") - video_answer_btn_label1.set_size(128, 40) - video_answer_btn_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_answer_btn_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = voice_answer_screen - EventMesh.publish("set_UI_high_priority", 1) - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - call_state = jrtc.get_state() - if call_state == 5: - self.timer.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "voiceing"}) - return - if call_state == 0: - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("load_screen", {"screen": "main_menu"}) - return - # print("voiceing_answer call_state",call_state) - self.count+=1 - if self.count >= 20: - - self.timer.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_jrtc_event") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - return - - EventMesh.publish("system_sleep_rest")#防止黑屏 - - - def Close(self): - self.timer.stop() - - def done_return(self): - pass - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - -camera_voice_answer_second_label = None -camera_voice_answer_screen = None -camera_voice_answer_label = None -camera_voice_answer_btn = None -camera_voice_answer_btn_label =None - -class VoiceShowScreen(Screen):#正在语音通话中 - # - NAME = "voiceing" - - def __init__(self): - super().__init__() - self.meta = None - self.preview1 = None - self.timer = osTimer() - self.statu_open = -1 - self.show_label = 0 - self.second_count = 0 - self.time_out = 0 - self.meta_type = "popup" - EventMesh.subscribe("set_dev_end_video",self.set_dev_end_video) - EventMesh.subscribe("get_dev_end_video",self.get_dev_end_video) - - - def initialization(self): - global camera_voice_answer_screen,camera_voice_answer_second_label ,camera_voice_answer_btn_label,camera_voice_answer_label,camera_voice_answer_btn - if camera_voice_answer_screen == None: - camera_voice_answer_screen = lv.obj() - print("camera_voice_answer_screen") - camera_voice_answer_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - camera_voice_answer_label = lv.label(camera_voice_answer_screen) - camera_voice_answer_label.set_pos(0, 20) - camera_voice_answer_label.set_text("正在通话中...") - camera_voice_answer_label.set_size(128, 40) - camera_voice_answer_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - camera_voice_answer_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - camera_voice_answer_second_label = lv.label(camera_voice_answer_screen) - camera_voice_answer_second_label.set_pos(0, 50) - camera_voice_answer_second_label.set_text(" ") - camera_voice_answer_second_label.set_size(128, 40) - camera_voice_answer_second_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - camera_voice_answer_second_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - camera_voice_answer_btn = lv.img(camera_voice_answer_screen) - camera_voice_answer_btn.add_flag(lv.obj.FLAG.CLICKABLE) - camera_voice_answer_btn.set_pos(48, 90) - camera_voice_answer_btn.set_size(32,32) - camera_voice_answer_btn.set_src("U:/static/hang_up.png") - - camera_voice_answer_btn_label = lv.label(camera_voice_answer_screen) - camera_voice_answer_btn_label.set_pos(18, 50) - camera_voice_answer_btn_label.set_text(" ") - camera_voice_answer_btn_label.set_size(90, 78) - camera_voice_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) - - camera_voice_answer_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) - - camera_voice_answer_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) - - self.meta = camera_voice_answer_screen - call_state = jrtc.get_state() - - self.second_count = 0 - self.statu_open = 0 - - self.time_out = 0 - - EventMesh.publish("set_UI_high_priority", 1) - if call_state == 5:#接通 - camera_voice_answer_label.set_text("正在通话中...") - camera_voice_answer_label.set_pos(0, 20) - camera_voice_answer_second_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_voice_answer_second_label.set_text("00:00") - camera_voice_answer_second_label.set_pos(0, 50) - # camera_voice_answer_btn.clear_flag(lv.obj.FLAG.HIDDEN) - # camera_voice_answer_btn_label.clear_flag(lv.obj.FLAG.HIDDEN) - else: - camera_voice_answer_label.set_text("正在接听中...") - camera_voice_answer_label.set_pos(0, 50) - camera_voice_answer_second_label.add_flag(lv.obj.FLAG.HIDDEN) - # camera_voice_answer_btn.add_flag(lv.obj.FLAG.HIDDEN) - # camera_voice_answer_btn_label.add_flag(lv.obj.FLAG.HIDDEN) - self.timer.start(1*1000,1,self.fun) - - - def close_cb(self,e): - self.statu_open = 1 - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - EventMesh.publish("set_UI_high_priority", 0) - - EventMesh.publish("close_jrtc_event") - EventMesh.publish("return_prev_screen") - - def get_dev_end_video(self,event,msg):#手表挂断app - return self.statu_open - - def set_dev_end_video(self,event,msg):#手表挂断app - self.statu_open = msg - - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - call_state = jrtc.get_state() - if call_state == 5: - camera_voice_answer_label.set_text("正在通话中...") - camera_voice_answer_label.set_pos(0, 20) - # camera_video_answer_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_voice_answer_second_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_voice_answer_second_label.set_pos(0, 50) - camera_voice_answer_btn.clear_flag(lv.obj.FLAG.HIDDEN) - camera_voice_answer_btn_label.clear_flag(lv.obj.FLAG.HIDDEN) - - self.second_count+=1 - self.show_time() - - if call_state != 5: - self.time_out+=1 - if self.time_out >= 60 or (call_state == 0 and self.statu_open == 0 and self.time_out >= 5): - self.time_out = 0 - self.timer.stop() - - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_jrtc_event") - EventMesh.publish("return_prev_screen") - - - - - - def show_time(self): - - if self.second_count >= 99*60: - total_hour = self.second_count//3600#小时 - total_min = (self.second_count%3600)//60#分钟 - total_sec = (self.second_count%3600)%60#秒 - camera_voice_answer_second_label.set_text("{}:{}:{}".format("%02d"%(total_hour),"%02d"%(total_min),"%02d"%(total_sec))) - - else: - total_min = self.second_count//60 - total_sec = self.second_count%60 - camera_voice_answer_second_label.set_text("{}:{}".format("%02d"%(total_min),"%02d"%(total_sec))) - - def Close(self): - self.timer.stop() - - def done_return(self): - pass - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - - - -video_answer_screen = None -video_answer_label = None -video_answer_btn1 = None -video_answer_btn_label1 = None -class cameraVdieoAnswerScreen(Screen):#视频通话接听画面 - # - NAME = "vedio_answer" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - self.count = 0 - - def initialization(self): - global video_answer_screen ,video_answer_btn_label1 - self.count = 0 - if video_answer_screen == None: - video_answer_screen = lv.obj() - print("video_answer_screen") - video_answer_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_answer_btn_label1 = lv.label(video_answer_screen) - video_answer_btn_label1.set_pos(0, 50) - video_answer_btn_label1.set_text("正在接听中...") - video_answer_btn_label1.set_size(128, 40) - video_answer_btn_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_answer_btn_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - self.meta = video_answer_screen - EventMesh.publish("set_UI_high_priority", 1) - self.timer.start(1*1000,1,self.fun) - - def fun(self,*argc): - call_state = jrtc.get_state() - if call_state == 5: - self.timer.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "vedioing"}) - return - if call_state == 0: - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("return_prev_screen") - return - # print("vedio_answer call_state",call_state) - self.count+=1 - if self.count >= 20: - - self.timer.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_jrtc_event") - EventMesh.publish("return_prev_screen") - - return - - EventMesh.publish("system_sleep_rest")#防止黑屏 - - - def Close(self): - self.timer.stop() - - def done_return(self): - pass - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - -camera_video_answer_screen = None -camera_video_answer_second_label = None -camera_video_answer_label = None -camera_video_answer_btn = None -camera_video_answer_btn_label = None -video_img_test = None -def jrtc_cb(close_sta): - print("jrtc callback:", close_sta) - if close_sta == 0 or close_sta == 1: - jrtc.close(0) - -jrtc.set_callback(jrtc_cb) -class VedioShowScreen(Screen):#正在视频通话中 - # - NAME = "vedioing" - - def __init__(self): - super().__init__() - self.meta = None - self.preview1 = None - self.timer = osTimer() - self.statu_open = -1 - self.show_label = 0 - self.second_count = 0 - self.time_out = 0 - self.jrtc_init_state = 0 - self.meta_type = "popup" - EventMesh.subscribe("open_vedio_infor",self.open_vedio_infor) - EventMesh.subscribe("close_jrtc_event",self.close_jrtc_event) - EventMesh.subscribe("clear_jrtc_init_state",self.clear_jrtc_init_state)#清楚jrtcinit标志防止重复init - EventMesh.subscribe("get_jrtc_init_state",self.get_jrtc_init_state)#获取jrtcinit标志防止重复init - - def open_vedio_infor(self,event,msg): - if self.jrtc_init_state == 0: - self.jrtc_init_state = 1 - EventMesh.publish("set_dev_end_video",0) - call_id = EventMesh.publish("get_vedio_call_id")#对方的账号 - meet_id = EventMesh.publish("get_vedio_meet_id")#共有的会议id - call_type = EventMesh.publish("get_vedio_call_type")#呼叫类型 - tokens_data = EventMesh.publish("get_vedio_tokens_data")#tookens数据#云米平台不需要tokens - - # jrtc.init() - # jrtc.config_server("119.3.54.56:1050") - # jrtc.config("e99697f86096a74dbf635096", "us145a", "1234567890abcdef", "") - # jrtc.open("us144a", "",[15,129,128,128],[15,120,240,320]) - # jrtc.set_cam_angle(jrtc.CAM_ROTATE_180) - - # data = ['6951832', '876226002021444', '1', '01lqlyqzQ4Gozdz8OJv1Mij2Y3PBq2y3+rtIA26Ge+m2QHTc/Vk=gufkGNMBiYhPjbq1tLCwtLKysLKws7a2tg=='] - jrtc.init() - tokens = str(tokens_data) - appkey = "efe9f8800a39d96244234097"#小见 - uid_key = "25v9C652123QL3N8" - - # appkey = "249e7d505516af0a7ed44097" - # uid_key = "qQI4gkB9FxH8J2cb" - imei = EventMesh.publish(constants.EVENT.GET_IMEI) - oneself_id = str(imei)#自己的账号默认是imei号 - jrtc.config(appkey,oneself_id,uid_key,tokens)#只初始化一次发起通话 - uid = str(call_id) - ticket = str(meet_id) - - print("uid ",uid,ticket,oneself_id) - #jrtc.set_rotate(0) - if call_type == 0:#语音通话不需要设置参数 - jrtc.open(uid,ticket,[],[]) - else: - jrtc.open(uid,ticket,[15,129,128,128],[15,120,240,320]) - jrtc.set_cam_angle(jrtc.CAM_ROTATE_180) - - - def close_jrtc_event(self,event,msg): - # print("close_jrtc_event") - jrtc.close(0) - pass - def clear_jrtc_init_state(self,event,msg): - self.jrtc_init_state = 0 - pass - - def get_jrtc_init_state(self,event,msg): - return self.jrtc_init_state - pass - - def initialization(self): - - global camera_video_answer_screen,video_img_test,camera_video_answer_btn_label,camera_video_answer_label,camera_video_answer_second_label,camera_video_answer_btn,vcamera_video_answer_btn_label - if camera_video_answer_screen == None: - camera_video_answer_screen = lv.obj() - print("camera_video_answer_screen") - camera_video_answer_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_img_test = lv.img(camera_video_answer_screen) - ret = jrtc.set_img(video_img_test) - video_img_test.align(lv.ALIGN.CENTER, 0, 0) - video_img_test.set_size(128,128) - - - camera_video_answer_label = lv.label(camera_video_answer_screen) - camera_video_answer_label.set_pos(0, 20) - camera_video_answer_label.set_text("正在通话中...") - camera_video_answer_label.set_size(128, 40) - camera_video_answer_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - camera_video_answer_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - camera_video_answer_second_label = lv.label(camera_video_answer_screen) - camera_video_answer_second_label.set_pos(0, 50) - camera_video_answer_second_label.set_text(" ") - camera_video_answer_second_label.set_size(128, 40) - camera_video_answer_second_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - camera_video_answer_second_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - camera_video_answer_btn = lv.img(camera_video_answer_screen) - camera_video_answer_btn.add_flag(lv.obj.FLAG.CLICKABLE) - camera_video_answer_btn.set_pos(48, 90) - camera_video_answer_btn.set_size(32,32) - camera_video_answer_btn.set_src("U:/static/hang_up.png") - - - camera_video_answer_btn_label = lv.label(camera_video_answer_screen) - camera_video_answer_btn_label.set_pos(18, 50) - camera_video_answer_btn_label.set_text(" ") - camera_video_answer_btn_label.set_size(90, 78) - camera_video_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) - - - camera_video_answer_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) - camera_video_answer_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) - self.meta = camera_video_answer_screen - - call_state = jrtc.get_state() - self.second_count = 0 - self.statu_open = 0 - self.time_out = 0 - - EventMesh.publish("set_UI_high_priority", 1) - if call_state == 5:#接通 - camera_video_answer_label.set_text("正在通话中...") - camera_video_answer_label.set_pos(0, 20) - # camera_video_answer_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_second_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_second_label.set_text("00:00") - camera_video_answer_second_label.set_pos(0, 50) - # camera_video_answer_btn.clear_flag(lv.obj.FLAG.HIDDEN) - # camera_video_answer_btn_label.clear_flag(lv.obj.FLAG.HIDDEN) - video_img_test.clear_flag(lv.obj.FLAG.HIDDEN) - else: - camera_video_answer_label.set_text("正在接听中...") - camera_video_answer_label.set_pos(0, 50) - # camera_video_answer_label.add_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_second_label.add_flag(lv.obj.FLAG.HIDDEN) - # camera_video_answer_btn.add_flag(lv.obj.FLAG.HIDDEN) - # camera_video_answer_btn_label.add_flag(lv.obj.FLAG.HIDDEN) - video_img_test.add_flag(lv.obj.FLAG.HIDDEN) - self.timer.start(1*1000,1,self.fun) - - - def close_cb(self,e): - self.statu_open = 1 - EventMesh.publish("set_dev_end_video",1) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_jrtc_event") - EventMesh.publish("return_prev_screen") - - - def fun(self,*argc): - EventMesh.publish("system_sleep_rest")#防止黑屏 - call_state = jrtc.get_state() - if call_state == 5: - camera_video_answer_label.set_text("正在通话中...") - camera_video_answer_label.set_pos(0, 20) - # camera_video_answer_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_second_label.clear_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_btn.clear_flag(lv.obj.FLAG.HIDDEN) - camera_video_answer_btn_label.clear_flag(lv.obj.FLAG.HIDDEN) - - video_img_test.clear_flag(lv.obj.FLAG.HIDDEN) - self.second_count+=1 - self.show_time() - # print("video call_state",call_state) - if call_state != 5: - self.time_out+=1 - if self.time_out >= 60 or (call_state == 0 and self.time_out >= 2 and self.statu_open != 1): - self.time_out = 0 - self.timer.stop() - # print("video call_state",call_state) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("close_jrtc_event") - EventMesh.publish("return_prev_screen") - - - def show_time(self): - - if self.second_count >= 99*60: - total_hour = self.second_count//3600#小时 - total_min = (self.second_count%3600)//60#分钟 - total_sec = (self.second_count%3600)%60#秒 - camera_video_answer_second_label.set_text("{}:{}:{}".format("%02d"%(total_hour),"%02d"%(total_min),"%02d"%(total_sec))) - - else: - total_min = self.second_count//60 - total_sec = self.second_count%60 - camera_video_answer_second_label.set_text("{}:{}".format("%02d"%(total_min),"%02d"%(total_sec))) - # camera_video_answer_second_label.set_text("%02d"%(total_min),"%02d"%(total_sec)) - - def Close(self): - self.timer.stop() - - def done_return(self): - pass - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - def btn1_release(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - def btn8_press(self): - # EventMesh.publish("load_screen", {"screen": "main_menu"}) - pass - - - - - -voice_call_screen = None -voice_call_img = None -voice_call_name_label = None -voice_call_answer = None -voice_call_hangup = None -voice_call_label = None -# CALL_LOG_MAX = 50 -class voiceInCallScreen(Screen):#语音通话打入中 - NAME = "voice_incall" - - def __init__(self): - super().__init__() - self.CALL_LOG_MAX = CALL_LOG_MAX - self.read_data = {} - self.meta_type = "popup" - self.aud = audio.Audio(0) - self.call_timer = osTimer() - self.call_timer1 = osTimer() - self.name = None - self.phonebook = {} - self.pro_state = 0 - self.meta = None - self.timeout = 0 - - def initialization(self): - global voice_call_screen,voice_call_img,voice_call_name_label,voice_call_answer,voice_call_hangup,voice_call_label - if voice_call_screen == None : - # -------------------------------------------vedio_call screen---------------------------------------------------------- - voice_call_screen = lv.obj() - print("voice_call_screen") - voice_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_call_label = lv.label(voice_call_screen) - voice_call_label.set_pos(0, 10) - voice_call_label.set_text("是否接听语音通话") - voice_call_label.set_size(128, 40) - voice_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - voice_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - # vedio_call_img = lv.img(voice_call_screen) - # vedio_call_img.set_pos(48, 10) - # vedio_call_img.set_size(32, 32) - # vedio_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") - # vedio_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_call_name_label = lv.label(voice_call_screen) - voice_call_name_label.set_pos(0, 50) - voice_call_name_label.set_text(" ") - voice_call_name_label.set_size(128, 40) - voice_call_name_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - voice_call_name_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_call_answer = lv.img(voice_call_screen) - voice_call_answer.set_size(32, 32) - voice_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) - voice_call_answer.set_pos(84, 85) - voice_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - voice_call_answer.set_src("U:/static/answer.png") - - voice_call_hangup = lv.img(voice_call_screen) - voice_call_hangup.set_size(32, 32) - voice_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) - voice_call_hangup.set_pos(11, 85) - voice_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - voice_call_hangup.set_src("U:/static/hang_up.png") - - voice_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)), - lv.EVENT.SHORT_CLICKED, None) - voice_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = voice_call_screen - - - EventMesh.publish("set_UI_high_priority", 1) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - - voice_call_name_label.set_text(call_id) - - - def post_processor_after_initialization(self): - global voice_call_screen,voice_call_img,voice_call_name_label,voice_call_answer,voice_call_hangup - self.call_timer.start(6000, 1, self.call_timer_cb) - self.timeout = 0 - self.call_timer1.start(1*1000, 1, self.get_video_state) - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def call_timer_cb(self,e): - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def get_video_state(self,e): - call_state = jrtc.get_state() - # print("vedio_incall",call_state) - self.timeout+=1 - if self.timeout >= 1*60: - self.timeout = 0 - self.call_timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("return_prev_screen") - - def answer(self,e): - self.call_timer.stop() - self.aud.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("clear_jrtc_init_state") - EventMesh.publish("open_vedio_infor") - EventMesh.publish("load_screen", {"screen": "voiceing"}) - - def Close(self): - self.call_timer.stop() - self.call_timer1.stop() - self.aud.stop() - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - pass - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - pass - - def done_left_to_right(self): - pass - - def done_right_to_left(self): - pass - - def done_bottom_to_top(self): - pass - - def done_top_to_bottom(self): - pass - - def done_return(self): - pass - - - -vedio_call_screen = None -vedio_call_img = None -vedio_call_name_label = None -vedio_call_answer = None -vedio_call_hangup = None -vedio_call_label = None -# CALL_LOG_MAX = 50 -class vedioCallingCallScreen(Screen):#视频通话打入中 - NAME = "vedio_incall" - - def __init__(self): - super().__init__() - self.CALL_LOG_MAX = CALL_LOG_MAX - self.read_data = {} - self.meta_type = "popup" - self.aud = audio.Audio(0) - self.call_timer = osTimer() - self.call_timer1 = osTimer() - self.name = None - self.phonebook = {} - self.pro_state = 0 - self.meta = None - self.timeout = 0 - EventMesh.subscribe("test_answer",self.test_answer) - - def initialization(self): - global vedio_call_screen,vedio_call_img,vedio_call_name_label,vedio_call_answer,vedio_call_hangup,vedio_call_label - if vedio_call_screen == None : - # -------------------------------------------vedio_call screen---------------------------------------------------------- - vedio_call_screen = lv.obj() - print("vedio_call_screen") - vedio_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - vedio_call_label = lv.label(vedio_call_screen) - vedio_call_label.set_pos(0, 10) - vedio_call_label.set_text("是否接听视频通话") - vedio_call_label.set_size(128, 40) - vedio_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - vedio_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - # vedio_call_img = lv.img(vedio_call_screen) - # vedio_call_img.set_pos(48, 10) - # vedio_call_img.set_size(32, 32) - # vedio_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") - # vedio_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - vedio_call_name_label = lv.label(vedio_call_screen) - vedio_call_name_label.set_pos(0, 50) - vedio_call_name_label.set_text(" ") - vedio_call_name_label.set_size(128, 40) - vedio_call_name_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - vedio_call_name_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - vedio_call_answer = lv.img(vedio_call_screen) - vedio_call_answer.set_size(32, 32) - vedio_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) - vedio_call_answer.set_pos(84, 85) - vedio_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - vedio_call_answer.set_src("U:/static/answer.png") - - vedio_call_hangup = lv.img(vedio_call_screen) - vedio_call_hangup.set_size(32, 32) - vedio_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) - vedio_call_hangup.set_pos(11, 85) - vedio_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - vedio_call_hangup.set_src("U:/static/hang_up.png") - - vedio_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)), - lv.EVENT.SHORT_CLICKED, None) - vedio_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - self.meta = vedio_call_screen - - vedio_call_label.set_text("是否接听视频通话") - - EventMesh.publish("set_UI_high_priority", 1) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - - vedio_call_name_label.set_text(call_id) - - - def post_processor_after_initialization(self): - global vedio_call_screen,vedio_call_img,vedio_call_name_label,vedio_call_answer,vedio_call_hangup - self.call_timer.start(6000, 1, self.call_timer_cb) - self.timeout = 0 - self.call_timer1.start(1*1000, 1, self.get_video_state) - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def call_timer_cb(self,e): - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 - - def get_video_state(self,e): - call_state = jrtc.get_state() - # print("vedio_incall",call_state) - self.timeout+=1 - if self.timeout >= 1*60: - self.timeout = 0 - self.call_timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("return_prev_screen") - - def answer(self,e): - self.call_timer.stop() - self.aud.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("clear_jrtc_init_state") - EventMesh.publish("open_vedio_infor") - EventMesh.publish("load_screen", {"screen": "vedioing"}) - - def test_answer(self,event,msg): - self.call_timer.stop() - self.aud.stop() - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("clear_jrtc_init_state") - EventMesh.publish("open_vedio_infor") - EventMesh.publish("load_screen", {"screen": "vedioing"}) - - def Close(self): - self.call_timer.stop() - self.call_timer1.stop() - self.aud.stop() - - def hangup(self,e): - EventMesh.publish("set_UI_high_priority", 0) - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - - EventMesh.publish("return_prev_screen") - - def btn1_release(self): - pass - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - pass - - def done_left_to_right(self): - pass - - def done_right_to_left(self): - pass - - def done_bottom_to_top(self): - pass - - def done_top_to_bottom(self): - pass - - def done_return(self): - pass - - - - - -video_outcall_screen = None -video_outcall_img = None -video_outcall_name = None -video_outcall_hangup_imgbtn = None -video_outcall_call = None -video_outcall_img_test = None -video_outcall_hangup_imgbtnlabel = None -class videoOutCallScreen(Screen):#正在拨号中...未打出 - NAME = "video_outcall" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer1 = osTimer() - self.time_count = 0 - self.second_count = 0 - self.answer = 0 - - - def initialization(self): - EventMesh.publish("set_UI_high_priority", 1) - self.time_count = 0 - global video_outcall_screen,video_outcall_img,video_outcall_hangup_imgbtnlabel,video_outcall_img_test,video_outcall_name ,video_outcall_call,video_outcall_hangup_imgbtn - if video_outcall_screen == None: - video_outcall_screen = lv.obj() - print("video_outcall_screen") - video_outcall_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_outcall_img_test = lv.img(video_outcall_screen) - ret = jrtc.set_img(video_outcall_img_test) - video_outcall_img_test.align(lv.ALIGN.CENTER, 0, 0) - video_outcall_img_test.set_size(128,128) - video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) - - video_outcall_name = lv.label(video_outcall_screen) - video_outcall_name.set_pos(0, 20) - video_outcall_name.set_size(LCD_X, 20) - video_outcall_name.set_text(" ") - video_outcall_name.set_long_mode(lv.label.LONG.DOT) - video_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_outcall_call = lv.label(video_outcall_screen) - video_outcall_call.set_pos(0, 50) - video_outcall_call.set_size(LCD_X, 40) - video_outcall_call.set_text("正在等待对方接听中...") - video_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_outcall_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_outcall_hangup_imgbtn = lv.img(video_outcall_screen) - video_outcall_hangup_imgbtn.set_size(32, 32) - video_outcall_hangup_imgbtn.set_src("U:/static/hang_up.png") - video_outcall_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - video_outcall_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - video_outcall_hangup_imgbtn.set_pos(48, 90) - - video_outcall_hangup_imgbtnlabel = lv.label(video_outcall_screen) - video_outcall_hangup_imgbtnlabel.set_pos(18, 50) - video_outcall_hangup_imgbtnlabel.set_text(" ") - video_outcall_hangup_imgbtnlabel.set_size(90, 78) - video_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) - - video_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - - video_outcall_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - - - - self.meta = video_outcall_screen - if video_outcall_name != None: - video_outcall_name.set_text(self.meta_info)#名称 - - self.time_count = 0 - self.second_count = 0 - self.answer = 0 - EventMesh.publish("set_UI_high_priority", 1) - call_state = jrtc.get_state() - # print("video_outcall",call_state) - if call_state == 5: - video_outcall_img_test.clear_flag(lv.obj.FLAG.HIDDEN) - video_outcall_name.set_text("正在通话中...")# - video_outcall_name.set_pos(0, 20) - else: - video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) - video_outcall_call.set_text("正在等待对方接听中...") - video_outcall_call.set_pos(0, 50) - video_outcall_name.set_text(self.meta_info)#名称 - video_outcall_name.set_pos(0, 20) - - self.timer1.start(1*1000,1,self.fun_cb) - - def post_processor_after_initialization(self): - pass - - def hangup(self,e): - self.answer = 1 - self.timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "videolist"}) - - pass - def fun_cb(self,*argc): - call_state = jrtc.get_state() - print("video_outcall",call_state) - EventMesh.publish("system_sleep_rest")#防止黑屏 - if call_state == 5: - video_outcall_img_test.clear_flag(lv.obj.FLAG.HIDDEN) - video_outcall_name.set_text("正在通话中...")# - video_outcall_name.set_pos(0, 20) - video_outcall_call.set_pos(0, 50) - self.second_count += 1 - self.show_time() - - if call_state != 5:#未接通 1分钟未接通挂断或者 接通后app 网络不好也主动手表挂断 - self.time_count+=1 - if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 2 and self.answer != 1): - self.time_count = 0 - self.timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "videolist"}) - - def show_time(self): - - if self.second_count >= 99*60: - total_hour = self.second_count//3600#小时 - total_min = (self.second_count%3600)//60#分钟 - total_sec = (self.second_count%3600)%60#秒 - video_outcall_call.set_text("{}:{}:{}".format("%02d"%(total_hour),"%02d"%(total_min),"%02d"%(total_sec))) - - else: - total_min = self.second_count//60 - total_sec = self.second_count%60 - video_outcall_call.set_text("{}:{}".format("%02d"%(total_min),"%02d"%(total_sec))) - - def Close(self): - self.timer1.stop() - - def done_return(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - pass - - -voice_outcall_screen = None -voice_outcall_img = None -voice_outcall_name = None -voice_outcall_hangup_imgbtn = None -voice_outcall_call = None -voice_outcall_img_test = None -voice_outcall_hangup_imgbtnlabel = None -class voiceOutCallScreen(Screen):#等待对方接接听中 - NAME = "voice_outcall" - - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.timer1 = osTimer() - self.time_count = 0 - self.second_count = 0 - self.answer = 0 - - - def initialization(self): - EventMesh.publish("set_UI_high_priority", 1) - self.time_count = 0 - global voice_outcall_screen,voice_outcall_img,voice_outcall_hangup_imgbtnlabel,voice_outcall_name ,voice_outcall_call,voice_outcall_hangup_imgbtn - if voice_outcall_screen == None: - voice_outcall_screen = lv.obj() - print("voice_outcall_screen") - voice_outcall_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_outcall_name = lv.label(voice_outcall_screen) - voice_outcall_name.set_pos(0, 20) - voice_outcall_name.set_size(LCD_X, 20) - voice_outcall_name.set_text(" ") - voice_outcall_name.set_long_mode(lv.label.LONG.DOT) - voice_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - voice_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_outcall_call = lv.label(voice_outcall_screen) - voice_outcall_call.set_pos(0, 50) - voice_outcall_call.set_size(LCD_X, 40) - voice_outcall_call.set_text("正在等待对方接听中...") - voice_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - voice_outcall_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - voice_outcall_hangup_imgbtn = lv.img(voice_outcall_screen) - voice_outcall_hangup_imgbtn.set_size(32, 32) - voice_outcall_hangup_imgbtn.set_src("U:/static/hang_up.png") - voice_outcall_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) - voice_outcall_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - voice_outcall_hangup_imgbtn.set_pos(48, 90) - - voice_outcall_hangup_imgbtnlabel = lv.label(voice_outcall_screen) - voice_outcall_hangup_imgbtnlabel.set_pos(18, 50) - voice_outcall_hangup_imgbtnlabel.set_text(" ") - voice_outcall_hangup_imgbtnlabel.set_size(90, 78) - voice_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) - - voice_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - - voice_outcall_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), - lv.EVENT.SHORT_CLICKED, None) - - - - self.meta = voice_outcall_screen - if voice_outcall_name != None: - voice_outcall_name.set_text(self.meta_info)#名称 - - self.time_count = 0 - self.second_count = 0 - self.answer = 0 - EventMesh.publish("set_UI_high_priority", 1) - call_state = jrtc.get_state() - # print("video_outcall",call_state) - if call_state == 5: - # video_outcall_img_test.clear_flag(lv.obj.FLAG.HIDDEN) - voice_outcall_name.set_text("正在通话中...")# - voice_outcall_name.set_pos(0, 20) - else: - # video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) - voice_outcall_call.set_text("正在等待对方接听中...") - voice_outcall_call.set_pos(0, 50) - voice_outcall_name.set_text(self.meta_info)#名称 - voice_outcall_name.set_pos(0, 20) - - self.timer1.start(1*1000,1,self.fun_cb) - - def post_processor_after_initialization(self): - pass - - def hangup(self,e): - self.answer = 1 - self.timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "videolist"}) - - pass - def fun_cb(self,*argc): - call_state = jrtc.get_state() - print("voice_outcall",call_state) - EventMesh.publish("system_sleep_rest")#防止黑屏 - if call_state == 5: - voice_outcall_name.set_text("正在通话中...")# - voice_outcall_name.set_pos(0, 20) - voice_outcall_call.set_pos(0, 50) - self.second_count += 1 - self.show_time() - - if call_state != 5: - self.time_count+=1 - if self.time_count >= 1*60 or (call_state == 0 and self.time_count >= 2 and self.answer != 1): - self.time_count = 0 - self.timer1.stop() - call_id = str(EventMesh.publish("get_vedio_call_id"))# - meet_id = str(EventMesh.publish("get_vedio_meet_id"))# - call_type = int(EventMesh.publish("get_vedio_call_type"))# - EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - # EventMesh.publish(constants.PROTOCOL.RCALLING_SEND,[call_id,meet_id,call_type]) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("load_screen", {"screen": "videolist"}) - - def show_time(self): - - if self.second_count >= 99*60: - total_hour = self.second_count//3600#小时 - total_min = (self.second_count%3600)//60#分钟 - total_sec = (self.second_count%3600)%60#秒 - voice_outcall_call.set_text("{}:{}:{}".format("%02d"%(total_hour),"%02d"%(total_min),"%02d"%(total_sec))) - - else: - total_min = self.second_count//60 - total_sec = self.second_count%60 - voice_outcall_call.set_text("{}:{}".format("%02d"%(total_min),"%02d"%(total_sec))) - - def Close(self): - self.timer1.stop() - - def done_return(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - pass - #EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - pass - - - - -videolist_screen = None -videolist_cont = None -videolist_top_title = None -videolist_none_label = None -videolist_screen_list_screen = None -class videolistScreen(Screen): - NAME = "videolist" - - def __init__(self): - super().__init__() - # -------------------------------------------popup_menu screen---------------------------------------------------------- - self.meta = None - self.videobook = {} - self.count = 0 - self.phone_num_count = 0 - self.phone_num = {} - self.name = [] - self.check_json = 0 - self.timer = osTimer() - self.videolist_detail_list = None - EventMesh.subscribe("video_updata_list_show", self.video_updata_list_show) - self.MXA_phone_num = 50 #最大显示号码个数 - self.videolist_detail_listt_dict = [] - self.calling_btn = [] - self.is_sliding = 0 - - def post_processor_before_initialization(self): - data = EventMesh.publish("get_videobook_list") - if data != None: - self.check_json = data[0] - self.videobook = data[1] - self.count = 0 - - def initialization(self): - self.is_sliding = 0 - global videolist_screen,videolist_cont,videolist_top_title,videolist_none_label,videolist_screen_list_screen - if videolist_screen == None: - videolist_screen = lv.obj() - print("videolist_screen") - videolist_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - videolist_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - videolist_screen_list_screen = lv.obj(videolist_screen) - videolist_screen_list_screen.set_pos(0, 30) - videolist_screen_list_screen.set_size(LCD_X, LCD_Y-30) - videolist_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - videolist_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - - videolist_top_title = lv.label(videolist_screen) - videolist_top_title.set_pos(0, 5) - videolist_top_title.set_size(LCD_X, 20) - videolist_top_title.set_text("视频通话账号") - videolist_top_title.set_long_mode(lv.label.LONG.WRAP) - videolist_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - videolist_top_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - - videolist_none_label = lv.label(videolist_screen) - videolist_none_label.set_pos(0, 60) - videolist_none_label.set_size(LCD_X, 60) - videolist_none_label.set_text("无SIM卡或未添加账号") - videolist_none_label.set_long_mode(lv.label.LONG.WRAP) - videolist_none_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - videolist_none_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.videolist_detail_list = lv.obj(videolist_screen_list_screen) - self.videolist_detail_list.set_pos(0, 0) - self.videolist_detail_list.set_size(LCD_X, LCD_Y-30+1) - self.videolist_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - self.videolist_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - for i in range(self.MXA_phone_num): - contact_btn = lv.btn(self.videolist_detail_list) - contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), - lv.EVENT.SHORT_CLICKED, None) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), lv.EVENT.PRESSING, None) - contact_btn.add_flag(lv.obj.FLAG.HIDDEN) - # contact_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) - - contact_btn_label_1 = lv.label(contact_btn) - contact_btn_label_1.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - contact_btn_label_2 = lv.label(contact_btn) - # contact_btn_label_2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - contact_btn_label_3 = lv.label(contact_btn) - contact_btn_label_3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - self.videolist_detail_listt_dict.append({"contact_btn":contact_btn,"contact_btn_label_1":contact_btn_label_1,"contact_btn_label_2":contact_btn_label_2,"contact_btn_label_3":contact_btn_label_3}) - self.meta = videolist_screen - self.count = 0 - self.btn_create_list_show(0) - - def video_updata_list_show(self,event,msg): - self.post_processor_before_initialization() - self.timer.start(1 * 1000, 0, self.OutTime_s) - - def OutTime_s(self,e): - self.btn_create_list_show(1) - - def btn_create_list_show(self,state): - EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_list_show_screen,"data":state}) - - def btn_create_list_show_screen(self,state): - global videolist_screen,videolist_cont,videolist_top_title,videolist_none_label,videolist_screen_list_screen - print("btn_create_list_show_screen!!!!!!!!!!!") - if videolist_screen == None: - return - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#有卡时触发sos报警 无卡时自动关机 - self.videolist_detail_list.add_flag(lv.obj.FLAG.HIDDEN) - videolist_none_label.clear_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - else: - #读取json文件中的键作为label文本; - if self.check_json == True and len(self.videobook) != 0: - self.videolist_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) - videolist_none_label.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - j =0 - print("self.videobook sorted :{} len(self.videobook) :{}".format(sorted(self.videobook.keys()),len(self.videobook))) - phonebook_keys = sorted(self.videobook.keys()) - - - if len(self.videobook) > self.MXA_phone_num: - j = len(self.videobook) - self.MXA_phone_num - for i in range(self.MXA_phone_num): #字典 key value - if(j >= len(self.videobook)): - self.videolist_detail_listt_dict[i]["contact_btn"].add_flag(lv.obj.FLAG.HIDDEN) - continue - name = self.videobook[phonebook_keys[j]] - key_tmp = phonebook_keys[j] - - print("name :{} key_tmp:{}".format(name,key_tmp)) - - #contact_btn = lv.btn(self.contact_detail_list) - self.videolist_detail_listt_dict[i]["contact_btn"].set_size(LCD_X,45) - self.videolist_detail_listt_dict[i]["contact_btn"].set_pos(0,47*i ) - self.videolist_detail_listt_dict[i]["contact_btn"].set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) - # add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - # contact_btn.add_style(style_contact_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) - # self.contact_detail_listt_dict[i]["contact_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), - # lv.EVENT.SHORT_CLICKED, None) - - #contact_btn_label_1 = lv.label(contact_btn) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_pos(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_X-15, 16) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_text(key_tmp[4:]) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.CLIP) - # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) - # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - #contact_btn_label_2 = lv.label(contact_btn) - self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_pos(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_size(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_2"].set_text(key_tmp[4:]) - - - #contact_btn_label_3 = lv.label(contact_btn) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 20) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_X-15, 16) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_text(name) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.CLIP) - # self.videolist_detail_listt_dict[i]["contact_btn_label_3"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - - self.videolist_detail_listt_dict[i]["contact_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - #self.contact_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) - j+=1 - - if state == 1: - self.videolist_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) - - else: - if videolist_screen_list_screen != None: - videolist_none_label.clear_flag(lv.obj.FLAG.HIDDEN) #显示空文本 - if self.videolist_detail_list != None: - self.videolist_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - - - def calling_cb(self,e): - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 - msg_text = e.get_target().get_child(1).get_text() - # EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) - EventMesh.publish("load_screen", {"screen": "vedio_mode","meta":msg_text}) - else: - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - - self.is_sliding =0 - - - def calling(self,msg_text): - pass - # _msg = msg_text - # print("calling",_msg) - # EventMesh.publish("set_vedio_call_id", _msg)# - # EventMesh.publish("set_vedio_call_type", 1)# - # EventMesh.publish(constants.PROTOCOL.AGTALK_SEND,[1,_msg]) - # EventMesh.publish("load_screen", {"screen": "video_outcall","meta":_msg}) - - - def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - - - -video_select_mode_screen = None -video_select_mode_label1 = None -video_select_mode_label2 = None -video_select_mode_btn_label1 = None -video_select_mode_name = None -video_select_mode_btn =None -video_select_mode_btn1 = None -class videoModeScreen(Screen):#通话模式选择 - # - NAME = "vedio_mode" - - def __init__(self): - super().__init__() - self.meta = None - self.timer = osTimer() - self.meta_type = "popup" - self.count = 0 - self.is_sliding = 0 - - def initialization(self): - global video_select_mode_screen,video_select_mode_btn1,video_select_mode_btn,video_select_mode_label1,video_select_mode_label2,video_answer_btn_label1,video_select_mode_name - self.count = 0 - self.is_sliding = 0 - if video_select_mode_screen == None: - video_select_mode_screen = lv.obj() - print("video_select_mode_screen") - video_select_mode_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_select_mode_name = lv.label(video_select_mode_screen) - video_select_mode_name.set_pos(0, 20) - video_select_mode_name.set_text(" ") - video_select_mode_name.set_size(128, 40) - video_select_mode_name.add_flag(lv.obj.FLAG.CLICKABLE) - video_select_mode_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_select_mode_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_select_mode_btn = lv.btn(video_select_mode_screen) - video_select_mode_btn.set_pos(4, 60) - video_select_mode_btn.set_size(120, 26) - video_select_mode_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - video_select_mode_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) - video_select_mode_btn.set_style_radius(30,0) - - video_select_mode_label1 = lv.label(video_select_mode_btn) - video_select_mode_label1.set_text("语音通话") - video_select_mode_label1.set_size(128, 25) - video_select_mode_label1.set_pos(0,5) - video_select_mode_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_select_mode_label1.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - # video_select_mode_label1 = lv.label(video_select_mode_screen) - # video_select_mode_label1.set_pos(0, 60) - # video_select_mode_label1.set_text("语音通话") - # video_select_mode_label1.set_size(128, 30) - # video_select_mode_label1.add_flag(lv.obj.FLAG.CLICKABLE) - # video_select_mode_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - # video_select_mode_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - video_select_mode_btn1 = lv.btn(video_select_mode_screen) - video_select_mode_btn1.set_pos(4, 90) - video_select_mode_btn1.set_size(120, 26) - video_select_mode_btn1.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.DEFAULT) - video_select_mode_btn1.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) - video_select_mode_btn1.set_style_radius(30,0) - - video_select_mode_label2 = lv.label(video_select_mode_btn1) - video_select_mode_label2.set_text("视频通话") - video_select_mode_label2.set_size(128, 25) - video_select_mode_label2.set_pos(0,5) - video_select_mode_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - video_select_mode_label2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) - - # video_select_mode_label2 = lv.label(video_select_mode_screen) - # video_select_mode_label2.set_pos(0, 90) - # video_select_mode_label2.set_text("视频通话") - # video_select_mode_label2.set_size(128, 38) - # video_select_mode_label2.add_flag(lv.obj.FLAG.CLICKABLE) - # video_select_mode_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - # video_select_mode_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - self.meta = video_select_mode_screen - - video_select_mode_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,0)), - lv.EVENT.SHORT_CLICKED, None) - video_select_mode_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,0)), lv.EVENT.PRESSING, None) - - video_select_mode_btn1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,1)), - lv.EVENT.SHORT_CLICKED, None) - video_select_mode_btn1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,1)), lv.EVENT.PRESSING, None) - - if self.meta_info != None: - if len(str(self.meta_info)) != 0: - video_select_mode_name.set_text("{}".format(self.meta_info)) - else: - video_select_mode_name.set_text(" ") - else: - video_select_mode_name.set_text(" ") - - self.timer.start(1*1000,1,self.fun) - - - def fun(self,*argc): - self.count+=1 - if self.count <= 30: - EventMesh.publish("system_sleep_rest")#防止黑屏 - else: - self.timer.stop() - EventMesh.publish("return_prev_screen") - pass - def calling_vedio_cb(self,e,data):#视频通话 - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - if data == 1: - msg_text = [self.meta_info,1] - EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) - else: - msg_text = [self.meta_info,0] - EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) - self.is_sliding = 0 - pass - - def calling(self,msg_text): - _msg = msg_text[0] - mode = msg_text[1] - print("calling",msg_text,_msg,mode) - if mode == 1:#0是语音 1是视频通话 - EventMesh.publish("load_screen", {"screen": "video_outcall","meta":_msg}) - else: - EventMesh.publish("load_screen", {"screen": "voice_outcall","meta":_msg}) - - EventMesh.publish("set_vedio_call_id", _msg)# - EventMesh.publish("set_vedio_call_type", mode)# - EventMesh.publish(constants.PROTOCOL.AGTALK_SEND,[mode,_msg]) - - def Close(self): - self.timer.stop() - - def done_return(self): - pass - EventMesh.publish("return_prev_screen") - - - def btn1_release(self): - EventMesh.publish("return_prev_screen") - pass - - def btn8_press(self): - EventMesh.publish("return_prev_screen") - pass - - -style_screen_calendar_1_extra_header_main_default = lv.style_t() -style_screen_calendar_1_extra_header_main_default.init() -style_screen_calendar_1_extra_header_main_default.set_bg_color(lv.color_make(0x21,0x95,0xf6)) -style_screen_calendar_1_extra_header_main_default.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) -style_screen_calendar_1_extra_header_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_calendar_1_extra_header_main_default.set_bg_opa(255) -style_screen_calendar_1_extra_header_main_default.set_text_color(lv.color_make(0xff,0xff,0xff)) -style_screen_calendar_1_extra_header_main_default.set_text_font(lv.K01_font_16_ALL) - -style_screen_calendar_1_main_main_default = lv.style_t() -style_screen_calendar_1_main_main_default.init() -style_screen_calendar_1_main_main_default.set_radius(0) -style_screen_calendar_1_main_main_default.set_bg_color(lv.color_make(0xff,0xff,0xff)) -style_screen_calendar_1_main_main_default.set_bg_grad_color(lv.color_make(0xff,0xff,0xff)) -style_screen_calendar_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_calendar_1_main_main_default.set_bg_opa(255) -style_screen_calendar_1_main_main_default.set_border_color(lv.color_make(0xc0,0xc0,0xc0)) -style_screen_calendar_1_main_main_default.set_border_width(1) -style_screen_calendar_1_main_main_default.set_border_opa(255) - -# add style for screen_calendar_1 - - - -rrestor_confirm_n_screen = None -rrestor_confirm_n_screen_label = None - -# -class restore_confirmScreen(Screen): - NAME = "restore_confirm" - def __init__(self): - super().__init__() - self.meta = None - self.meta_type = "popup" - self.count = 0 - self.timer1 = osTimer() - self.timer2 = osTimer() - self.timer3 = osTimer() - - EventMesh.subscribe("app_factory_cb",self.app_factory_cb) - - def initialization(self): - global rrestor_confirm_n_screen ,rrestor_confirm_n_screen_label - if rrestor_confirm_n_screen == None : - rrestor_confirm_n_screen = lv.obj() - print("rrestor_confirm_n_screen") - rrestor_confirm_n_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - # add style for watchface - rrestor_confirm_n_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - #进入图片 - - rrestor_confirm_n_screen_label = lv.label(rrestor_confirm_n_screen) - rrestor_confirm_n_screen_label.set_pos(0, 40) - rrestor_confirm_n_screen_label.set_size(128, 60) - rrestor_confirm_n_screen_label.set_text("正在恢复出厂中\n请稍等...") - rrestor_confirm_n_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - rrestor_confirm_n_screen_label.set_long_mode(lv.label.LONG.WRAP) - rrestor_confirm_n_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - - - self.meta = rrestor_confirm_n_screen - self.timer1.start(1000,1,self.timer_cb_onescond) - - ret = 0 - ret = ql_fs.path_exists("/usr/static/storage_file")#电话本 - if ret == True: - ql_fs.rmdirs("/usr/static/storage_file") - ql_fs.mkdirs("/usr/static/storage_file") - - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂 - EventMesh.publish(constants.PROTOCOL.DLT_SEND) - self.timer2.start(4000,0,self.timer_cb_threescond) - - def app_factory_cb(self,event,msg): - ret = 0 - ret = ql_fs.path_exists("/ext/static/storage_file")#电话本 - if ret == True: - ql_fs.rmdirs("/ext/static/storage_file") - ql_fs.mkdirs("/ext/static/storage_file") - EventMesh.publish("alipay_unbind") - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂 - EventMesh.publish(constants.PROTOCOL.DLT_SEND) - self.timer3.start(4000,0,self.timer_cb_threescond) - pass - - def Close(self): - self.timer1.stop() - self.timer2.stop() - - def timer_cb_threescond(self,e): - - Power.powerRestart() - - def timer_cb_onescond(self,e): - EventMesh.publish("system_sleep_rest")#防止黑屏 - - - def done_left_to_right(self): - pass - def done_right_to_left(self): - pass - def done_bottom_to_top(self): - pass - def done_top_to_bottom(self): - pass - def done_return(self): - pass - def done_click(self): - pass - - def btn8_press(self): - pass - def btn1_press(self): - pass - def btn1_release(self): - pass - - - -#from ui_WatchFaceScreen import WatchFaceScreen -class UI(object): - def __init__(self): - #self.screen = WatchFaceScreen() - #self.screen_old = self.screen - self.ui_queue = Queue() - _thread.stack_size(13*1024) - _thread.start_new_thread(self.ui_queue_thread, ()) - _thread.stack_size(8*1024) - self.screen = None - self.screen_old = None - self.screen_prev = None - self.screen_prev_new = None - self.screen_last = None - self.screen_list = [] - self.lv = lv - self.system_sleep_timer = osTimer() - self.system_sleep_timer_count = 0 - self.sleep_flag = 1 - self.aud = audio.Audio(0) - self.aud.set_pa(Pin.GPIO43) - self.level = 2 - self.main_flag = 0 - self.main_id = 0 - self.set_interrup_flag = 0 - self.UI_high_priority_flag = 0 #如果=1,则当前ui不被打断 - - self.page_id = ["main_menu"] - self.page_count = 0 - - self.level = EventMesh.publish("get_storage_config","brightness_level") - print("self.level:{}".format(self.level)) - - if self.level == None: - self.level = 2 - self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, self.level*100, 1000) - self.PWM_backlight.open() - self.sleep_lock = 0 - - def post_processor_after_instantiation(self): - EventMesh.subscribe("load_screen", self.load_screen_cb) - - EventMesh.subscribe("btn1_press", self.btn_press) - EventMesh.subscribe("btn8_press", self.btn_press) - EventMesh.subscribe("btn8_long_press", self.btn_press) - - EventMesh.subscribe("btn1_release", self.btn_release) - EventMesh.subscribe("btn8_release", self.btn_release) - - EventMesh.subscribe("done_left_to_right", self.ui_press) - EventMesh.subscribe("done_right_to_left", self.ui_press) - EventMesh.subscribe("done_bottom_to_top", self.ui_press) - EventMesh.subscribe("done_top_to_bottom", self.ui_press) - EventMesh.subscribe("done_return", self.ui_press) - EventMesh.subscribe("done_click", self.ui_press) - EventMesh.subscribe("done_error", self.ui_press) - EventMesh.subscribe("done_press", self.ui_press) - EventMesh.subscribe("call_in", self.publish_call_in) - - EventMesh.subscribe("get_lcd_state", self.get_lcd_state) - EventMesh.subscribe("set_lcd_state", self.set_lcd_state) - - #EventMesh.subscribe("call_in", self.publish_call_in) - #EventMesh.subscribe("set_bg_img", self.set_bg_img) - - EventMesh.subscribe(constants.EVENT.SYSTEM_SLEEP, self.system_sleep) - EventMesh.subscribe(constants.EVENT.SYSTEM_UP, self.system_up) - EventMesh.subscribe("system_sleep_rest", self.system_sleep_rest) - EventMesh.subscribe("set_UI_high_priority", self.set_UI_high_priority) - EventMesh.subscribe("get_UI_high_priority", self.get_UI_high_priority) - - EventMesh.subscribe("set_interrup_incall", self.set_interrup_incall) - EventMesh.subscribe("get_interrup_incall", self.get_interrup_incall) - EventMesh.subscribe("get_screen_NAME",self.get_screen_NAME) - EventMesh.subscribe("publish_message_event_ui",self.publish_message_event_ui) - EventMesh.subscribe("return_prev_screen",self.return_prev_screen) - - EventMesh.subscribe("del_prev_screen",self.del_prev_screen)#退出当前界面就删除当前界面 进去需要保存当前界面 - EventMesh.subscribe("add_new_screen",self.add_new_screen)#保存新的界面用作返回上一级 - - self.system_sleep_timer.start(1000, 1, self.system_sleep_timer_cb) - - def publish_message_event_ui(self,event,msg): - self.ui_queue.put(msg) - - #ui的消息队列处理,防止内存越界 格式:{函数名,数据} - def ui_queue_thread(self): - while True: - data = self.ui_queue.get() - #print("ui_queue_thread:data = {}".format(data)) - if data != None: - try: - data["func"](data["data"]) - except Exception as e: - print("ui_queue_thread:ERROR:{}".format(e)) - # for scr in self.screen_list: - # if scr.handle_message_event(data) == 1 : - # break - - def add_new_screen(self, event, msg): - if msg == "main_menu": - if self.page_count > 0: - self.page_id.clear()#清空所有 - self.page_count = 0 - self.page_id = ["main_menu"] - print("add_new_screen ",self.page_id,self.page_count) - else: - if self.page_count == None: - self.page_count = 0 - self.page_id.clear()#清空所有 - self.page_id = ["main_menu"] - last_screen = self.page_id[int(self.page_count)] - print("self.page_id",last_screen,msg,self.page_id,self.page_count) - if last_screen != msg and (msg in last_screen) == False: - self.page_count+=1 - page_pre = "{}".format(msg) - self.page_id.append(page_pre) - - def del_prev_screen(self, event, msg): - if self.page_count > 0: - # print("del_prev_screen self.page_id",self.page_id,self.page_count) - if self.screen.meta_type != "popup": - del self.page_id[int(self.page_count)] - self.page_count-=1 - - if self.page_count == 0: - self.page_id.clear()#清空所有 - self.page_id = ["main_menu"] - - if self.page_count == None: - self.page_count = 0 - self.page_id.clear()#清空所有 - self.page_id = ["main_menu"] - - def return_prev_screen(self, event, msg): - EventMesh.publish("del_prev_screen")#退出当前界面就删除当前界面 进去需要保存当前界面 - - pre_page = self.page_id[int(self.page_count)] - # print("pre_page:data = {} self.page_count:{}".format(pre_page,self.page_count)) - if len(pre_page) == 0:#预防是空的界面 - self.page_count = 0 - pre_page = "main_menu" - - if self.page_count == None: - self.page_count = 0 - - if self.page_count == 0: - pre_page = "main_menu" - if pre_page != None: - EventMesh.publish("load_screen", {"screen": pre_page}) - # if self.screen_prev != None: - # print("return_prev_screen",self.screen_prev) - # EventMesh.publish("load_screen", {"screen": self.screen_prev.NAME}) - - def set_interrup_incall(self, event, msg): - self.set_interrup_flag = msg - - def get_interrup_incall(self, event, msg): - return self.set_interrup_flag - - def set_UI_high_priority(self, event, msg): - self.UI_high_priority_flag = msg - - def get_UI_high_priority(self, event, msg): - return self.UI_high_priority_flag - - def get_lcd_state(self, event, key): - return self.sleep_flag - - def set_lcd_state(self, event, key): - print("key_:{}".format(key)) - self.sleep_flag = key - - def system_sleep_rest(self, event, key): - #print("system_sleep_rest!!!!!") - self.system_sleep_timeout_rest() - - def ui_press(self, event, key): - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME == "system_init": - return - self.system_sleep_timeout_rest() - #print("ui press {}".format(event)) - if event == "done_left_to_right": - self.screen.done_left_to_right() - if event == "done_right_to_left": - self.screen.done_right_to_left() - if event == "done_bottom_to_top": - self.screen.done_bottom_to_top() - if event == "done_top_to_bottom": - self.screen.done_top_to_bottom() - if event == "done_return": - self.screen.done_return() - if event == "done_click": - self.screen.done_click() - # if event == "done_press": - # self.system_sleep_timeout_rest() - def btn_press(self, event, key): - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME == "system_init": - return - print("btn_press: {}".format(event)) - #主表盘按电源键,息屏 - - #息屏状态按按钮都亮屏 - - - if self.main_flag != 1 and self.sleep_flag == 0: - if event == "btn8_long_press": - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 - sos_number = EventMesh.publish("get_dial_sos_number") - if sos_number != None: - if len(sos_number) != 0: - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME != "SOS_POPUP": - EventMesh.publish("load_screen", {"screen": "SOS_POPUP"}) - else: - EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) - else: - EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) - else: - self.__lcd_on() - return - # if event == "btn1_press": - # self.screen.btn1_press() - # self.__lcd_on() - if event == "btn8_press": - self.screen.btn8_press() - if event == "btn8_long_press": - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 - sos_number = EventMesh.publish("get_dial_sos_number") - if sos_number != None: - if len(sos_number) != 0: - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME != "SOS_POPUP": - EventMesh.publish("load_screen", {"screen": "SOS_POPUP"}) - else: - EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) - else: - EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) - - if event == "btn1_press": - self.screen.btn1_release() - - - def btn_release(self, event, msg): - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME == "system_init": - return - print("btn_release: {}".format(event)) - # if self.main_flag != 1 and self.sleep_flag == 0: - # self.__lcd_on() - # return - # if event == "btn1_release": - - # self.screen.btn1_release() - - def __lcd_on(self): - self.system_sleep_timeout_rest() - if self.sleep_flag == 0 : - print("__lcd_on") - if self.sleep_lock == 1: - print("__lcd_on:sleep_lock:error!") - utime.sleep_ms(200) - self.sleep_lock = 1 - self.sleep_flag = 1 - - - #lcd_ctrl.write(1) - #utime.sleep(10) - self.screen.lcd_on() - self.system_sleep_timer.start(1000, 1, self.system_sleep_timer_cb) - EventMesh.publish("set_lcd_state",self.sleep_flag) - tp_cst816.resume() - lcd.lcd_display_on() - utime.sleep_ms(2) - lv.autoSleep(0) - pm.autosleep(0) - pm.sclkEx_set(0, 1, 5) - utime.sleep_ms(60) - self.level = EventMesh.publish("get_brightness_level") - if self.level == None: - self.level = 6 - elif self.level > 10: - self.level = 10 - elif self.level <= 0: - self.level = 1 - # print("__lcd_on self.level:",self.level) - self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, self.level*100, 1000) - self.PWM_backlight.open() - self.sleep_lock = 0 - - def publish_call_in(self, event, msg): - EventMesh.publish("load_screen", {"screen": "dialing", "meta": msg}) - - def __lcd_off(self): - - if self.sleep_flag == 1 : - print("__lcd_off") - if self.sleep_lock == 1: - print("__lcd_on:sleep_lock:error!") - utime.sleep_ms(200) - self.sleep_lock = 1 - self.sleep_flag = 0 - self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1000) - self.PWM_backlight.open() - #lcd_ctrl.write(0) - # - lv.autoSleep(1) - pm.autosleep(1) - pm.sclkEx_set(1, 1, 5) - utime.sleep_ms(2) - tp_cst816.suspend() - lcd.lcd_display_off() - #utime.sleep_ms(80) - EventMesh.publish("set_lcd_state",self.sleep_flag) - self.sleep_lock = 0 - self.screen.lcd_off() - self.system_sleep_timer.stop() - EventMesh.publish("Hsensor_set_sleep") #让系统更快休眠 - - def system_sleep(self, event, msg) : - self.__lcd_off() - - def system_up(self, event, msg): - self.__lcd_on() - - def system_sleep_timer_cb(self, *args): - #print("system_sleep_timer_count:{}".format(self.system_sleep_timer_count)) - time = EventMesh.publish("get_brightness_time") - if time == None: - time = 10 - self.system_sleep_timer_count += 1 - if self.system_sleep_timer_count >= time : - self.system_sleep_timer_count = 0 - self.__lcd_off() - - def system_sleep_timeout_rest(self) : - #print("system_sleep_timeout_rest") - self.system_sleep_timer_count = 0 - - def start(self): - #self.post_processor_after_instantiation() - pass - - def add_screen(self, screen): - self.screen_list.append(screen) - return self - - def get_screen_NAME(self, event, msg): - return self.screen.NAME - - def load_screen_cb(self, topic, msg): - EventMesh.publish("publish_message_event_ui",{"func":self.load_screen,"data":msg}) - - - # "dialing_noplay_popup" - # "dial_no_connect_popup" - # "on_call" - # "dialing" - # "incoming_call" - - def load_screen(self, msg): - print("msg1={} self.UI_high_priority_flag:{}".format(msg,self.UI_high_priority_flag)) - if self.UI_high_priority_flag == 1:#电话界面屏蔽其他界面 - return - state = EventMesh.publish("get_cur_class_time_state") - print("state:{}".format(state)) - if state != None: - if state == 1: - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if msg["screen"] == "charge_out" or msg["screen"] == "charge_in": - pass - else: - if screen_NAME == "class_time" :#在上课禁用界面打断其他操作界面 - print("class_time UI") - if msg["screen"] == "countdown_end": - # print("countdown_end UI") - EventMesh.publish("close_count_show_info") - return - else: - if screen_NAME != "dialing_noplay_popup" or screen_NAME != "dial_no_connect_popup" or \ - screen_NAME != "on_call" or screen_NAME != "dialing" or screen_NAME != "incoming_call" or \ - screen_NAME != "charge_in" or screen_NAME != "charge_out": - EventMesh.publish("load_screen", {"screen": "class_time"}) - - if self.screen : - - if self.screen.NAME == msg["screen"]: - return - for scr in self.screen_list: - if scr.NAME == msg["screen"]: - # 每次屏幕切换开始息屏倒计时 - - if scr.NAME == 'main_menu': - self.main_flag = 1 - else : - self.main_flag = 0 - mem = gc.mem_free() - print('1剩余内存RAM:{} KB'.format(mem / 1024)) - - self.screen = scr - play_state = EventMesh.publish("get_audio_state")#音频播放状态 - if play_state != None: - if play_state != 0:#在上一个界面在播放音频时切换界面则关闭 以免一直播放 - self.aud.stop() - - if self.screen_old != None : - - self.screen_old.Close() #先关闭上一次界面 - self.lv.img.cache_invalidate_src(None) #清img cache - self.lv.img.cache_set_size(16) #开img cache - # if self.screen_old.meta_type != "popup": #不是弹窗,保存上一个界面,用来返回 - if self.screen.meta_type != "popup": #只要当前界面不是弹窗界面都要保存当前界面 - # if self.screen_prev_new != self.screen:#screen_prev = setiing self.screen = imei self.screen_prev = setiing self.screen_prev_new = imei - # print('self.screen_prev.NAME6:{} self.screen_old:{}'.format(self.screen_old.NAME,self.screen.NAME))#第一种 - # self.screen_prev = self.screen_prev_new - # self.screen_last = self.screen_prev_new - # self.screen_prev_new = self.screen - # print('self.screen_prev.NAME5:{} self.screen_prev_new:{} self.screen_old:{}'.format(self.screen_prev.NAME,self.screen_prev_new.NAME,self.screen_old.NAME)) - # else: - # if self.screen_last != None: - # self.screen_prev = self.screen_last - - # print('self.screen_prev.NAME4:{} self.screen:{} self.screen_old:{}'.format(self.screen_prev.NAME,self.screen.NAME,self.screen_old.NAME)) - # print('self.screen_prev.NAME2:{} self.screen_old:{}'.format(self.screen_prev.NAME,self.screen.NAME)) - # else: - # if self.screen_prev_new != None:#self.screen_prev = imei self.screen_prev = imei - # self.screen_prev = self.screen_prev_new - if self.screen_old.meta_type != "popup": - self.screen_prev = self.screen_old #第二种方式 - screen_new = msg["screen"] - # print('self.screen_prev.NAME:{} self.screen_old:{}'.format(self.screen_prev.NAME,self.screen.NAME)) - if self.screen_prev.NAME != self.screen.NAME: - EventMesh.publish("add_new_screen",screen_new)#保存新的界面用作返回上一级 - - if msg.get("meta"): - self.screen.meta_info = msg.get("meta") - print("load_screen:post_processor_before_initialization") - self.screen.post_processor_before_initialization() - print("load_screen:initialization") - self.screen.initialization() - - print("load_screen.load()") - self.screen.load() - self.lv.scr_load(self.screen.get_meta()) - - self.screen.post_processor_after_initialization() - self.screen_old = self.screen - # if self.screen_prev == None: - # self.screen_prev = self.screen - # if self.screen_prev_new == None: - # self.screen_prev_new = self.screen - self.__lcd_on() - mem = gc.mem_free() - print('2剩余内存RAM:{} KB'.format(mem / 1024)) - - - - - - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py deleted file mode 100644 index a1ecfb2b..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py +++ /dev/null @@ -1,426 +0,0 @@ -#表盘 -import osTimer -import lvgl as lv -import EventMesh -import osTimer -import constants -from ui import Screen,style_img,style_screen,style_font_youyuan_70_black,style_font_youyuan_28 -import ql_fs -import ujson -from machine import RTC - - - -# style_font_youyuan_20 = lv.style_t() -# style_font_youyuan_20.init() -# style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -# style_font_youyuan_20.set_text_font_v2("font_22.bin",22,0) - -watchface_style_default = lv.style_t() -watchface_style_default.init() -watchface_style_default.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -#watchface_style_default.set_text_font_v2("font_28.bin",28,0) -watchface_style_default.set_text_font(lv.K01_font_16_ALL) - - - -Watchface = lv.obj() -print("Watchface") -Watchface1 = lv.obj(Watchface) - -Watchface1.set_size(128,128) -#Watchface1.set_pos(0,0) -Watchface1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -Watchface1.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) - -# create style style_watchface_img_default -style_watchface_img_default = lv.style_t() -style_watchface_img_default.init() -style_watchface_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) -style_watchface_img_default.set_img_recolor_opa(0) -style_watchface_img_default.set_img_opa(255) - - -#表盘 -#主图片 -watchface1_bg_img = lv.img(Watchface1) -watchface1_bg_img.set_pos(int(0),int(0)) -watchface1_bg_img.set_size(128,128) -watchface1_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -watchface1_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) -watchface1_bg_img.set_src("U:/static/bg.png") -watchface1_bg_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) -#状态栏 - -power_line_points = [{"x":0,"y":0},{"x":0,"y":10}] -power_line_red = lv.style_t() -power_line_red.init() -power_line_red.set_line_width(0)#23 宽度 -power_line_red.set_line_color(lv.color_make(0xff, 0xff, 0xff)) - - - -watchface1_mpsignal_img = lv.img(Watchface1) -watchface1_mpsignal_img.set_pos(int(10),int(5)) -watchface1_mpsignal_img.set_size(22,12) -watchface1_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -watchface1_mpsignal_img.set_src("U:/static/mpsignal5.png") -watchface1_mpsignal_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -watchface1_res_stat_battery_img = lv.img(Watchface1) -watchface1_res_stat_battery_img.set_pos(int(102),int(5)) -watchface1_res_stat_battery_img.set_size(24,12)#16 8 -watchface1_res_stat_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -watchface1_res_stat_battery_img.set_src("U:/static/vbat_0.png") -watchface1_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -watchface1_res_stat_battery_line = lv.line(Watchface1) -watchface1_res_stat_battery_line.set_points(power_line_points,2) -watchface1_res_stat_battery_line.set_pos(int(103),int(6)) -watchface1_res_stat_battery_line.set_size(0,10)#高度12 -watchface1_res_stat_battery_line.add_style(power_line_red,0) - - -data = RTC().datetime() -hour = data[4] -min = data[5] - -week = data[3] - -date1 = data[1] -date2 = data[2] -print("hour:{} min:{} week:{} date1:{} date2:{} data:{}".format(hour,min,week,date1,date2,data)) - -def get_week(msg): - if msg == 1: - return '一' - elif msg == 2: - return '二' - elif msg == 3: - return '三' - elif msg == 4: - return '四' - elif msg == 5: - return '五' - elif msg == 6: - return '六' - elif msg == 7 or msg == 0: - return '日' - - -watchface1_time1_hour = lv.label(Watchface1) -watchface1_time1_hour.set_pos(4, 72) -watchface1_time1_hour.set_size(100, 32) -watchface1_time1_hour.set_align(lv.TEXT_ALIGN.LEFT) -watchface1_time1_hour.set_text("{}".format("%02d"%(hour))) -# watchface1_time1_text.set_text("%02d:%02d"%(hour,min)) -watchface1_time1_hour.add_style(style_font_youyuan_70_black, lv.PART.MAIN|lv.STATE.DEFAULT) - -watchface1_time1_min = lv.label(Watchface1) -watchface1_time1_min.set_pos(4, 98) -watchface1_time1_min.set_size(100, 30) -watchface1_time1_min.set_align(lv.TEXT_ALIGN.LEFT) -watchface1_time1_min.set_text("{}".format("%02d"%(min))) -# watchface1_time1_text.set_text("%02d:%02d"%(hour,min)) -watchface1_time1_min.add_style(style_font_youyuan_70_black, lv.PART.MAIN|lv.STATE.DEFAULT) - -#日期 -watchface1_date_span = lv.label(Watchface1) -watchface1_date_span.set_pos(56, 20) -watchface1_date_span.set_size(68, 20) -watchface1_date_span.set_align(lv.TEXT_ALIGN.LEFT) -watchface1_date_span.set_text("%02d月%02d日"%(date1,date2)) -watchface1_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) -#星期 -watchface1_week_span = lv.label(Watchface1) -watchface1_week_span.set_pos(76, 38) -watchface1_week_span.set_size(48, 20) -watchface1_week_span.set_align(lv.TEXT_ALIGN.LEFT) -watchface1_week_span.set_text("星期%s"%(get_week(week))) -watchface1_week_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - -#天气 -watchface1_weather_span = lv.label(Watchface1) -watchface1_weather_span.set_pos(65, 100) -watchface1_weather_span.set_size(58, 24) -watchface1_weather_span.set_align(lv.TEXT_ALIGN.LEFT) -watchface1_weather_span.set_text("_ _") -watchface1_weather_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) - -watchface1_weather_img = lv.img(Watchface1) -watchface1_weather_img.set_pos(105, 5) -watchface1_weather_img.set_size(0, 0) -watchface1_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -watchface1_weather_unit_img = lv.img(Watchface1) -watchface1_weather_unit_img.set_pos(94, 5) -watchface1_weather_unit_img.set_size(11, 11) -watchface1_weather_unit_img.set_src("U:/static/degree.png") -watchface1_weather_unit_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - - - -class WatchFace1(): - NAME = "Watchface1" - # # #表盘1 - def __init__(self,main_menu): - print("Watchface1:__init__") - self.meta = Watchface1 - Watchface1.set_parent(main_menu)#设置父控件 - - def initialization(self,main_menu): - print("Watchface1:initialization") - - #获取信号 - signal = EventMesh.publish("screen_get_sig") - if signal: - self.__signal(None, signal) - # 获取电池电量 - battery = EventMesh.publish("screen_get_battery") - if battery: - self.__battery(None, battery) - time = EventMesh.publish("screen_get_time") - #print("publish_time:"+time) - if time: - self.__time(None, time) - hrValue = EventMesh.publish("get_old_hr_data") - if hrValue: - self.__oldHrValue(None, hrValue) - - spo2Value = EventMesh.publish("get_old_spo2_data") - if spo2Value : - self.__oldSpo2Value(None, spo2Value) - # print("main get_step msg:{}".format(msg)) - weather_data = EventMesh.publish("get_weather_data") - self.__weather(None,weather_data) - # step = EventMesh.publish(constants.EVENT.GET_STEP) - step = EventMesh.publish("get_old_step_value") - self.__stepValue(None, step) - - - def timerout_update(self): - #获取信号 - signal = EventMesh.publish("screen_get_sig") - if signal: - self.__signal(None, signal) - # 获取电池电量 - battery = EventMesh.publish("screen_get_battery") - if battery: - self.__battery(None, battery) - - time = EventMesh.publish("screen_get_time") - #print("publish_time:"+time) - if time: - self.__time(None, time) - - hrValue = EventMesh.publish("get_old_hr_data") - if hrValue: - self.__oldHrValue(None, hrValue) - - spo2Value = EventMesh.publish("get_old_spo2_data") - if spo2Value : - self.__oldSpo2Value(None, spo2Value) - # print("main get_step msg:{}".format(msg)) - # step = EventMesh.publish(constants.EVENT.GET_STEP) - step = EventMesh.publish("get_old_step_value") - self.__stepValue(None, step) - - weather_data = EventMesh.publish("get_weather_data") - self.__weather(None,weather_data) - - def __weather(self, event, msg): - # print("weather_data",msg) - #时间 - if msg != None: - #3 4 - weather_type = msg[3]#天气类型 - weather_temp = msg[4]#天气温度 - # print("weather_type weather_temp",type(weather_type),type(weather_temp),weather_type,weather_temp) - if weather_type != None and weather_temp != None: - if int(weather_type) > 3: - watchface1_weather_unit_img.set_pos(60+12+10, 102) - - watchface1_weather_span.set_pos(60,92) - watchface1_weather_span.set_text(str("_ _")) - - watchface1_weather_img.set_pos(60+12+8+20, 102) - watchface1_weather_img.set_size(11, 10) - watchface1_weather_img.set_src("U:/static/04_WM.png") - - - else: - - len_data = len(str(weather_temp))*8 - watchface1_weather_unit_img.set_pos(60+len_data+5, 102) - watchface1_weather_span.set_pos(60,100) - watchface1_weather_span.set_text(str(weather_temp)) - - watchface1_weather_img.set_pos(60+len_data+6+15, 103) - watchface1_weather_img.set_size(11, 10) - watchface1_weather_img.set_src("U:/static/%02d_WM.png"%(int(weather_type))) - - else: - watchface1_weather_unit_img.set_pos(60+12+10, 102) - - watchface1_weather_span.set_pos(60,92) - watchface1_weather_span.set_text(str("_ _")) - - watchface1_weather_img.set_pos(60+12+8+20, 102) - watchface1_weather_img.set_size(11, 10) - watchface1_weather_img.set_src("U:/static/04_WM.png") - - - else: - watchface1_weather_unit_img.set_pos(60+12+10, 102) - - watchface1_weather_span.set_pos(60,92) - watchface1_weather_span.set_text(str("_ _")) - - watchface1_weather_img.set_pos(60+12+8+20, 102) - watchface1_weather_img.set_size(11, 10) - watchface1_weather_img.set_src("U:/static/04_WM.png") - - - def __time(self, event, msg): - #时间 - data = RTC().datetime() - hour = data[4] - min = data[5] - - week = data[3] - - date1 = data[1] - date2 = data[2] - watchface1_time1_hour.set_text("{}".format("%02d"%(hour))) - watchface1_time1_min.set_text("{}".format("%02d"%(min))) - watchface1_date_span.set_text("%02d月%02d日"%(date1,date2))#日期 - watchface1_week_span.set_text("星期%s"%(get_week(week))) #星期 - - def __signal(self, event, msg): - #print("__signal_cb:",str(msg)) - # 信号强度值范围0 ~ 31,值越大表示信号强度越好 - #print("__signal_cb:{}".format(msg//8)) - if msg: - if msg >= 0 and msg<=31 : - watchface1_mpsignal_img.set_src("U:/static/mpsignal{}.png".format(msg//8+1)) - else : - watchface1_mpsignal_img.set_src("U:/static/mpsignal5.png") - - def __battery(self, event, msg): - #print("__battery_cb:",str(msg)) - # print("__battery",msg) - if msg[0] == '1': - watchface1_res_stat_battery_line.set_pos(int(0),int(0)) - watchface1_res_stat_battery_line.set_size(0,0) - watchface1_res_stat_battery_line.set_style_line_width(0,lv.PART.MAIN) - watchface1_res_stat_battery_img.set_src("U:/static/charge_ing.png") - # watchface1_res_stat_charge_in_img.set_src("U:/static/charge_in.png") - else: - watchface1_res_stat_battery_img.set_src("U:/static/vbat_0.png") - level = msg[1] - if level >= 99: - level = 100 - line_len = int(level*(20/100)) - if line_len <= 5: - line_len = 5 - if level <= 5: - level = 5 - line_points = [ - {"x":0, "y":0}, - {"x":line_len, "y":0}, - ] - watchface1_res_stat_battery_line.set_size(int(line_len),int(2)) - watchface1_res_stat_battery_line.set_pos(int(103),int(11)) - watchface1_res_stat_battery_line.set_points(line_points, 2) - watchface1_res_stat_battery_line.set_style_line_width(10,lv.PART.MAIN) - - if line_len <= 5: - watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) - else: - watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0xff,0xff),0) - - def __oldHrValue(self, event, msg): - pass - # watchface1_HB_span.set_text("120") - - def __oldSpo2Value(self, event, msg): - pass - # watchface1_SPO2_span.set_text(str(msg)) - - def __stepValue(self, event, msg): - if msg == None: - pass - # watchface1_step_span.set_text("0") - else: - pass - # watchface1_step_span.set_text(str(msg)) - - def Close(self): - pass - - def done_left_to_right(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_right_to_left(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_top_to_bottom(self): - EventMesh.publish("load_screen", {"screen": "popup"}) - - def done_bottom_to_top(self): - EventMesh.publish("load_screen", {"screen": "call_log"}) - - - - - - -class WatchFace(): - #NAME = "Watchface" - - def __init__(self): - #表盘 - self.meta = None - self.watchface_style_num = "Watchface1" - self.watchface_list = [] - self.timer_update = osTimer() - EventMesh.subscribe("set_change_face", self.change_face) - self.PWM_backlight = None - read_data = EventMesh.publish("get_storage_config","watchface") - if read_data != None: - self.watchface_style_num = read_data - - - def initialization(self,main_menu): - if self.watchface_list == [] : #第一次初始化 - self.watchface_list.append( WatchFace1(main_menu)) - # self.watchface_list.append( WatchFace2(main_menu)) - print("watchface INIT !!!!!!!!:",self.watchface_style_num) - for wat in self.watchface_list: - if wat.NAME == self.watchface_style_num : - self.watchface_style = wat - wat.meta.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 - self.watchface_style.initialization(main_menu) - self.meta = self.watchface_style.meta - self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 - self.watchface_style.timerout_update() - self.timer_update.start(10000, 1, self.timerout_update) - - def timerout_update(self, *args, **kwargs): - self.watchface_style.timerout_update() - - def change_face(self, event=None, msg=None): - print("change_face :",msg) - self.watchface_style_num = str(msg) - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def Close(self): - print("watchface Close !!!!!!!!") - self.timer_update.stop() - self.watchface_style.Close() - return - - - - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_main_menu.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_main_menu.py deleted file mode 100644 index 4e1c9dcf..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_main_menu.py +++ /dev/null @@ -1,541 +0,0 @@ -#主菜单 -import utime -import osTimer -import lvgl as lv -import EventMesh -from machine import Timer -import voiceCall -import osTimer -import constants -from misc import Power -import pm -from ui import Screen -from ui_WatchFaceScreen import WatchFace -style_MainMenu_screen_default = lv.style_t() -style_MainMenu_screen_default.init() -style_MainMenu_screen_default.set_radius(0) -style_MainMenu_screen_default.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) -style_MainMenu_screen_default.set_bg_opa(255) -style_MainMenu_screen_default.set_border_width(0) -style_MainMenu_screen_default.set_pad_left(0) -style_MainMenu_screen_default.set_pad_right(0) -style_MainMenu_screen_default.set_pad_top(0) -style_MainMenu_screen_default.set_pad_bottom(0) - -style_MainMenu_img_default = lv.style_t() -style_MainMenu_img_default.init() -style_MainMenu_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) -style_MainMenu_img_default.set_img_recolor_opa(0) -style_MainMenu_img_default.set_img_opa(255) - - - -style_btn = lv.style_t() -style_btn.init() -style_btn.set_bg_opa(lv.OPA.TRANSP) -style_btn.set_shadow_opa(0) -style_btn.set_border_width(0) - - -# MainMenu = lv.obj() -# class MainMenuScreen(Screen): -# NAME = "main_menu" - -# def __init__(self): -# super().__init__() -# #主菜单 -# self.meta = MainMenu -# self.main_menu_style_num = "MainMenu2" - -# def initialization(self): -# print("main_menu INIT !!!!!!!!") -# EventMesh.publish("load_screen", {"screen": self.main_menu_style_num}) - - -# def post_processor_after_instantiation(self): -# EventMesh.subscribe("change_style", self.change_style) - - -# def change_style(self, event=None, msg=None): #换风格 -# self.main_menu_style_num = msg -# EventMesh.publish("load_screen", {"screen": self.main_menu_style_num}) - -# def Close(self): -# return - - -# def done_return(self): -# EventMesh.publish("load_screen", {"screen": "Watchface"}) - -# def btn1_release(self): -# EventMesh.publish("load_screen", {"screen": "Watchface"}) - -# def btn8_press(self): -# EventMesh.publish("load_screen", {"screen": "Watchface"}) - - - - - -style_font_youyuan_font_60 = lv.style_t() -style_font_youyuan_font_60.init() -style_font_youyuan_font_60.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) -style_font_youyuan_font_60.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_font_60.set_text_font(lv.font_60_main_menu) -MainMenu2x = 0 -MainMenu2_num = 0 -MainMenu2 = lv.obj() -print("MainMenu2") -MainMenu2_til = lv.tileview(MainMenu2) -MainMenu2_til.set_scrollbar_mode(0) -MainMenu2_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -#工具箱 -MainMenu2_toolbox = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_toolbox) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_toolbox = lv.img(MainMenu2_toolbox) -MainMenu2_img_toolbox.set_size(80,80) -MainMenu2_img_toolbox.set_pos(24,10) -MainMenu2_img_toolbox.set_src("U:/static/IMAGE_ONE_PAGE_TOOLS.png") -MainMenu2_img_toolbox.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_toolbox.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_toolbox_txt = lv.label(MainMenu2_toolbox) -MainMenu2_img_toolbox_txt.set_pos(int(0),int(100)) -MainMenu2_img_toolbox_txt.set_size(128,20) -MainMenu2_img_toolbox_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_toolbox_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_toolbox_txt.set_text("工具箱") -MainMenu2_img_toolbox_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - -#加好友,暂时没有 -MainMenu2_toolbox = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_toolbox) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_add_friends = lv.img(MainMenu2_toolbox) -MainMenu2_img_add_friends.set_size(80,80) -MainMenu2_img_add_friends.set_pos(24,10) -MainMenu2_img_add_friends.set_src("U:/static/IMAGE_ONE_PAGE_FRIEND.png") -MainMenu2_img_add_friends.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_add_friends.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_add_friends_txt = lv.label(MainMenu2_toolbox) -MainMenu2_img_add_friends_txt.set_pos(int(0),int(100)) -MainMenu2_img_add_friends_txt.set_size(128,20) -MainMenu2_img_add_friends_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_add_friends_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_add_friends_txt.set_text("交友") -MainMenu2_img_add_friends_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - -#微聊 -MainMenu2_wechat = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_wechat) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_wechat = lv.img(MainMenu2_wechat) -MainMenu2_img_wechat.set_size(80,80) -MainMenu2_img_wechat.set_pos(24,10) -MainMenu2_img_wechat.set_src("U:/static/IMAGE_ONE_PAGE_WECHAT.png") -MainMenu2_img_wechat.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_wechat.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_wechat_txt = lv.label(MainMenu2_wechat) -MainMenu2_img_wechat_txt.set_pos(int(0),int(100)) -MainMenu2_img_wechat_txt.set_size(128,20) -MainMenu2_img_wechat_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_wechat_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_wechat_txt.set_text("微聊") -MainMenu2_img_wechat_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - -#视频通话 -MainMenu2_heartrate = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_heartrate) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_camera_video = lv.img(MainMenu2_heartrate) -MainMenu2_img_camera_video.set_size(80,80) -MainMenu2_img_camera_video.set_pos(24,10) -MainMenu2_img_camera_video.set_src("U:/static/IMAGE_ONE_PAGE_VIDEOCALL.png") -MainMenu2_img_camera_video.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera_video.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_camera_video_txt = lv.label(MainMenu2_heartrate) -MainMenu2_img_camera_video_txt.set_pos(int(0),int(100)) -MainMenu2_img_camera_video_txt.set_size(128,20) -MainMenu2_img_camera_video_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera_video_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_camera_video_txt.set_text("视频通话") -MainMenu2_img_camera_video_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - -#表盘 -MainMenu2_Watchface = MainMenu2_til.add_tile(MainMenu2_num,0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_Watchface) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_num+=1 -MainMenu2x+=1 - - - -#通讯录 -MainMenu2_contacts = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_contacts) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_contacts = lv.img(MainMenu2_contacts) -MainMenu2_img_contacts.set_size(80,80) -MainMenu2_img_contacts.set_pos(24,10) -MainMenu2_img_contacts.set_src("U:/static/IMAGE_ONE_PAGE_CONTACTS.png") -MainMenu2_img_contacts.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_contacts.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_contacts_txt = lv.label(MainMenu2_contacts) -MainMenu2_img_contacts_txt.set_pos(int(0),int(100)) -MainMenu2_img_contacts_txt.set_size(128,20) -MainMenu2_img_contacts_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_contacts_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_contacts_txt.set_text("联系人") -MainMenu2_img_contacts_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - - -#拨号盘 -MainMenu2_phone = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_phone) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_phone = lv.img(MainMenu2_phone) -MainMenu2_img_phone.set_size(80,80) -MainMenu2_img_phone.set_pos(24,10) -MainMenu2_img_phone.set_src("U:/static/IMAGE_ONE_PAGE_CALL.png") -MainMenu2_img_phone.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_phone.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_phone_text = lv.label(MainMenu2_phone) -MainMenu2_img_phone_text.set_pos(int(0),int(100)) -MainMenu2_img_phone_text.set_size(128,20) -MainMenu2_img_phone_text.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_phone_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_phone_text.set_text("拨号盘") -MainMenu2_img_phone_text.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - -#相机 -MainMenu2_camera = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_camera) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_camera = lv.img(MainMenu2_camera) -MainMenu2_img_camera.set_size(80,80) -MainMenu2_img_camera.set_pos(24,10) -MainMenu2_img_camera.set_src("U:/static/IMAGE_ONE_PAGE_CAMERA.png") -MainMenu2_img_camera.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_camera_txt = lv.label(MainMenu2_camera) -MainMenu2_img_camera_txt.set_pos(int(0),int(100)) -MainMenu2_img_camera_txt.set_size(128,20) -MainMenu2_img_camera_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_camera_txt.set_text("相机") -MainMenu2_img_camera_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - - -#相册 -MainMenu2_camera_album = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -label_text = lv.label(MainMenu2_camera_album) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_camera_album = lv.img(MainMenu2_camera_album) -MainMenu2_img_camera_album.set_size(80,80) -MainMenu2_img_camera_album.set_pos(24,10) -MainMenu2_img_camera_album.set_src("U:/static/IMAGE_ONE_PAGE_ALBUM.png") -MainMenu2_img_camera_album.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera_album.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_camera_album_txt = lv.label(MainMenu2_camera_album) -MainMenu2_img_camera_album_txt.set_pos(int(0),int(100)) -MainMenu2_img_camera_album_txt.set_size(128,20) -MainMenu2_img_camera_album_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_camera_album_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_camera_album_txt.set_text("相册") -MainMenu2_img_camera_album_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - - - -#设置 -MainMenu2_setting = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) -#MainMenu2_setting.set_tile_act(0,0,lv.ANIM.ON) -label_text = lv.label(MainMenu2_setting) -label_text.set_pos(0, 0) -label_text.set_size(0, 0) -label_text.set_text("{}".format(MainMenu2_num)) -MainMenu2_img_setting = lv.img(MainMenu2_setting) -MainMenu2_img_setting.set_size(80,80) -MainMenu2_img_setting.set_pos(24,10) -MainMenu2_img_setting.set_src("U:/static/IMAGE_ONE_PAGE_SETTINGS.png") -MainMenu2_img_setting.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_setting.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -MainMenu2_img_setting_txt = lv.label(MainMenu2_setting) -MainMenu2_img_setting_txt.set_pos(int(0),int(100)) -MainMenu2_img_setting_txt.set_size(128,20) -MainMenu2_img_setting_txt.add_flag(lv.obj.FLAG.CLICKABLE) -MainMenu2_img_setting_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -MainMenu2_img_setting_txt.set_text("设置") -MainMenu2_img_setting_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -MainMenu2_num+=1 -MainMenu2x+=1 - - - -# #短信 -# MainMenu2_SMS = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) -# label_text = lv.label(MainMenu2_SMS) -# label_text.set_pos(0, 0) -# label_text.set_size(0, 0) -# label_text.set_text("{}".format(MainMenu2_num)) -# MainMenu2_img_sms = lv.img(MainMenu2_SMS) -# MainMenu2_img_sms.set_size(80,80) -# MainMenu2_img_sms.set_pos(24,10) -# MainMenu2_img_sms.set_src("U:/static/IMAGE_ONE_PAGE_SMS.png") -# MainMenu2_img_sms.add_flag(lv.obj.FLAG.CLICKABLE) -# MainMenu2_img_sms.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) - -# MainMenu2_img_sms_txt = lv.label(MainMenu2_SMS) -# MainMenu2_img_sms_txt.set_pos(int(0),int(100)) -# MainMenu2_img_sms_txt.set_size(128,20) -# MainMenu2_img_sms_txt.add_flag(lv.obj.FLAG.CLICKABLE) -# MainMenu2_img_sms_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# MainMenu2_img_sms_txt.set_text("短信") -# MainMenu2_img_sms_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) -# MainMenu2_num+=1 -# MainMenu2x+=1 - - - - - - - - - - - - - - - - - -#主菜单风格2,单页 -class MainMenuScreen(Screen): - NAME = "main_menu" - def __init__(self): - self.is_sliding =0 - self.meta = MainMenu2 - self.watchface = WatchFace() - self.menu_id = "0" - print("MainMenu1:__init__") - # MainMenu2_til.add_event_cb(lambda e: EventMesh.callback_wrapper(self.scroll_begin_event(e)),lv.EVENT.ALL,None) - #lv_obj_add_event_cb(lv_tabview_get_content(tabview), scroll_begin_event, LV_EVENT_SCROLL_END, NULL); - MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_add_friends.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "pp_main")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_camera_video.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_camera.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_camera_album.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) - MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) - # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) - #MainMenu2_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) - - MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) - MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) - MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) - MainMenu2_img_add_friends.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "pp_main")), lv.EVENT.PRESSING, None) - MainMenu2_img_camera_video.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.PRESSING, None) - MainMenu2_img_camera.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.PRESSING, None) - MainMenu2_img_camera_album.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.PRESSING, None) - MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) - MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) - # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) - #MainMenu2_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) - - - EventMesh.subscribe("watch_top_show", self.watch_top_show) - EventMesh.subscribe("return_setiing", self.return_setiing) - - def initialization(self): - self.is_sliding = 0 - self.watchface.initialization(MainMenu2_Watchface) - print("self.menu_id",self.menu_id) - if self.menu_id =="0": - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - # if self.meta_info in globals() : - # MainMenu2_til.set_tile_id(self.meta_info[0],self.meta_info[1],lv.ANIM.OFF) - pass# - def scroll_begin_event(self, e): - pass - - - def watch_top_show(self, event, msg): # - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - - def img_cb(self, e, msg): - code = e.get_code() - - #print("code!!!!!!!!",code,msg) - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - # print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 - state = EventMesh.publish("get_key_board", "key_board") - # print("msg",type(msg),msg,state) - if state == 1: - # print("state11",state) - if msg == 'Phone': - # print("Phone",state) - EventMesh.publish("load_screen", {"screen": "keyboard_popup"}) - pass - else: - if msg == "pp_main": - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - return - else: - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - else: - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - - else: - if msg == "pp_main": - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - return - else: - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - else: - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - print("MainMenu2:img_cb:{} {}".format(msg,type(msg))) - print("2self.is_sliding",self.is_sliding) - - self.is_sliding =0 - - - - def lcd_on(self): - self.watchface.watchface_style.timerout_update() - self.watchface.timer_update.start(10000, 1, self.watchface.timerout_update) - - def lcd_off(self): - self.watchface.timer_update.stop() - - def done_return(self): - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - - def btn1_release(self): - flag = EventMesh.publish("get_lcd_state") - if flag == 0: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - else: - if MainMenu2_til.get_tile_act() != None: - id = MainMenu2_til.get_tile_act().get_child(0).get_text() - #if id != "0": - - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - - def return_setiing(self, event, msg): - MainMenu2_til.set_tile_id(7,0,lv.ANIM.OFF) - - - - def btn8_press(self): - flag = EventMesh.publish("get_lcd_state") - if MainMenu2_til.get_tile_act() != None: - id = MainMenu2_til.get_tile_act().get_child(0).get_text() - if id == "4": - if flag == 1: - EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - else: - if flag == 1: - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - else: - if flag == 1: - MainMenu2_til.set_tile_id(4,0,lv.ANIM.OFF) - else: - EventMesh.publish(constants.EVENT.SYSTEM_UP) - - def done_bottom_to_top(self): - id = MainMenu2_til.get_tile_act().get_child(0).get_text() - if id == "4": - EventMesh.publish("load_screen", {"screen": "up_screen"}) - self.menu_id = id - - def done_top_to_bottom(self): - id = MainMenu2_til.get_tile_act().get_child(0).get_text() - if id == "4": - EventMesh.publish("load_screen", {"screen": "down_screen"}) - self.menu_id = id - def done_left_to_right(self): - self.menu_id = id - # id = MainMenu2_til.get_tile_act().get_child(0).get_text() - # print("done_left_to_right:ID{}".format(id)) - # if id == "0": - # MainMenu2_til.set_tile_id(MainMenu2_num-2,0,lv.ANIM.OFF) - # elif self.menu_id != '2' and id == '1': - # MainMenu2_til.set_tile_id(MainMenu2_num-2,0,lv.ANIM.OFF) - # self.menu_id = id - pass - def done_right_to_left(self): - self.menu_id = id - # id = MainMenu2_til.get_tile_act().get_child(0).get_text() - # print("done_right_to_left:ID{}".format(id)) - # if id == "0": - # MainMenu2_til.set_tile_id(0,0,lv.ANIM.OFF) - # elif (self.menu_id != str(MainMenu2_num-2) ) and id == str(MainMenu2_num-1) : - # MainMenu2_til.set_tile_id(0,0,lv.ANIM.OFF) - # self.menu_id = id - pass - def Close(self): - self.watchface.Close() - print("main_menu Close !!!!!!!!") - # self.menu_id = '0' - return - diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/versions.py b/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/versions.py deleted file mode 100644 index 475d8642..00000000 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/versions.py +++ /dev/null @@ -1,2 +0,0 @@ -Version="V1.0" -Build_Time="2024-06-15 11:35:16" diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h index 1e7def92..16fe13e3 100644 --- a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h +++ b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h @@ -4,16 +4,15 @@ * Helios SDK Configuration * */ -#define PROJECT_NAME_G3_K01 1 //项目宏定义 +#define PROJECT_NAME_M36_W8 1 //项目宏定义 #define CONFIG_LVGL_SPAN 1 #define CONFIG_LVGL_FS_HELIOS 1 -#define CONFIG_LVGL_GIF_DECODE 1 +//#define CONFIG_LVGL_GIF_DECODE 1 #define CONFIG_LVGL_SPINNER 1 #define CONFIG_LCD 1 #define CONFIG_LVGL_ANIMIMG 1 #define CONFIG_LVGL_KEYBOARD 1 #define CONFIG_LVGL_CALENDAR 1 -#define CONFIG_AUDIO_G711_COMPRESS 1 #define CONFIG_LVGL_LED 1 #define CONFIG_VIOCE_CALL 1 #define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1 @@ -31,7 +30,7 @@ //#define CONFIG_GH301x 1 #define CONFIG_MBEDTLS 1 //#define CONFIG_TTS 1 -#define CONFIG_SC7A20 1 +//#define CONFIG_SC7A20 1 #define CONFIG_LVGL_WIN 1 #define CONFIG_LVGL_COLORWHEEL 1 #define CONFIG_LVGL_CANVAS 1 @@ -43,4 +42,6 @@ #define CONFIG_JPEG 1 #define CONFIG_CAMERA_SAVEPHOTOS 1 //菊风视频通话 -#define CONFIG_juphoon 1 \ No newline at end of file +#define CONFIG_juphoon 1 +//#define CONFIG_LVGL_USE_FREETYPE 1//矢量字库 +#define PROJECT_NAME_G3_K01_font 1 \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk index 879f09ae..012987df 100644 --- a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk +++ b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk @@ -2,7 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Helios SDK Configuration # -PROJECT_NAME_G3_K01=y +PROJECT_NAME_M36_W8=y # # System Configuration # @@ -60,8 +60,9 @@ CONFIG_LCD=y # CONFIG_UART_SLIP is not set # CONFIG_POC is not set #CONFIG_GH301x=y -CONFIG_AUDIO_G711_COMPRESS=y -CONFIG_SC7A20=y +#CONFIG_HX3918=y +#CONFIG_SC7A20=y +#CONFIG_LVGL_USE_FREETYPE=y #菊风视频通话 CONFIG_juphoon=y - +PROJECT_NAME_G3_K01_font=y diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h index 7ffdbeb9..f0fd0145 100644 --- a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h +++ b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h @@ -52,23 +52,9 @@ #define MICROPY_QPY_MODULE_NB (0) #define MICROPY_QPY_MODULE_UHASHLIB (1) #define MICROPY_QPY_MODULE_UCRYPTOLIB (1) -#define MICROPY_QPY_MODULE_CAN_MCP2515 (1) - - -#if CONFIG_AUDIO_G711_COMPRESS -#define MICROPY_QPY_MODULE_G711 (1) -#else -#define MICROPY_QPY_MODULE_G711 (0) -#endif - -#if CONFIG_AUDIO_G729_COMPRESS -#define MICROPY_QPY_MODULE_G729 (1) -#else -#define MICROPY_QPY_MODULE_G729 (0) -#endif #define MICROPY_QPY_MODULE_ALIPAY (0) #define MICROPY_QPY_MODULE_VFS_THREADSAFE (1) - +#define MICROPY_QPY_MODULE_GPIO_ENCODER (0) #if CONFIG_MBEDTLS #define MICROPY_QPY_MODULE_USSL (0) #define MICROPY_QPY_SSL_MBEDTLS (1) diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.7z b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.7z index 00bfb2d8..0b5c3196 100644 Binary files a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.7z and b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.7z differ diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip index 231eb6c0..253bbc2b 100644 Binary files a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip and b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip differ diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h index 7232096e..242610f4 100644 --- a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h +++ b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h @@ -2,8 +2,8 @@ #ifndef __APP_LINK_START_ADDR_H__ #define __APP_LINK_START_ADDR_H__ -#define APP_LINK_START_ADDR 0x804E4000 -#define APP_FLASH_MAX_SIZE 0x208000 +#define APP_LINK_START_ADDR 0x804E2000 +#define APP_FLASH_MAX_SIZE 0x220000 #define APP_RAM_START 0x7E3E0000 #define APP_RAM_MAX_SIZE 0x180000 diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib index 78522608..8f0ae189 100644 Binary files a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib and b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib differ diff --git a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib index 1dc8ac09..2c9d26bb 100644 Binary files a/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib and b/2.sdk-ZY/Helios_SDK/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib differ diff --git a/2.sdk-ZY/project/C06S/images/customer_fs.bin b/2.sdk-ZY/project/C06S/images/customer_fs.bin index 13910d37..fa045a1a 100644 Binary files a/2.sdk-ZY/project/C06S/images/customer_fs.bin and b/2.sdk-ZY/project/C06S/images/customer_fs.bin differ diff --git a/2.sdk-ZY/project/C06S/images/ext_fs.bin b/2.sdk-ZY/project/C06S/images/ext_fs.bin index 3e06fd48..6637f645 100644 Binary files a/2.sdk-ZY/project/C06S/images/ext_fs.bin and b/2.sdk-ZY/project/C06S/images/ext_fs.bin differ diff --git a/2.sdk-ZY/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py b/2.sdk-ZY/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py index 2bf3df12..c061ed66 100644 --- a/2.sdk-ZY/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py +++ b/2.sdk-ZY/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py @@ -1,2 +1,2 @@ Version="V1.0" -Build_Time="2024-01-25 16:47:49" +Build_Time="2024-07-04 12:43:35" diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h index 2fe8e6bf..055131db 100644 --- a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h +++ b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h @@ -41,3 +41,4 @@ #define CONFIG_CAMERA 1 #define CONFIG_JPEG 1 #define CONFIG_CAMERA_SAVEPHOTOS 1 +//#define CONFIG_LVGL_USE_FREETYPE 1//矢量字库 \ No newline at end of file diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk index 168ac944..cc096a60 100644 --- a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk +++ b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk @@ -62,4 +62,4 @@ CONFIG_LCD=y #CONFIG_GH301x=y CONFIG_HX3918=y CONFIG_SC7A20=y - +#CONFIG_LVGL_USE_FREETYPE=y diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h index 5db3e8b3..b0cc7f52 100644 --- a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h +++ b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h @@ -54,7 +54,7 @@ #define MICROPY_QPY_MODULE_UCRYPTOLIB (1) #define MICROPY_QPY_MODULE_ALIPAY (0) #define MICROPY_QPY_MODULE_VFS_THREADSAFE (1) -#define MICROPY_QPY_MODULE_GPIO_ENCODER (1) +#define MICROPY_QPY_MODULE_GPIO_ENCODER (0) #if CONFIG_MBEDTLS #define MICROPY_QPY_MODULE_USSL (0) #define MICROPY_QPY_SSL_MBEDTLS (1) diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip index 5fb8defa..9330161d 100644 Binary files a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip and b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip differ diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib index 072d3142..78522608 100644 Binary files a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib and b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib differ diff --git a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib index 525a1f3a..1dc8ac09 100644 Binary files a/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib and b/2.sdk-ZY/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib differ diff --git a/2.sdk-ZY/project/K01/images/customer_fs.bin b/2.sdk-ZY/project/K01/images/customer_fs.bin index e33428ca..4b72e87e 100644 Binary files a/2.sdk-ZY/project/K01/images/customer_fs.bin and b/2.sdk-ZY/project/K01/images/customer_fs.bin differ diff --git a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/versions.py b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/versions.py index 475d8642..8098fa0f 100644 --- a/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/versions.py +++ b/2.sdk-ZY/project/K01/sdk/services/microPython/ports/quectel/core/versions.py @@ -1,2 +1,2 @@ Version="V1.0" -Build_Time="2024-06-15 11:35:16" +Build_Time="2024-07-05 10:20:36" diff --git a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h index 1e7def92..84313455 100644 --- a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h +++ b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h @@ -43,4 +43,5 @@ #define CONFIG_JPEG 1 #define CONFIG_CAMERA_SAVEPHOTOS 1 //菊风视频通话 -#define CONFIG_juphoon 1 \ No newline at end of file +#define CONFIG_juphoon 1 +#define PROJECT_NAME_G3_K01_font 1 \ No newline at end of file diff --git a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk index 879f09ae..0f95eb78 100644 --- a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk +++ b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk @@ -64,4 +64,4 @@ CONFIG_AUDIO_G711_COMPRESS=y CONFIG_SC7A20=y #菊风视频通话 CONFIG_juphoon=y - +PROJECT_NAME_G3_K01_font=y diff --git a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip index 06c5a5b6..bc20a8d0 100644 Binary files a/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip and b/2.sdk-ZY/project/K01/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip differ diff --git a/2.sdk-ZY/project/W9/ext/static/0_BAT.png b/2.sdk-ZY/project/W9/ext/static/0_BAT.png new file mode 100644 index 00000000..c37574ac Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/0_BAT.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/0_weather.png b/2.sdk-ZY/project/W9/ext/static/0_weather.png new file mode 100644 index 00000000..a2539365 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/0_weather.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/1_weather.png b/2.sdk-ZY/project/W9/ext/static/1_weather.png new file mode 100644 index 00000000..ec616f53 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/1_weather.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/2_weather.png b/2.sdk-ZY/project/W9/ext/static/2_weather.png new file mode 100644 index 00000000..b77505bf Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/2_weather.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/3_weather.png b/2.sdk-ZY/project/W9/ext/static/3_weather.png new file mode 100644 index 00000000..b598f0ff Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/3_weather.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF001.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF001.png new file mode 100644 index 00000000..3d77e434 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF001.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF002.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF002.png new file mode 100644 index 00000000..aa6efead Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF002.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF003.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF003.png new file mode 100644 index 00000000..a294299e Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF003.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF004.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF004.png new file mode 100644 index 00000000..be7a97d4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF004.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF005.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF005.png new file mode 100644 index 00000000..ca62dd95 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF005.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF006.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF006.png new file mode 100644 index 00000000..fcef234a Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF006.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF007.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF007.png new file mode 100644 index 00000000..90ee105c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF007.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF008.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF008.png new file mode 100644 index 00000000..1240f4b9 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF008.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF009.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF009.png new file mode 100644 index 00000000..afa8ee84 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF009.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF010.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF010.png new file mode 100644 index 00000000..1035f68f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF010.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF011.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF011.png new file mode 100644 index 00000000..4ca5e8dc Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_LISTEN_GIF011.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK001.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK001.png new file mode 100644 index 00000000..1c1c40c6 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK001.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK002.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK002.png new file mode 100644 index 00000000..ebde5798 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK002.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK003.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK003.png new file mode 100644 index 00000000..662efecb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK003.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK004.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK004.png new file mode 100644 index 00000000..8a55790e Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK004.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK005.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK005.png new file mode 100644 index 00000000..a1264737 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK005.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK006.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK006.png new file mode 100644 index 00000000..58795a9c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK006.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK007.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK007.png new file mode 100644 index 00000000..e1fa0262 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK007.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK008.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK008.png new file mode 100644 index 00000000..15a79702 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK008.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK009.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK009.png new file mode 100644 index 00000000..2a2c3d7c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK009.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK010.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK010.png new file mode 100644 index 00000000..186c889d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK010.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK011.png b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK011.png new file mode 100644 index 00000000..bdc78dc1 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/AI_THINK011.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_confirm_bt.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_confirm_bt.png new file mode 100644 index 00000000..00ade64b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_confirm_bt.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_result_bt.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_bt.png new file mode 100644 index 00000000..72a2f6bb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_bt.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_start.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_start.png new file mode 100644 index 00000000..6fae0204 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_start.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_stop.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_stop.png new file mode 100644 index 00000000..d58ea1fe Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_result_can_stop.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_talk_bt.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_talk_bt.png new file mode 100644 index 00000000..ec42e3e7 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_talk_bt.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/AI/ai_warning.png b/2.sdk-ZY/project/W9/ext/static/AI/ai_warning.png new file mode 100644 index 00000000..df210cec Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/AI/ai_warning.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1.jpg b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1.jpg new file mode 100644 index 00000000..78bf3c55 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1.jpg differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11.png new file mode 100644 index 00000000..ecf67873 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11_1.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11_1.png new file mode 100644 index 00000000..d4873f96 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_11_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_12.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_12.png new file mode 100644 index 00000000..58d75700 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_12.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13.png new file mode 100644 index 00000000..b8afd22d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13_1_1.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13_1_1.png new file mode 100644 index 00000000..0e1b0b84 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_13_1_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_1_1.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_1_1.png new file mode 100644 index 00000000..3ff4400f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_1_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2.png new file mode 100644 index 00000000..1cc13f6c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2_1.png b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2_1.png new file mode 100644 index 00000000..481a84fc Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/alipay/1_2_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_1.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_1.png new file mode 100644 index 00000000..dfc8af1e Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_2.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_2.png new file mode 100644 index 00000000..07f2ea2a Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_2.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_3.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_3.png new file mode 100644 index 00000000..d9e83ed4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/R_3.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_1.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_1.png new file mode 100644 index 00000000..aeddf4c6 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_2.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_2.png new file mode 100644 index 00000000..e7861e04 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_2.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_3.png b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_3.png new file mode 100644 index 00000000..8c6c4e0b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/APP/wechat/S_3.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/DIAL_PREV01.png b/2.sdk-ZY/project/W9/ext/static/DIAL_PREV01.png new file mode 100644 index 00000000..24f48cc2 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/DIAL_PREV01.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/DIAL_PREV02.png b/2.sdk-ZY/project/W9/ext/static/DIAL_PREV02.png new file mode 100644 index 00000000..c3170dcf Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/DIAL_PREV02.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_APP_QR_CODE.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_APP_QR_CODE.png new file mode 100644 index 00000000..69fe55c8 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_APP_QR_CODE.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DELKEY.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DELKEY.png new file mode 100644 index 00000000..d82916c8 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DELKEY.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL.png new file mode 100644 index 00000000..aa26f3a0 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL_CONTACT.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL_CONTACT.png new file mode 100644 index 00000000..9161a2b8 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_BUTTON_DIAL_CONTACT.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png new file mode 100644 index 00000000..1216575c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_CALL.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_CALL.png new file mode 100644 index 00000000..793876c0 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_CALL.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_NONE.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_NONE.png new file mode 100644 index 00000000..bce1bfad Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NOTICE_NONE.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY00_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY00_ICON.png new file mode 100644 index 00000000..c79e5c07 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY07_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY07_ICON.png new file mode 100644 index 00000000..a5c579e4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY07_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY09_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY09_ICON.png new file mode 100644 index 00000000..304ecb05 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY09_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY0_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY0_ICON.png new file mode 100644 index 00000000..a739ffb0 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY0_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY1_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY1_ICON.png new file mode 100644 index 00000000..93aa580f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY1_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY2_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY2_ICON.png new file mode 100644 index 00000000..01192662 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY2_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY3_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY3_ICON.png new file mode 100644 index 00000000..c38515b4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY3_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY4_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY4_ICON.png new file mode 100644 index 00000000..502e5c73 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY4_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY5_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY5_ICON.png new file mode 100644 index 00000000..8ee6b4f2 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY5_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY6_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY6_ICON.png new file mode 100644 index 00000000..7ac14078 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY6_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY7_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY7_ICON.png new file mode 100644 index 00000000..0784165d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY7_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY8_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY8_ICON.png new file mode 100644 index 00000000..1878619d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY8_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY9_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY9_ICON.png new file mode 100644 index 00000000..126ae77c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEY9_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYHASH00_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYHASH00_ICON.png new file mode 100644 index 00000000..6278f30b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYHASH00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYSTAR00_ICON.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYSTAR00_ICON.png new file mode 100644 index 00000000..c64ec927 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_NUMBER_KEYSTAR00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/IMAGE_STEP.png b/2.sdk-ZY/project/W9/ext/static/IMAGE_STEP.png new file mode 100644 index 00000000..30fe40bb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/IMAGE_STEP.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/REDUCE_VOLUM_ICON.png b/2.sdk-ZY/project/W9/ext/static/REDUCE_VOLUM_ICON.png new file mode 100644 index 00000000..6e66a7ce Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/REDUCE_VOLUM_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/RED_RETURN_PNG.png b/2.sdk-ZY/project/W9/ext/static/RED_RETURN_PNG.png new file mode 100644 index 00000000..e7af8032 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/RED_RETURN_PNG.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/R_CALL_mp3.mp3 b/2.sdk-ZY/project/W9/ext/static/R_CALL_mp3.mp3 new file mode 100644 index 00000000..3e2d29bf Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/R_CALL_mp3.mp3 differ diff --git a/2.sdk-ZY/project/W9/ext/static/R_POWER_1.mp3 b/2.sdk-ZY/project/W9/ext/static/R_POWER_1.mp3 new file mode 100644 index 00000000..a112ae88 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/R_POWER_1.mp3 differ diff --git a/2.sdk-ZY/project/W9/ext/static/R_POWER_OFF_1.mp3 b/2.sdk-ZY/project/W9/ext/static/R_POWER_OFF_1.mp3 new file mode 100644 index 00000000..4bc6099b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/R_POWER_OFF_1.mp3 differ diff --git a/2.sdk-ZY/project/W9/ext/static/SOS_PLAY.mp3 b/2.sdk-ZY/project/W9/ext/static/SOS_PLAY.mp3 new file mode 100644 index 00000000..f2588cdb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/SOS_PLAY.mp3 differ diff --git a/2.sdk-ZY/project/W9/ext/static/VOLUM_ADD_ICON.png b/2.sdk-ZY/project/W9/ext/static/VOLUM_ADD_ICON.png new file mode 100644 index 00000000..c49a7282 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/VOLUM_ADD_ICON.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/add_btn.png b/2.sdk-ZY/project/W9/ext/static/add_btn.png new file mode 100644 index 00000000..4e180873 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/add_btn.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/album_delete.png b/2.sdk-ZY/project/W9/ext/static/album_delete.png new file mode 100644 index 00000000..8ea8e288 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/album_delete.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/answer.png b/2.sdk-ZY/project/W9/ext/static/answer.png new file mode 100644 index 00000000..4121841f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/answer.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/audio_audio_haixiu.mp3 b/2.sdk-ZY/project/W9/ext/static/audio_audio_haixiu.mp3 new file mode 100644 index 00000000..673a9977 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/audio_audio_haixiu.mp3 differ diff --git a/2.sdk-ZY/project/W9/ext/static/bg.png b/2.sdk-ZY/project/W9/ext/static/bg.png new file mode 100644 index 00000000..cb51f244 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/bg.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/camera_album_btn.png b/2.sdk-ZY/project/W9/ext/static/camera_album_btn.png new file mode 100644 index 00000000..af0c9bee Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/camera_album_btn.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/camera_btn.png b/2.sdk-ZY/project/W9/ext/static/camera_btn.png new file mode 100644 index 00000000..e059ba2d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/camera_btn.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/cancel_icon.png b/2.sdk-ZY/project/W9/ext/static/cancel_icon.png new file mode 100644 index 00000000..905ad0a9 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/cancel_icon.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/charge_ing.png b/2.sdk-ZY/project/W9/ext/static/charge_ing.png new file mode 100644 index 00000000..61cb943a Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/charge_ing.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/find_phone.png b/2.sdk-ZY/project/W9/ext/static/find_phone.png new file mode 100644 index 00000000..4edcb408 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/find_phone.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/hang_up.png b/2.sdk-ZY/project/W9/ext/static/hang_up.png new file mode 100644 index 00000000..ef3e0fbb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/hang_up.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/list_bg.png b/2.sdk-ZY/project/W9/ext/static/list_bg.png new file mode 100644 index 00000000..5cd1c80a Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/list_bg.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/low_power.png b/2.sdk-ZY/project/W9/ext/static/low_power.png new file mode 100644 index 00000000..81883498 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/low_power.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/menu_time.png b/2.sdk-ZY/project/W9/ext/static/menu_time.png new file mode 100644 index 00000000..c7941f55 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/menu_time.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/menustyle_select.png b/2.sdk-ZY/project/W9/ext/static/menustyle_select.png new file mode 100644 index 00000000..1ad816b6 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/menustyle_select.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/mpsignal1.png b/2.sdk-ZY/project/W9/ext/static/mpsignal1.png new file mode 100644 index 00000000..2fad2fc4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/mpsignal1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/mpsignal2.png b/2.sdk-ZY/project/W9/ext/static/mpsignal2.png new file mode 100644 index 00000000..0ae3897c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/mpsignal2.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/mpsignal3.png b/2.sdk-ZY/project/W9/ext/static/mpsignal3.png new file mode 100644 index 00000000..facd701f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/mpsignal3.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/mpsignal4.png b/2.sdk-ZY/project/W9/ext/static/mpsignal4.png new file mode 100644 index 00000000..59024dd9 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/mpsignal4.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/mpsignal5.png b/2.sdk-ZY/project/W9/ext/static/mpsignal5.png new file mode 100644 index 00000000..7edc0d2c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/mpsignal5.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/off_icon.png b/2.sdk-ZY/project/W9/ext/static/off_icon.png new file mode 100644 index 00000000..b74f45b7 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/off_icon.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/point_black.png b/2.sdk-ZY/project/W9/ext/static/point_black.png new file mode 100644 index 00000000..16cbf4ea Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/point_black.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/point_white.png b/2.sdk-ZY/project/W9/ext/static/point_white.png new file mode 100644 index 00000000..9b0585fa Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/point_white.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/poweroff_icon.png b/2.sdk-ZY/project/W9/ext/static/poweroff_icon.png new file mode 100644 index 00000000..744901d0 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/poweroff_icon.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/reduce_btn.png b/2.sdk-ZY/project/W9/ext/static/reduce_btn.png new file mode 100644 index 00000000..3162f892 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/reduce_btn.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_app_qrcode.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_app_qrcode.png new file mode 100644 index 00000000..6c5055da Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_app_qrcode.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_bright.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_bright.png new file mode 100644 index 00000000..6ece4597 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_bright.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_imei_qrcode.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_imei_qrcode.png new file mode 100644 index 00000000..90029c56 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_imei_qrcode.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_poweroff.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_poweroff.png new file mode 100644 index 00000000..d9c389fd Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_poweroff.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_restore.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_restore.png new file mode 100644 index 00000000..04bc1fba Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_restore.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_theme_menustyle.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_theme_menustyle.png new file mode 100644 index 00000000..45a2727b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_theme_menustyle.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_upgrade.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_upgrade.png new file mode 100644 index 00000000..4b5812fe Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_upgrade.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_version.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_version.png new file mode 100644 index 00000000..8ece3f51 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_version.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_volume.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_volume.png new file mode 100644 index 00000000..79f77887 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_volume.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/menu_watch_switch.png b/2.sdk-ZY/project/W9/ext/static/setting/menu_watch_switch.png new file mode 100644 index 00000000..b6a01fc3 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/menu_watch_switch.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/setting/setting_text.png b/2.sdk-ZY/project/W9/ext/static/setting/setting_text.png new file mode 100644 index 00000000..6ff41e4e Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/setting/setting_text.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/stopwatch_play.png b/2.sdk-ZY/project/W9/ext/static/stopwatch_play.png new file mode 100644 index 00000000..73a652b4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/stopwatch_play.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/stopwatch_reset.png b/2.sdk-ZY/project/W9/ext/static/stopwatch_reset.png new file mode 100644 index 00000000..7a5e6d41 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/stopwatch_reset.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/stopwatch_stop.png b/2.sdk-ZY/project/W9/ext/static/stopwatch_stop.png new file mode 100644 index 00000000..ef1e7344 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/stopwatch_stop.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/storage_file/wechat_num.txt b/2.sdk-ZY/project/W9/ext/static/storage_file/wechat_num.txt new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CAMERA.png b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CAMERA.png new file mode 100644 index 00000000..b175b0f4 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CAMERA.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CONTACTS.png b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CONTACTS.png new file mode 100644 index 00000000..e62722a2 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_CONTACTS.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_SETING.png b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_SETING.png new file mode 100644 index 00000000..2464976f Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_SETING.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_WECHAT.png b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_WECHAT.png new file mode 100644 index 00000000..2ab9e3ec Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/theme1/THEME1_WECHAT.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/time_down.png b/2.sdk-ZY/project/W9/ext/static/time_down.png new file mode 100644 index 00000000..ceb6157d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/time_down.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/time_finish.png b/2.sdk-ZY/project/W9/ext/static/time_finish.png new file mode 100644 index 00000000..8c4a52c0 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/time_finish.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/time_up.png b/2.sdk-ZY/project/W9/ext/static/time_up.png new file mode 100644 index 00000000..55e459a2 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/time_up.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/time_up1.png b/2.sdk-ZY/project/W9/ext/static/time_up1.png new file mode 100644 index 00000000..65b9c6bb Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/time_up1.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/time_up2.png b/2.sdk-ZY/project/W9/ext/static/time_up2.png new file mode 100644 index 00000000..41a9c60c Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/time_up2.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_ALARM.png b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_ALARM.png new file mode 100644 index 00000000..dc0a8c53 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_ALARM.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_COUNTDOWN.png b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_COUNTDOWN.png new file mode 100644 index 00000000..817e227d Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_COUNTDOWN.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STEP.png b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STEP.png new file mode 100644 index 00000000..9f3a4bf6 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STEP.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STOPWATCH.png b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STOPWATCH.png new file mode 100644 index 00000000..a1a04927 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_STOPWATCH.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_WEATHER.png b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_WEATHER.png new file mode 100644 index 00000000..0d9b2442 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/IMAGE_SECMENU_WEATHER.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/sms_setting.png b/2.sdk-ZY/project/W9/ext/static/tool/sms_setting.png new file mode 100644 index 00000000..7ff5771e Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/sms_setting.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png b/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png new file mode 100644 index 00000000..0db49139 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/tool/tool_text.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/update.png b/2.sdk-ZY/project/W9/ext/static/update.png new file mode 100644 index 00000000..6357d6e9 Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/update.png differ diff --git a/2.sdk-ZY/project/W9/ext/static/vbat_0.png b/2.sdk-ZY/project/W9/ext/static/vbat_0.png new file mode 100644 index 00000000..c3341e8b Binary files /dev/null and b/2.sdk-ZY/project/W9/ext/static/vbat_0.png differ diff --git a/2.sdk-ZY/project/W9/firmware_base_release_pack.zip.tmp b/2.sdk-ZY/project/W9/firmware_base_release_pack.zip.tmp new file mode 100644 index 00000000..ca188440 Binary files /dev/null and b/2.sdk-ZY/project/W9/firmware_base_release_pack.zip.tmp differ diff --git a/2.sdk-ZY/project/W9/font/ext_font.bin b/2.sdk-ZY/project/W9/font/ext_font.bin new file mode 100644 index 00000000..fe952341 Binary files /dev/null and b/2.sdk-ZY/project/W9/font/ext_font.bin differ diff --git a/2.sdk-ZY/project/W9/font/font_28.bin b/2.sdk-ZY/project/W9/font/font_28.bin new file mode 100644 index 00000000..f9a14201 Binary files /dev/null and b/2.sdk-ZY/project/W9/font/font_28.bin differ diff --git a/2.sdk-ZY/project/W9/font/font_40.bin b/2.sdk-ZY/project/W9/font/font_40.bin new file mode 100644 index 00000000..9e38282a Binary files /dev/null and b/2.sdk-ZY/project/W9/font/font_40.bin differ diff --git a/2.sdk-ZY/project/W9/font/font_bin_merge.py b/2.sdk-ZY/project/W9/font/font_bin_merge.py new file mode 100644 index 00000000..7d177dca --- /dev/null +++ b/2.sdk-ZY/project/W9/font/font_bin_merge.py @@ -0,0 +1,48 @@ +from struct import * + + +def bin_create(*args): + if len(args) < 1: + print("wrong params number!") + return -1 + # bin header :one byte for font_num, font_num bytes for bin_size + # 大端1,小端2 + # endian = input("输入大小端:") + with open("ext_font.bin","wb") as dest_file: + # start + start = "s" + end = "e" + + font_num = len(args) + bin_data = [] + bin_size = [] + font_name = "" + + for i in range(font_num): + with open(args[i], "rb") as bin_file: + data = bin_file.read() + padding = "\0" * (128 - len(args[i])) + string_padded = args[i] + padding + font_name += string_padded + bin_size.append(len(data)) + bin_data.append(data) + + # # 大端 + # if endian == "1": + # write_data = pack(">B%ds%dI"% (font_num*128, font_num), font_num, font_name.encode(), *bin_size) + # # 小端 + # else: + write_data = pack("__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if( p_pos[0] != 0 ) { + uint32_t pos = p_pos[0]; + glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(pos, sizeof(glyph_dsc_t)); + return __user_font_getdata(pos+sizeof(glyph_dsc_t), gdsc->box_w*gdsc->box_h*__g_xbf_hd.bpp/8); + } + return NULL; +} + + +static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { + if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) { + return NULL; + } + uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4; + uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4); + if( p_pos[0] != 0 ) { + glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], sizeof(glyph_dsc_t)); + dsc_out->adv_w = gdsc->adv_w; + dsc_out->box_h = gdsc->box_h; + dsc_out->box_w = gdsc->box_w; + dsc_out->ofs_x = gdsc->ofs_x; + dsc_out->ofs_y = gdsc->ofs_y; + dsc_out->bpp = __g_xbf_hd.bpp; + return true; + } + return false; +} + + +//HarmonyOS Sans SC,,-1 +//字模高度:33 +//XBF字体,外部bin文件 +lv_font_t font_28 = { + .get_glyph_bitmap = __user_font_get_bitmap, + .get_glyph_dsc = __user_font_get_glyph_dsc, + .line_height = 33, + .base_line = 0, +}; + diff --git "a/2.sdk-ZY/project/W9/font/\345\270\270\347\224\250\344\270\255\346\226\207\345\255\227.txt" "b/2.sdk-ZY/project/W9/font/\345\270\270\347\224\250\344\270\255\346\226\207\345\255\227.txt" new file mode 100644 index 00000000..61551386 --- /dev/null +++ "b/2.sdk-ZY/project/W9/font/\345\270\270\347\224\250\344\270\255\346\226\207\345\255\227.txt" @@ -0,0 +1 @@ +啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄zxcvbnm,./';lkjhgfdsaqwertyuiop[]\1234567890-=ZXCVBNM<>?ASDFGHJKL:"QWERTYUIOP{}|~!@#$%^&*()_+` ,。、‘;’【】、·《》?:“”{}|~!@#ï¿¥%……&*()——+°℃ \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/images/customer_fs.bin b/2.sdk-ZY/project/W9/images/customer_fs.bin new file mode 100644 index 00000000..de0b82c0 Binary files /dev/null and b/2.sdk-ZY/project/W9/images/customer_fs.bin differ diff --git a/2.sdk-ZY/project/W9/new.bat b/2.sdk-ZY/project/W9/new.bat new file mode 100644 index 00000000..1f314e93 --- /dev/null +++ b/2.sdk-ZY/project/W9/new.bat @@ -0,0 +1,39 @@ +@echo off + +md images +del images /q +@GOTO :STEP1 +..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin +if errorlevel 1 ( + echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! " + goto exit +) +if errorlevel 0 ( + echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! " +) +:STEP1 + +..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 589824 -i .\images\customer_fs.bin +if errorlevel 1 ( + echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!" + goto exit +) +if errorlevel 0 ( + echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! " +) + +%copy font\ext_font.bin images\ext_font.bin% + +..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\ +if errorlevel 0 ( + echo images压缩成功!!!!!!!!!!!!!! +) +if errorlevel 1 ( + echo images压缩失败!!!!!!!!!!!!!!!!!! + goto exit +) +xcopy sdk\ ..\..\Helios_SDK\ /e/h/y +cd ..\..\Helios_SDK +helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE +cd .. +:exit \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/EventMesh.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/EventMesh.py new file mode 100644 index 00000000..e1cceaa7 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/EventMesh.py @@ -0,0 +1,114 @@ +import _thread +import usys +import versions + +MODEL = "W8_" #项目型号 + + +version = "{}{}".format(MODEL,versions.Version) +builTime = "{}".format(versions.Build_Time) + +class EventStore(object): + def __init__(self): + self.map = dict() + self.log = None + self.__filters = [] + + def add_filter(self, flt): + self.__filters.append(flt) + + def append(self, event, cb): + self.map[event] = cb + + def fire_async(self, event, msg,thread_size): + if event in self.map: + #print("fire_async:thread_size:{}".format(thread_size)) + if thread_size != None: + _thread.stack_size(thread_size) + #print("fire_async:thread_size:{}".format(thread_size)) + _thread.start_new_thread(self.map[event], (event, msg)) + if thread_size != None: + _thread.stack_size(8*1024) + if self.log: + self.log.info("ASYNC executed (event) -> {} (params) -> {} (result) -> {}".format(event, msg, None)) + + def fire_sync(self, event, msg): + res = None + try: + if event in self.map: + res = self.map[event](event, msg) + except Exception as e: + usys.print_exception(e) + if self.log: + self.log.info("ERROR executed (event) -> {} (params) -> {} (result) -> {}".format(event, msg, res)) + if event not in self.__filters: + if self.log: + self.log.info("SYNC executed (event) -> {} (params) -> {} (result) -> {}".format(event, msg, res)) + return res + + +event_store = EventStore() + + +def subscribe(event, cb): + """ + subscribe event and cb + """ + return event_store.append(event, cb) + + +def publish(event, msg=None): + """ + publish event and msg + """ + return publish_sync(event, msg) + + +def publish_async(event, msg=None,thread_size = None): + """ + 异步发送 + """ + return event_store.fire_async(event, msg,thread_size) + + +def publish_sync(event, msg=None): + """ + 同步发送 + """ + return event_store.fire_sync(event, msg) + + +def set_log(log_adapter): + event_store.log = log_adapter + + +def add_filter(flt): + event_store.add_filter(flt) +import utime +import uos +Txt_Log = 0 +def txt_log(data): + if Txt_Log != 0 : + print(data) + try: + f_stat = uos.stat("ext/log.txt") + if f_stat[6] >50*1024: + uos.remove("ext/log.txt") + except Exception as e: + usys.print_exception(e) + with open("/usr/log.txt","a",encoding="utf-8") as fd: + d_time = utime.localtime() + data_tmp = "%02d-%02d %02d:%02d:%02d :"%(d_time[1],d_time[2],d_time[3],d_time[4],d_time[5]) + fd.write(data_tmp+data+"\n") + +def callback_wrapper(callback):#按键回调 + def wrapped_callback(*args, **kwargs): + try: + return callback(*args, **kwargs) + except Exception as e: + # 在这里处理异常,例如打印错误信息,保存到日志文件,等等。 + print('Exception in callback:', e) + # 如果需要,你可以在这里重新抛出异常 + # raise + return wrapped_callback + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/Makefile b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/Makefile similarity index 97% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/Makefile rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/Makefile index 74ce1ce6..c381e3ec 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/Makefile +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/Makefile @@ -269,8 +269,6 @@ SRC_QSTR_IGNORE = py/nlr% SRC_QSTR += $(SRC_MOD) $(filter-out $(SRC_QSTR_IGNORE),$(PY_CORE_O_BASENAME:.o=.c)) $(PY_EXTMOD_O_BASENAME:.o=.c) SRC_QSTR += \ source/modalipay.c \ - source/modalipay_collection.c \ - source/modalipay_se.c \ source/audio_audio.c \ source/audio_handle.c \ source/audio_queue.c \ @@ -357,12 +355,11 @@ SRC_QSTR += \ source/tp_gt9xx.c \ source/tp_xpt2046.c \ source/tp_cst816.c \ - source/tp_ft6x36.c \ - source/tp_st1615.c \ source/modGsensor.c \ source/modGsensor_SC7A20.c \ source/modHsensor.c \ source/modHsensor_GH3018.c \ + source/modHsensor_HX3918.c \ source/modVideoCall.c \ source/modVideoCall_juphoon.c \ source/modrsa.c \ @@ -544,7 +541,6 @@ INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/net INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/netinet INC += -I$(ROOT)/system/lwip/$(strip $(PLAT))/src/include/posix/sys INC += -I$(ROOT)/system/at -INC += -I$(ROOT)/system/esim endif ifeq ($(strip $(PLAT)),Unisoc_8910_R05) @@ -692,6 +688,9 @@ ifeq ($(CONFIG_JPEG), y) INC += -I$(ROOT)/components/jpeg/jpeg-9c INC += -I$(ROOT)/components/jpeg endif +ifeq ($(CONFIG_HX3918), y) +INC += -I$(ROOT)/components/HX3918 +endif ifeq ($(CONFIG_GH301x), y) INC += -I$(ROOT)/components/GH301x endif @@ -701,7 +700,6 @@ endif ifeq ($(CONFIG_juphoon), y) INC += -I$(ROOT)/components/juphoon endif - ifeq ($(CONFIG_POC_BND), y) INC += -I$(ROOT)/components/poc INC += -I$(ROOT)/components/poc/bnd/inc @@ -891,25 +889,12 @@ frozen_mpy_list = $(BUILD)/_boot_RDA.mpy \ $(BUILD)/ntptime.mpy \ $(BUILD)/checkNet.mpy \ $(BUILD)/uping.mpy \ - - -ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),BC92RB)) - frozen_mpy_list += $(BUILD)/ftplib.mpy \ - $(BUILD)/ftplibtls.mpy -endif + $(BUILD)/ymodem.mpy \ ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),BC25B8PA_LBS)) frozen_mpy_list += $(BUILD)/cellLocator.mpy endif -ifneq (,$(findstring BC25,$(BOARD))) - frozen_mpy_list += $(BUILD)/ymodem.mpy -endif - -ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),BC32RA)) - frozen_mpy_list += $(BUILD)/bak_util.mpy -endif - else ifeq ($(strip $(PLAT)),ASR_1803s) frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/system.mpy \ @@ -959,18 +944,12 @@ frozen_mpy_list = $(BUILD)/_boot_Qualcomm.mpy \ $(BUILD)/sys_bus.mpy \ $(BUILD)/event_message.mpy \ $(BUILD)/bak_util.mpy \ - $(BUILD)/ftplib.mpy \ - $(BUILD)/ftplibtls.mpy \ $(BUILD)/uwebsocket.mpy \ $(BUILD)/uping.mpy \ $(BUILD)/ymodem.mpy \ -ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),BG600LM3)) -frozen_mpy_list += $(BUILD)/gnss.mpy -endif - else ifeq ($(strip $(PLAT)),ASR_1606) -ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC800KCN_CC EC600MCN_CC EC600MCN_CC_EXT EC600MCN_LF_SLPOC EC600MCN_CC_EXT_TTS EC800MCN_CC_TTS)) +ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC600MCN_CC EC800MCN_CC EC600MCN_CC_EXT EC600MCN_LF_SLPOC)) frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/system.mpy \ $(BUILD)/dataCall.mpy \ @@ -990,29 +969,20 @@ frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/checkNet.mpy \ $(BUILD)/ymodem.mpy -else ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC800MCN_CC)) +else ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC600MCN_CC_EXT_TTS)) frozen_mpy_list = $(BUILD)/_boot.mpy \ - $(BUILD)/system.mpy \ $(BUILD)/dataCall.mpy \ - $(BUILD)/queue.mpy \ - $(BUILD)/log.mpy \ - $(BUILD)/request.mpy \ + $(BUILD)/file_crc32.mpy \ $(BUILD)/ntptime.mpy \ - $(BUILD)/checkNet.mpy \ - $(BUILD)/ftplib.mpy \ - $(BUILD)/cellLocator.mpy - + $(BUILD)/ymodem.mpy else frozen_mpy_list = $(BUILD)/_boot.mpy \ - $(BUILD)/umqtt.mpy \ $(BUILD)/ntptime.mpy \ $(BUILD)/request.mpy \ $(BUILD)/log.mpy \ - $(BUILD)/aLiYun.mpy \ $(BUILD)/hmac.mpy \ $(BUILD)/hashlib.mpy \ $(BUILD)/base64.mpy \ - $(BUILD)/TenCentYun.mpy \ $(BUILD)/file_sha256.mpy \ $(BUILD)/checksum.mpy \ $(BUILD)/checkNet.mpy \ @@ -1025,7 +995,6 @@ frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/backup_restore.mpy \ $(BUILD)/file_crc32.mpy \ $(BUILD)/system.mpy \ - $(BUILD)/gnss.mpy \ $(BUILD)/unzip.mpy \ $(BUILD)/queue.mpy \ $(BUILD)/sys_bus.mpy \ @@ -1042,6 +1011,7 @@ frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/appWechat.mpy \ $(BUILD)/btn_device_ec800m.mpy \ $(BUILD)/capacitive_hynitron_cst816d_update.mpy \ + $(BUILD)/code.mpy \ $(BUILD)/common.mpy \ $(BUILD)/constants.mpy \ $(BUILD)/EventMesh.mpy \ @@ -1053,13 +1023,15 @@ frozen_mpy_list = $(BUILD)/_boot.mpy \ $(BUILD)/ui_main_menu.mpy \ $(BUILD)/ui_setting.mpy \ $(BUILD)/ui_WatchFaceScreen.mpy \ + $(BUILD)/ui_health.mpy \ $(BUILD)/main_init.mpy \ - $(BUILD)/calculator.mpy \ + $(BUILD)/motor.mpy \ $(BUILD)/versions.mpy \ - $(BUILD)/pp_main.mpy \ - $(BUILD)/copy.mpy \ - $(BUILD)/types.mpy + $(BUILD)/ui_video.mpy \ + $(BUILD)/ai.mpy \ + + ifeq ($(strip $(BOARD)),$(filter $(strip $(BOARD)),EC800MCN_LE_VOLVGL)) frozen_mpy_list += $(BUILD)/CMCC_DM.mpy endif diff --git "a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254 (2).py" "b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254 (2).py" new file mode 100644 index 00000000..10767c22 --- /dev/null +++ "b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254 (2).py" @@ -0,0 +1,1760 @@ +import utime +import audio +from machine import Pin +import osTimer +import _thread +from queue import Queue +import uwebsocket +import usys +import EventMesh +import constants +import ujson +import lvgl as lv +import urandom +import uhashlib +import ubinascii +from ui import style_font_youyuan_20,style_screen,Screen,style_img,LCD_SIZE_H,LCD_SIZE_W +style_font_youyuan_ai_20 = lv.style_t() +style_font_youyuan_ai_20.init() +style_font_youyuan_ai_20.set_text_color(lv.color_make(253, 82, 19)) +style_font_youyuan_ai_20.set_text_font(lv.K01_font_16_ALL) +#length长度内,返回string句号或逗号的分割字符串 +def split_string(string,start,end): + count = string.find(',',start,end) + if count != -1: + return string[:count] + count = string.find('.',start,end) + if count != -1: + return string[:count] + count = string.find('!',start,end) + if count != -1: + return string[:count] + count = string.find('?',start,end) + if count != -1: + return string[:count] + + count = string.find(',',start,end) + if count != -1: + return string[:count+len(',')] + count = string.find('。',start,end) + if count != -1: + return string[:count+len('。')] + count = string.find('!',start,end) + if count != -1: + return string[:count+len('!')] + count = string.find('?',start,end) + if count != -1: + return string[:count+len('?')] + return '' +def sub_utf8_String(string,length): + if length >= len(string): + return string + i = 0 + p = 0 + while True: + ch = ord(string[i]) + #1111110x + if ch >= 252: + p = p + 6 + #111110xx + elif ch >= 248: + p = p + 5 + #11110xxx + elif ch >= 240: + p = p + 4 + #1110xxxx + elif ch >= 224: + p = p + 3 + #110xxxxx + elif ch >= 192: + p = p + 2 + else: + p = p + 1 + if p >= length: + break + else: + i = p + + return string[0:i] + +style_AI_btn = lv.style_t() +style_AI_btn.init() +style_AI_btn.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_AI_btn.set_border_width(0) +style_AI_btn.set_shadow_opa(0) + +style_common_bg_rect_btn_pressed = lv.style_t() +style_common_bg_rect_btn_pressed.init() +style_common_bg_rect_btn_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_common_bg_rect_btn_pressed.set_bg_opa(100) +style_common_bg_rect_btn_pressed.set_border_width(0) +style_common_bg_rect_btn_pressed.set_shadow_opa(0) + +style_font_20_ai_white = lv.style_t() +style_font_20_ai_white.init() +style_font_20_ai_white.set_radius(0) +style_font_20_ai_white.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +#style_font_20_ai_white.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_font_20_ai_white.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_font_20_ai_white.set_bg_opa(255) +style_font_20_ai_white.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_20_ai_white.set_text_font(lv.K01_font_16_ALL) + +style_font_20_ai_green = lv.style_t() +style_font_20_ai_green.init() +style_font_20_ai_green.set_radius(5) +style_font_20_ai_green.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) +#style_font_20_ai_green.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_font_20_ai_green.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_font_20_ai_green.set_bg_opa(255) +style_font_20_ai_green.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_20_ai_green.set_text_font(lv.K01_font_16_ALL) + +AI_screen = lv.obj() +print("AI_screen") +AI_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_talk_end_screen = lv.obj(AI_screen) +AI_talk_end_screen.set_pos(0, 0) +AI_talk_end_screen.set_size(LCD_SIZE_W,LCD_SIZE_H) +print("AI_talk_end_screen") +AI_talk_end_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_end_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + +AI_screen_list_screen_title = lv.obj(AI_talk_end_screen) +AI_screen_list_screen_title.set_pos(0, 0) +AI_screen_list_screen_title.set_size(LCD_SIZE_W,40) +AI_screen_list_screen_title.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_screen_list_screen_title.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_success_title1 = lv.label(AI_screen_list_screen_title) +# al_success_title1.set_pos(0, 5) +# al_success_title1.set_size(LCD_SIZE_W, 25) +# al_success_title1.set_text("AI智能助手") +# al_success_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# al_success_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# AI_press_btn = lv.btn(AI_talk_end_screen) +# AI_press_btn.set_pos(10, (LCD_SIZE_H-60)+4) +# AI_press_btn.set_size(LCD_SIZE_W-20, 56) +# AI_press_btn.add_style(style_AI_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# AI_press_btn.add_style(style_common_bg_rect_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) +# AI_press_btn.set_style_radius(30,0) + +AI_talk_end_bt_screen = lv.obj(AI_talk_end_screen) +AI_talk_end_bt_screen.set_pos(0, 210) +AI_talk_end_bt_screen.set_size(LCD_SIZE_W,LCD_SIZE_H-210) +print("AI_talk_end_bt_screen") +AI_talk_end_bt_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_end_bt_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_talk_end_screen_icon1 = lv.img(AI_talk_end_bt_screen) +al_talk_end_screen_icon1.set_size(50,50) +al_talk_end_screen_icon1.set_pos(15,5) +al_talk_end_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_end_screen_icon1.set_src("U:/static/AI/ai_result_can_bt.png") +al_talk_end_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_end_screen_cancel_bt = lv.label(AI_talk_end_bt_screen) +al_talk_end_screen_cancel_bt.set_text(" ") +al_talk_end_screen_cancel_bt.set_size(80, 72) +al_talk_end_screen_cancel_bt.set_pos(0,0) +al_talk_end_screen_cancel_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_talk_end_screen_icon2 = lv.img(AI_talk_end_bt_screen) +al_talk_end_screen_icon2.set_size(150,50) +al_talk_end_screen_icon2.set_pos(80,5) +al_talk_end_screen_icon2.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_end_screen_icon2.set_src("U:/static/AI/ai_result_bt.png") +al_talk_end_screen_icon2.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_press_label_bt = lv.label(al_talk_end_screen_icon2) +AI_press_label_bt.set_text(" ") +AI_press_label_bt.set_size(240-150, 72) +AI_press_label_bt.set_pos(0,0) +AI_press_label_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +AI_press_label = lv.label(al_talk_end_screen_icon2) +AI_press_label.set_text("继续对话") +AI_press_label.set_size(240-108, 50) +AI_press_label.set_pos(8,13) +AI_press_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +AI_press_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +style_green_screen = lv.style_t() +style_green_screen.init() +style_green_screen.set_radius(5) +style_green_screen.set_bg_color(lv.color_make(79,195,76)) +style_green_screen.set_bg_opa(255) +style_green_screen.set_border_width(0) +style_green_screen.set_pad_left(0) +style_green_screen.set_pad_right(0) +style_green_screen.set_pad_top(0) +style_green_screen.set_pad_bottom(0) + +style_font_28_green_bg_gray = lv.style_t() +style_font_28_green_bg_gray.init() +# style_font_28_green_bg_gray.set_bg_color(lv.color_make(79,195,76)) +# style_font_28_green_bg_gray.set_bg_opa(255) +# style_font_28_green_bg_gray.set_radius(5) +# style_font_28_green_bg_gray.set_border_width(0) +# style_font_28_green_bg_gray.set_pad_left(0) +# style_font_28_green_bg_gray.set_pad_right(0) +# style_font_28_green_bg_gray.set_pad_top(0) +# style_font_28_green_bg_gray.set_pad_bottom(0) +style_font_28_green_bg_gray.set_text_color(lv.color_make(255, 255, 255)) #字体文本颜色 +style_font_28_green_bg_gray.set_text_font(lv.K01_font_16_ALL) + +#列表obj +style_wechat_s_btn = lv.style_t() +style_wechat_s_btn.init() +style_wechat_s_btn.set_radius(5) +style_wechat_s_btn.set_bg_opa(255) +style_wechat_s_btn.set_border_width(0) +style_wechat_s_btn.set_pad_left(0) +style_wechat_s_btn.set_pad_right(0) +style_wechat_s_btn.set_pad_top(0) +style_wechat_s_btn.set_pad_bottom(0) +style_wechat_s_btn.set_bg_color(lv.color_make(79,195,76)) +style_wechat_s_btn.set_shadow_opa(0) + +AI_end_screen_list_screen = lv.obj(AI_talk_end_screen) +AI_end_screen_list_screen.set_pos(10, 5) +AI_end_screen_list_screen.set_size(LCD_SIZE_W-10,205) +AI_end_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_end_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_end_screen_list_screen.set_flex_flow(lv.FLEX_FLOW.COLUMN)#自动排成一列对齐 + +AI_end_screen_list_detail_screen = lv.obj(AI_end_screen_list_screen) +AI_end_screen_list_detail_screen.set_pos(0, 5) +AI_end_screen_list_detail_screen.set_size(230,lv.SIZE.CONTENT) +AI_end_screen_list_detail_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + +AI_end_screen_list_detail_screen1 = lv.obj(AI_end_screen_list_detail_screen) +AI_end_screen_list_detail_screen1.set_pos(30,10) +AI_end_screen_list_detail_screen1.set_size(190,lv.SIZE.CONTENT) +AI_end_screen_list_detail_screen1.add_style(style_wechat_s_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_listen_text = lv.label(AI_end_screen_list_detail_screen1) +AI_listen_text.set_pos(5, 10) +AI_listen_text.set_size(175, lv.SIZE.CONTENT) +AI_listen_text.set_text(" ") +AI_listen_text.set_long_mode(lv.label.LONG.WRAP) +AI_listen_text.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +AI_listen_text.add_style(style_font_28_green_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + +style_gray_screen = lv.style_t() +style_gray_screen.init() +style_gray_screen.set_radius(5) +style_gray_screen.set_bg_color(lv.color_make(66,66,66)) #灰色背景 +style_gray_screen.set_bg_opa(255) +style_gray_screen.set_border_width(0) +style_gray_screen.set_pad_left(0) +style_gray_screen.set_pad_right(0) +style_gray_screen.set_pad_top(0) +style_gray_screen.set_pad_bottom(0) + +#灰色背景黑色字 +style_font_28_black_bg_gray = lv.style_t() +style_font_28_black_bg_gray.init() +# style_font_28_black_bg_gray.set_radius(5) +# style_font_28_black_bg_gray.set_bg_opa(255) +# style_font_28_black_bg_gray.set_border_width(0) +# style_font_28_black_bg_gray.set_pad_left(0) +# style_font_28_black_bg_gray.set_pad_right(0) +# style_font_28_black_bg_gray.set_pad_top(0) +# style_font_28_black_bg_gray.set_pad_bottom(0) +# style_font_28_black_bg_gray.set_bg_color(lv.color_make(66,66,66)) #字体文本颜色 +style_font_28_black_bg_gray.set_text_color(lv.color_make(153, 153, 153)) #字体文本颜色 +style_font_28_black_bg_gray.set_text_font(lv.K01_font_16_ALL) + +style_wechat_r_btn = lv.style_t() +style_wechat_r_btn.init() +style_wechat_r_btn.set_radius(5) +style_wechat_r_btn.set_bg_opa(255) +style_wechat_r_btn.set_border_width(0) +style_wechat_r_btn.set_pad_left(0) +style_wechat_r_btn.set_pad_right(0) +style_wechat_r_btn.set_pad_top(0) +style_wechat_r_btn.set_pad_bottom(0) +style_wechat_r_btn.set_bg_color(lv.color_make(66,66,66)) +style_wechat_r_btn.set_border_width(0) +style_wechat_r_btn.set_shadow_opa(0) + + +msg_detail_cont_obj = lv.obj(AI_end_screen_list_screen) +msg_detail_cont_obj.set_pos(0, 5) +msg_detail_cont_obj.set_size(220,lv.SIZE.CONTENT) +msg_detail_cont_obj.add_style(style_wechat_r_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_label = lv.label(msg_detail_cont_obj) +AI_label.set_pos(5, 10) +AI_label.set_size(205, lv.SIZE.CONTENT) +AI_label.set_long_mode(lv.label.LONG.WRAP) +AI_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +AI_label.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + + + +#开始对话 +AI_talk_screen = lv.obj(AI_screen) +print("AI_talk_screen") +AI_talk_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_talk_screen.set_pos(0, 0) +AI_talk_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) + + +al_talk_screen_title1 = lv.label(AI_talk_screen) +al_talk_screen_title1.set_pos(0, 20) +al_talk_screen_title1.set_size(LCD_SIZE_W, 40) +al_talk_screen_title1.set_text("AI智能助手") +al_talk_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_talk_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_talk_screen_icon1 = lv.img(AI_talk_screen) +al_talk_screen_icon1.set_size(140,45) +al_talk_screen_icon1.set_pos((240-140)//2,110-13) +al_talk_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +al_talk_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_screen_icon = lv.img(AI_talk_screen) +al_talk_screen_icon.set_size(230,58) +al_talk_screen_icon.set_pos((240-230)//2,210) +al_talk_screen_icon.set_src("U:/static/AI/ai_talk_bt.png") +al_talk_screen_icon.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_screen_icon_btn = lv.label(AI_talk_screen) +al_talk_screen_icon_btn.set_text(" ") +al_talk_screen_icon_btn.set_size(240, 190) +al_talk_screen_icon_btn.set_pos(0,92) +al_talk_screen_icon_btn.add_flag(lv.obj.FLAG.CLICKABLE) + +al_talk_screen_title4 = lv.label(al_talk_screen_icon) +al_talk_screen_title4.set_pos(0, 18) +al_talk_screen_title4.set_size(230, 58) +al_talk_screen_title4.set_text("开始对话") +al_talk_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_talk_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#没有网络数据 +AI_no_net_screen = lv.obj(AI_screen) +print("AI_no_net_screen") +AI_no_net_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_no_net_screen.set_pos(0, 0) +AI_no_net_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_no_net_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_no_sim_popup_screen_title1 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title1.set_pos(0, 20) +al_no_sim_popup_screen_title1.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title1.set_text("AI智能助手") +al_no_sim_popup_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_icon = lv.img(AI_no_net_screen) +al_no_sim_popup_screen_icon.set_size(42,42) +al_no_sim_popup_screen_icon.set_pos((240-42)//2,60) +al_no_sim_popup_screen_icon.set_src("U:/static/AI/ai_warning.png") +al_no_sim_popup_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_no_sim_popup_screen_title2 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title2.set_pos(0, 125) +al_no_sim_popup_screen_title2.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title2.set_text("启动失败") +al_no_sim_popup_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_title3 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title3.set_pos(0, 165) +al_no_sim_popup_screen_title3.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title3.set_text("请先开启移动数据") +al_no_sim_popup_screen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_no_sim_popup_screen_icon1 = lv.img(AI_no_net_screen) +al_no_sim_popup_screen_icon1.set_size(230,58) +al_no_sim_popup_screen_icon1.set_pos((240-230)//2,210) +al_no_sim_popup_screen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_no_sim_popup_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_no_sim_popup_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_title4 = lv.label(al_no_sim_popup_screen_icon1) +al_no_sim_popup_screen_title4.set_pos(0, 18) +al_no_sim_popup_screen_title4.set_size(230, 58) +al_no_sim_popup_screen_title4.set_text("确定") +al_no_sim_popup_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#正在聆听 +AI_listen_screen = lv.obj(AI_screen) +print("AI_listen_screen") +AI_listen_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_listen_screen.set_pos(0, 0) +AI_listen_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_listen_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +ai_talk_requestion_obj = lv.obj(AI_listen_screen) +ai_talk_requestion_obj.set_pos(15, 20) +ai_talk_requestion_obj.set_size(LCD_SIZE_W-25, 58) +ai_talk_requestion_obj.add_style(style_green_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_listen_screen_title1 = lv.label(ai_talk_requestion_obj) +al_listen_screen_title1.set_pos(0, 5) +al_listen_screen_title1.set_size(LCD_SIZE_W-25, 58) +al_listen_screen_title1.set_text("识别中...") +al_listen_screen_title1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +al_listen_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +# al_listen_screen_icon1 = lv.gif(AI_listen_screen) +# al_listen_screen_icon1.set_size(140,45) +# al_listen_screen_icon1.set_pos((240-140)//2,110) +# # al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +# al_listen_screen_icon1.set_src("U:/static/AI/listen_gif.gif") + +# al_listen_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_listen_screen_icon1 = lv.img(AI_listen_screen) +al_listen_screen_icon1.set_size(140,45) +al_listen_screen_icon1.set_pos((240-140)//2,110) +al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +# al_listen_screen_icon1.set_src("U:/static/AI/listen_gif.gif") + +al_listen_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_listen_screen_icon = lv.img(AI_listen_screen) +# al_listen_screen_icon.set_size(230,58) +# al_listen_screen_icon.set_pos((240-230)//2,210) +# al_listen_screen_icon.set_src("U:/static/AI/ai_confirm_bt.png") +# al_listen_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_listen_screen_icon_bt = lv.label(AI_listen_screen) +al_listen_screen_icon_bt.set_text(" ") +al_listen_screen_icon_bt.set_size(240, 190) +al_listen_screen_icon_bt.set_pos(0,92) + +al_listen_screen_title4 = lv.label(AI_listen_screen) +al_listen_screen_title4.set_pos(0, 220) +al_listen_screen_title4.set_size(240, 58) +al_listen_screen_title4.set_text("正在聆听...") +al_listen_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_listen_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#正在思考 +AI_think_screen = lv.obj(AI_screen) +print("AI_think_screen") +AI_think_screen.set_pos(0, 0) +AI_think_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_think_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_think_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_think_screen_title1 = lv.label(AI_think_screen) +al_think_screen_title1.set_pos(0, 20) +al_think_screen_title1.set_size(LCD_SIZE_W, 40) +al_think_screen_title1.set_text("正在思考...") +al_think_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_think_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_think_screen_icon = lv.gif(AI_think_screen) +# al_think_screen_icon.set_size(130,130) +# al_think_screen_icon.set_pos((240-130)//2,65) +# # al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") +# al_think_screen_icon.set_src("U:/static/AI/think_gif.gif") +# al_think_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon = lv.img(AI_think_screen) +al_think_screen_icon.set_size(130,130) +al_think_screen_icon.set_pos((240-130)//2,65) +al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") +# al_think_screen_icon.set_src("U:/static/AI/think_gif.gif") + +al_think_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon1 = lv.img(AI_think_screen) +al_think_screen_icon1.set_size(230,58) +al_think_screen_icon1.set_pos((240-230)//2,210) +al_think_screen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_think_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_think_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon1_bt = lv.label(AI_think_screen) +al_think_screen_icon1_bt.set_text(" ") +al_think_screen_icon1_bt.set_size(240, 190) +al_think_screen_icon1_bt.set_pos(0,92) +al_think_screen_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + + +al_think_screen_title4 = lv.label(al_think_screen_icon1) +al_think_screen_title4.set_pos(0, 18) +al_think_screen_title4.set_size(230, 58) +al_think_screen_title4.set_text("取消") +al_think_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_think_screen_title4.add_style(style_font_youyuan_ai_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# #连接超时 +AI_connect_timerout_screen = lv.obj(AI_screen) +AI_connect_timerout_screen.set_pos(0, 0) +AI_connect_timerout_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +print("AI_connect_timerout_screen") +AI_connect_timerout_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_connect_timerout_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_connect_timerout_title1 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title1.set_pos(0, 20) +al_connect_timerout_title1.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title1.set_text("AI智能助手") +al_connect_timerout_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_icon = lv.img(AI_connect_timerout_screen) +al_connect_timerout_icon.set_size(42,42) +al_connect_timerout_icon.set_pos((240-42)//2,60) +al_connect_timerout_icon.set_src("U:/static/AI/ai_warning.png") +al_connect_timerout_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_connect_timerout_title2 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title2.set_pos(0, 125) +al_connect_timerout_title2.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title2.set_text("连接超时") +al_connect_timerout_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_title3 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title3.set_pos(0, 165) +al_connect_timerout_title3.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title3.set_text("请重新对话") +al_connect_timerout_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_connect_timerout_icon1 = lv.img(AI_connect_timerout_screen) +al_connect_timerout_icon1.set_size(230,58) +al_connect_timerout_icon1.set_pos((240-230)//2,210) +al_connect_timerout_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_connect_timerout_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_connect_timerout_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_icon1_bt = lv.label(AI_connect_timerout_screen) +al_connect_timerout_icon1_bt.set_text(" ") +al_connect_timerout_icon1_bt.set_size(240, 190) +al_connect_timerout_icon1_bt.set_pos(0,92) +al_connect_timerout_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_connect_timerout_title4 = lv.label(al_connect_timerout_icon1) +al_connect_timerout_title4.set_pos(0, 18) +al_connect_timerout_title4.set_size(230, 58) +al_connect_timerout_title4.set_text("确定") +al_connect_timerout_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +#未检测到录音 +AI_not_listen_text_screen = lv.obj(AI_screen) +AI_not_listen_text_screen.set_pos(0, 0) +AI_not_listen_text_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +print("AI_not_listen_text_screen") +AI_not_listen_text_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_not_listen_text_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_not_listen_title1 = lv.label(AI_not_listen_text_screen) +al_not_listen_title1.set_pos(0, 20) +al_not_listen_title1.set_size(LCD_SIZE_W, 40) +al_not_listen_title1.set_text("AI智能助手") +al_not_listen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_icon = lv.img(AI_not_listen_text_screen) +al_not_listen_icon.set_size(42,42) +al_not_listen_icon.set_pos((240-42)//2,60) +al_not_listen_icon.set_src("U:/static/AI/ai_warning.png") +al_not_listen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_not_listen_title2 = lv.label(AI_not_listen_text_screen) +al_not_listen_title2.set_pos(0, 125) +al_not_listen_title2.set_size(LCD_SIZE_W, 40) +al_not_listen_title2.set_text("未检测到录音数据") +al_not_listen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_title3 = lv.label(AI_not_listen_text_screen) +al_not_listen_title3.set_pos(0, 165) +al_not_listen_title3.set_size(LCD_SIZE_W, 40) +al_not_listen_title3.set_text("请重新对话") +al_not_listen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_not_listen_icon1 = lv.img(AI_not_listen_text_screen) +al_not_listen_icon1.set_size(230,58) +al_not_listen_icon1.set_pos((240-230)//2,210) +al_not_listen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_not_listen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_not_listen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_icon1_bt = lv.label(AI_not_listen_text_screen) +al_not_listen_icon1_bt.set_text(" ") +al_not_listen_icon1_bt.set_size(240, 190) +al_not_listen_icon1_bt.set_pos(0,92) +al_not_listen_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_not_listen_title4 = lv.label(al_not_listen_icon1) +al_not_listen_title4.set_pos(0, 18) +al_not_listen_title4.set_size(230, 58) +al_not_listen_title4.set_text("确定") +al_not_listen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +class AIScreen(Screen):#AI_GUI + # + NAME = "AI_success" + + def __init__(self): + super().__init__() + self.meta = AI_screen + # self.meta_type = "popup" + self.Audio_buf_size = 8*1024 + self.record_timer = osTimer() + self.record = audio.Record() + #self.record.end_callback(self.record_callback) + self.record.gain_set(4,10) + self.aud = audio.Audio(0) + self.audio_play_state = 1 #音频播放完状态 + self.aud.setCallback(self.audio_cb) + + self.TTS_PRO_TYPE = 0 #TTS协议类型,=0:用长文本合成接口,=1用音频流合成接口 + self.AI_audio_queue_thread_id = 0 + self.AI_send_data_queue_thread_id = 0 + self.AI_client_chat_recv_id = 0 + self.AI_client_tts_recv_id = 0 + self.AI_client_asr_recv_id = 0 + self.AI_client_asr = None + self.AI_client_asr_isconnect = 0 #是否连接成功 + self.AI_client_asr_num = 0 + self.AI_client_chat = None + self.AI_client_chat_isconnect = 0 #是否连接成功 + self.AI_client_chat_num = 1 + self.AI_client_chat_play_str = "" + self.AI_client_chat_end_flag = 0 + self.AI_client_tts = None + self.AI_client_tts_isconnect = 0 #是否连接成功 + self.AI_client_tts_num = 2 + self.AI_client_tts_timer = osTimer() + self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 #单次tts总数据长度 + self.AI_client_tts_str_total_len = 0 #单次已发送tts字符串长度 + self.AI_client_tts_str_sen = '' #单次已发送tts字符串长度 + self.AI_client_tts_tra_flag = 0 + self.AI_client_tts_full_sentence_flag = 0 #完整的句子标识 + self.tts_time_count = 0 + self.tts_time_outcount = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.tts_data_tmp = bytes() + self.press_state = 0 + self.AI_label_answer = "" + self.AI_label_str = "" + self.AI_client_tts_play_data_len = 0 + self.refresh_texttimer = osTimer() + self.AI_listen_text = "" + self.AI_listen_end = 0 #语音识别完成 + self.refresh_count = 0 + self.AI_send_data_queue = Queue(100) + self.AI_audio_queue = Queue(100) + + AI_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.GESTURE, None) + + al_talk_screen_icon.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + al_talk_screen_icon_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + + al_no_sim_popup_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), lv.EVENT.SHORT_CLICKED, None) #无网络按钮 + + # al_listen_screen_icon_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), lv.EVENT.SHORT_CLICKED, None) #说话完成按钮 + # al_listen_screen_icon.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), lv.EVENT.SHORT_CLICKED, None) #说话完成按钮 + + al_think_screen_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,4)), lv.EVENT.SHORT_CLICKED, None) #思考界面取消按钮 + al_think_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,4)), lv.EVENT.SHORT_CLICKED, None) #思考界面取消按钮 + + al_connect_timerout_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,5)), lv.EVENT.SHORT_CLICKED, None) #连接超时 请重新对话按钮 + al_connect_timerout_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,5)), lv.EVENT.SHORT_CLICKED, None) #连接超时 请重新对话按钮 + + al_talk_end_screen_cancel_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,6)), lv.EVENT.SHORT_CLICKED, None) #对话结束 取消对话按钮 + al_talk_end_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,6)), lv.EVENT.SHORT_CLICKED, None) #对话结束 取消对话按钮 + + AI_press_label_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,7)), lv.EVENT.SHORT_CLICKED, None) #对话结束 继续对话按钮 + al_talk_end_screen_icon2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,7)), lv.EVENT.SHORT_CLICKED, None) #对话结束 继续对话按钮 + + al_not_listen_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,8)), lv.EVENT.SHORT_CLICKED, None) + al_not_listen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,8)), lv.EVENT.SHORT_CLICKED, None) + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + if (AI_talk_end_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_listen_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or\ + (AI_talk_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_no_net_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + (AI_connect_timerout_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_not_listen_text_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + (AI_think_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False: + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 1: + self.talking_cb(e) + pass + elif msg == 2: + self.img_cb(e) + pass + elif msg == 3: + self.listen_end_btcb(e) + pass + elif msg == 4: + self.think_bt_cb(e) + pass + elif msg == 5: + self.talk_end_continue_cb(e) + pass + elif msg == 6: + self.talk_end_cancel_cb(e) + pass + elif msg == 7: + self.talk_end_continue_cb(e) + pass + elif msg == 8: + self.talk_end_continue_cb(e) + pass + + def clear_flag(self): #清标识 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.AI_listen_end = 0 #语音识别完成 + self.refresh_count = 0 + self.AI_listen_text = "" + self.AI_label_str = "" + self.AI_label_answer = "" + self.tts_time_count = 0 + self.tts_time_outcount = 0 + + def talk_end_cancel_cb(self,e):#对话结束已经播放音频取消继续对话按钮 + self.Close() + self.AI_label_answer = "" + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + + def talk_end_continue_cb(self,e):#连接超时确定按钮回调或者继续对话按钮 + self.Close() + self.AI_label_answer = "" + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_listen_screen.clear_flag(lv.obj.FLAG.HIDDEN) + al_listen_screen_title1.set_text("识别中...") + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") + self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) + EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) + + pass + + def talk_connectout_cb(self,e):#连接超时确定按钮回调 + + pass + + def think_bt_cb(self,e):#正在思考确定按钮回调 取消播放 + self.Close() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + pass + + def not_talk_cb(self):#没有说话或者没有检测到录音数据 + self.Close() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + + def listen_end_btcb(self,e):#说话完成确定按钮回调 + if self.AI_listen_end == 1:#说话完成 已有录音文字返回 + self.AI_listen_end = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + if self.AI_listen_text != "": + self.AI_client_chat_send(self.AI_listen_text) + print("self.AI_listen_text:{}".format(self.AI_listen_text)) + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") + self.refresh_count = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.refresh_texttimer.start(500,1,self.text_show_think) + else: + self.not_talk_cb() + return + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + return + else:#没有识别到录音文字 + self.not_talk_cb() + + def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_end_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + # self.AI_label_answer = "" + AI_end_screen_list_screen.scroll_to(0, 0, lv.ANIM.OFF) + AI_label.set_pos(5, 10) + AI_label.set_text(self.AI_label_answer) + AI_label.set_text("数据解析中...") + + # self.AI_listen_text = "嗯。" + str_len = len(self.AI_listen_text)*20 + if str_len > 165: + str_len = 165 + print("len:{} str_len:{} self.AI_listen_text:{}\r\n".format(len(self.AI_listen_text),str_len,self.AI_listen_text)) + # AI_end_screen_list_detail_screen1.set_pos(170-str_len,10) + + # AI_listen_text.set_size(str_len,lv.SIZE.CONTENT) + + # AI_listen_text.set_pos(0, 10) + # AI_listen_text.set_size(str_len,lv.SIZE.CONTENT) + AI_listen_text.set_text(self.AI_listen_text) + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.refresh_count = 0 + self.refresh_texttimer.start(500,1,self.ai_talk_end_show_text)#stop() #(500,1,self.ai_talk_end_show_text) + def ai_talk_end_show_text(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.ai_talk_end_lcd_on,"data":0}) + def ai_talk_end_lcd_on(self,data): + EventMesh.publish("system_sleep_rest")#防止黑屏 + + def ai_talk_end_show_text_cb(self,data): + AI_label.set_text(self.AI_label_answer) + + pass + + def connect_timerout_popup(self,msg):#连接超时弹窗提示 + self.Close() + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.clear_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + if msg == 1: #连接超时 + al_connect_timerout_title2.set_text("连接超时") + else: + al_connect_timerout_title2.set_text("网络连接异常") + + + def text_show_think(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.text_show_think_cb,"data":0}) + def think_end_result(self): + if self.timer_out_count > 1: + if self.img_show_count_flag == 1: + return + self.timer_out_count = 0 + self.img_show_count_flag = 1 + self.refresh_texttimer.stop() + self.ai_talk_end() + def text_show_think_cb(self,data): #文本刷新 + if self.img_show_count_flag == 1: + self.refresh_texttimer.stop() + return + if self.AI_label_str != "": + self.timer_out_count = 1 + self.img_show_count_flag = 1 + self.refresh_texttimer.stop() + self.ai_talk_end() + return + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer_out_count += 1 + if self.timer_out_count > 2*30: #说话了服务器没有返回结果数据 + self.timer_out_count = 0 + #连接超时 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.connect_timerout_popup(1) + return + + if self.img_show_count > 10: + self.img_show_count_tmp+=1 + self.img_show_count_tmp = self.img_show_count-self.img_show_count_tmp + if self.img_show_count_tmp >= 10: + self.img_show_count = 1 + al_think_screen_icon.set_src("U:/static/AI/AI_THINK{}.png".format("%03d"%(self.img_show_count_tmp))) + else: + self.img_show_count+=1 + self.img_show_count_tmp = 0 + al_think_screen_icon.set_src("U:/static/AI/AI_THINK{}.png".format("%03d"%(self.img_show_count))) + + + self.refresh_count+=1 + if self.refresh_count > 3: + self.refresh_count = 0 + if self.refresh_count == 1: + al_think_screen_title1.set_text("正在思考.") + elif self.refresh_count == 2: + al_think_screen_title1.set_text("正在思考..") + elif self.refresh_count == 3: + al_think_screen_title1.set_text("正在思考...") + pass + def img_cb(self,e): #无网络 无数据按钮回调 + self.refresh_texttimer.stop() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + pass + def initialization(self): + self.TTS_PRO_TYPE = 0 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #开启显示 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + self.aud.setVolume(11)#设置最大声录音 + + self.AI_label_answer = "" + self.AI_client_chat_play_str = '' + self.AI_init() + self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len = 0 + self.AI_client_tts_tra_flag = 0 + #EventMesh.publish("publish_message_event_ui",{"func":self.websocket_connect,"data":""}) + def websocket_connect(self,data): + self.websocket_connect_asr() + self.websocket_connect_chat() + self.websocket_connect_tts() + + pass + + def audio_cb(self,event): + if event == 0: + self.audio_play_state =1 + EventMesh.publish("set_audio_state", 1) + print('audio-play start. ai') + elif event == 7: + self.audio_play_state = 0 + EventMesh.publish("set_audio_state", 0) + # if self.AI_audio_queue.size() > 0: + # data = self.AI_audio_queue.get() + # print("audio_queue:data:{}".format(len(data))) + # if len(data) > 1: + # try: + # # while self.audio_play_state : + # # utime.sleep_ms(1) + # EventMesh.publish("system_sleep_rest")#防止黑屏 + # tmp=self.aud.playStream(3, data)#播放音频流文件 + # self.audio_play_state =1 + # print("playStream:{}".format(tmp)) + # except Exception as e: + # usys.print_exception(e) + #print('audio-play finish.') + def AI_init(self): + self.AI_audio_queue_thread_id = _thread.start_new_thread(self.AI_audio_queue_thread, ()) + self.AI_send_data_queue_thread_id = _thread.start_new_thread(self.AI_send_data_queue_thread, ()) + + + + #按下录音 + def talking_cb(self,e): + self.press_state = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + signal = EventMesh.publish("screen_get_sig") + if signal == -1 or EventMesh.publish("get_sim_Status") != 1:#网络不正常 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示 + al_no_sim_popup_screen_title3.set_text("无SIM卡") + + elif signal == None or signal == 0 or signal == 99: + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示 + al_no_sim_popup_screen_title3.set_text("请先开启移动数据") + + else: + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_listen_screen.clear_flag(lv.obj.FLAG.HIDDEN) + al_listen_screen_title1.set_text("识别中...") + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") + self.timer_out_count = 0 + self.refresh_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + + EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) + + + def text_show_refresh(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.text_show_refresh_cb,"data":0}) + def talk_ars_end(self): + if self.AI_listen_text == "": + return + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + self.timer_out_count = 0 + print("talk_ars_end!!!!!!!!!!!\r\n") + self.AI_client_chat_send(self.AI_listen_text) + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + + + def text_show_refresh_cb(self,data): + if self.AI_listen_end == 1 or self.timer_out_count >= 120:#语音识别结束 + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + if self.AI_listen_text != "": + self.img_show_count_tmp+=1 + if self.img_show_count_tmp > 2: + self.AI_listen_end = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.timer_out_count = 0 + print("self.AI_listen_text:{}".format(self.AI_listen_text)) + #正在思考 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") + self.refresh_count = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.refresh_texttimer.start(500,1,self.text_show_think) + else: + + self.not_talk_cb() + return + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + return + + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer_out_count += 1 + + self.img_show_count+=1 + if self.img_show_count > 11: + self.img_show_count = 1 + # print("self.img_show_count:{}\r\n".format(self.img_show_count)) + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF{}.png".format("%03d"%(self.img_show_count))) + + self.refresh_count+=1 + if self.refresh_count > 3: + self.refresh_count =0 + if self.refresh_count == 1: + al_listen_screen_title4.set_text("正在聆听.") + elif self.refresh_count == 2: + al_listen_screen_title4.set_text("正在聆听..") + elif self.refresh_count == 3: + al_listen_screen_title4.set_text("正在聆听...") + pass + #按下录音 + def talking(self,e): + #self.AI_client_tts_send("创建客户端, debug=True输出日志")#TTS语音播放AI结果 + #return + if 1:#EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + if 1:#self.audio_play_state == 0: + self.audio_play_state = 1 + print("talking1") + #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 + try: + print("talking2") + self.Close() + print("talking3") + self.AI_init() + self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) + except Exception as e: + usys.print_exception(e) + al_listen_screen_title1.set_text("识别中...") + self.record.stream_start(audio.Record.AMRNB, 8000, 60) + self.record_timer.start(1*1000,1,self.record_timer_cb) + self.refresh_texttimer.start(500,1,self.text_show_refresh) + #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 + + # AI_label.clear_flag(lv.obj.FLAG.HIDDEN) + # AI_label.set_text("语音识别中...") + # AI_listen_text.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_listen_text.set_text("{}S".format(str(self.countdown))) + self.press_state = 1 + self.AI_client_asr_start() + else: + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + #松开确认结果 + def sending_cb(self,e): + EventMesh.publish("publish_message_event_ui",{"func":self.sending,"data":e}) + def sending(self,e): + if self.press_state == 1: + if 1:#EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + # self.record.stream_start(audio.Record.AMRNB, 8000, 2) + # self.record_timer.start(2*1000,0,self.record_timer_cb) + # AI_label.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_label.set_text(" ") + # AI_listen_text.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_listen_text.set_text(" ") + #Wechat_log("sending_cb1") + #EventMesh.publish("publish_message_event_ui",{"func":self.sending,"data":e}) + #self.sending(e) + #Wechat_log("sending_cb2") + self.audio_play_state = 0 + else: + self.press_state = 0 + #EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + else: + pass + #定时器 + def record_timer_cb(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + Record_read_buf = bytearray(self.Audio_buf_size) + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("record_timer_cb:{}".format(Record_len)) + if Record_len >0: + read_buf = bytes(Record_read_buf[:Record_len]) + self.AI_client_asr_send(read_buf) + #获取trace_id + def get_trace_id(self): + t = utime.mktime(utime.localtime()) + t = t*1000+urandom.randint(0, 1000) + md5_data = "{}".format(t)#md5签名 + sign_data = "" + hash_obj = uhashlib.md5(md5_data) + res = hash_obj.digest() + + # 转成十六进制表示 + sign_data = ubinascii.hexlify(res) + sign_data = sign_data.decode('ascii') + return sign_data +##################################################### + #AI识别链路 + def websocket_connect_chat(self): + print("websocket_connect_chat:{}!!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_chat_isconnect)) + #if self.AI_client_chat_isconnect == 0: + # 创建客户端, debug=True输出日志, ip和端口需要自己填写, 或者是域名 + try: + self.AI_client_chat = uwebsocket.Client.connect('ws://121.40.67.151:9099/chat/ws', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_chat error!!!\r\n") + self.connect_timerout_popup(2) + return + # 线程接收数据 + if self.AI_client_chat_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_chat_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_chat_recv_id = 0 + self.AI_client_chat_recv_id = _thread.start_new_thread(self.AI_client_chat_recv, (self.AI_client_chat,)) + self.AI_client_chat_isconnect = 1 + def websocket_deconnect_chat(self): + if self.AI_client_chat_isconnect == 1: + self.AI_client_chat_isconnect = 0 + self.AI_client_chat.close() + + def AI_client_chat_send(self,data_str): + chat_data_str = "{\"type\":\"chat\",\"content\":\"%s\"}"%(data_str) + #self.AI_client_chat.send(chat_data_str) + self.AI_send_data_queue.put([self.AI_client_chat_num,chat_data_str]) + #Ai chat读数据 + def AI_client_chat_recv(self,cli): + while True: + try: + # 死循环接收数据 + recv_data = cli.recv() + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_chat_recv close") + #self.AI_client_chat_isconnect = 0 + #self.websocket_deconnect_chat() + break + try: + #print("AI_client_chat_recv recv_data = {}".format(recv_data)) + jsload_data = ujson.loads(recv_data) + #print("AI_client_chat_recv jsload_data = {}".format(jsload_data)) + chat_data = jsload_data["content"] + if chat_data: + #self.AI_client_tts_send(jsload_data["content"])#TTS语音播放AI结果 + print("AI_client_chat_recv chat_data = {}".format(chat_data)) + self.AI_label_str+=str(chat_data) + self.AI_client_chat_play_str+=str(chat_data) + self.think_end_result() + if self.TTS_PRO_TYPE == 1: + AI_label.set_text(self.AI_label_str) + # EventMesh.publish("system_sleep_rest")#防止黑屏 + else: + # if self.AI_label_str: + # self.AI_client_tts_send(self.AI_label_str)#TTS语音播放AI结果 + print("AI_client_chat_recv chat_data start\r\n") + if jsload_data['type']=='start': + self.AI_label_str = "" + self.AI_client_chat_end_flag = 0 + self.websocket_connect_tts() #连接tts + # + elif jsload_data['type']=='end': + print("chat end!!!!!!!!!!!!!!") + self.AI_client_chat_end_flag = 1 + except Exception as e: + usys.print_exception(e) + + except Exception as e: + usys.print_exception(e) + break + self.AI_client_chat_isconnect = 0 + self.AI_client_chat_recv_id = 0 +############################################################################## + #文字转语音链路 + def websocket_connect_tts(self): + print("websocket_connect_tts:{}!!!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_tts_isconnect)) + if self.AI_client_tts_isconnect == 0: + try: + # self.AI_client_tts = uwebsocket.Client.connect('ws://40.67.151:9099/tts/', debug=False) + self.AI_client_tts = uwebsocket.Client.connect('ws://121.40.67.151:9099/tts/long-text-stream', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_tts ERROR:{}\r\n".format(e)) + self.connect_timerout_popup(2) + return + print("websocket_connect_tts:self.AI_client_tts {}\r\n".format(self.AI_client_tts)) + # 线程接收数据 + if self.AI_client_tts_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_tts_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_tts_recv_id = 0 + #_thread.stack_size(20*1024) + self.AI_client_tts_recv_id = _thread.start_new_thread(self.AI_client_tts_recv, (self.AI_client_tts,)) + #_thread.stack_size(8*1024) + self.AI_client_tts_isconnect = 1 + self.AI_client_tts_start() + def websocket_deconnect_tts(self): + if self.AI_client_tts_isconnect == 1: + self.AI_client_tts_isconnect = 0 + try: + self.AI_client_tts.close() + except Exception as e: + usys.print_exception(e) + def AI_client_tts_timer_cb(self,*argc): + # EventMesh.publish("system_sleep_rest")#防止黑屏 + self.tts_time_count+=1 + + if self.TTS_PRO_TYPE == 1: + #tts数据入队 + self.AI_client_tts_put_data() + print("AI_audio_queue.size:{},AI_send_data_queue.size:{} self.AI_client_chat_play_str:{} self.AI_client_tts_tra_flag:{}\r\n".format(self.AI_audio_queue.size(),self.AI_send_data_queue.size(),self.AI_client_chat_play_str,self.AI_client_tts_tra_flag) ) + #字符串分段发送,等待播放缓存变小 + if len(self.AI_client_chat_play_str) >0 and self.AI_client_tts_data_len < 150*1024 :#and (self.AI_client_tts_str_total_len <100 or self.AI_client_tts_str_total_len - self.AI_client_tts_data_total_len//672 < 60)缓存200k以下,且tts发送文字字节数比返回音频数据少60字节 + # play_str = split_string(self.AI_client_chat_play_str,40)# + # if play_str =="":#没找到句号或者逗号,切割字符串 + self.tts_time_outcount+=1 + + if self.TTS_PRO_TYPE == 1: + play_str = sub_utf8_String(self.AI_client_chat_play_str,20)#按中文切割字符串 + self.AI_client_tts_str_total_len += len(play_str) + elif self.TTS_PRO_TYPE == 0: + if self.AI_audio_queue.size() >= 5 or self.AI_client_tts_tra_flag == 1 or (self.tts_time_outcount < 3 and len(self.AI_client_chat_play_str) < 100):#存了超过4句,就等小于3次在转化 + return + play_str = split_string(self.AI_client_chat_play_str,50,100)#按逗号,句号切割 + if play_str =="" or len(play_str)>100:#没找到句号或者逗号,切割字符串 + play_str = sub_utf8_String(self.AI_client_chat_play_str,100)#按中文切割字符串 + self.AI_client_tts_tra_flag = 1 + self.AI_client_tts_str_sen = play_str + if len(play_str) == 0: + return + self.AI_client_tts_send(play_str)#TTS语音播放AI结果 + self.AI_client_chat_play_str = self.AI_client_chat_play_str[len(play_str):] + print("TTS play:len{},data{}".format(len(play_str),play_str)) + if len(self.AI_client_chat_play_str) <=0 and self.AI_client_chat_end_flag ==1 : + self.AI_client_chat_end_flag=0 + self.AI_client_tts_end() + + def AI_client_tts_send(self,data_str): + data_l = {} + if self.TTS_PRO_TYPE == 1: + + data_l ={"header": {"event": "RunSynthesis","trace_id": self.get_trace_id()},"payload": {"text":"%s"%(data_str)}} + elif self.TTS_PRO_TYPE == 0: + data_l ={ + "header": { + "event": "LongTextStream", + "trace_id": self.get_trace_id() + }, + "payload": { + "voice":"xiaoyun", + "format":"mp3", + "sample_rate":8000, + "volume":90, + "speech_rate":2, + "text":"%s"%(data_str) + } + } + json_data = ujson.dumps(data_l) + self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + def AI_client_tts_start(self): + data_l ={"header": {"event": "StartSynthesis","trace_id": self.get_trace_id()}, + "payload": {"voice":"xiaoyun","format":"mp3","sample_rate":8000,"volume":60,"speech_rate":1,}} + #print("\r\nAI_client_tts_start!!!!!!!!!!!!\r\n") + json_data = ujson.dumps(data_l) + #print("AI_client_tts_send:{}".format(json_data)) + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + self.tts_time_count = 0 + self.tts_data_tmp = b'' + self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len= 0 + + #self.AI_client_tts_str_sen = "" + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_tra_flag = 1 + self.AI_client_tts.send(json_data) + utime.sleep_ms(100) + #self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + def AI_client_tts_end(self): + if self.TTS_PRO_TYPE == 1: + data_l ={"header": {"event": "StopSynthesis","trace_id": self.get_trace_id()}} + json_data = ujson.dumps(data_l) + self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + #TTS数据入队 + def AI_client_tts_put_data(self): + #存够5k数据或者3秒超时 + if (self.AI_client_tts_full_sentence_flag == 1 and len(self.tts_data_tmp) >30*1024) \ + or self.tts_time_count >= 3 \ + or (self.AI_client_tts_full_sentence_flag == 1 and self.AI_client_tts_tra_flag == 1 and len(self.tts_data_tmp) >5*1024): + self.AI_client_tts_full_sentence_flag == 0 + #self.AI_client_tts_data_len +=len(self.tts_data_tmp) + if self.AI_client_tts_tra_flag == 1:#第一个数据去掉头 + self.tts_data_tmp = self.tts_data_tmp[9:] + if len(self.tts_data_tmp)>0: + self.AI_audio_queue.put([self.tts_data_tmp,self.AI_client_tts_str_sen]) + print("入:{},{}".format(len(self.tts_data_tmp),self.AI_client_tts_data_len)) + self.tts_time_count = 0 + self.tts_data_tmp = b'' + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_tra_flag = 0 + #文字转语音链路读数据 + def AI_client_tts_recv(self,cli): + recv_data_len_same_count = 0 + recv_data_len = 0 + while True: + try: + # 死循环接收数据 + + recv_data = cli.recv() + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + break + try: + print("AI_client_tts_recv :{}".format(len(recv_data))) + #结束标志{"header":{"event":"EndSynthesis","msg":"success","status":20000000,"task_id":"ffd727e620000803280c5a6498d0e321"}} + if isinstance(recv_data, str): + print("AI_client_tts_recv:str recv_data:{}".format(recv_data)) + if recv_data.find('\"event\":\"EndSynthesis\"') != -1: + print("EndSynthesis!!!!!!!!!!!!!!!!!\r\n") + print("EndSynthesis!!!!!!!!!!!!!!!!!!\r\n") + #self.tts_data_tmp=self.tts_data_tmp[9:-100] + try: + self.websocket_deconnect_tts()#断开 + except Exception as e: #网络连接异常 + usys.print_exception(e) + + + self.tts_time_count = 60#立即发送剩余数据 + self.AI_client_tts_put_data() + + self.AI_client_tts_full_sentence_flag = 1 + break + if recv_data.find('\"msg\":\"success\"') == -1: + break + else: + #判断是否是一个完整的句子 + recv_data_len_tmp = len(recv_data) + if self.TTS_PRO_TYPE == 1: + print("recv_data_len_same_count:{}".format(recv_data_len_same_count)) + if recv_data_len == recv_data_len_tmp: + recv_data_len_same_count+=1 + else: + if recv_data_len_same_count > 2:#认为是完整的句子 + self.AI_client_tts_full_sentence_flag = 1 + print("self.AI_client_tts_full_sentence_flag = 1!!!!!!!!!!!!") + recv_data_len_same_count = 0 + recv_data_len = recv_data_len_tmp + self.tts_data_tmp+=recv_data + self.AI_client_tts_data_len+=recv_data_len_tmp + self.AI_client_tts_data_total_len += recv_data_len_tmp + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_put_data() + #utime.sleep_ms(1000) + except Exception as e: + usys.print_exception(e) + # print(recv_data) + # print(type(recv_data)) + + except Exception as e: + usys.print_exception(e) + break + self.AI_client_tts_isconnect = 0 + self.AI_client_tts_recv_id = 0 + self.AI_client_tts_tra_flag = 0 +####################################################################### + #语音转文字链路 + def websocket_connect_asr(self): + print("websocket_connect_asr:{}!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_asr_isconnect)) + try: + self.websocket_deconnect_asr()#先断一次,预防出错 + except Exception as e: + usys.print_exception(e) + + try: + self.AI_client_asr = uwebsocket.Client.connect('ws://121.40.67.151:9099/asr/ws', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_asr error!!!\r\n") + self.connect_timerout_popup(2) + return + # 线程接收数据 + if self.AI_client_asr_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_asr_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_asr_recv_id = 0 + self.AI_client_asr_recv_id = _thread.start_new_thread(self.AI_client_asr_recv, (self.AI_client_asr,)) + self.AI_client_asr_isconnect = 1 + def websocket_deconnect_asr(self): + if self.AI_client_asr_isconnect == 1: + self.AI_client_asr_isconnect = 0 + self.AI_client_asr.close() + def AI_client_asr_send(self,data_bytes): + #self.AI_client_asr.send(data_bytes) + self.AI_send_data_queue.put([self.AI_client_asr_num,data_bytes]) + def AI_client_asr_start(self): + + self.AI_send_data_queue.put([self.AI_client_asr_num,"{\"header\":{\"event\":\"StartTranscription\",\"trace_id\":\"3fa6b9e6a30b407ea38ad7ae69e6c291\"},\"payload\":{\"format\":\"amr\",\"sample_rate\":8000}}"]) + #语音转文字链路读数据 + def AI_client_asr_recv(self,cli): + + while True: + try: + # 死循环接收数据 + recv_data = cli.recv() + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_asr_recv close") + #self.AI_client_asr_isconnect = 0 + #self.websocket_deconnect_asr() + break + try: + if isinstance(recv_data, str): + jsload_data = ujson.loads(recv_data) + print("jsload_data = {}".format(jsload_data)) + if jsload_data["result"] == None: + continue + if jsload_data["result"]["result"]: + self.AI_listen_text = str(jsload_data["result"]["result"]) + al_listen_screen_title1.set_text(str(jsload_data["result"]["result"])) + # AI_listen_text.set_text(str(jsload_data["result"]["result"])) + if jsload_data["result"]["is_end"] == True: #{"type":"chat","content":"你好"} + self.AI_listen_end = 1 + self.audio_play_state = 0 + self.talk_ars_end() + break + #chat_data = bytearray(chat_data_str) + # AI_label.set_text("思考中...") + # self.AI_client_chat_send(str(jsload_data["result"]["result"])) + # print("chat_data:{}".format(str(jsload_data["result"]["result"]))) + # self.record.stop()#关闭录音 + # self.record_timer.stop()#关闭定时器 + + # try: + # self.websocket_deconnect_asr() + # break + # except Exception as e: + # usys.print_exception(e) + elif jsload_data["result"]["is_end"] == False: + self.AI_listen_end = 0 + # AI_label.set_text("语音识别中...") + except Exception as e: + print("error recv_data:{}".format(recv_data)) + usys.print_exception(e) + + except Exception as e: + usys.print_exception(e) + break + self.AI_client_asr_isconnect = 0 + self.AI_client_asr_recv_id = 0 + ############################################### + #发送数据队列 + def AI_send_data_queue_thread(self): + while True: + #data[0]是websocket连接对象编号,data[1]是数据 + data = self.AI_send_data_queue.get() + if data != None: + try: + #data["func"](data["data"]) + # self.record.stop() + # self.aud.playStream(4, data) + # self.record.stream_start(audio.Record.AMRNB, 8000, 60) + # 发送数据 + #bytes_data = bytes(data[1]) + #data[0].send(data[1]) + if data[0] == self.AI_client_chat_num: + if self.AI_client_chat_isconnect == 0: + try: + self.websocket_connect_chat() + except Exception as e: #网络连接异常 + usys.print_exception(e) + tmp = self.AI_client_chat.send(data[1]) + print("chat send_data:{} tmp:{}".format(len(data[1]),tmp)) + if data[0] == self.AI_client_asr_num: + if self.AI_client_asr_isconnect == 0: + try: + self.websocket_connect_asr() + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("asr send_data:{}".format(len(data[1]))) + self.AI_client_asr.send(data[1]) + if data[0] == self.AI_client_tts_num: + if self.AI_client_tts_isconnect == 0: + try: + self.websocket_connect_tts() + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("tts send_data:{}".format((data[1]))) + self.AI_client_tts.send(data[1]) + except Exception as e: + print("DeviceInfo_queue_thread:ERROR:{}".format(e)) + usys.print_exception(e) + if data[0] == self.AI_client_chat_num: + self.AI_client_chat_isconnect = 0 + try: + self.websocket_connect_chat() + except Exception as e: #网络连接异常 + usys.print_exception(e) + if data[0] == self.AI_client_asr_num: + self.AI_client_asr_isconnect = 0 + try: + self.websocket_connect_asr() + except Exception as e: #网络连接异常 + usys.print_exception(e) + if data[0] == self.AI_client_tts_num: + count =10 + while 1: + count-=1 + if count<=0: + break + self.AI_client_tts_isconnect = 0 + try: + self.websocket_connect_tts() + except Exception as e: #网络连接异常 + usys.print_exception(e) + #self.AI_client_tts_start() + if self.AI_client_tts_isconnect == 1: + try: + self.AI_client_tts.send(data[1]) + break + except Exception as e: + usys.print_exception(e) + + ############################################ + # 音频队列 + def AI_audio_queue_thread(self): + + while True: + try: + if 1: #self.audio_play_state == 0: + #print("AI_audio_queue_thread") + data = self.AI_audio_queue.get() + + #self.AI_client_tts_data_len=len(data) + print("audio_queue:len:{},data{}".format(len(data[0]),data[1])) + if len(data[0]) > 1: + if self.TTS_PRO_TYPE == 0: + + self.AI_label_answer+=data[1] + EventMesh.publish("publish_message_event_ui",{"func":self.ai_talk_end_show_text_cb,"data":0}) + # AI_label.set_text(self.AI_label_answer) + try: + + tmp= self.aud.playStream(3, data[0])#播放音频流 + print("出:{},{}!!!".format(len(data[0]),self.AI_client_tts_data_len)) + if tmp != 0: + print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data[0]))) + self.AI_client_tts_data_len -=len(data[0]) + except Exception as e: + print("AI_audio_queue_thread:ERROR:") + usys.print_exception(e) + except Exception as e: + print("AI_audio_queue_thread:ERROR:") + usys.print_exception(e) + def Close(self): + try: + #销毁线程 + if self.AI_audio_queue_thread_id != 0: + try: + _thread.stop_thread(self.AI_audio_queue_thread_id) + except Exception as e: + usys.print_exception(e) + self.AI_audio_queue_thread_id = 0 + if self.AI_send_data_queue_thread_id != 0: + try: + _thread.stop_thread(self.AI_send_data_queue_thread_id) + except Exception as e: + usys.print_exception(e) + self.AI_send_data_queue_thread_id = 0 + if self.AI_client_chat_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_chat_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_chat_recv_id = 0 + if self.AI_client_tts_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_tts_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_tts_recv_id = 0 + if self.AI_client_asr_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_asr_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_asr_recv_id = 0 + except Exception as e: + usys.print_exception(e) + self.AI_send_data_queue.clear() + print("close:AI_send_data_queue:size:{}".format(self.AI_send_data_queue.size())) + self.AI_audio_queue.clear() + self.AI_client_tts_str_sen = '' + self.record_timer.stop() + self.AI_client_tts_timer.stop() + self.aud.stopPlayStream() + self.aud.stopAll() + self.AI_client_chat_play_str = "" + self.AI_client_tts_tra_flag = 0 + self.record.stop()#关闭录音 + Record_read_buf = bytearray(self.Audio_buf_size) + for i in range(10): + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("Record_len:!!!!!!{}\r\n".format(Record_len)) + if Record_len <= 0: + break + self.AI_label_answer = "" + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.clear_flag() + try: + self.websocket_deconnect_asr() + self.websocket_deconnect_tts() + self.websocket_deconnect_chat() + except Exception as e: + usys.print_exception(e) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_left_to_right(self): + # # print("ai done_right_to_left\r\n") + # if (AI_talk_end_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_listen_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or\ + # (AI_talk_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_no_net_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + # (AI_connect_timerout_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_not_listen_text_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + # (AI_think_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False: + # EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ai.py "b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254.py" similarity index 58% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ai.py rename to "2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254.py" index a2e386c9..425edee4 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ai.py +++ "b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai - \345\211\257\346\234\254.py" @@ -4,27 +4,59 @@ from machine import Pin import osTimer import _thread from queue import Queue -from ui import style_font_youyuan_20,style_screen,Screen,style_font_youyuan_20_black,style_img,LCD_SIZE_H,LCD_SIZE_W +LCD_SIZE_H = 280 +LCD_SIZE_W = 240 import uwebsocket import usys import EventMesh import constants import ujson import lvgl as lv +import urandom +import uhashlib +import ubinascii +style_screen = lv.style_t() +style_screen.init() +style_screen.set_radius(0) +style_screen.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_screen.set_bg_opa(255) +style_screen.set_border_width(0) +style_screen.set_pad_left(0) +style_screen.set_pad_right(0) +style_screen.set_pad_top(0) +style_screen.set_pad_bottom(0) + +style_font_youyuan_20 = lv.style_t() +style_font_youyuan_20.init() +style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) #length长度内,返回string句号或逗号的分割字符串 -def split_string(string,length): - count = string.find(',',0,length) +def split_string(string,start,end): + count = string.find(',',start,end) + if count != -1: + return string[:count] + count = string.find('.',start,end) if count != -1: return string[:count] - count = string.find('.',0,length) + count = string.find('!',start,end) if count != -1: return string[:count] - count = string.find('。',0,length) + count = string.find('?',start,end) + if count != -1: + return string[:count] + + count = string.find(',',start,end) + if count != -1: + return string[:count+len(',')] + count = string.find('。',start,end) if count != -1: - return string[:count-1+len('。')] - count = string.find(',',0,length) + return string[:count+len('。')] + count = string.find('!',start,end) if count != -1: - return string[:count-1+len(',')] + return string[:count+len('!')] + count = string.find('?',start,end) + if count != -1: + return string[:count+len('?')] return '' def sub_utf8_String(string,length): if length >= len(string): @@ -74,13 +106,13 @@ style_common_bg_rect_btn_pressed.set_shadow_opa(0) # style_font_20_ai_green.init() # style_font_20_ai_green.set_text_color(lv.color_make(0x00, 0xf0, 0x00)) # style_font_20_ai_green.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) -# style_font_20_ai_green.set_text_font_v2("font_28.bin",28,0) +# style_font_20_ai_green.set_text_font(lv.K01_font_16_ALL) # style_font_20_ai_white = lv.style_t() # style_font_20_ai_white.init() # style_font_20_ai_white.set_text_color(lv.color_make(0x00, 0xf0, 0x00)) # style_font_20_ai_white.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) -# style_font_20_ai_white.set_text_font_v2("font_28.bin",28,0) +# style_font_20_ai_white.set_text_font(lv.K01_font_16_ALL) style_font_20_ai_white = lv.style_t() style_font_20_ai_white.init() @@ -90,7 +122,7 @@ style_font_20_ai_white.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) style_font_20_ai_white.set_bg_grad_dir(lv.GRAD_DIR.NONE) style_font_20_ai_white.set_bg_opa(255) style_font_20_ai_white.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_20_ai_white.set_text_font_v2("font_28.bin",28,0) +style_font_20_ai_white.set_text_font(lv.K01_font_16_ALL) style_font_20_ai_green = lv.style_t() style_font_20_ai_green.init() @@ -100,7 +132,7 @@ style_font_20_ai_green.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) style_font_20_ai_green.set_bg_grad_dir(lv.GRAD_DIR.NONE) style_font_20_ai_green.set_bg_opa(255) style_font_20_ai_green.set_text_color(lv.color_make(0x00, 0x00, 0x00)) -style_font_20_ai_green.set_text_font_v2("font_28.bin",28,0) +style_font_20_ai_green.set_text_font(lv.K01_font_16_ALL) AI_screen = lv.obj() print("AI_screen") @@ -132,25 +164,33 @@ AI_press_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) AI_press_label_countdown = lv.label(AI_screen_list_screen) AI_press_label_countdown.set_pos(30, 20) -AI_press_label_countdown.set_size(LCD_SIZE_W-30, 80) +AI_press_label_countdown.set_size(LCD_SIZE_W-30, 40) AI_press_label_countdown.set_text(" ") AI_press_label_countdown.set_long_mode(lv.label.LONG.WRAP) AI_press_label_countdown.set_style_text_align(lv.TEXT_ALIGN.RIGHT, 0) AI_press_label_countdown.add_style(style_font_20_ai_green, lv.PART.MAIN | lv.STATE.DEFAULT) AI_label = lv.label(AI_screen_list_screen) -AI_label.set_pos(0, 130) -AI_label.set_size(LCD_SIZE_W-30, 80) +AI_label.set_pos(0, 90) +AI_label.set_size(LCD_SIZE_W-30, 120) AI_label.set_text(" ") AI_label.set_long_mode(lv.label.LONG.WRAP) AI_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) AI_label.add_style(style_font_20_ai_white, lv.PART.MAIN | lv.STATE.DEFAULT) -tmp_data_str = "人工智能(Artificial Intelligence),英文缩写为AI。 是新一轮科技革命和产业变革的重要驱动力量, 是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。\ -人工智能是智能学科重要的组成部分,它企图了解智能的实质,并生产出一种新的能以与人类智能相似的方式做出反应的智能机器。人工智能是十分广泛的科学,包括机器人、语言识别、图像识别、自然语言处理、专家系统、机器学习,计算机视觉等。\ -人工智能大模型带来的治理挑战也不容忽视。 马斯克指出,在人工智能机器学习面具之下的本质仍然是统计。 营造良好创新生态,需做好前瞻研究,建立健全保障人工智能健康发展的法律法规、制度体系、伦理道德。 着眼未来,在重视防范风险的同时,\ -也应同步建立容错、纠错机制,努力实现规范与发展的动态平衡。" -class AIScreen(Screen):#AI_GUI +ai_tts_str_tmp = \ +"1、关于什么是“智能”,涉及到诸如意识(CONSCIOUSNESS)、自我(SELF)、思维(MIND)(包括无意识的思维(UNCONSCIOUS_MIND))等问题。\ +2、人唯一了解的智能是人本身的智能,这是普遍认同的观点。但是我们对我们自身智能的理解都非常有限,对构成人的智能的必要元素也了解有限,所以就很难定义什么是人工智能。\ +3、人工智能的研究往往涉及对人的智能本身的研究。其它关于动物或其它人造系统的智能也普遍被认为是人工智能相关的研究课题。\ +4、尼尔逊教授对人工智能下了这样一个定义:“人工智能是关于知识的学科――怎样表示知识以及怎样获得知识并使用知识的科学。”而另一个美国麻省理工学院的温斯顿教授认为:\ +5、“人工智能就是研究如何使计算机去做过去只有人才能做的智能工作。”这些说法反映了人工智能学科的基本思想和基本内容。即人工智能是研究人类智能活动的规律,\ +6、构造具有一定智能的人工系统,研究如何让计算机去完成以往需要人的智力才能胜任的工作,也就是研究如何应用计算机的软硬件来模拟人类某些智能行为的基本理论、方法和技术。\ +7、20世纪70年代以来,人工智能被称为世界三大尖端技术之一(空间技术、能源技术、人工智能)。也被认为是21世纪三大尖端技术(基因工程、纳米科学、人工智能)之一。\ +8、这是因为近三十年来它获得了迅速的发展,在很多学科领域都获得了广泛应用,并取得了丰硕的成果,人工智能已逐步成为一个独立的分支,无论在理论和实践上都已自成一个系统。\ +9、人工智能是研究使用计算机来模拟人的某些思维过程和智能行为(如学习、推理、思考、规划等)的学科,主要包括计算机实现智能的原理、制造类似于人脑智能的计算机,\ +10、使计算机能实现更高层次的应用。人工智能将涉及到计算机科学、心理学、哲学和语言学等学科。可以说几乎是自然科学和社会科学的所有学科,其范围已远远超出了计算机科学的范畴,\ +" +class AIScreen():#AI_GUI # NAME = "AI_success" @@ -168,6 +208,7 @@ class AIScreen(Screen):#AI_GUI self.audio_play_state = 0 #音频播放完状态 self.aud.setCallback(self.audio_cb) + self.TTS_PRO_TYPE = 0 #TTS协议类型,=0:用长文本合成接口,=1用音频流合成接口 self.AI_audio_queue_thread_id = 0 self.AI_send_data_queue_thread_id = 0 self.AI_client_chat_recv_id = 0 @@ -186,12 +227,18 @@ class AIScreen(Screen):#AI_GUI self.AI_client_tts_num = 2 self.AI_client_tts_timer = osTimer() self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 #单次tts总数据长度 + self.AI_client_tts_str_total_len = 0 #单次已发送tts字符串长度 + self.AI_client_tts_str_sen = '' #单次已发送tts字符串长度 self.AI_client_tts_tra_flag = 0 + self.AI_client_tts_full_sentence_flag = 0 #完整的句子标识 self.tts_time_count = 0 self.tts_data_tmp = bytes() self.press_state = 0 self.AI_label_str = "" self.AI_client_tts_play_data_len = 0 + self.AI_send_data_queue = Queue(100) + self.AI_audio_queue = Queue(100) # AI_press_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.talking_cb(e)), # lv.EVENT.LONG_PRESSED, None) # AI_press_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sending_cb(e)), @@ -199,15 +246,16 @@ class AIScreen(Screen):#AI_GUI AI_press_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.talking_cb(e)), lv.EVENT.RELEASED, None) def initialization(self): + self.TTS_PRO_TYPE = 0 self.aud.setVolume(11)#设置最大声录音 - self.AI_audio_queue = Queue(100) - self.AI_audio_queue_thread_id = _thread.start_new_thread(self.AI_audio_queue_thread, ()) - - self.AI_send_data_queue = Queue(100) - self.AI_send_data_queue_thread_id = _thread.start_new_thread(self.AI_send_data_queue_thread, ()) - self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) - self.AI_client_chat_play_str = tmp_data_str + self.AI_client_chat_play_str = '' + #测试代码 + self.AI_client_chat_play_str =ai_tts_str_tmp + self.AI_init() self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len = 0 + self.AI_client_tts_tra_flag = 0 #EventMesh.publish("publish_message_event_ui",{"func":self.websocket_connect,"data":""}) def websocket_connect(self,data): self.websocket_connect_asr() @@ -219,7 +267,7 @@ class AIScreen(Screen):#AI_GUI def audio_cb(self,event): if event == 0: self.audio_play_state =1 - print('audio-play start.') + #print('audio-play start.') elif event == 7: self.audio_play_state = 0 # if self.AI_audio_queue.size() > 0: @@ -235,11 +283,17 @@ class AIScreen(Screen):#AI_GUI # print("playStream:{}".format(tmp)) # except Exception as e: # usys.print_exception(e) - print('audio-play finish.') - + #print('audio-play finish.') + def AI_init(self,): + self.AI_audio_queue_thread_id = _thread.start_new_thread(self.AI_audio_queue_thread, ()) + self.AI_send_data_queue_thread_id = _thread.start_new_thread(self.AI_send_data_queue_thread, ()) + + self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) + #按下录音 def talking_cb(self,e): - EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) + print("talking_cb") + #EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) #按下录音 def talking(self,e): #self.AI_client_tts_send("创建客户端, debug=True输出日志")#TTS语音播放AI结果 @@ -250,22 +304,23 @@ class AIScreen(Screen):#AI_GUI print("talking1") #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 try: - self.record.stop()#关闭录音 - self.record.stream_start(audio.Record.AMRNB, 8000, 60) + print("talking2") + self.Close() + print("talking3") + self.AI_init() except Exception as e: - usys.print_exception(e) + usys.print_exception(e) + self.record.stream_start(audio.Record.AMRNB, 8000, 60) self.record_timer.start(1*1000,1,self.record_timer_cb) - self.aud.stopAll() - self.AI_client_chat_play_str = "" - self.AI_send_data_queue.clear()#清音频队列 #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 - AI_label.clear_flag(lv.obj.FLAG.HIDDEN) - AI_label.set_text("语音识别中...") + AI_press_label_countdown.clear_flag(lv.obj.FLAG.HIDDEN) #AI_press_label_countdown.set_text("{}S".format(str(self.countdown))) self.press_state = 1 self.AI_client_asr_start() + AI_label.set_text("语音识别中...") + print("talking7") else: EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) @@ -302,78 +357,27 @@ class AIScreen(Screen):#AI_GUI if Record_len >0: read_buf = bytes(Record_read_buf[:Record_len]) self.AI_client_asr_send(read_buf) + #获取trace_id + def get_trace_id(self): + t = utime.mktime(utime.localtime()) + t = t*1000+urandom.randint(0, 1000) + md5_data = "{}".format(t)#md5签名 + sign_data = "" + hash_obj = uhashlib.md5(md5_data) + res = hash_obj.digest() + + # 转成十六进制表示 + sign_data = ubinascii.hexlify(res) + sign_data = sign_data.decode('ascii') + return sign_data ##################################################### - #AI识别链路 - def websocket_connect_chat(self): - print("websocket_connect_chat:{}".format(self.AI_client_chat_isconnect)) - #if self.AI_client_chat_isconnect == 0: - # 创建客户端, debug=True输出日志, ip和端口需要自己填写, 或者是域名 - self.AI_client_chat = uwebsocket.Client.connect('ws://121.40.67.151:9099/chat/ws', debug=True) - # 线程接收数据 - if self.AI_client_chat_recv_id != 0: - try: - _thread.stop_thread(self.AI_client_chat_recv_id) - except Exception as e: - usys.print_exception(e) - self.AI_client_chat_recv_id = 0 - self.AI_client_chat_recv_id = _thread.start_new_thread(self.AI_client_chat_recv, (self.AI_client_chat,)) - self.AI_client_chat_isconnect = 1 - def websocket_deconnect_chat(self): - if self.AI_client_chat_isconnect == 1: - self.AI_client_chat_isconnect = 0 - self.AI_client_chat.close() - - def AI_client_chat_send(self,data_str): - chat_data_str = "{\"type\":\"chat\",\"content\":\"%s\"}"%(data_str) - #self.AI_client_chat.send(chat_data_str) - self.AI_send_data_queue.put([self.AI_client_chat_num,chat_data_str]) - #Ai chat读数据 - def AI_client_chat_recv(self,cli): - while True: - try: - # 死循环接收数据 - recv_data = cli.recv() - if not recv_data: - # 服务器关闭连接或客户端关闭连接 - print("AI_client_chat_recv close") - #self.AI_client_chat_isconnect = 0 - #self.websocket_deconnect_chat() - break - try: - #print("AI_client_chat_recv recv_data = {}".format(recv_data)) - jsload_data = ujson.loads(recv_data) - #print("AI_client_chat_recv jsload_data = {}".format(jsload_data)) - if jsload_data["content"]: - #self.AI_client_tts_send(jsload_data["content"])#TTS语音播放AI结果 - self.AI_label_str+=str(jsload_data["content"]) - self.AI_client_chat_play_str+=str(jsload_data["content"]) - AI_label.set_text(self.AI_label_str) - EventMesh.publish("system_sleep_rest")#防止黑屏 - else: - # if self.AI_label_str: - # self.AI_client_tts_send(self.AI_label_str)#TTS语音播放AI结果 - - if jsload_data['type']=='start': - self.AI_label_str = "" - self.AI_client_chat_end_flag = 0 - self.websocket_connect_tts() #连接tts - # - elif jsload_data['type']=='end': - self.AI_client_chat_end_flag = 1 - except Exception as e: - usys.print_exception(e) - - except Exception as e: - usys.print_exception(e) - break - self.AI_client_tts_isconnect = 0 - self.AI_client_tts_recv_id = 0 + ############################################################################## #文字转语音链路 def websocket_connect_tts(self): - print("websocket_connect_tts:{}".format(self.AI_client_tts_isconnect)) + #print("websocket_connect_tts:{}!!!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_tts_isconnect)) if self.AI_client_tts_isconnect == 0: - self.AI_client_tts = uwebsocket.Client.connect('ws://121.40.67.151:9099/tts/long-text-stream', debug=True) + self.AI_client_tts = uwebsocket.Client.connect('ws://121.40.67.151:9099/tts/long-text-stream', debug=False) # 线程接收数据 if self.AI_client_tts_recv_id != 0: try: @@ -389,47 +393,46 @@ class AIScreen(Screen):#AI_GUI def websocket_deconnect_tts(self): if self.AI_client_tts_isconnect == 1: self.AI_client_tts_isconnect = 0 - self.AI_client_tts.close() + try: + self.AI_client_tts.close() + except Exception as e: + usys.print_exception(e) def AI_client_tts_timer_cb(self,*argc): - self.tts_time_count+=1 - #tts数据入队 - self.AI_client_tts_put_data() - print("AI_audio_queue.size:{}".format(self.AI_audio_queue.size()) ) - #字符串分段发送,等待播放缓存变小 - if len(self.AI_client_chat_play_str) >0 and self.AI_client_tts_data_len < 400*1024: - # play_str = split_string(self.AI_client_chat_play_str,40)# - # if play_str =="":#没找到句号或者逗号,切割字符串 - play_str = sub_utf8_String(self.AI_client_chat_play_str,60)#按中文切割字符串 - self.AI_client_tts_send(play_str)#TTS语音播放AI结果 - self.AI_client_chat_play_str = self.AI_client_chat_play_str[len(play_str):] - self.AI_client_tts_tra_flag = 1 - print("TTS play:{}".format(play_str)) - if len(self.AI_client_chat_play_str) <=0 and self.AI_client_chat_end_flag ==1 and self.AI_client_tts_data_len < 20*1024: - self.AI_client_chat_end_flag=0 - self.AI_client_tts_end() EventMesh.publish("system_sleep_rest")#防止黑屏 + self.tts_time_count+=1 + if self.TTS_PRO_TYPE == 1: + #tts数据入队 + self.AI_client_tts_put_data() + #print("AI_audio_queue.size:{},AI_send_data_queue.size:{},AI_client_chat_play_str_len:{}".format(self.AI_audio_queue.size(),self.AI_send_data_queue.size(),len(self.AI_client_chat_play_str)) ) + + #这里循坏读mp3文件,入队数据, + self.AI_audio_queue.put([self.tts_data_tmp,"1111111"]) def AI_client_tts_send(self,data_str): - data_l ={"header": {"event": "RunSynthesis","trace_id": "3fa6b9e6a30b407ea38ad7ae69e6c291"},"payload": {"text":"%s"%(data_str)}} - # data_l ={ - # "header": { - # "event": "LongTextStream", - # "trace_id": "3fa6b9e6a30b407ea38ad7ae69e6c291" - # }, - # "payload": { - # "voice":"xiaoyun", - # "format":"mp3", - # "sample_rate":8000, - # "volume":100, - # "speech_rate":0, - # "text":"%s"%(data_str) - # } - # } + data_l = {} + if self.TTS_PRO_TYPE == 1: + + data_l ={"header": {"event": "RunSynthesis","trace_id": self.get_trace_id()},"payload": {"text":"%s"%(data_str)}} + elif self.TTS_PRO_TYPE == 0: + data_l ={ + "header": { + "event": "LongTextStream", + "trace_id": self.get_trace_id() + }, + "payload": { + "voice":"xiaoyun", + "format":"mp3", + "sample_rate":8000, + "volume":90, + "speech_rate":2, + "text":"%s"%(data_str) + } + } json_data = ujson.dumps(data_l) self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) def AI_client_tts_start(self): - data_l ={"header": {"event": "StartSynthesis","trace_id": "3fa6b9e6a30b407ea38ad7ae69e6c291"}, - "payload": {"voice":"xiaoyun","format":"mp3","sample_rate":8000,"volume":100,"speech_rate":1,}} - print("\r\nAI_client_tts_start!!!!!!!!!!!!\r\n") + data_l ={"header": {"event": "StartSynthesis","trace_id": self.get_trace_id()}, + "payload": {"voice":"xiaoyun","format":"mp3","sample_rate":8000,"volume":60,"speech_rate":1,}} + #print("\r\nAI_client_tts_start!!!!!!!!!!!!\r\n") json_data = ujson.dumps(data_l) #print("AI_client_tts_send:{}".format(json_data)) self.record.stop()#关闭录音 @@ -437,28 +440,50 @@ class AIScreen(Screen):#AI_GUI self.tts_time_count = 0 self.tts_data_tmp = b'' self.AI_client_tts_data_len = 0 - self.AI_audio_queue.clear() - self.AI_client_tts.send(json_data) - utime.sleep_ms(100) + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len= 0 + + #self.AI_client_tts_str_sen = "" + if self.TTS_PRO_TYPE == 1: + #self.AI_audio_queue.clear() + self.AI_client_tts_tra_flag = 1 + self.AI_client_tts.send(json_data) + utime.sleep_ms(100) + # if self.TTS_PRO_TYPE == 0: + # self.AI_client_tts_tra_flag = 0 #self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) def AI_client_tts_end(self): - data_l ={"header": {"event": "StopSynthesis","trace_id": "3fa6b9e6a30b407ea38ad7ae69e6c291"}} - json_data = ujson.dumps(data_l) - self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + if self.TTS_PRO_TYPE == 1: + data_l ={"header": {"event": "StopSynthesis","trace_id": self.get_trace_id()}} + json_data = ujson.dumps(data_l) + self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) #TTS数据入队 def AI_client_tts_put_data(self): #存够5k数据或者3秒超时 - if len(self.tts_data_tmp) >1*1024 or self.tts_time_count >= 3: + if (self.AI_client_tts_full_sentence_flag == 1 and len(self.tts_data_tmp) >30*1024) \ + or self.tts_time_count >= 3 \ + or (self.AI_client_tts_full_sentence_flag == 1 and self.AI_client_tts_tra_flag == 1 and len(self.tts_data_tmp) >5*1024): + self.AI_client_tts_full_sentence_flag == 0 #self.AI_client_tts_data_len +=len(self.tts_data_tmp) + #print("AI_client_tts_put_data1") + if self.AI_client_tts_tra_flag == 1:#第一个数据去掉头 + self.tts_data_tmp = self.tts_data_tmp[9:] + #print("AI_client_tts_put_data2") if len(self.tts_data_tmp)>0: - self.AI_audio_queue.put(self.tts_data_tmp) - print("入:{},{}".format(len(self.tts_data_tmp),self.AI_client_tts_data_len)) + #print("AI_client_tts_put_data3") + tmp = self.AI_audio_queue.put([self.tts_data_tmp,self.AI_client_tts_str_sen]) + #print("AI_client_tts_put_data4") + print("入:tmp:{},{},{},{}".format(tmp,len(self.tts_data_tmp),self.AI_client_tts_data_len,len(self.AI_client_tts_str_sen))) + print("AI_audio_queue.size:{},AI_send_data_queue.size:{},AI_client_chat_play_str_len:{}".format(self.AI_audio_queue.size(),self.AI_send_data_queue.size(),len(self.AI_client_chat_play_str)) ) self.tts_time_count = 0 self.tts_data_tmp = b'' - self.AI_client_tts_tra_flag = 0 + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_tra_flag = 0 + #print("AI_client_tts_put_data5") #文字转语音链路读数据 def AI_client_tts_recv(self,cli): - + recv_data_len_same_count = 0 + recv_data_len = 0 while True: try: # 死循环接收数据 @@ -466,27 +491,43 @@ class AIScreen(Screen):#AI_GUI recv_data = cli.recv() if not recv_data: # 服务器关闭连接或客户端关闭连接 - print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") - print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + #print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + #print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") break try: - print("AI_client_tts_recv :{}".format(len(recv_data))) + #print("AI_client_tts_recv :{}".format(len(recv_data))) #结束标志{"header":{"event":"EndSynthesis","msg":"success","status":20000000,"task_id":"ffd727e620000803280c5a6498d0e321"}} + if isinstance(recv_data, str): print("AI_client_tts_recv:str recv_data:{}".format(recv_data)) if recv_data.find('\"event\":\"EndSynthesis\"') != -1: print("EndSynthesis!!!!!!!!!!!!!!!!!\r\n") - print("EndSynthesis!!!!!!!!!!!!!!!!!!\r\n") - #self.tts_time_count = 60#立即发送剩余数据 + # #self.tts_data_tmp=self.tts_data_tmp[9:-100] - #self.AI_client_tts_put_data() - self.AI_client_tts_tra_flag = 0 self.websocket_deconnect_tts()#断开 + self.tts_time_count = 60#立即发送剩余数据 + self.AI_client_tts_put_data() + self.AI_client_tts_full_sentence_flag = 1 + #print("EndSynthesis!!!!!!!!!!!!!!!!!!\r\n") break else: + #判断是否是一个完整的句子 + recv_data_len_tmp = len(recv_data) + if self.TTS_PRO_TYPE == 1: + print("recv_data_len_same_count:{}".format(recv_data_len_same_count)) + if recv_data_len == recv_data_len_tmp: + recv_data_len_same_count+=1 + else: + if recv_data_len_same_count > 2:#认为是完整的句子 + self.AI_client_tts_full_sentence_flag = 1 + print("self.AI_client_tts_full_sentence_flag = 1!!!!!!!!!!!!") + recv_data_len_same_count = 0 + recv_data_len = recv_data_len_tmp self.tts_data_tmp+=recv_data - self.AI_client_tts_data_len+=len(recv_data) - self.AI_client_tts_put_data() + self.AI_client_tts_data_len+=recv_data_len_tmp + self.AI_client_tts_data_total_len += recv_data_len_tmp + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_put_data() #utime.sleep_ms(1000) except Exception as e: usys.print_exception(e) @@ -498,87 +539,15 @@ class AIScreen(Screen):#AI_GUI break self.AI_client_tts_isconnect = 0 self.AI_client_tts_recv_id = 0 + self.AI_client_tts_tra_flag = 0 ####################################################################### - #语音转文字链路 - def websocket_connect_asr(self): - print("websocket_connect_asr:{}".format(self.AI_client_asr_isconnect)) - try: - self.websocket_deconnect_asr()#先断一次,预防出错 - except Exception as e: - usys.print_exception(e) - self.AI_client_asr = uwebsocket.Client.connect('ws://121.40.67.151:9099/asr/ws', debug=True) - # 线程接收数据 - if self.AI_client_asr_recv_id != 0: - try: - _thread.stop_thread(self.AI_client_asr_recv_id) - except Exception as e: - usys.print_exception(e) - self.AI_client_asr_recv_id = 0 - self.AI_client_asr_recv_id = _thread.start_new_thread(self.AI_client_asr_recv, (self.AI_client_asr,)) - self.AI_client_asr_isconnect = 1 - def websocket_deconnect_asr(self): - if self.AI_client_asr_isconnect == 1: - self.AI_client_asr_isconnect = 0 - self.AI_client_asr.close() - def AI_client_asr_send(self,data_bytes): - #self.AI_client_asr.send(data_bytes) - self.AI_send_data_queue.put([self.AI_client_asr_num,data_bytes]) - def AI_client_asr_start(self): - self.AI_send_data_queue.put([self.AI_client_asr_num,"{\"header\":{\"event\":\"StartTranscription\",\"trace_id\":\"3fa6b9e6a30b407ea38ad7ae69e6c291\"},\"payload\":{\"format\":\"amr\",\"sample_rate\":8000}}"]) - #语音转文字链路读数据 - def AI_client_asr_recv(self,cli): - - while True: - try: - # 死循环接收数据 - recv_data = cli.recv() - if not recv_data: - # 服务器关闭连接或客户端关闭连接 - print("AI_client_asr_recv close") - #self.AI_client_asr_isconnect = 0 - #self.websocket_deconnect_asr() - break - try: - if isinstance(recv_data, str): - jsload_data = ujson.loads(recv_data) - print("jsload_data = {}".format(jsload_data)) - if jsload_data["result"] == None: - continue - if jsload_data["result"]["result"]: - AI_press_label_countdown.set_text(str(jsload_data["result"]["result"])) - if jsload_data["result"]["is_end"] == True: #{"type":"chat","content":"你好"} - #chat_data = bytearray(chat_data_str) - AI_label.set_text("思考中...") - self.AI_client_chat_send(str(jsload_data["result"]["result"])) - print("chat_data:{}".format(str(jsload_data["result"]["result"]))) - self.record.stop()#关闭录音 - self.record_timer.stop()#关闭定时器 - try: - self.websocket_deconnect_asr() - break - except Exception as e: - usys.print_exception(e) - elif jsload_data["result"]["is_end"] == False: - AI_label.set_text("语音识别中...") - except Exception as e: - print("error recv_data:{}".format(recv_data)) - usys.print_exception(e) - - except Exception as e: - usys.print_exception(e) - break - self.AI_client_asr_isconnect = 0 - self.AI_client_asr_recv_id = 0 + ############################################### #发送数据队列 def AI_send_data_queue_thread(self): while True: #data[0]是websocket连接对象编号,data[1]是数据 data = self.AI_send_data_queue.get() - - - - if data != None: try: #data["func"](data["data"]) @@ -591,8 +560,8 @@ class AIScreen(Screen):#AI_GUI if data[0] == self.AI_client_chat_num: if self.AI_client_chat_isconnect == 0: self.websocket_connect_chat() - self.AI_client_chat.send(data[1]) - print("chat send_data:{}".format(len(data[1]))) + tmp = self.AI_client_chat.send(data[1]) + print("chat send_data:{} tmp:{}".format(len(data[1]),tmp)) if data[0] == self.AI_client_asr_num: if self.AI_client_asr_isconnect == 0: self.websocket_connect_asr() @@ -601,7 +570,7 @@ class AIScreen(Screen):#AI_GUI if data[0] == self.AI_client_tts_num: if self.AI_client_tts_isconnect == 0: self.websocket_connect_tts() - print("tts send_data:{}".format((data[1]))) + #print("tts send_data:{}".format((data[1]))) self.AI_client_tts.send(data[1]) except Exception as e: print("DeviceInfo_queue_thread:ERROR:{}".format(e)) @@ -633,34 +602,39 @@ class AIScreen(Screen):#AI_GUI def AI_audio_queue_thread(self): while True: - if self.audio_play_state == 0: - data = self.AI_audio_queue.get() - print("audio_queue:data:{}".format(len(data))) - self.AI_client_tts_data_len=len(data) - if len(data) > 1: - # f = open("/usr/test.mp3", "w+") - # f.write(data) - try: - # while self.audio_play_state: - # pass - print("开始播放!!!!!!!!!!!!!!!!!!!!!") - print("开始播放!!!!!!!!!!!!!!!!!!!!!") - print("开始播放!!!!!!!!!!!!!!!!!!!!!") - print("开始播放!!!!!!!!!!!!!!!!!!!!!") - #data = data[9:] - tmp=self.aud.playStream(3, data,0,self.AI_client_tts_data_len)#播放音频流 - print("出:{},{}!!!".format(len(data),self.AI_client_tts_data_len)) - if tmp != 0: - print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data))) - print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data))) - print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data))) - print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data))) - self.AI_client_tts_data_len -=len(data) - except Exception as e: + try: + if self.audio_play_state == 0: + #print("AI_audio_queue_thread") + data = self.AI_audio_queue.get() + + #self.AI_client_tts_data_len=len(data) + print("audio_queue:len:{},data{}".format(len(data[0]),data[1])) + if len(data[0]) > 1: + if self.TTS_PRO_TYPE == 0: + AI_label.set_text(data[1]) + # + # f = open("/usr/test.mp3", "w+") + # f.write(data) + try: + # while self.audio_play_state: + # pass + #print("开始播放!!!!!!!!!!!!!!!!!!!!!") + #print("开始播放!!!!!!!!!!!!!!!!!!!!!") + #print("开始播放!!!!!!!!!!!!!!!!!!!!!") + #print("开始播放!!!!!!!!!!!!!!!!!!!!!") + + tmp=self.aud.playStream(3, data[0])#播放音频流 + print("出:{},{}!!!".format(len(data[0]),self.AI_client_tts_data_len)) + + self.AI_client_tts_data_len -=len(data[0]) + except Exception as e: + print("AI_audio_queue_thread:ERROR:") + usys.print_exception(e) + except Exception as e: print("AI_audio_queue_thread:ERROR:") usys.print_exception(e) - def Close(self): + print("Close1") try: #销毁线程 if self.AI_audio_queue_thread_id != 0: @@ -695,21 +669,29 @@ class AIScreen(Screen):#AI_GUI self.AI_client_asr_recv_id = 0 except Exception as e: usys.print_exception(e) + print("Close2") self.AI_send_data_queue.clear() - print("close:AI_send_data_queue:size:{}".format(self.AI_send_data_queue.size())) self.AI_audio_queue.clear() + print("Close3") + self.AI_client_tts_str_sen = '' self.record_timer.stop() self. AI_client_tts_timer.stop() + print("Close4") self.aud.stopPlayStream() self.aud.stopAll() + print("Close5") self.AI_client_chat_play_str = "" + self.AI_client_tts_tra_flag = 0 self.record.stop()#关闭录音 + print("Close6") try: self.websocket_deconnect_asr() self.websocket_deconnect_tts() self.websocket_deconnect_chat() except Exception as e: usys.print_exception(e) + print("Close7") + def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py new file mode 100644 index 00000000..bdfb60c6 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ai.py @@ -0,0 +1,2043 @@ +import utime +import audio +from machine import Pin +import osTimer +import _thread +from queue import Queue +import uwebsocket +import usys +import EventMesh +import constants +import ujson +import lvgl as lv +import urandom +import uhashlib +import ubinascii +import gc +from ui import style_font_youyuan_20,style_screen,Screen,style_img,LCD_SIZE_H,LCD_SIZE_W +style_font_youyuan_ai_20 = lv.style_t() +style_font_youyuan_ai_20.init() +style_font_youyuan_ai_20.set_text_color(lv.color_make(253, 82, 19)) +style_font_youyuan_ai_20.set_text_font(lv.K01_font_16_ALL) +#length长度内,返回string句号或逗号的分割字符串 +def split_string(string,start,end): + count = string.find('\n',start,end) + if count != -1: + return string[:count+1] + count = string.find(',',start,end) + if count != -1: + return string[:count+1] + count = string.find('.',start,end) + if count != -1: + return string[:count+1] + count = string.find('!',start,end) + if count != -1: + return string[:count+1] + count = string.find('?',start,end) + if count != -1: + return string[:count+1] + + + count = string.find(',',start,end) + if count != -1: + return string[:count+len(',')] + count = string.find('。',start,end) + if count != -1: + return string[:count+len('。')] + count = string.find('、',start,end) + if count != -1: + return string[:count+len('、')] + + count = string.find('!',start,end) + if count != -1: + return string[:count+len('!')] + count = string.find('?',start,end) + if count != -1: + return string[:count+len('?')] + return '' +def sub_utf8_String(string,length): + if length >= len(string): + return string + i = 0 + p = 0 + while True: + ch = ord(string[i]) + #1111110x + if ch >= 252: + p = p + 6 + #111110xx + elif ch >= 248: + p = p + 5 + #11110xxx + elif ch >= 240: + p = p + 4 + #1110xxxx + elif ch >= 224: + p = p + 3 + #110xxxxx + elif ch >= 192: + p = p + 2 + else: + p = p + 1 + if p >= length: + break + else: + i = p + + return string[0:i] + +style_AI_btn = lv.style_t() +style_AI_btn.init() +style_AI_btn.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_AI_btn.set_border_width(0) +style_AI_btn.set_shadow_opa(0) + +style_common_bg_rect_btn_pressed = lv.style_t() +style_common_bg_rect_btn_pressed.init() +style_common_bg_rect_btn_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_common_bg_rect_btn_pressed.set_bg_opa(100) +style_common_bg_rect_btn_pressed.set_border_width(0) +style_common_bg_rect_btn_pressed.set_shadow_opa(0) + +style_font_20_ai_white = lv.style_t() +style_font_20_ai_white.init() +style_font_20_ai_white.set_radius(0) +style_font_20_ai_white.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +#style_font_20_ai_white.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_font_20_ai_white.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_font_20_ai_white.set_bg_opa(255) +style_font_20_ai_white.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_20_ai_white.set_text_font(lv.K01_font_16_ALL) + +style_font_20_ai_green = lv.style_t() +style_font_20_ai_green.init() +style_font_20_ai_green.set_radius(5) +style_font_20_ai_green.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) +#style_font_20_ai_green.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_font_20_ai_green.set_bg_grad_dir(lv.GRAD_DIR.NONE) +style_font_20_ai_green.set_bg_opa(255) +style_font_20_ai_green.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_20_ai_green.set_text_font(lv.K01_font_16_ALL) + +AI_screen = lv.obj() +print("AI_screen") +AI_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_talk_end_screen = lv.obj(AI_screen) +AI_talk_end_screen.set_pos(0, 0) +AI_talk_end_screen.set_size(LCD_SIZE_W,LCD_SIZE_H) +print("AI_talk_end_screen") +AI_talk_end_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_end_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + +AI_screen_list_screen_title = lv.obj(AI_talk_end_screen) +AI_screen_list_screen_title.set_pos(0, 0) +AI_screen_list_screen_title.set_size(LCD_SIZE_W,40) +AI_screen_list_screen_title.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_screen_list_screen_title.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_success_title1 = lv.label(AI_screen_list_screen_title) +# al_success_title1.set_pos(0, 5) +# al_success_title1.set_size(LCD_SIZE_W, 25) +# al_success_title1.set_text("AI智能助手") +# al_success_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# al_success_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# AI_press_btn = lv.btn(AI_talk_end_screen) +# AI_press_btn.set_pos(10, (LCD_SIZE_H-60)+4) +# AI_press_btn.set_size(LCD_SIZE_W-20, 56) +# AI_press_btn.add_style(style_AI_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# AI_press_btn.add_style(style_common_bg_rect_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) +# AI_press_btn.set_style_radius(30,0) + +AI_talk_end_bt_screen = lv.obj(AI_talk_end_screen) +AI_talk_end_bt_screen.set_pos(0, 210) +AI_talk_end_bt_screen.set_size(LCD_SIZE_W,LCD_SIZE_H-210) +print("AI_talk_end_bt_screen") +AI_talk_end_bt_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_end_bt_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_talk_end_screen_icon1 = lv.img(AI_talk_end_bt_screen) +al_talk_end_screen_icon1.set_size(50,50) +al_talk_end_screen_icon1.set_pos(15,10) +al_talk_end_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_end_screen_icon1.set_src("U:/static/AI/ai_result_can_start.png") +al_talk_end_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_end_screen_cancel_bt = lv.label(AI_talk_end_bt_screen) +al_talk_end_screen_cancel_bt.set_text(" ") +al_talk_end_screen_cancel_bt.set_size(80, 72) +al_talk_end_screen_cancel_bt.set_pos(0,0) +al_talk_end_screen_cancel_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_talk_end_screen_icon2 = lv.img(AI_talk_end_bt_screen) +al_talk_end_screen_icon2.set_size(150,50) +al_talk_end_screen_icon2.set_pos(80,10) +al_talk_end_screen_icon2.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_end_screen_icon2.set_src("U:/static/AI/ai_result_bt.png") +al_talk_end_screen_icon2.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +AI_press_label_bt = lv.label(al_talk_end_screen_icon2) +AI_press_label_bt.set_text(" ") +AI_press_label_bt.set_size(240-150, 72) +AI_press_label_bt.set_pos(0,0) +AI_press_label_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +AI_press_label = lv.label(al_talk_end_screen_icon2) +AI_press_label.set_text("继续对话") +AI_press_label.set_size(240-108, 50) +AI_press_label.set_pos(8,18) +AI_press_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +AI_press_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +style_green_screen = lv.style_t() +style_green_screen.init() +style_green_screen.set_radius(5) +style_green_screen.set_bg_color(lv.color_make(79,195,76)) +style_green_screen.set_bg_opa(255) +style_green_screen.set_border_width(0) +style_green_screen.set_pad_left(0) +style_green_screen.set_pad_right(0) +style_green_screen.set_pad_top(0) +style_green_screen.set_pad_bottom(0) + +style_font_28_green_bg_gray = lv.style_t() +style_font_28_green_bg_gray.init() +# style_font_28_green_bg_gray.set_bg_color(lv.color_make(79,195,76)) +# style_font_28_green_bg_gray.set_bg_opa(255) +# style_font_28_green_bg_gray.set_radius(5) +# style_font_28_green_bg_gray.set_border_width(0) +# style_font_28_green_bg_gray.set_pad_left(0) +# style_font_28_green_bg_gray.set_pad_right(0) +# style_font_28_green_bg_gray.set_pad_top(0) +# style_font_28_green_bg_gray.set_pad_bottom(0) +style_font_28_green_bg_gray.set_text_color(lv.color_make(255, 255, 255)) #字体文本颜色 +style_font_28_green_bg_gray.set_text_font(lv.K01_font_16_ALL) +style_gray_screen = lv.style_t() +style_gray_screen.init() +style_gray_screen.set_radius(5) +style_gray_screen.set_bg_color(lv.color_make(66,66,66)) #灰色背景 +style_gray_screen.set_bg_opa(255) +style_gray_screen.set_border_width(0) +style_gray_screen.set_pad_left(0) +style_gray_screen.set_pad_right(0) +style_gray_screen.set_pad_top(0) +style_gray_screen.set_pad_bottom(0) + +#灰色背景黑色字 +style_font_28_black_bg_gray = lv.style_t() +style_font_28_black_bg_gray.init() +# style_font_28_black_bg_gray.set_radius(5) +# style_font_28_black_bg_gray.set_bg_opa(255) +# style_font_28_black_bg_gray.set_border_width(0) +# style_font_28_black_bg_gray.set_pad_left(0) +# style_font_28_black_bg_gray.set_pad_right(0) +# style_font_28_black_bg_gray.set_pad_top(0) +# style_font_28_black_bg_gray.set_pad_bottom(0) +# style_font_28_black_bg_gray.set_bg_color(lv.color_make(66,66,66)) #字体文本颜色 +style_font_28_black_bg_gray.set_text_color(lv.color_make(153, 153, 153)) #字体文本颜色 +style_font_28_black_bg_gray.set_text_font(lv.K01_font_16_ALL) + +style_wechat_r_btn = lv.style_t() +style_wechat_r_btn.init() +style_wechat_r_btn.set_radius(5) +style_wechat_r_btn.set_bg_opa(255) +style_wechat_r_btn.set_border_width(0) +style_wechat_r_btn.set_pad_left(0) +style_wechat_r_btn.set_pad_right(0) +style_wechat_r_btn.set_pad_top(0) +style_wechat_r_btn.set_pad_bottom(0) +style_wechat_r_btn.set_bg_color(lv.color_make(66,66,66)) +style_wechat_r_btn.set_border_width(0) +style_wechat_r_btn.set_shadow_opa(0) +#列表obj +style_wechat_s_btn = lv.style_t() +style_wechat_s_btn.init() +style_wechat_s_btn.set_radius(5) +style_wechat_s_btn.set_bg_opa(255) +style_wechat_s_btn.set_border_width(0) +style_wechat_s_btn.set_pad_left(0) +style_wechat_s_btn.set_pad_right(0) +style_wechat_s_btn.set_pad_top(0) +style_wechat_s_btn.set_pad_bottom(0) +style_wechat_s_btn.set_bg_color(lv.color_make(79,195,76)) +style_wechat_s_btn.set_shadow_opa(0) + +AI_end_screen_list_screen = lv.obj(AI_talk_end_screen) +AI_end_screen_list_screen.set_pos(10, 5) +AI_end_screen_list_screen.set_size(LCD_SIZE_W-10,205) +AI_end_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_end_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_end_screen_list_screen.set_flex_flow(lv.FLEX_FLOW.COLUMN)#自动排成一列对齐 + +AI_end_screen_list_detail_screen = lv.obj(AI_end_screen_list_screen) +AI_end_screen_list_detail_screen.set_pos(0, 5) +AI_end_screen_list_detail_screen.set_size(230,lv.SIZE.CONTENT) +AI_end_screen_list_detail_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +#ASR结果1 +AI_end_screen_list_detail_screen1 = lv.obj(AI_end_screen_list_detail_screen) +AI_end_screen_list_detail_screen1.set_pos(30,10) +AI_end_screen_list_detail_screen1.set_size(190,lv.SIZE.CONTENT) +AI_end_screen_list_detail_screen1.add_style(style_wechat_s_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_listen_text = lv.label(AI_end_screen_list_detail_screen1) +AI_listen_text.set_pos(5, 10) +AI_listen_text.set_size(175, lv.SIZE.CONTENT) +AI_listen_text.set_text(" ") +AI_listen_text.set_long_mode(lv.label.LONG.WRAP) +AI_listen_text.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +AI_listen_text.add_style(style_font_28_green_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + +#chat结果1 +msg_detail_cont_obj = lv.obj(AI_end_screen_list_screen) +msg_detail_cont_obj.set_pos(0, 5) +msg_detail_cont_obj.set_size(220,lv.SIZE.CONTENT) +msg_detail_cont_obj.add_style(style_wechat_r_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_label = lv.label(msg_detail_cont_obj) +AI_label.set_pos(5, 10) +AI_label.set_size(205, lv.SIZE.CONTENT) +AI_label.set_long_mode(lv.label.LONG.WRAP) +AI_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +AI_label.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + +#222222222222222222222222222222222222 +AI_end_screen_list_screen2 = lv.obj(AI_talk_end_screen) +AI_end_screen_list_screen2.set_pos(10, 5) +AI_end_screen_list_screen2.set_size(LCD_SIZE_W-10,205) +AI_end_screen_list_screen2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_end_screen_list_screen2.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_end_screen_list_screen2.set_flex_flow(lv.FLEX_FLOW.COLUMN)#自动排成一列对齐 + +#chat结果2 +msg_detail_cont_obj2 = lv.obj(AI_end_screen_list_screen2) +msg_detail_cont_obj2.set_pos(0, 5) +msg_detail_cont_obj2.set_size(220,lv.SIZE.CONTENT) +msg_detail_cont_obj2.add_style(style_wechat_r_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_label2 = lv.label(msg_detail_cont_obj2) +AI_label2.set_pos(5, 10) +AI_label2.set_size(205, lv.SIZE.CONTENT) +AI_label2.set_long_mode(lv.label.LONG.WRAP) +AI_label2.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +AI_label2.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_end_screen_list_screen2.add_flag(lv.obj.FLAG.HIDDEN) #隐藏2 + +#开始对话 +AI_talk_screen = lv.obj(AI_screen) +print("AI_talk_screen") +AI_talk_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_talk_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_talk_screen.set_pos(0, 0) +AI_talk_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) + + +al_talk_screen_title1 = lv.label(AI_talk_screen) +al_talk_screen_title1.set_pos(0, 20) +al_talk_screen_title1.set_size(LCD_SIZE_W, 40) +al_talk_screen_title1.set_text("AI智能助手") +al_talk_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_talk_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_talk_screen_icon1 = lv.img(AI_talk_screen) +al_talk_screen_icon1.set_size(140,45) +al_talk_screen_icon1.set_pos((240-140)//2,110-13) +al_talk_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +al_talk_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_screen_icon = lv.img(AI_talk_screen) +al_talk_screen_icon.set_size(230,58) +al_talk_screen_icon.set_pos((240-230)//2,210) +al_talk_screen_icon.set_src("U:/static/AI/ai_talk_bt.png") +al_talk_screen_icon.add_flag(lv.obj.FLAG.CLICKABLE) +al_talk_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_talk_screen_icon_btn = lv.label(AI_talk_screen) +al_talk_screen_icon_btn.set_text(" ") +al_talk_screen_icon_btn.set_size(240, 190) +al_talk_screen_icon_btn.set_pos(0,92) +al_talk_screen_icon_btn.add_flag(lv.obj.FLAG.CLICKABLE) + +al_talk_screen_title4 = lv.label(al_talk_screen_icon) +al_talk_screen_title4.set_pos(0, 18) +al_talk_screen_title4.set_size(230, 58) +al_talk_screen_title4.set_text("开始对话") +al_talk_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_talk_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#没有网络数据 +AI_no_net_screen = lv.obj(AI_screen) +print("AI_no_net_screen") +AI_no_net_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_no_net_screen.set_pos(0, 0) +AI_no_net_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_no_net_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_no_sim_popup_screen_title1 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title1.set_pos(0, 20) +al_no_sim_popup_screen_title1.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title1.set_text("AI智能助手") +al_no_sim_popup_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_icon = lv.img(AI_no_net_screen) +al_no_sim_popup_screen_icon.set_size(42,42) +al_no_sim_popup_screen_icon.set_pos((240-42)//2,60) +al_no_sim_popup_screen_icon.set_src("U:/static/AI/ai_warning.png") +al_no_sim_popup_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_no_sim_popup_screen_title2 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title2.set_pos(0, 125) +al_no_sim_popup_screen_title2.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title2.set_text("启动失败") +al_no_sim_popup_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_title3 = lv.label(AI_no_net_screen) +al_no_sim_popup_screen_title3.set_pos(0, 165) +al_no_sim_popup_screen_title3.set_size(LCD_SIZE_W, 40) +al_no_sim_popup_screen_title3.set_text("请先开启移动数据") +al_no_sim_popup_screen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_no_sim_popup_screen_icon1 = lv.img(AI_no_net_screen) +al_no_sim_popup_screen_icon1.set_size(230,58) +al_no_sim_popup_screen_icon1.set_pos((240-230)//2,210) +al_no_sim_popup_screen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_no_sim_popup_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_no_sim_popup_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_no_sim_popup_screen_title4 = lv.label(al_no_sim_popup_screen_icon1) +al_no_sim_popup_screen_title4.set_pos(0, 18) +al_no_sim_popup_screen_title4.set_size(230, 58) +al_no_sim_popup_screen_title4.set_text("确定") +al_no_sim_popup_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_no_sim_popup_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#正在聆听 +AI_listen_screen = lv.obj(AI_screen) +print("AI_listen_screen") +AI_listen_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_listen_screen.set_pos(0, 0) +AI_listen_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_listen_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +ai_talk_requestion_obj = lv.obj(AI_listen_screen) +ai_talk_requestion_obj.set_pos(15, 20) +ai_talk_requestion_obj.set_size(LCD_SIZE_W-25, 58) +ai_talk_requestion_obj.add_style(style_green_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_listen_screen_title1 = lv.label(ai_talk_requestion_obj) +al_listen_screen_title1.set_pos(0, 5) +al_listen_screen_title1.set_size(LCD_SIZE_W-25, 58) +al_listen_screen_title1.set_text("识别中...") +al_listen_screen_title1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +al_listen_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +# al_listen_screen_icon1 = lv.gif(AI_listen_screen) +# al_listen_screen_icon1.set_size(140,45) +# al_listen_screen_icon1.set_pos((240-140)//2,110) +# # al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +# al_listen_screen_icon1.set_src("U:/static/AI/listen_gif.gif") + +# al_listen_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_listen_screen_icon1 = lv.img(AI_listen_screen) +al_listen_screen_icon1.set_size(140,45) +al_listen_screen_icon1.set_pos((240-140)//2,110) +al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") +# al_listen_screen_icon1.set_src("U:/static/AI/listen_gif.gif") + +al_listen_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_listen_screen_icon = lv.img(AI_listen_screen) +# al_listen_screen_icon.set_size(230,58) +# al_listen_screen_icon.set_pos((240-230)//2,210) +# al_listen_screen_icon.set_src("U:/static/AI/ai_confirm_bt.png") +# al_listen_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_listen_screen_icon_bt = lv.label(AI_listen_screen) +al_listen_screen_icon_bt.set_text(" ") +al_listen_screen_icon_bt.set_size(240, 190) +al_listen_screen_icon_bt.set_pos(0,92) + +al_listen_screen_title4 = lv.label(AI_listen_screen) +al_listen_screen_title4.set_pos(0, 220) +al_listen_screen_title4.set_size(240, 58) +al_listen_screen_title4.set_text("正在聆听...") +al_listen_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_listen_screen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +#正在思考 +AI_think_screen = lv.obj(AI_screen) +print("AI_think_screen") +AI_think_screen.set_pos(0, 0) +AI_think_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +AI_think_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_think_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_think_screen_title1 = lv.label(AI_think_screen) +al_think_screen_title1.set_pos(0, 20) +al_think_screen_title1.set_size(LCD_SIZE_W, 40) +al_think_screen_title1.set_text("正在思考...") +al_think_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_think_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# al_think_screen_icon = lv.gif(AI_think_screen) +# al_think_screen_icon.set_size(130,130) +# al_think_screen_icon.set_pos((240-130)//2,65) +# # al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") +# al_think_screen_icon.set_src("U:/static/AI/think_gif.gif") +# al_think_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon = lv.img(AI_think_screen) +al_think_screen_icon.set_size(130,130) +al_think_screen_icon.set_pos((240-130)//2,65) +al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") +# al_think_screen_icon.set_src("U:/static/AI/think_gif.gif") + +al_think_screen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon1 = lv.img(AI_think_screen) +al_think_screen_icon1.set_size(230,58) +al_think_screen_icon1.set_pos((240-230)//2,210) +al_think_screen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_think_screen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_think_screen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_think_screen_icon1_bt = lv.label(AI_think_screen) +al_think_screen_icon1_bt.set_text(" ") +al_think_screen_icon1_bt.set_size(240, 190) +al_think_screen_icon1_bt.set_pos(0,92) +al_think_screen_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + + +al_think_screen_title4 = lv.label(al_think_screen_icon1) +al_think_screen_title4.set_pos(0, 18) +al_think_screen_title4.set_size(230, 58) +al_think_screen_title4.set_text("取消") +al_think_screen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_think_screen_title4.add_style(style_font_youyuan_ai_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# #连接超时 +AI_connect_timerout_screen = lv.obj(AI_screen) +AI_connect_timerout_screen.set_pos(0, 0) +AI_connect_timerout_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +print("AI_connect_timerout_screen") +AI_connect_timerout_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_connect_timerout_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_connect_timerout_title1 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title1.set_pos(0, 20) +al_connect_timerout_title1.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title1.set_text("AI智能助手") +al_connect_timerout_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_icon = lv.img(AI_connect_timerout_screen) +al_connect_timerout_icon.set_size(42,42) +al_connect_timerout_icon.set_pos((240-42)//2,60) +al_connect_timerout_icon.set_src("U:/static/AI/ai_warning.png") +al_connect_timerout_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_connect_timerout_title2 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title2.set_pos(0, 125) +al_connect_timerout_title2.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title2.set_text("连接超时") +al_connect_timerout_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_title3 = lv.label(AI_connect_timerout_screen) +al_connect_timerout_title3.set_pos(0, 165) +al_connect_timerout_title3.set_size(LCD_SIZE_W, 40) +al_connect_timerout_title3.set_text("请重新对话") +al_connect_timerout_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_connect_timerout_icon1 = lv.img(AI_connect_timerout_screen) +al_connect_timerout_icon1.set_size(230,58) +al_connect_timerout_icon1.set_pos((240-230)//2,210) +al_connect_timerout_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_connect_timerout_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_connect_timerout_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_connect_timerout_icon1_bt = lv.label(AI_connect_timerout_screen) +al_connect_timerout_icon1_bt.set_text(" ") +al_connect_timerout_icon1_bt.set_size(240, 190) +al_connect_timerout_icon1_bt.set_pos(0,92) +al_connect_timerout_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_connect_timerout_title4 = lv.label(al_connect_timerout_icon1) +al_connect_timerout_title4.set_pos(0, 18) +al_connect_timerout_title4.set_size(230, 58) +al_connect_timerout_title4.set_text("确定") +al_connect_timerout_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_connect_timerout_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +#未检测到录音 +AI_not_listen_text_screen = lv.obj(AI_screen) +AI_not_listen_text_screen.set_pos(0, 0) +AI_not_listen_text_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) +print("AI_not_listen_text_screen") +AI_not_listen_text_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +AI_not_listen_text_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + +al_not_listen_title1 = lv.label(AI_not_listen_text_screen) +al_not_listen_title1.set_pos(0, 20) +al_not_listen_title1.set_size(LCD_SIZE_W, 40) +al_not_listen_title1.set_text("AI智能助手") +al_not_listen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_icon = lv.img(AI_not_listen_text_screen) +al_not_listen_icon.set_size(42,42) +al_not_listen_icon.set_pos((240-42)//2,60) +al_not_listen_icon.set_src("U:/static/AI/ai_warning.png") +al_not_listen_icon.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_not_listen_title2 = lv.label(AI_not_listen_text_screen) +al_not_listen_title2.set_pos(0, 125) +al_not_listen_title2.set_size(LCD_SIZE_W, 40) +al_not_listen_title2.set_text("未检测到录音数据") +al_not_listen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_title3 = lv.label(AI_not_listen_text_screen) +al_not_listen_title3.set_pos(0, 165) +al_not_listen_title3.set_size(LCD_SIZE_W, 40) +al_not_listen_title3.set_text("请重新对话") +al_not_listen_title3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +al_not_listen_icon1 = lv.img(AI_not_listen_text_screen) +al_not_listen_icon1.set_size(230,58) +al_not_listen_icon1.set_pos((240-230)//2,210) +al_not_listen_icon1.set_src("U:/static/AI/ai_confirm_bt.png") +al_not_listen_icon1.add_flag(lv.obj.FLAG.CLICKABLE) +al_not_listen_icon1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +al_not_listen_icon1_bt = lv.label(AI_not_listen_text_screen) +al_not_listen_icon1_bt.set_text(" ") +al_not_listen_icon1_bt.set_size(240, 190) +al_not_listen_icon1_bt.set_pos(0,92) +al_not_listen_icon1_bt.add_flag(lv.obj.FLAG.CLICKABLE) + +al_not_listen_title4 = lv.label(al_not_listen_icon1) +al_not_listen_title4.set_pos(0, 18) +al_not_listen_title4.set_size(230, 58) +al_not_listen_title4.set_text("确定") +al_not_listen_title4.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +al_not_listen_title4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +class AIScreen(Screen):#AI_GUI + # + NAME = "AI_success" + + def __init__(self): + super().__init__() + self.meta = AI_screen + # self.meta_type = "popup" + self._1S_timer = osTimer() + self.Audio_buf_size = 8*1024 + self.record_timer = osTimer() + self.record = audio.Record() + #self.record.end_callback(self.record_callback) + self.record.gain_set(4,10) + self.aud = audio.Audio(0) + self.audio_play_state = 1 #音频播放完状态 + self.aud.setCallback(self.audio_cb) + + self.TTS_PRO_TYPE = 0 #TTS协议类型,=0:用长文本合成接口,=1用音频流合成接口 + self.AI_audio_queue_thread_id = 0 + self.AI_send_data_queue_thread_id = 0 + self.AI_client_chat_recv_id = 0 + self.AI_client_tts_recv_id = 0 + self.AI_client_asr_recv_id = 0 + self.AI_client_asr = None + self.AI_client_asr_isconnect = 0 #是否连接成功 + self.AI_client_asr_num = 0 + self.AI_client_chat = None + self.AI_client_chat_isconnect = 0 #是否连接成功 + self.AI_client_chat_num = 1 + self.AI_client_chat_play_str = "" + self.AI_client_chat_end_flag = 0 + self.AI_client_tts = None + self.AI_client_tts_isconnect = 0 #是否连接成功 + self.AI_client_tts_num = 2 + self.AI_client_tts_timer = osTimer() + self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 #单次tts总数据长度 + self.AI_client_tts_str_total_len = 0 #单次已发送tts字符串长度 + self.AI_client_tts_str_sen = '' #单次已发送tts字符串长度 + self.AI_client_tts_tra_flag = 0 + self.AI_client_tts_full_sentence_flag = 0 #完整的句子标识 + self.tts_time_count = 0 + self.tts_time_outcount = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.tts_data_tmp = bytes() + self.press_state = 0 + self.AI_label_answer = "" + self.AI_label_str = "" + + self.AI_client_tts_play_data_len = 0 + self.refresh_texttimer = osTimer() + self.AI_listen_text = "" + self.AI_listen_end = 0 #语音识别完成 + self.refresh_count = 0 + self.AI_send_data_queue = Queue(100) + self.AI_audio_queue = Queue(100) + self.page_num = 0 + self.page_num_tmp = 0 + self.text_max = 400 #一次最大显示字数 + self.scroll_flag_next = 0 + self.scroll_flag_prev = 0 + self.hard_flag_next = 0 + self.hard_flag_prev = 0 + self.scroll_timer_count = 0 + + self.play_flag = 0 + self.play_flag_init = 0 + AI_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.GESTURE, None) + + al_talk_screen_icon.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + al_talk_screen_icon_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + + al_no_sim_popup_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), lv.EVENT.SHORT_CLICKED, None) #无网络按钮 + + # al_listen_screen_icon_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), lv.EVENT.SHORT_CLICKED, None) #说话完成按钮 + # al_listen_screen_icon.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), lv.EVENT.SHORT_CLICKED, None) #说话完成按钮 + + al_think_screen_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,4)), lv.EVENT.SHORT_CLICKED, None) #思考界面取消按钮 + al_think_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,4)), lv.EVENT.SHORT_CLICKED, None) #思考界面取消按钮 + + al_connect_timerout_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,5)), lv.EVENT.SHORT_CLICKED, None) #连接超时 请重新对话按钮 + al_connect_timerout_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,5)), lv.EVENT.SHORT_CLICKED, None) #连接超时 请重新对话按钮 + + al_talk_end_screen_cancel_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,6)), lv.EVENT.SHORT_CLICKED, None) #对话结束 取消对话按钮 + al_talk_end_screen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,6)), lv.EVENT.SHORT_CLICKED, None) #对话结束 取消对话按钮 + + AI_press_label_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,7)), lv.EVENT.SHORT_CLICKED, None) #对话结束 继续对话按钮 + al_talk_end_screen_icon2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,7)), lv.EVENT.SHORT_CLICKED, None) #对话结束 继续对话按钮 + + al_not_listen_icon1_bt.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,8)), lv.EVENT.SHORT_CLICKED, None) + al_not_listen_icon1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,8)), lv.EVENT.SHORT_CLICKED, None) + AI_end_screen_list_screen2.add_event_cb(self.scroll_event_cb, lv.EVENT.SCROLL_END, None) + AI_end_screen_list_screen.add_event_cb(self.scroll_event_cb, lv.EVENT.SCROLL_END, None) + + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + if (AI_talk_end_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_listen_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or\ + (AI_talk_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_no_net_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + (AI_connect_timerout_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_not_listen_text_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + (AI_think_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False: + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 1: + self.talking_cb(e) + pass + elif msg == 2: + self.img_cb(e) + pass + elif msg == 3: + self.listen_end_btcb(e) + pass + elif msg == 4: + self.think_bt_cb(e) + pass + elif msg == 5: + self.talk_end_continue_cb(e) + pass + elif msg == 6: + self.talk_end_cancel_cb(e) + pass + elif msg == 7: + self.talk_end_continue_cb(e) + pass + elif msg == 8: + self.talk_end_continue_cb(e) + pass + + def clear_flag(self): #清标识 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.AI_listen_end = 0 #语音识别完成 + self.refresh_count = 0 + self.AI_listen_text = "" + self.AI_label_str = "" + self.AI_label_answer = "" + self.tts_time_count = 0 + self.tts_time_outcount = 0 + + def talk_end_cancel_cb(self,e):#对话结束已经播放音频取消继续对话按钮 + if self.play_flag == 1: + self.play_flag = 0 + self.aud.stopPlayStream() + self.aud.stopAll() + print("talk_end_cancel_cb stop()\r\n") + EventMesh.publish("publish_message_event_ui",{"func":self.upload_img,"data":0}) + else: + self.play_flag = 1 + print("talk_end_cancel_cb start()\r\n") + EventMesh.publish("publish_message_event_ui",{"func":self.upload_img,"data":1}) + return + + self.Close() + self.AI_label_answer = "" + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + def upload_img(self,msg): + if msg == 1: + al_talk_end_screen_icon1.set_src("U:/static/AI/ai_result_can_start.png") + else: + al_talk_end_screen_icon1.set_src("U:/static/AI/ai_result_can_stop.png") + + def talk_end_continue_cb(self,e):#连接超时确定按钮回调或者继续对话按钮 + self.Close() + self.AI_label_answer = "" + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_listen_screen.clear_flag(lv.obj.FLAG.HIDDEN) + al_listen_screen_title1.set_text("识别中...") + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") + self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) + EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) + + pass + + def talk_connectout_cb(self,e):#连接超时确定按钮回调 + + pass + + def think_bt_cb(self,e):#正在思考确定按钮回调 取消播放 + self.Close() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + pass + + def not_talk_cb(self):#没有说话或者没有检测到录音数据 + self.Close() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + def scroll_event_cb(self,e): + try: + + # 获取事件源对象 + obj = e.get_target() + code = e.get_code() + # 如果事件是滚动条事件 + if code == lv.EVENT.SCROLL_END: + + # 获取滚动条对象 + + # 获取滚动条的位置 + sb_value = obj.get_scroll_y() + + # 获取对象的高度和内容的总高度 + content_height = obj.get_scroll_bottom()#obj.get_child(0).get_height()+obj.get_child(1).get_height() + #obj_height= obj.get_height() + #print("scroll_event_cb:sb_value:{},content_height:{}".format(sb_value,content_height)) + #print("scroll_event_cb:scroll_flag_next:{},scroll_flag_prev:{}".format(self.scroll_flag_next,self.scroll_flag_prev)) + # 检查滚动条是否已经到达最大值,即内容是否已经到达底部 + if self.hard_flag_next == 1 or self.hard_flag_prev == 1: + self.scroll_timer_count = 10 #滑动计时器初始化 + if content_height < 0: + self.scroll_flag_next = 1 + elif self.hard_flag_next == 1 and self.scroll_flag_next == 1 and content_height == 0: + print("下一页") + + self.page_change(2,self.AI_label_str) + self.scroll_flag_next = 0 + self.hard_flag_next = 0 + else: + self.scroll_flag_next = 0 + self.hard_flag_next = 0 + if sb_value < 0: + self.scroll_flag_prev = 1 + elif self.hard_flag_prev == 1 and self.scroll_flag_prev == 1 and sb_value == 0: + print("上一页") + self.page_change(1,self.AI_label_str) + self.scroll_flag_prev = 0 + self.hard_flag_prev = 0 + else: + self.scroll_flag_prev = 0 + self.hard_flag_prev = 0 + except Exception as e: + usys.print_exception(e) + + def page_change(self,dir,text_str):#翻页,dir: = 0跳转第一页,=1上一页,=2下一页,=3最后一页,最后的内容 + text_str_list = [] + text_str_list_len = 0 + while 1:#分割字符串,获取列表 + str_tmp = split_string(text_str[text_str_list_len:],self.text_max,self.text_max+150)#按逗号,句号切割 + if str_tmp =="" :#没找到句号或者逗号,切割字符串 + str_tmp = sub_utf8_String(text_str[text_str_list_len:],self.text_max)#按中文切割字符串 + #print("page_change:str_tmp:{}".format((str_tmp))) + #str_tmp = sub_utf8_String(text_str[text_str_list_len:],self.text_max) + text_str_list_len+=len(str_tmp) + + if len(text_str) <= text_str_list_len: + text_str_list.append(str_tmp) + break + text_str_list.append(str_tmp) + + if self.AI_client_chat_end_flag ==1:#char回答完后,使最后一页字数大于一页 + #if len(text_str_list[-1]) < 50: + if len(self.AI_label_str ) <= len(text_str): + text_str_list[-1]+="\n\n\n\n~~~~~END~~~~~" + if len(text_str_list[-1])<30: + text_str_list[-1]+="\n\n" + else: #chat未完成,创造中 + if dir != 3: + text_str_list[-1]+="\n\n 创作中...\n\n" + + if dir == 0:#第一页 + self.page_num = 0 + if len(text_str_list)>self.page_num: + AI_label.set_text(text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + AI_end_screen_list_screen2.scroll_to_y(0,lv.ANIM.OFF) + AI_end_screen_list_screen2.add_flag(lv.obj.FLAG.HIDDEN) #隐藏2 + AI_end_screen_list_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + elif dir == 1:#上一页 + if self.page_num == 1: #第二页, + + self.page_num-=1 + if len(text_str_list)>self.page_num: + AI_label.set_text(text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + #AI_label.set_text(text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + scroll_bottom = AI_label.get_height() + print("page_change:scroll_bottom:{}".format(scroll_bottom)) + AI_end_screen_list_screen.scroll_to_y(scroll_bottom,lv.ANIM.OFF) + AI_end_screen_list_screen2.add_flag(lv.obj.FLAG.HIDDEN) #隐藏2 + AI_end_screen_list_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + #AI_end_screen_list_screen.scroll_to_view(lv.ANIM.OFF) + elif self.page_num > 1: + self.page_num-=1 + if len(text_str_list)>self.page_num: + AI_label2.set_text(text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + scroll_bottom = AI_label2.get_height() + print("page_change:scroll_bottom:{}".format(scroll_bottom)) + + AI_end_screen_list_screen2.scroll_to_y(scroll_bottom,lv.ANIM.OFF) + #AI_end_screen_list_screen2.scroll_to_view(lv.ANIM.OFF) + elif dir == 2:#下一页 + if len(text_str_list)<=self.page_num+1:#最大页 + return + self.page_num+=1 + if len(text_str_list)>self.page_num: + #AI_label2.set_text(' ...\n\n'+text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + #print("page_change:next:{}".format(text_str_list[self.page_num])) + AI_label2.set_text(text_str_list[self.page_num]+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + AI_end_screen_list_screen2.scroll_to_y(0,lv.ANIM.OFF) + if self.page_num == 1: #显示第二页 + AI_end_screen_list_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏1 + AI_end_screen_list_screen2.clear_flag(lv.obj.FLAG.HIDDEN) # + elif dir == 3:#最后一页,最后的内容 + if len(text_str_list)>1:#大于一页 + + self.page_num = len(text_str_list)-1 + #if len(text_str_list)>self.page_num: + str_tmp = sub_utf8_String(text_str_list[self.page_num-1],self.text_max-80)#在开头加上上一页的最后30字节数据 + #print("str_tmp123:{}".format(str_tmp)) + if len(text_str_list[self.page_num-1])>len(str_tmp): + str_tmp = text_str_list[self.page_num-1][len(str_tmp):] + else: + str_tmp = '' + # + AI_label2.set_text(str_tmp+text_str_list[self.page_num])#+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + scroll_bottom = AI_label2.get_height() + AI_end_screen_list_screen2.scroll_to(0,scroll_bottom,lv.ANIM.ON) + #print("最后内容,大于一页 scroll_bottom:{}".format(scroll_bottom)) + if self.page_num_tmp == self.page_num:#解决切换页面的时候不跳动问题 + # AI_label2.set_text("\n\n"+str_tmp+text_str_list[self.page_num]) + # scroll_bottom = AI_label2.get_height() + AI_end_screen_list_screen2.scroll_to(0,scroll_bottom,lv.ANIM.ON) + else: + # AI_label2.set_text("\n\n\n\n\n\n"+str_tmp+text_str_list[self.page_num]) + # scroll_bottom = AI_label2.get_height() + AI_end_screen_list_screen2.scroll_to(0,scroll_bottom,lv.ANIM.OFF) + self.page_num_tmp = self.page_num + print("text_str_list[self.page_num]:{}".format(str_tmp+text_str_list[self.page_num])) + #AI_end_screen_list_screen2.scroll_to_view(lv.ANIM.OFF) + AI_end_screen_list_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏1 + AI_end_screen_list_screen2.clear_flag(lv.obj.FLAG.HIDDEN) # + if len(self.AI_label_str ) > len(text_str):#处理播放音频的时候,获取下一页数据 + self.page_num-=1 + elif len(text_str_list) == 1:#只有一页 + self.page_num = 0 + if len(text_str_list)>self.page_num: + AI_label.set_text(text_str_list[self.page_num])#+'\n ...{}/{}...'.format(self.page_num+1,len(text_str_list))) + scroll_bottom = AI_label.get_height() + #print("最后内容,只有一页 scroll_bottom:{}".format(scroll_bottom)) + # if(scroll_bottom>200): + # scroll_bottom -= 200 + + AI_end_screen_list_screen.scroll_to(0,scroll_bottom,lv.ANIM.ON) + #AI_end_screen_list_screen.scroll_to_view(lv.ANIM.OFF) + AI_end_screen_list_screen2.add_flag(lv.obj.FLAG.HIDDEN) #隐藏2 + AI_end_screen_list_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + print("page_change1:page_num:{},text_str_list len:{}".format(self.page_num,len(text_str_list))) + #print("page_change2:page_num:{}".format(self.page_num)) + #print("page_change3:str:{}".format(text_str_list[self.page_num])) + + def listen_end_btcb(self,e):#说话完成确定按钮回调 + if self.AI_listen_end == 1:#说话完成 已有录音文字返回 + self.AI_listen_end = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + if self.AI_listen_text != "": + self.AI_client_chat_send(self.AI_listen_text) + print("self.AI_listen_text:{}".format(self.AI_listen_text)) + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") + self.refresh_count = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.refresh_texttimer.start(500,1,self.text_show_think) + else: + self.not_talk_cb() + return + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + return + else:#没有识别到录音文字 + self.not_talk_cb() + + def ai_talk_end(self):#语言识别完 思考结束显示最后的文本和音频数据 + + self.play_flag = 1 + + self.AI_label_answer = "" + AI_end_screen_list_screen.scroll_to(0, 0, lv.ANIM.OFF) + AI_label.set_pos(5, 10) + #AI_label.set_text(self.AI_label_answer) + AI_label.set_text("思考中...") + AI_label2.set_text(" ") + self.scroll_timer_count = 0 + # self.AI_listen_text = "嗯。" + str_len = len(self.AI_listen_text)*20 + if str_len > 165: + str_len = 165 + print("len:{} str_len:{} self.AI_listen_text:{}\r\n".format(len(self.AI_listen_text),str_len,self.AI_listen_text)) + # AI_end_screen_list_detail_screen1.set_pos(170-str_len,10) + + # AI_listen_text.set_size(str_len,lv.SIZE.CONTENT) + + # AI_listen_text.set_pos(0, 10) + # AI_listen_text.set_size(str_len,lv.SIZE.CONTENT) + AI_listen_text.set_text(self.AI_listen_text) + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.refresh_count = 0 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_end_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + al_talk_end_screen_icon1.set_src("U:/static/AI/ai_result_can_start.png") + AI_end_screen_list_screen2.add_flag(lv.obj.FLAG.HIDDEN) #隐藏2 + AI_end_screen_list_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + + def ai_talk_end_show_text_cb(self,data): + #AI_label.set_text(self.AI_label_answer) + #print("ai_talk_end_show_text_cb:scroll_timer_count{}".format(self.scroll_timer_count)) + if self.scroll_timer_count <= 0: + self.page_change(3,self.AI_label_answer)#刷新到最后内容 + pass + + def connect_timerout_popup(self,msg):#连接超时弹窗提示 + EventMesh.publish("publish_message_event_ui",{"func":self.connect_timerout_popup_cb,"data":msg}) + + def connect_timerout_popup_cb(self,msg): + self.Close() + print("connect_timerout_popup!!!!!!\r\n") + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.clear_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + if msg == 1: #连接超时 + al_connect_timerout_title2.set_text("连接超时") + else: + al_connect_timerout_title2.set_text("网络连接异常") + + + def text_show_think(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.text_show_think_cb,"data":0}) + + def text_show_think_cb(self,data): #文本刷新 + if self.img_show_count_flag == 1: + self.refresh_texttimer.stop() + return + if self.AI_label_str != "": + self.timer_out_count = 1 + self.img_show_count_flag = 1 + self.refresh_texttimer.stop() + self.ai_talk_end() + return + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer_out_count += 1 + if self.timer_out_count > 2*30: #说话了服务器没有返回结果数据 + self.timer_out_count = 0 + #连接超时 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.connect_timerout_popup(1) + return + + if self.img_show_count > 10: + self.img_show_count_tmp+=1 + self.img_show_count_tmp = self.img_show_count-self.img_show_count_tmp + if self.img_show_count_tmp >= 10: + self.img_show_count = 1 + al_think_screen_icon.set_src("U:/static/AI/AI_THINK{}.png".format("%03d"%(self.img_show_count_tmp))) + else: + self.img_show_count+=1 + self.img_show_count_tmp = 0 + al_think_screen_icon.set_src("U:/static/AI/AI_THINK{}.png".format("%03d"%(self.img_show_count))) + + + self.refresh_count+=1 + if self.refresh_count > 3: + self.refresh_count = 0 + if self.refresh_count == 1: + al_think_screen_title1.set_text("正在思考.") + elif self.refresh_count == 2: + al_think_screen_title1.set_text("正在思考..") + elif self.refresh_count == 3: + al_think_screen_title1.set_text("正在思考...") + pass + + def think_end_result(self): + EventMesh.publish("publish_message_event_ui",{"func":self.think_end_result_cb,"data":0}) + def think_end_result_cb(self,data): + if self.timer_out_count > 1: + if self.img_show_count_flag == 1: + return + self.timer_out_count = 0 + self.img_show_count_flag = 1 + self.refresh_texttimer.stop() + self.ai_talk_end() + + def img_cb(self,e): #无网络 无数据按钮回调 + self.refresh_texttimer.stop() + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + pass + def initialization(self): + self.play_flag = 1 + self.TTS_PRO_TYPE = 0 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #开启显示 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_talk_screen.clear_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + #self.aud.setVolume(11)#设置最大声录音 + + self.AI_label_answer = "" + self.AI_client_chat_play_str = '' + self.AI_init() + self.AI_client_tts_data_len = 0 + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len = 0 + self.AI_client_tts_tra_flag = 0 + #EventMesh.publish("publish_message_event_ui",{"func":self.websocket_connect,"data":""}) + def websocket_connect(self,data): + self.websocket_connect_asr() + self.websocket_connect_chat() + self.websocket_connect_tts() + + pass + + def audio_cb(self,event): + if event == 0: + self.audio_play_state =1 + EventMesh.publish("set_audio_state", 1) + print('audio-play start. ai') + elif event == 7: + self.audio_play_state = 0 + EventMesh.publish("set_audio_state", 0) + # if self.AI_audio_queue.size() > 0: + # data = self.AI_audio_queue.get() + # print("audio_queue:data:{}".format(len(data))) + # if len(data) > 1: + # try: + # # while self.audio_play_state : + # # utime.sleep_ms(1) + # EventMesh.publish("system_sleep_rest")#防止黑屏 + # tmp=self.aud.playStream(3, data)#播放音频流文件 + # self.audio_play_state =1 + # print("playStream:{}".format(tmp)) + # except Exception as e: + # usys.print_exception(e) + #print('audio-play finish.') + def AI_init(self): + self.AI_audio_queue_thread_id = _thread.start_new_thread(self.AI_audio_queue_thread, ()) + self.AI_send_data_queue_thread_id = _thread.start_new_thread(self.AI_send_data_queue_thread, ()) + self._1S_timer.start(1000,1,self._1S_timer_cb) + + + #按下录音 + def talking_cb(self,e): + self.press_state = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + signal = EventMesh.publish("screen_get_sig") + if signal == -1 or EventMesh.publish("get_sim_Status") != 1:#网络不正常 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示 + al_no_sim_popup_screen_title3.set_text("无SIM卡") + + elif signal == None or signal == 0 or signal == 99: + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_no_net_screen.clear_flag(lv.obj.FLAG.HIDDEN) #开启显示 + al_no_sim_popup_screen_title3.set_text("请先开启移动数据") + + else: + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_think_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_listen_screen.clear_flag(lv.obj.FLAG.HIDDEN) + al_listen_screen_title1.set_text("识别中...") + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF001.png") + self.timer_out_count = 0 + self.refresh_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + + EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) + + def talk_ars_end(self): + + + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + self.timer_out_count = 0 + self.AI_send_data_queue.clear() + Record_read_buf = bytearray(self.Audio_buf_size) + for i in range(10): + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("Record_len:!!!!!!{}\r\n".format(Record_len)) + if Record_len <= 0: + break + print("talk_ars_end2!!!!!!!!!!!\r\n") + + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + if self.AI_listen_text == "": + return + self.AI_client_chat_send(self.AI_listen_text) + + + def text_show_refresh(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.text_show_refresh_cb,"data":0}) + + def text_show_refresh_cb(self,data): + if self.AI_listen_end == 1 or self.timer_out_count >= 120:#语音识别结束 + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + if self.AI_listen_text != "": + self.img_show_count_tmp+=1 + if self.img_show_count_tmp > 2: + self.AI_listen_end = 0 + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.timer_out_count = 0 + print("self.AI_listen_text:{}".format(self.AI_listen_text)) + #正在思考 + AI_talk_end_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_listen_screen.add_flag(lv.obj.FLAG.HIDDEN) + AI_talk_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_no_net_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_connect_timerout_screen.add_flag(lv.obj.FLAG.HIDDEN) #先隐藏 + AI_not_listen_text_screen.add_flag(lv.obj.FLAG.HIDDEN) # + AI_think_screen.clear_flag(lv.obj.FLAG.HIDDEN) # + al_think_screen_icon.set_src("U:/static/AI/AI_THINK001.png") + self.refresh_count = 0 + self.timer_out_count = 0 + self.img_show_count = 0 + self.img_show_count_tmp = 0 + self.img_show_count_flag = 0 + self.refresh_texttimer.start(500,1,self.text_show_think) + else: + + self.not_talk_cb() + return + try: + self.websocket_deconnect_asr() + except Exception as e: + usys.print_exception(e) + return + + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer_out_count += 1 + + self.img_show_count+=1 + if self.img_show_count > 11: + self.img_show_count = 1 + # print("self.img_show_count:{}\r\n".format(self.img_show_count)) + al_listen_screen_icon1.set_src("U:/static/AI/AI_LISTEN_GIF{}.png".format("%03d"%(self.img_show_count))) + + self.refresh_count+=1 + if self.refresh_count > 3: + self.refresh_count =0 + if self.refresh_count == 1: + al_listen_screen_title4.set_text("正在聆听.") + elif self.refresh_count == 2: + al_listen_screen_title4.set_text("正在聆听..") + elif self.refresh_count == 3: + al_listen_screen_title4.set_text("正在聆听...") + pass + #按下录音 + def talking(self,e): + #self.AI_client_tts_send("创建客户端, debug=True输出日志")#TTS语音播放AI结果 + #return + if 1:#EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + if 1:#self.audio_play_state == 0: + self.audio_play_state = 1 + print("talking1") + #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 + try: + print("talking2") + self.Close() + print("talking3") + self.AI_init() + self.AI_client_tts_timer.start(1000,1,self.AI_client_tts_timer_cb) + except Exception as e: + usys.print_exception(e) + al_listen_screen_title1.set_text("识别中...") + self.record.stream_start(audio.Record.AMRNB, 8000, 60) + self.record_timer.start(1*1000,1,self.record_timer_cb) + self.refresh_texttimer.start(500,1,self.text_show_refresh) + #self.AI_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 + + # AI_label.clear_flag(lv.obj.FLAG.HIDDEN) + # AI_label.set_text("语音识别中...") + # AI_listen_text.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_listen_text.set_text("{}S".format(str(self.countdown))) + self.press_state = 1 + self.AI_client_asr_start() + else: + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + #松开确认结果 + def sending_cb(self,e): + EventMesh.publish("publish_message_event_ui",{"func":self.sending,"data":e}) + def sending(self,e): + if self.press_state == 1: + if 1:#EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + # self.record.stream_start(audio.Record.AMRNB, 8000, 2) + # self.record_timer.start(2*1000,0,self.record_timer_cb) + # AI_label.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_label.set_text(" ") + # AI_listen_text.clear_flag(lv.obj.FLAG.HIDDEN) + #AI_listen_text.set_text(" ") + #Wechat_log("sending_cb1") + #EventMesh.publish("publish_message_event_ui",{"func":self.sending,"data":e}) + #self.sending(e) + #Wechat_log("sending_cb2") + self.audio_play_state = 0 + else: + self.press_state = 0 + #EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + else: + pass + def _1S_timer_cb(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + if self.scroll_timer_count > 0: + self.scroll_timer_count-=1 + #定时器 + def record_timer_cb(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + Record_read_buf = bytearray(self.Audio_buf_size) + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("record_timer_cb:{}".format(Record_len)) + if Record_len >0: + read_buf = bytes(Record_read_buf[:Record_len]) + self.AI_client_asr_send(read_buf) + #获取trace_id + def get_trace_id(self): + t = utime.mktime(utime.localtime()) + t = t*1000+urandom.randint(0, 1000) + md5_data = "{}".format(t)#md5签名 + sign_data = "" + hash_obj = uhashlib.md5(md5_data) + res = hash_obj.digest() + + # 转成十六进制表示 + sign_data = ubinascii.hexlify(res) + sign_data = sign_data.decode('ascii') + return sign_data +##################################################### + #AI识别链路 + def websocket_connect_chat(self): + print("websocket_connect_chat:{}!!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_chat_isconnect)) + #if self.AI_client_chat_isconnect == 0: + # 创建客户端, debug=True输出日志, ip和端口需要自己填写, 或者是域名 + try: + self.AI_client_chat = uwebsocket.Client.connect('ws://118.145.158.207:80/chat/ws', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_chat error!!!\r\n") + + self.connect_timerout_popup(2) + return + # 线程接收数据 + if self.AI_client_chat_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_chat_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_chat_recv_id = 0 + self.AI_client_chat_recv_id = _thread.start_new_thread(self.AI_client_chat_recv, (self.AI_client_chat,)) + self.AI_client_chat_isconnect = 1 + def websocket_deconnect_chat(self): + if self.AI_client_chat_isconnect == 1: + self.AI_client_chat_isconnect = 0 + self.AI_client_chat.close() + + def AI_client_chat_send(self,data_str): + chat_data_str = "{\"type\":\"chat\",\"content\":\"%s\"}"%(data_str) + #self.AI_client_chat.send(chat_data_str) + self.AI_send_data_queue.put([self.AI_client_chat_num,chat_data_str]) + #Ai chat读数据 + def AI_client_chat_recv(self,cli): + while True: + try: + # 死循环接收数据 + recv_data = cli.recv() + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_chat_recv close") + #self.AI_client_chat_isconnect = 0 + #self.websocket_deconnect_chat() + break + try: + #print("AI_client_chat_recv recv_data = {}".format(recv_data)) + jsload_data = ujson.loads(recv_data) + #print("AI_client_chat_recv jsload_data = {}".format(jsload_data)) + chat_data = jsload_data["content"] + if chat_data: + #self.AI_client_tts_send(jsload_data["content"])#TTS语音播放AI结果 + print("AI_client_chat_recv chat_data = {}".format(chat_data)) + self.AI_label_str+=str(chat_data) + self.AI_client_chat_play_str+=str(chat_data) + self.think_end_result() + if self.TTS_PRO_TYPE == 1: + AI_label.set_text(self.AI_label_str) + # EventMesh.publish("system_sleep_rest")#防止黑屏 + else: + # if self.AI_label_str: + # self.AI_client_tts_send(self.AI_label_str)#TTS语音播放AI结果 + #print("AI_client_chat_recv chat_data start\r\n") + if jsload_data['type']=='start': + self.AI_label_str = "" + self.AI_client_chat_end_flag = 0 + self.AI_client_tts_data_len = 0 + self.websocket_connect_tts() #连接tts + # + elif jsload_data['type']=='end': + print("chat end!!!!!!!!!!!!!!") + self.AI_client_chat_end_flag = 1 + if len(self.AI_client_chat_play_str) > 100: + utime.sleep_ms(100) + except Exception as e: + usys.print_exception(e) + + except Exception as e: + usys.print_exception(e) + break + self.AI_client_chat_isconnect = 0 + self.AI_client_chat_recv_id = 0 +############################################################################## + #文字转语音链路 + def websocket_connect_tts(self): + #print("websocket_connect_tts:{}!!!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_tts_isconnect)) + if self.AI_client_tts_isconnect == 0: + try: + # self.AI_client_tts = uwebsocket.Client.connect('ws://40.67.151:9099/tts/', debug=False) + self.AI_client_tts = uwebsocket.Client.connect('ws://118.145.158.207:80/tts/long-text-stream', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_tts ERROR:{}\r\n".format(e)) + self.connect_timerout_popup(2) + return + #print("websocket_connect_tts:self.AI_client_tts {}\r\n".format(self.AI_client_tts)) + # 线程接收数据 + if self.AI_client_tts_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_tts_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_tts_recv_id = 0 + #_thread.stack_size(20*1024) + self.AI_client_tts_recv_id = _thread.start_new_thread(self.AI_client_tts_recv, (self.AI_client_tts,)) + #_thread.stack_size(8*1024) + self.AI_client_tts_isconnect = 1 + self.AI_client_tts_start() + def websocket_deconnect_tts(self): + if self.AI_client_tts_isconnect == 1: + self.AI_client_tts_isconnect = 0 + try: + self.AI_client_tts.close() + except Exception as e: + usys.print_exception(e) + def AI_client_tts_timer_cb(self,*argc): + # EventMesh.publish("system_sleep_rest")#防止黑屏 + self.tts_time_count+=1 + if self.play_flag == 0: + return + if self.TTS_PRO_TYPE == 1: + #tts数据入队 + self.AI_client_tts_put_data() + #print("AI_audio_queue.size:{},AI_send_data_queue.size:{} self.AI_client_chat_play_str:{} self.AI_client_tts_tra_flag:{}\r\n".format(self.AI_audio_queue.size(),self.AI_send_data_queue.size(),self.AI_client_chat_play_str,self.AI_client_tts_tra_flag) ) + #字符串分段发送,等待播放缓存变小 + if len(self.AI_client_chat_play_str) >0 and self.AI_client_tts_data_len < 130*1024 :#and (self.AI_client_tts_str_total_len <100 or self.AI_client_tts_str_total_len - self.AI_client_tts_data_total_len//672 < 60)缓存200k以下,且tts发送文字字节数比返回音频数据少60字节 + # play_str = split_string(self.AI_client_chat_play_str,40)# + # if play_str =="":#没找到句号或者逗号,切割字符串 + self.tts_time_outcount+=1 + + if self.TTS_PRO_TYPE == 1: + play_str = sub_utf8_String(self.AI_client_chat_play_str,20)#按中文切割字符串 + self.AI_client_tts_str_total_len += len(play_str) + elif self.TTS_PRO_TYPE == 0: + if self.AI_audio_queue.size() >= 4 or self.AI_client_tts_tra_flag == 1 or (self.tts_time_outcount < 3 and len(self.AI_client_chat_play_str) < 100):#存了超过4句,就等小于3次在转化 + return + play_str = split_string(self.AI_client_chat_play_str,50,100)#按逗号,句号切割 + if play_str =="" or len(play_str)>100:#没找到句号或者逗号,切割字符串 + play_str = sub_utf8_String(self.AI_client_chat_play_str,100)#按中文切割字符串 + self.AI_client_tts_tra_flag = 1 + self.AI_client_tts_str_sen = play_str + if len(play_str) == 0: + return + self.AI_client_tts_send(play_str)#TTS语音播放AI结果 + self.AI_client_chat_play_str = self.AI_client_chat_play_str[len(play_str):] + #print("TTS play:len{},data{}".format(len(play_str),play_str)) + if self.TTS_PRO_TYPE == 1 and len(self.AI_client_chat_play_str) <=0 and self.AI_client_chat_end_flag ==1 : + self.AI_client_chat_end_flag=0 + self.AI_client_tts_end() + + def AI_client_tts_send(self,data_str): + data_l = {} + if self.TTS_PRO_TYPE == 1: + + data_l ={"header": {"event": "RunSynthesis","trace_id": self.get_trace_id()},"payload": {"text":"%s"%(data_str)}} + elif self.TTS_PRO_TYPE == 0: + data_l ={ + "header": { + "event": "LongTextStream", + "trace_id": self.get_trace_id() + }, + "payload": { + "voice":"zhixiaomei",#"xiaoyun", + "format":"mp3", + "sample_rate":8000, + "volume":90, + "speech_rate":30, + "text":"%s"%(data_str) + } + } + json_data = ujson.dumps(data_l) + self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + def AI_client_tts_start(self): + data_l ={"header": {"event": "StartSynthesis","trace_id": self.get_trace_id()}, + "payload": {"voice":"xiaoyun","format":"mp3","sample_rate":8000,"volume":60,"speech_rate":1,}} + #print("\r\nAI_client_tts_start!!!!!!!!!!!!\r\n") + json_data = ujson.dumps(data_l) + #print("AI_client_tts_send:{}".format(json_data)) + self.record.stop()#关闭录音 + self.record_timer.stop()#关闭定时器 + self.tts_time_count = 0 + self.tts_data_tmp = b'' + + self.AI_client_tts_data_total_len = 0 + self.AI_client_tts_str_total_len= 0 + + #self.AI_client_tts_str_sen = "" + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_data_len = 0 + self.AI_client_tts_tra_flag = 1 + self.AI_client_tts.send(json_data) + utime.sleep_ms(100) + #self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + + def AI_client_tts_end(self): + if self.TTS_PRO_TYPE == 1: + data_l ={"header": {"event": "StopSynthesis","trace_id": self.get_trace_id()}} + json_data = ujson.dumps(data_l) + self.AI_send_data_queue.put([self.AI_client_tts_num,json_data]) + #TTS数据入队 + def AI_client_tts_put_data(self): + #存够5k数据或者3秒超时 + if (self.AI_client_tts_full_sentence_flag == 1 and len(self.tts_data_tmp) >30*1024) \ + or self.tts_time_count >= 3 \ + or (self.AI_client_tts_full_sentence_flag == 1 and self.AI_client_tts_tra_flag == 1 and len(self.tts_data_tmp) >5*1024): + self.AI_client_tts_full_sentence_flag == 0 + #self.AI_client_tts_data_len +=len(self.tts_data_tmp) + if self.AI_client_tts_tra_flag == 1:#第一个数据去掉头 + self.tts_data_tmp = self.tts_data_tmp[9:] + if len(self.tts_data_tmp)>0: + self.AI_audio_queue.put([self.tts_data_tmp,self.AI_client_tts_str_sen]) + print("入:{},{}".format(len(self.tts_data_tmp),self.AI_client_tts_data_len)) + self.tts_time_count = 0 + self.tts_data_tmp = b'' + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_tra_flag = 0 + gc.collect()#GC主动回收内存 + #文字转语音链路读数据 + def AI_client_tts_recv(self,cli): + recv_data_len_same_count = 0 + recv_data_len = 0 + while True: + try: + # 死循环接收数据 + + recv_data = cli.recv() + + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + print("AI_client_tts_recv close!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n") + break + try: + # print("AI_client_tts_recv :{}".format(len(recv_data))) + #结束标志{"header":{"event":"EndSynthesis","msg":"success","status":20000000,"task_id":"ffd727e620000803280c5a6498d0e321"}} + if isinstance(recv_data, str): + #print("AI_client_tts_recv:str recv_data:{}".format(recv_data)) + if recv_data.find('\"event\":\"EndSynthesis\"') != -1: + #print("EndSynthesis!!!!!!!!!!!!!!!!!\r\n") + #print("EndSynthesis!!!!!!!!!!!!!!!!!!\r\n") + #self.tts_data_tmp=self.tts_data_tmp[9:-100] + try: + self.websocket_deconnect_tts()#断开 + except Exception as e: #网络连接异常 + usys.print_exception(e) + + + self.tts_time_count = 60#立即发送剩余数据 + self.AI_client_tts_put_data() + + self.AI_client_tts_full_sentence_flag = 1 + break + if recv_data.find('\"msg\":\"success\"') == -1: + break + else: + #判断是否是一个完整的句子 + recv_data_len_tmp = len(recv_data) + if self.TTS_PRO_TYPE == 1: + print("recv_data_len_same_count:{}".format(recv_data_len_same_count)) + if recv_data_len == recv_data_len_tmp: + recv_data_len_same_count+=1 + else: + if recv_data_len_same_count > 2:#认为是完整的句子 + self.AI_client_tts_full_sentence_flag = 1 + print("self.AI_client_tts_full_sentence_flag = 1!!!!!!!!!!!!") + recv_data_len_same_count = 0 + recv_data_len = recv_data_len_tmp + self.tts_data_tmp+=recv_data + self.AI_client_tts_data_len+=recv_data_len_tmp + self.AI_client_tts_data_total_len += recv_data_len_tmp + if self.TTS_PRO_TYPE == 1: + self.AI_client_tts_put_data() + #utime.sleep_ms(1000) + except Exception as e: + usys.print_exception(e) + # print(recv_data) + # print(type(recv_data)) + mem = gc.mem_free() + print('2剩余内存RAM:{} KB'.format(mem / 1024)) + except Exception as e: + usys.print_exception(e) + break + self.AI_client_tts_isconnect = 0 + self.AI_client_tts_recv_id = 0 + self.AI_client_tts_tra_flag = 0 +####################################################################### + #语音转文字链路 + def websocket_connect_asr(self): + print("websocket_connect_asr:{}!!!!!!!!!!!!!!!!!!!!".format(self.AI_client_asr_isconnect)) + try: + self.websocket_deconnect_asr()#先断一次,预防出错 + except Exception as e: + usys.print_exception(e) + + try: + self.AI_client_asr = uwebsocket.Client.connect('ws://118.145.158.207:80/asr/ws', debug=False) + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("websocket_connect_asr error!!!\r\n") + self.connect_timerout_popup(2) + return + # 线程接收数据 + if self.AI_client_asr_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_asr_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_asr_recv_id = 0 + self.AI_client_asr_recv_id = _thread.start_new_thread(self.AI_client_asr_recv, (self.AI_client_asr,)) + self.AI_client_asr_isconnect = 1 + def websocket_deconnect_asr(self): + if self.AI_client_asr_isconnect == 1: + self.AI_client_asr_isconnect = 0 + self.AI_client_asr.close() + def AI_client_asr_send(self,data_bytes): + #self.AI_client_asr.send(data_bytes) + self.AI_send_data_queue.put([self.AI_client_asr_num,data_bytes]) + def AI_client_asr_start(self): + self.AI_send_data_queue.put([self.AI_client_asr_num,"{\"header\":{\"event\":\"StartTranscription\",\"trace_id\":\"%s\"},\"payload\":{\"format\":\"amr\",\"sample_rate\":8000}}"%(self.get_trace_id())]) + #语音转文字链路读数据 + def AI_client_asr_recv(self,cli): + + while True: + try: + # 死循环接收数据 + recv_data = cli.recv() + if not recv_data: + # 服务器关闭连接或客户端关闭连接 + print("AI_client_asr_recv close") + #self.AI_client_asr_isconnect = 0 + #self.websocket_deconnect_asr() + break + try: + if isinstance(recv_data, str): + jsload_data = ujson.loads(recv_data) + print("jsload_data = {}".format(jsload_data)) + if recv_data.find('\"result\"') == -1: + #if jsload_data["result"] == None: + print("continue recv_data:{}".format(recv_data)) + continue + if jsload_data["result"] == None: + print("continue recv_data:{}".format(recv_data)) + continue + if jsload_data["result"]["result"]: + self.AI_listen_text = str(jsload_data["result"]["result"]) + al_listen_screen_title1.set_text(str(jsload_data["result"]["result"])) + # AI_listen_text.set_text(str(jsload_data["result"]["result"])) + if jsload_data["result"]["is_end"] == True: #{"type":"chat","content":"你好"} + self.AI_listen_end = 1 + self.audio_play_state = 0 + self.talk_ars_end() + break + #chat_data = bytearray(chat_data_str) + # AI_label.set_text("思考中...") + # self.AI_client_chat_send(str(jsload_data["result"]["result"])) + # print("chat_data:{}".format(str(jsload_data["result"]["result"]))) + # self.record.stop()#关闭录音 + # self.record_timer.stop()#关闭定时器 + + # try: + # self.websocket_deconnect_asr() + # break + # except Exception as e: + # usys.print_exception(e) + elif jsload_data["result"]["is_end"] == False: + self.AI_listen_end = 0 + # AI_label.set_text("语音识别中...") + except Exception as e: + print("error recv_data:{}".format(recv_data)) + usys.print_exception(e) + + except Exception as e: + usys.print_exception(e) + break + self.AI_client_asr_isconnect = 0 + self.AI_client_asr_recv_id = 0 + ############################################### + #发送数据队列 + def AI_send_data_queue_thread(self): + while True: + #data[0]是websocket连接对象编号,data[1]是数据 + data = self.AI_send_data_queue.get() + if data != None: + try: + #data["func"](data["data"]) + # self.record.stop() + # self.aud.playStream(4, data) + # self.record.stream_start(audio.Record.AMRNB, 8000, 60) + # 发送数据 + #bytes_data = bytes(data[1]) + #data[0].send(data[1]) + if data[0] == self.AI_client_chat_num: + if self.AI_client_chat_isconnect == 0: + try: + self.websocket_connect_chat() + except Exception as e: #网络连接异常 + usys.print_exception(e) + if self.AI_client_chat != None: + tmp = self.AI_client_chat.send(data[1]) + print("chat send_data:{} tmp:{}".format(len(data[1]),tmp)) + if data[0] == self.AI_client_asr_num: + if isinstance(data[1], str): + print("ASR:AI_client_asr_isconnect:{},data:{}",self.AI_client_asr_isconnect,data[1]) + if self.AI_client_asr_isconnect == 0: + try: + self.websocket_connect_asr() + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("asr send_data:{}".format(len(data[1]))) + if self.AI_client_asr != None: + self.AI_client_asr.send(data[1]) + if data[0] == self.AI_client_tts_num: + if self.AI_client_tts_isconnect == 0: + try: + self.websocket_connect_tts() + except Exception as e: #网络连接异常 + usys.print_exception(e) + print("tts send_data:{}".format((data[1]))) + if self.AI_client_tts != None: + self.AI_client_tts.send(data[1]) + except Exception as e: + print("DeviceInfo_queue_thread:ERROR:{}".format(e)) + usys.print_exception(e) + if data[0] == self.AI_client_chat_num: + self.AI_client_chat_isconnect = 0 + try: + self.websocket_connect_chat() + except Exception as e: #网络连接异常 + usys.print_exception(e) + if data[0] == self.AI_client_asr_num: + self.AI_client_asr_isconnect = 0 + try: + self.websocket_connect_asr() + except Exception as e: #网络连接异常 + usys.print_exception(e) + if data[0] == self.AI_client_tts_num: + count =10 + while 1: + count-=1 + if count<=0: + break + self.AI_client_tts_isconnect = 0 + try: + self.websocket_connect_tts() + except Exception as e: #网络连接异常 + usys.print_exception(e) + #self.AI_client_tts_start() + if self.AI_client_tts_isconnect == 1: + try: + if self.AI_client_tts != None: + self.AI_client_tts.send(data[1]) + break + except Exception as e: + usys.print_exception(e) + + ############################################ + # 音频队列 + def AI_audio_queue_thread(self): + + while True: + try: + if 1: #self.audio_play_state == 0: + #print("AI_audio_queue_thread") + if self.play_flag == 1: + self.play_flag_init = 1 + data = self.AI_audio_queue.get() + + #self.AI_client_tts_data_len=len(data) + #print("audio_queue:len:{},data{}".format(len(data[0]),data[1])) + if len(data[0]) > 1: + if self.TTS_PRO_TYPE == 0: + if self.play_flag == 1: + self.AI_label_answer+=data[1] + EventMesh.publish("publish_message_event_ui",{"func":self.ai_talk_end_show_text_cb,"data":0}) + # AI_label.set_text(self.AI_label_answer) + try: + if self.play_flag == 1: + tmp= self.aud.playStream(3, data[0])#播放音频流 + print("出:{},{}!!!".format(len(data[0]),self.AI_client_tts_data_len)) + if tmp != 0: + print("2playStream:error tmp:{} data len:{}!!!!!!!!!!!!".format(tmp,len(data[0]))) + self.AI_client_tts_data_len -=len(data[0]) + mem = gc.mem_free() + print('1剩余内存RAM:{} KB'.format(mem / 1024)) + except Exception as e: + print("AI_audio_queue_thread:ERROR:") + usys.print_exception(e) + else: + if self.play_flag_init == 1: + self.play_flag_init = 0 + self.aud.stopPlayStream() + utime.sleep_ms(2) + except Exception as e: + print("AI_audio_queue_thread:ERROR:") + usys.print_exception(e) + def Close(self): + try: + #销毁线程 + if self.AI_audio_queue_thread_id != 0: + try: + _thread.stop_thread(self.AI_audio_queue_thread_id) + except Exception as e: + usys.print_exception(e) + self.AI_audio_queue_thread_id = 0 + if self.AI_send_data_queue_thread_id != 0: + try: + _thread.stop_thread(self.AI_send_data_queue_thread_id) + except Exception as e: + usys.print_exception(e) + self.AI_send_data_queue_thread_id = 0 + if self.AI_client_chat_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_chat_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_chat_recv_id = 0 + if self.AI_client_tts_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_tts_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_tts_recv_id = 0 + if self.AI_client_asr_recv_id != 0: + try: + _thread.stop_thread(self.AI_client_asr_recv_id) + except Exception as e: + usys.print_exception(e) + self.AI_client_asr_recv_id = 0 + except Exception as e: + usys.print_exception(e) + self._1S_timer.stop() + self.AI_send_data_queue.clear() + print("close:AI_send_data_queue:size:{}".format(self.AI_send_data_queue.size())) + self.AI_audio_queue.clear() + self.AI_client_tts_str_sen = '' + self.record_timer.stop() + self.AI_client_tts_timer.stop() + self.aud.stopPlayStream() + self.aud.stopAll() + self.AI_client_chat_play_str = "" + self.AI_client_tts_tra_flag = 0 + self.record.stop()#关闭录音 + Record_read_buf = bytearray(self.Audio_buf_size) + for i in range(10): + Record_len = self.record.stream_read(Record_read_buf, self.Audio_buf_size) + print("Record_len:!!!!!!{}\r\n".format(Record_len)) + if Record_len <= 0: + break + self.AI_label_answer = "" + self.refresh_count = 0 + self.refresh_texttimer.stop() + self.clear_flag() + try: + self.websocket_deconnect_asr() + self.websocket_deconnect_tts() + self.websocket_deconnect_chat() + except Exception as e: + usys.print_exception(e) + + def done_bottom_to_top(self): + print("done_bottom_to_top:") + self.hard_flag_next = 1 + + def done_top_to_bottom(self): + # self.timer_start_cb() + print("done_top_to_bottom") + self.hard_flag_prev = 1 + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_left_to_right(self): + # # print("ai done_right_to_left\r\n") + # if (AI_talk_end_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_listen_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or\ + # (AI_talk_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_no_net_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + # (AI_connect_timerout_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or (AI_not_listen_text_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False or \ + # (AI_think_screen.has_flag(lv.obj.FLAG.HIDDEN)) == False: + # EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/alarm.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py similarity index 55% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/alarm.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py index b27a855a..a08bc500 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/alarm.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/alarm.py @@ -11,7 +11,7 @@ import ujson import ql_fs from misc import Power import audio -from ui import style_screen_btn_1_main_main_default,style_font_youyuan_20_gray,style_img,style_screen,style_font_youyuan_20 +from ui import style_img,style_screen,style_font_youyuan_20,LCD_SIZE_H,LCD_SIZE_W import ntptime #ntptime.settime(timezone=8) @@ -32,10 +32,8 @@ MAX_ALARM = 3 #CONT的样式 style_cont_alarm = lv.style_t() style_cont_alarm.init() -style_cont_alarm.set_bg_color(lv.color_make(0xA0, 0xA0, 0xA0)) -style_cont_alarm.set_bg_grad_color(lv.color_make(0xA0, 0xA0, 0xA0)) -style_cont_alarm.set_bg_opa(255) -style_cont_alarm.set_radius(0) +style_cont_alarm.set_bg_color(lv.color_make(51, 51,51)) +style_cont_alarm.set_radius(5) style_cont_alarm.set_pad_left(0) style_cont_alarm.set_pad_right(0) style_cont_alarm.set_pad_top(0) @@ -57,6 +55,10 @@ style_font_yellow.init() style_font_yellow.set_text_color(lv.color_make(0xF1, 0xA3, 0x3B)) style_font_yellow.set_text_font(lv.K01_font_16_ALL) +alarm_style_font_youyuan_20_gray = lv.style_t() +alarm_style_font_youyuan_20_gray.init() +alarm_style_font_youyuan_20_gray.set_text_color(lv.color_make(100, 100, 100)) +alarm_style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) #背景样式 style_alarm_screen_default = lv.style_t() style_alarm_screen_default.init() @@ -71,18 +73,16 @@ style_alarm_screen_default.set_pad_bottom(0) clk_list_screen = lv.obj() print("clk_list_screen") clk_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -clk_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - -# clk_list_title_bg= lv.btn(clk_list_screen) -# clk_list_title_bg.set_size(112,25) -# clk_list_title_bg.set_pos(8,5) -# clk_list_title_bg.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN | lv.STATE.DEFAULT) -# clk_list_title_bg.set_ext_click_area(25) - -clk_list_title = lv.label(clk_list_screen) -clk_list_title.set_pos(4, 5) -clk_list_title.set_size(112, 20) -clk_list_title.set_text("闹钟") + +clk_list_title_bg= lv.btn(clk_list_screen) +clk_list_title_bg.set_size(220,40) +clk_list_title_bg.set_pos(10,10) +clk_list_title_bg.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_list_title = lv.label(clk_list_title_bg) +clk_list_title.set_pos(0, 12) +clk_list_title.set_size(240, 38) +clk_list_title.set_text("闹钟列表") clk_list_title.set_long_mode(lv.label.LONG.WRAP) clk_list_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) clk_list_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -101,32 +101,306 @@ clk_list_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # clk_list_add.set_ext_click_area(15) clk_list_screen1_1 = lv.obj(clk_list_screen) -clk_list_screen1_1.set_pos(0, 35) -clk_list_screen1_1.set_size(128, 128-35) -clk_list_screen1_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +clk_list_screen1_1.set_pos(0, 60) +clk_list_screen1_1.set_size(240, LCD_SIZE_H-60) clk_list_screen1_1.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) -# no_add_alarm_img = lv.img(clk_list_screen1_1) -# no_add_alarm_img.set_pos(15, 0) -# no_add_alarm_img.set_size(98, 94) -# no_add_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_POPUP_02.png") -# no_add_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +no_add_alarm_img = lv.img(clk_list_screen1_1) +no_add_alarm_img.set_pos(65, 0) +no_add_alarm_img.set_size(110, 140) +no_add_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") +no_add_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) #暂未添加闹钟 no_add_alarm = lv.label(clk_list_screen1_1) -no_add_alarm.set_pos(0, 20) -no_add_alarm.set_size(128, 20) -no_add_alarm.set_text("请在app上设置") +no_add_alarm.set_pos(0, 170) +no_add_alarm.set_size(240, (LCD_SIZE_H-65)-170) +no_add_alarm.set_text("闹钟暂未设置") no_add_alarm.set_long_mode(lv.label.LONG.WRAP) no_add_alarm.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) no_add_alarm.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - +# -------------------------------------------clk_edit screen---------------------------------------------------------- + +clk_edit_screen = lv.obj() +print("clk_edit_screen") +clk_edit_screen.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_edit_title = lv.label(clk_edit_screen) +clk_edit_title.set_pos(0, 0) +clk_edit_title.set_size(240, TITLE_HEIGHT) +clk_edit_title.set_text("编辑闹钟") +clk_edit_title.set_long_mode(lv.label.LONG.WRAP) +clk_edit_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +clk_edit_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_edit_time = lv.btn(clk_edit_screen) +clk_edit_time.set_size(224,75) +clk_edit_time.set_pos(8,58) +clk_edit_time.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_edit_time_label = lv.label(clk_edit_time) +clk_edit_time_label.set_pos(60, 15) +clk_edit_time_label.set_size(100, 40) +clk_edit_time_label.set_text("编辑时间") +clk_edit_time_label.set_long_mode(lv.label.LONG.WRAP) +clk_edit_time_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +clk_edit_time_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_edit_weekday = lv.btn(clk_edit_screen) +clk_edit_weekday.set_size(224,75) +clk_edit_weekday.set_pos(8,137) +clk_edit_weekday.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_edit_weekday_label = lv.label(clk_edit_weekday) +clk_edit_weekday_label.set_pos(60, 15) +clk_edit_weekday_label.set_size(100, 40) +clk_edit_weekday_label.set_text("编辑星期") +clk_edit_weekday_label.set_long_mode(lv.label.LONG.WRAP) +clk_edit_weekday_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +clk_edit_weekday_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_delete_alarm = lv.btn(clk_edit_screen) +clk_delete_alarm.set_size(224,75) +clk_delete_alarm.set_pos(8,216) +clk_delete_alarm.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_delete_alarm_label = lv.label(clk_delete_alarm) +clk_delete_alarm_label.set_pos(60, 15) +clk_delete_alarm_label.set_size(100, 40) +clk_delete_alarm_label.set_text("删除闹钟") +clk_delete_alarm_label.set_long_mode(lv.label.LONG.WRAP) +clk_delete_alarm_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +clk_delete_alarm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# -------------------------------------------clk_repeat screen---------------------------------------------------------- +clk_repeat_screen = lv.obj() +print("clk_repeat_screen") +clk_repeat_screen.set_scrollbar_mode(0) +clk_repeat_screen.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_btn = lv.btn(clk_repeat_screen) +clk_repeat_btn.set_size(224,40) +clk_repeat_btn.set_pos(9,40) +clk_repeat_btn.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label = lv.label(clk_repeat_btn) +clk_repeat_label.set_pos(8, 10) +clk_repeat_label.set_size(103, 40) +clk_repeat_label.set_text("星期一") +clk_repeat_label.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch = lv.switch(clk_repeat_btn) +clk_repeat_switch.set_pos(191, 5) +clk_repeat_switch.set_size(24, 24) +clk_repeat_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch.set_ext_click_area(20) +clk_repeat_switch.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + +clk_repeat_btn1 = lv.btn(clk_repeat_screen) +clk_repeat_btn1.set_size(224,40) +clk_repeat_btn1.set_pos(9,90) +clk_repeat_btn1.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label1 = lv.label(clk_repeat_btn1) +clk_repeat_label1.set_pos(8, 10) +clk_repeat_label1.set_size(103, 40) +clk_repeat_label1.set_text("星期二") +clk_repeat_label1.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch1 = lv.switch(clk_repeat_btn1) +clk_repeat_switch1.set_pos(191, 5) +clk_repeat_switch1.set_size(24, 24) +clk_repeat_switch1.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch1.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch1.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch1.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch1.set_ext_click_area(20) +clk_repeat_switch1.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + + +clk_repeat_btn2 = lv.btn(clk_repeat_screen) +clk_repeat_btn2.set_size(224,40) +clk_repeat_btn2.set_pos(9,140) +clk_repeat_btn2.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label2 = lv.label(clk_repeat_btn2) +clk_repeat_label2.set_pos(8, 10) +clk_repeat_label2.set_size(103, 40) +clk_repeat_label2.set_text("星期三") +clk_repeat_label2.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label2.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + +clk_repeat_switch2 = lv.switch(clk_repeat_btn2) +clk_repeat_switch2.set_pos(191, 5) +clk_repeat_switch2.set_size(24, 24) +clk_repeat_switch2.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch2.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch2.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch2.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch2.set_ext_click_area(20) +clk_repeat_switch2.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + +clk_repeat_btn3 = lv.btn(clk_repeat_screen) +clk_repeat_btn3.set_size(224,40) +clk_repeat_btn3.set_pos(9,190) +clk_repeat_btn3.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label3 = lv.label(clk_repeat_btn3) +clk_repeat_label3.set_pos(8, 10) +clk_repeat_label3.set_size(103, 40) +clk_repeat_label3.set_text("星期四") +clk_repeat_label3.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label3.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch3 = lv.switch(clk_repeat_btn3) +clk_repeat_switch3.set_pos(191, 5) +clk_repeat_switch3.set_size(24, 24) +clk_repeat_switch3.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch3.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch3.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch3.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch3.set_ext_click_area(20) +clk_repeat_switch3.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + +clk_repeat_btn4 = lv.btn(clk_repeat_screen) +clk_repeat_btn4.set_size(224,40) +clk_repeat_btn4.set_pos(9,240) +clk_repeat_btn4.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label4 = lv.label(clk_repeat_btn4) +clk_repeat_label4.set_pos(8, 10) +clk_repeat_label4.set_size(103, 40) +clk_repeat_label4.set_text("星期五") +clk_repeat_label4.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label4.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch4 = lv.switch(clk_repeat_btn4) +clk_repeat_switch4.set_pos(191, 5) +clk_repeat_switch4.set_size(24, 24) +clk_repeat_switch4.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch4.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch4.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch4.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch4.set_ext_click_area(20) +clk_repeat_switch4.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + +clk_repeat_btn5 = lv.btn(clk_repeat_screen) +clk_repeat_btn5.set_size(224,40) +clk_repeat_btn5.set_pos(9,290) +clk_repeat_btn5.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label5 = lv.label(clk_repeat_btn5) +clk_repeat_label5.set_pos(8, 10) +clk_repeat_label5.set_size(103, 40) +clk_repeat_label5.set_text("星期六") +clk_repeat_label5.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label5.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label5.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch5 = lv.switch(clk_repeat_btn5) +clk_repeat_switch5.set_pos(191, 5) +clk_repeat_switch5.set_size(24, 24) +clk_repeat_switch5.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch5.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch5.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) +clk_repeat_switch5.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch5.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch5.set_ext_click_area(20) + +clk_repeat_btn6 = lv.btn(clk_repeat_screen) +clk_repeat_btn6.set_size(224,40) +clk_repeat_btn6.set_pos(9,340) +clk_repeat_btn6.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + +clk_repeat_label6 = lv.label(clk_repeat_btn6) +clk_repeat_label6.set_pos(8, 10) +clk_repeat_label6.set_size(103, 40) +clk_repeat_label6.set_text("星期日") +clk_repeat_label6.set_long_mode(lv.label.LONG.DOT) +clk_repeat_label6.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_repeat_label6.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + +clk_repeat_switch6 = lv.switch(clk_repeat_btn6) +clk_repeat_switch6.set_pos(191, 5) +clk_repeat_switch6.set_size(24, 24) +clk_repeat_switch6.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN) +clk_repeat_switch6.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR) +clk_repeat_switch6.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.KNOB) +clk_repeat_switch6.set_style_bg_color(lv.color_make(0xf1, 0xa3, 0x3b),lv.PART.KNOB| lv.STATE.CHECKED) +clk_repeat_switch6.set_ext_click_area(20) +clk_repeat_switch6.set_style_bg_color(lv.color_make(0xFF, 0xFF, 0xFF),lv.PART.INDICATOR| lv.STATE.CHECKED) + +# -------------------------------------------clk_repeat screen---------------------------------------------------------- +clk_time_screen = lv.obj() +print("clk_time_screen") +clk_time_screen.set_scrollbar_mode(0) +clk_time_screen.add_style(style_alarm_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +#hour的样式 +style_roller_hour_main = lv.style_t() +style_roller_hour_main.init() +style_roller_hour_main.set_radius(6) +style_roller_hour_main.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_roller_hour_main.set_bg_opa(102) +style_roller_hour_main.set_border_width(0) + +style_roller_hour_selected = lv.style_t() +style_roller_hour_selected.init() +style_roller_hour_selected.set_radius(6) +style_roller_hour_selected.set_bg_color(lv.color_make(0x2c, 0x2c, 0x2f)) +style_roller_hour_selected.set_border_width(0) + +#创建hour的roller +clk_time_roller_1 = lv.roller(clk_time_screen) +clk_time_roller_1.set_width(50) +clk_time_roller_1.set_pos(60, 50) +clk_time_roller_1.set_options( + "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23", + lv.roller.MODE.NORMAL) +clk_time_roller_1.set_visible_row_count(5) +clk_time_roller_1.add_style(style_roller_hour_main, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_time_roller_1.add_style(style_roller_hour_selected, lv.PART.SELECTED | lv.STATE.DEFAULT) + +#min的样式 +#创建min的roller +clk_time_roller_2 = lv.roller(clk_time_screen) +clk_time_roller_2.set_width(50) +clk_time_roller_2.set_pos(130, 50) +clk_time_roller_2.set_options( + "00\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59", + lv.roller.MODE.NORMAL) +clk_time_roller_2.set_visible_row_count(5) +clk_time_roller_2.add_style(style_roller_hour_main, lv.PART.MAIN | lv.STATE.DEFAULT) +clk_time_roller_2.add_style(style_roller_hour_selected, lv.PART.SELECTED | lv.STATE.DEFAULT) + +#完成按钮 +alarm_ok= lv.btn(clk_time_screen) +alarm_ok.set_size(150,40) +alarm_ok.set_pos(45,250) +alarm_ok.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) +alarm_ok.set_ext_click_area(20) + +label_ok = lv.label(alarm_ok) +label_ok.set_pos(30, 20) +label_ok.set_size(100, 40) +label_ok.set_text("完成") +label_ok.set_long_mode(lv.label.LONG.DOT) +label_ok.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +label_ok.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) #闹钟信息 -alarm_list = [{'hour': 16, 'repeart': 10, 'idx': 0, 'enabled': 0, 'days': [0,1,2,3,4,5,6], 'minute': 39}, - {'hour': 16, 'repeart': 10, 'idx': 1, 'enabled': 0, 'days': [0,1,2,3,4,5,6], 'minute': 39}] +alarm_list = [{'hour': 16, 'repeart': 10, 'idx': 0, 'enabled': 0, 'days': [], 'minute': 39}, + {'hour': 16, 'repeart': 10, 'idx': 1, 'enabled': 0, 'days': [], 'minute': 39}] #用于显示闹钟列表不包含开关机信息 class ClockManager(Abstract): @@ -135,13 +409,12 @@ class ClockManager(Abstract): self.rtc = RTC() self.days = 0 self.idx = 0 - + self.rtc.enable_alarm(1) IFEXIST = ql_fs.path_exists("/usr/static/storage_file/alarm_msg.json") self.check_alarm_list = [] if IFEXIST == True: with open("/usr/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd: self.check_alarm_list = ujson.load(fd) - print("self.check_alarm_list",self.check_alarm_list) def post_processor_after_instantiation(self): EventMesh.subscribe("push_clock_info", self.set) @@ -152,7 +425,7 @@ class ClockManager(Abstract): EventMesh.subscribe("get_alarm_indx", self.get_alarm_indx) EventMesh.subscribe("get_check_alarm_list", self.get_check_alarm_list) - + def get_check_alarm_list(self, event, msg): alarm_len = 0 @@ -363,7 +636,7 @@ class ClockManager(Abstract): alarm_list[idx]["enabled"] = False with open("/usr/static/storage_file/alarm_msg.json", 'w+',encoding='utf-8') as fd: ujson.dump(alarm_list,fd) - + EventMesh.publish("set_rtc_alarm") #设置下一个闹钟,定时开关机功能 if 0 : msg_data = EventMesh.publish("get_boot_off_time") @@ -386,9 +659,9 @@ class ClockManager(Abstract): get_hr_state = EventMesh.publish("get_hr_state") get_spo2_state = EventMesh.publish("get_spo2_state") - # if get_hr_state != None or get_spo2_state != None: - # if get_hr_state != 1 and get_spo2_state != 1: - EventMesh.publish("load_screen", {"screen": "popup_alarm"}) + if get_hr_state != None or get_spo2_state != None: + if get_hr_state != 1 and get_spo2_state != 1: + EventMesh.publish("load_screen", {"screen": "popup_alarm"}) # def _reset_rtc_alarm_time(self, args): # print("---alarm_ring---") @@ -515,14 +788,14 @@ popup_alarm_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) popup_alarm_img = lv.img(popup_alarm_screen) -popup_alarm_img.set_pos(15, 5) -popup_alarm_img.set_size(98, 94) -popup_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_POPUP_02.png") +popup_alarm_img.set_pos(63, 60) +popup_alarm_img.set_size(110, 140) +popup_alarm_img.set_src("U:/static/IMAGE_IDLE_SCREEN_ALARM_ICON_NEW.png") popup_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) popup_alarm_time = lv.label(popup_alarm_screen) -popup_alarm_time.set_pos(0, 100) -popup_alarm_time.set_size(128, 20) +popup_alarm_time.set_pos(0, 230) +popup_alarm_time.set_size(240, 50) popup_alarm_time.set_text(" ") popup_alarm_time.set_long_mode(lv.label.LONG.WRAP) popup_alarm_time.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -533,17 +806,17 @@ class PopupAlarmScreen(Screen): def __init__(self): super().__init__() self.meta = popup_alarm_screen - self.meta_type = "popup" self.timer = osTimer() self.aud = audio.Audio(0) self.alarm_count = 0 - + self.meta_type = "popup" + def initialization(self): self.alarm_count = 0 - self.timer.start(3*1000,1,self.exit_alarm_page) + self.timer.start(1000,1,self.exit_alarm_page) time = EventMesh.publish("screen_get_time")#获取系统时间 popup_alarm_time.set_text("{}:{}".format("%02d"%(time[0][0]),"%02d"%(time[0][1]))) - + EventMesh.publish("set_motor_time",[1,2,8*6,8,4])#设置马达参数 def Close(self): self.alarm_count=0 @@ -551,94 +824,61 @@ class PopupAlarmScreen(Screen): self.aud.stop() def exit_alarm_page(self,*arges): - EventMesh.publish("system_sleep_rest") + EventMesh.publish("system_sleep_rest")#防止黑屏 self.alarm_count+=1 - if self.alarm_count > 100: + if self.alarm_count > 60: self.alarm_count = 0 self.aud.stop() self.timer.stop() - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) + EventMesh.publish("load_screen", {"screen": "main_menu"}) return - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #播放声音 - + play_state = EventMesh.publish("get_audio_state")#音频播放状态 + if play_state != None: + if play_state == 0:#在上一个界面在播放音频时切换界面则关闭 以免一直播放 + self.aud.stop() + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') #播放声音 + def close_timer(self): self.alarm_count=0 self.timer.stop() self.aud.stop() + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + def done_left_to_right(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_right_to_left(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_bottom_to_top(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_top_to_bottom(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_return(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_click(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): self.close_timer() EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): self.close_timer() + EventMesh.publish("watch_top_show") EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) -#闹钟列表 -style_common_pressed = lv.style_t() -style_common_pressed.init() -style_common_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) -style_common_pressed.set_bg_opa(200) -style_common_pressed.set_border_width(0) -style_common_pressed.set_shadow_opa(0) -style_common_pressed.set_border_width(0) -style_common_pressed.set_pad_left(0) -style_common_pressed.set_pad_right(0) -style_common_pressed.set_pad_top(0) -style_common_pressed.set_pad_bottom(0) - -alarm_main_default = lv.style_t() -alarm_main_default.init() -alarm_main_default.set_radius(5) -alarm_main_default.set_bg_color(lv.color_make(0x64,0x64,0x64)) -alarm_main_default.set_bg_grad_color(lv.color_make(0x64,0x64,0x64)) -alarm_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -alarm_main_default.set_bg_opa(255) -alarm_main_default.set_border_color(lv.color_make(0x64,0x64,0x64)) -alarm_main_default.set_border_width(0) -alarm_main_default.set_border_opa(255) -alarm_main_default.set_pad_left(0) -alarm_main_default.set_pad_right(0) -alarm_main_default.set_pad_top(0) -alarm_main_default.set_pad_bottom(0) - -alarm_style_font_youyuan_20_gray = lv.style_t() -alarm_style_font_youyuan_20_gray.init() -alarm_style_font_youyuan_20_gray.set_text_color(lv.color_make(200, 200, 200)) -alarm_style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) +ALARM_LIST_SIZE = 70 #闹钟列表 class ClkListScreen(Screen): NAME = "clk_list" @@ -646,27 +886,30 @@ class ClkListScreen(Screen): super().__init__() self.meta = clk_list_screen self.clock_list = [] - self.MXA_clk_num = 3 + self.MXA_clk_num = 3#有两个开关机隐藏的 self.contact_detail_listt_dict = [] # clk_list_add_btn.add_event_cb(lambda e: self.add_alarm_btn(e), # lv.EVENT.PRESSED, None) self.weekdays_list = ["日","一","二","三","四","五","六"] EventMesh.subscribe("push_update_alarm_show", self.update_show_info) + clk_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), + lv.EVENT.GESTURE, None) self.alarm_show_list = lv.obj(clk_list_screen) - self.alarm_show_list.set_pos(0, 25) - self.alarm_show_list.set_size(128, 128-25) + self.alarm_show_list.set_pos(0, 60) + self.alarm_show_list.set_size(240, LCD_SIZE_H-60) self.alarm_show_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) self.alarm_show_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + self.alarm_show_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), + lv.EVENT.GESTURE, None) self.timer=osTimer() for i in range(self.MXA_clk_num): _btn = lv.btn(self.alarm_show_list) - _btn.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) - _btn.add_style(alarm_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) _btn.add_flag(lv.obj.FLAG.CLICKABLE) + _btn.add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), - lv.EVENT.SHORT_CLICKED, None) - + lv.EVENT.CLICKED, None) + _btn.add_flag(lv.obj.FLAG.HIDDEN) _btn_label1 = lv.label(_btn) _btn_label2 = lv.label(_btn) _btn_label2.set_long_mode(lv.label.LONG.DOT) @@ -677,7 +920,9 @@ class ClkListScreen(Screen): self.contact_detail_listt_dict.append({"_btn":_btn,"_btn_label1":_btn_label1,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3}) def initialization(self): + EventMesh.publish("read_alarminjson") + EventMesh.publish("set_rtc_alarm") print("n闹钟列表初始化!!") self.alarm_draw_btn() @@ -685,55 +930,63 @@ class ClkListScreen(Screen): # EventMesh.publish("read_alarminjson") self.timer.start(1*1000,0,self.delay_update) def delay_update(self,*agrs): - + # EventMesh.publish("set_rtc_alarm") self.alarm_draw_btn() def alarm_draw_btn(self): - get_alarm_data = EventMesh.publish("get_storage_config","normal_alarm") + get_alarm_data = EventMesh.publish("get_storage_config","normal_alarm") + print("get_alarm_data",get_alarm_data) if get_alarm_data != None and get_alarm_data != []: + if len(get_alarm_data) != 0: - + # print("nalarm_list:{}".format(alarm_list)) + no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.add_flag(lv.obj.FLAG.HIDDEN) - num = 0 count = 0 clock_nums = len(get_alarm_data)#3-2 = 1 0 # for i ,each in enumerate(self.clock_list): - i=0 - for i in range(self.MXA_clk_num): + for i in range(0,self.MXA_clk_num): if i >= clock_nums: self.contact_detail_listt_dict[i]["_btn"].add_flag(lv.obj.FLAG.HIDDEN) continue + hour = get_alarm_data[i]["hour"] min = get_alarm_data[i]["min"] - # repeart = get_alarm_data[i]["repeart"] - day = get_alarm_data[i]["day"] - - print("alarm!!!!!!!!!!") + print("count1:{}".format(count)) #_btn = lv.btn(self.alarm_show_list) - self.contact_detail_listt_dict[count]["_btn"].set_size(120,35) - self.contact_detail_listt_dict[count]["_btn"].set_pos(4,39*count) + self.contact_detail_listt_dict[count]["_btn"].set_size(230,ALARM_LIST_SIZE) + self.contact_detail_listt_dict[count]["_btn"].set_pos(5,(ALARM_LIST_SIZE+4)*count) + # self.contact_detail_listt_dict[i]["_btn"].add_style(style_cont_alarm, lv.PART.MAIN | lv.STATE.DEFAULT) + # self.contact_detail_listt_dict[i]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_alarm(e)), + # lv.EVENT.CLICKED, None) + + # print("------刷新闹钟列表噢:{} num:{}",each,num) #_btn_label1 = lv.label(_btn) - self.contact_detail_listt_dict[count]["_btn_label1"].set_pos(20, 0) + self.contact_detail_listt_dict[count]["_btn_label1"].set_pos(50, 0) self.contact_detail_listt_dict[count]["_btn_label1"].set_size(0, 0) self.contact_detail_listt_dict[count]["_btn_label1"].set_text(" ") #_btn_label2 = lv.label(_btn) - self.contact_detail_listt_dict[count]["_btn_label2"].set_pos(10, 0) - self.contact_detail_listt_dict[count]["_btn_label2"].set_size(97, 20) + self.contact_detail_listt_dict[count]["_btn_label2"].set_pos(20, 8) + self.contact_detail_listt_dict[count]["_btn_label2"].set_size(97, 28) self.contact_detail_listt_dict[count]["_btn_label2"].set_text("%02d" % hour + ":"+"%02d" %min) + # _btn_label2.set_text(str(each["days"])) + + # _btn_label2.set_long_mode(lv.label.LONG.DOT) + # _btn_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) self.contact_detail_listt_dict[count]["_btn_label2"].set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) _new_list = sorted(day) _output = [self.weekdays_list[x] for x in _new_list] #_btn_label3 = lv.label(_btn) - self.contact_detail_listt_dict[count]["_btn_label3"].set_pos(10, 18) - self.contact_detail_listt_dict[count]["_btn_label3"].set_size(128-8, 20) + self.contact_detail_listt_dict[count]["_btn_label3"].set_pos(20, 40) + self.contact_detail_listt_dict[count]["_btn_label3"].set_size(200, 28) print("_new_list:{}".format(_new_list)) if day == []: self.contact_detail_listt_dict[count]["_btn_label3"].set_text("一次") @@ -741,28 +994,38 @@ class ClkListScreen(Screen): self.contact_detail_listt_dict[count]["_btn_label3"].set_text("每天") else: self.contact_detail_listt_dict[count]["_btn_label3"].set_text(",".join(_output)) - + # _btn_label3.set_long_mode(lv.label.LONG.DOT) + # _btn_label3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) self.contact_detail_listt_dict[count]["_btn_label3"].set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) self.contact_detail_listt_dict[count]["_btn"].clear_flag(lv.obj.FLAG.HIDDEN) - count+=1 if count == 0: - # no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) - else: + else : + no_add_alarm_img.add_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.add_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.clear_flag(lv.obj.FLAG.HIDDEN) else: - # no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) else: - # no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_add_alarm_img.clear_flag(lv.obj.FLAG.HIDDEN) no_add_alarm.clear_flag(lv.obj.FLAG.HIDDEN) self.alarm_show_list.add_flag(lv.obj.FLAG.HIDDEN) def edit_alarm(self, e):#暂时屏蔽 + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + pass return idx = int(e.get_target().get_child(0).get_text()) print("edit!!!!!!!!!!!!:",idx) @@ -795,11 +1058,13 @@ class ClkListScreen(Screen): # EventMesh.publish("set_rtc_alarm") # print("sw_event_cb ~~~") + + # def done_return(self): + # EventMesh.publish("load_screen", {"screen": "toolbox"}) def done_return(self): EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "toolbox"}) - + def btn1_release(self): EventMesh.publish("load_screen", {"screen": "toolbox"}) @@ -810,153 +1075,156 @@ class ClkListScreen(Screen): -# class NewEditClk(Screen): -# NAME = "new_edit_clk" -# def __init__(self): -# super().__init__() -# self.meta = clk_edit_screen -# clk_edit_weekday.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_weekday(e)), lv.EVENT.SHORT_CLICKED, None) -# clk_edit_time.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_time(e)), lv.EVENT.SHORT_CLICKED, None) -# clk_delete_alarm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.delete_alarm(e)), lv.EVENT.SHORT_CLICKED, None) -# def initialization(self): -# print("hahahahh",self.meta_info["idx"]) +class NewEditClk(Screen): + NAME = "new_edit_clk" + + def __init__(self): + super().__init__() + self.meta = clk_edit_screen + clk_edit_weekday.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_weekday(e)), lv.EVENT.CLICKED, None) + clk_edit_time.add_event_cb(lambda e: EventMesh.callback_wrapper(self.edit_time(e)), lv.EVENT.CLICKED, None) + clk_delete_alarm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.delete_alarm(e)), lv.EVENT.CLICKED, None) + + def initialization(self): + print("hahahahh",self.meta_info["idx"]) -# def delete_alarm(self, e): -# EventMesh.publish("remove_alarm",self.meta_info) + def delete_alarm(self, e): + EventMesh.publish("remove_alarm",self.meta_info) -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def edit_weekday(self,e): -# self.load_screen(e, {"screen": "clk_period", -# "meta": self.meta_info}) + def edit_weekday(self,e): + self.load_screen(e, {"screen": "clk_period", + "meta": self.meta_info}) -# def edit_time(self,e): -# self.load_screen(e, {"screen": "clk_time", -# "meta": self.meta_info}) + def edit_time(self,e): + self.load_screen(e, {"screen": "clk_time", + "meta": self.meta_info}) -# def done_return(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def btn1_release(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def btn8_press(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def btn8_press(self): -# class CLKTimeScreen(Screen): -# NAME = "clk_time" + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def __init__(self): -# super().__init__() -# self.meta = clk_time_screen -# # alarm_ok.add_event_cb(lambda e: self.handler(e), lv.EVENT.PRESSED, None) +class CLKTimeScreen(Screen): + NAME = "clk_time" + + def __init__(self): + super().__init__() + self.meta = clk_time_screen + # alarm_ok.add_event_cb(lambda e: self.handler(e), lv.EVENT.PRESSED, None) -# def initialization(self): -# roll_1_v = self.meta_info["hour"] -# roll_2_v = self.meta_info["minute"] + def initialization(self): + roll_1_v = self.meta_info["hour"] + roll_2_v = self.meta_info["minute"] -# clk_time_roller_1.set_selected(int(roll_1_v), lv.ANIM.ON) -# clk_time_roller_2.set_selected(int(roll_2_v), lv.ANIM.ON) - -# def handler(self, e): -# option_1 = " " * 10 -# option_2 = " " * 10 -# clk_time_roller_2.get_selected_str(option_2, len(option_2)) -# clk_time_roller_1.get_selected_str(option_1, len(option_1)) -# option_1_strip = option_1.strip()[:2] -# option_2_strip = option_2.strip()[:2] -# print("option_1_strip = {} option_2_strip = {}".format(option_1_strip, option_2_strip)) -# self.meta_info["hour"] = int(option_1_strip) -# self.meta_info["minute"] = int(option_2_strip) -# EventMesh.publish("push_clock_info", self.meta_info) - -# EventMesh.publish("load_screen", {"screen": "clk_list"}) - -# def done_return(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + clk_time_roller_1.set_selected(int(roll_1_v), lv.ANIM.ON) + clk_time_roller_2.set_selected(int(roll_2_v), lv.ANIM.ON) + + def handler(self, e): + option_1 = " " * 10 + option_2 = " " * 10 + clk_time_roller_2.get_selected_str(option_2, len(option_2)) + clk_time_roller_1.get_selected_str(option_1, len(option_1)) + option_1_strip = option_1.strip()[:2] + option_2_strip = option_2.strip()[:2] + print("option_1_strip = {} option_2_strip = {}".format(option_1_strip, option_2_strip)) + self.meta_info["hour"] = int(option_1_strip) + self.meta_info["minute"] = int(option_2_strip) + EventMesh.publish("push_clock_info", self.meta_info) + + EventMesh.publish("load_screen", {"screen": "clk_list"}) + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def btn1_release(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) - -# def btn8_press(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) - -# class ClkPeriod(Screen): -# NAME = "clk_period" - -# def __init__(self): -# super().__init__() -# self.meta = clk_repeat_screen -# self.choice_list=[] -# self.alarm_info={} -# self.clk_switch_list = [ -# clk_repeat_switch6, -# clk_repeat_switch, -# clk_repeat_switch1, -# clk_repeat_switch2, -# clk_repeat_switch3, -# clk_repeat_switch4, -# clk_repeat_switch5, - -# ] - -# clk_repeat_switch.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,1)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,2)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,3)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,4)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch4.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,5)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch5.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,6)), lv.EVENT.VALUE_CHANGED, None) -# clk_repeat_switch6.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,0)), lv.EVENT.VALUE_CHANGED, None) - -# def initialization(self): -# self.choice_list = self.meta_info["days"] -# self.alarm_info = self.meta_info -# print("初始化:{},{}".format(self.alarm_info,self.choice_list)) - - -# for i in range(0,6): -# if i in self.choice_list: -# self.clk_switch_list[i].add_state(lv.STATE.CHECKED) - -# else: -# self.clk_switch_list[i].clear_state(lv.STATE.CHECKED) - - -# def save_choice(self,e,i): -# if i in self.choice_list: -# self.clk_switch_list[i].clear_state(lv.STATE.CHECKED) -# self.choice_list.remove(i) -# print("here1-----",self.choice_list,i) - -# else: -# self.clk_switch_list[i].add_state(lv.STATE.CHECKED) -# self.choice_list.append(i) -# print("here2-----",self.choice_list,i) - -# print("here-----",self.choice_list) -# self.alarm_info["days"] = self.choice_list - -# print("编辑星期:{}".format(self.alarm_info)) -# if self.alarm_info["days"] == []: -# self.alarm_info["repeart"] = 1 -# else: -# num = self.alarm_info["days"] -# if len(num) >= 7: -# self.alarm_info["repeart"] = 2 -# else: -# self.alarm_info["repeart"] = 3 - -# EventMesh.publish("push_clock_info", self.alarm_info) - -# def done_return(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) + + def btn8_press(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) + +class ClkPeriod(Screen): + NAME = "clk_period" + + def __init__(self): + super().__init__() + self.meta = clk_repeat_screen + self.choice_list=[] + self.alarm_info={} + self.clk_switch_list = [ + clk_repeat_switch6, + clk_repeat_switch, + clk_repeat_switch1, + clk_repeat_switch2, + clk_repeat_switch3, + clk_repeat_switch4, + clk_repeat_switch5, + + ] + + clk_repeat_switch.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,1)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,2)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,3)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,4)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch4.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,5)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch5.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,6)), lv.EVENT.VALUE_CHANGED, None) + clk_repeat_switch6.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e,0)), lv.EVENT.VALUE_CHANGED, None) + + def initialization(self): + self.choice_list = self.meta_info["days"] + self.alarm_info = self.meta_info + print("初始化:{},{}".format(self.alarm_info,self.choice_list)) + + + for i in range(0,6): + if i in self.choice_list: + self.clk_switch_list[i].add_state(lv.STATE.CHECKED) + + else: + self.clk_switch_list[i].clear_state(lv.STATE.CHECKED) + + + def save_choice(self,e,i): + if i in self.choice_list: + self.clk_switch_list[i].clear_state(lv.STATE.CHECKED) + self.choice_list.remove(i) + print("here1-----",self.choice_list,i) + + else: + self.clk_switch_list[i].add_state(lv.STATE.CHECKED) + self.choice_list.append(i) + print("here2-----",self.choice_list,i) + + print("here-----",self.choice_list) + self.alarm_info["days"] = self.choice_list + + print("编辑星期:{}".format(self.alarm_info)) + if self.alarm_info["days"] == []: + self.alarm_info["repeart"] = 1 + else: + num = self.alarm_info["days"] + if len(num) >= 7: + self.alarm_info["repeart"] = 2 + else: + self.alarm_info["repeart"] = 3 + + EventMesh.publish("push_clock_info", self.alarm_info) + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def btn1_release(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) -# def btn8_press(self): -# EventMesh.publish("load_screen", {"screen": "clk_list"}) + def btn8_press(self): + EventMesh.publish("load_screen", {"screen": "clk_list"}) diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appAlipay.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py similarity index 84% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appAlipay.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py index f79360d6..b2153193 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appAlipay.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appAlipay.py @@ -13,10 +13,11 @@ import pm from ui import Screen from code import code_128_generate_barcode import code128 +import usys style_font_youyuan_20 = lv.style_t() style_font_youyuan_20.init() style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_20.set_text_font_v2("font_28.bin",28,0) +style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) style_btn_alipay = lv.style_t() style_btn_alipay.init() @@ -38,6 +39,7 @@ class Alipay(Abstract): 支付宝 """ def __init__(self): + self.alipay = None self.imei = modem.getDevImei() if self.imei == None : self.imei = "1111" @@ -49,7 +51,7 @@ class Alipay(Abstract): self.imsi = "1111" self.mac = "123456" self.sn = modem.getDevSN() - if self.sn == "" : + if self.sn == "" or self.sn == -1 or len(self.sn) < 17: self.sn = "{:Z>17}".format(self.imei) self.vendor = "ZHSX" self.product_name = "ZHSX" @@ -61,6 +63,8 @@ class Alipay(Abstract): self.timer_Alipay = osTimer() self.Alipay_Ui_isOpen = 0 self.Alipay_init_flag = 0 + self.is_simcard_identify = 255 + self.is_init = 255 EventMesh.subscribe("alipay_unbind", self.alipay_unbind) EventMesh.subscribe("alipay_1", self.alipay_1) @@ -74,23 +78,10 @@ class Alipay(Abstract): EventMesh.subscribe("get_Alipay_Ui_isOpen",self.get_Alipay_Ui_isOpen) EventMesh.subscribe("set_Alipay_Ui_isOpen",self.set_Alipay_Ui_isOpen) - self.is_simcard_identify = 255 - self.is_init = 255 - self.upay_bound = 0 #绑定结果 - #print("\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',0".format(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self. product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0)) - self.alipay = ALIPAY(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self. product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0) - #print("Alipay init:{}".format(self.alipay)) - #self.alipay = ALIPAY("867387060319491", "898604293619F0549750","460044917509047", "123456", "P1Q22I80C0007530P","ZHIHUISHIXUN", "ZHIHUISHIXUN", "EC800M", "uHTfYqOlGlA" , "a15PcyZ3IHA", "kOGGPhtXAg1Lz1vg",0) - # '826226511997184', '898600811923C9628962','460071677091483', '123456', 'PIQ38706031949100', 'ZHIHUISHIXUN','ZHIHUISHIXUN', 'EG810M', 'uHTfYqOlGlA', 'a15PcyZ3IHA', 'kOGGPhtXAg1Lz1vg',0 - #self.alipay = ALIPAY('826226511997184', '898600811923C9628962', '460071677091483', '123456', "P1Q22I80C0007530P",'ZHSX', 'ZHSX', 'EG810M', 'voPuTFiLcdA', 'a1c7Ojs6HMR', 'TxPFIJ5F1kwa0zO3', 0) - #self.alipay.register_print() - #self.alipay.set_log_limit(5) - self.alipay.set_log_limit(0) - #self.timer_Alipay.start(20000, 1, self.timeout_Alipay) def post_processor_after_instantiation(self): print("post_processor_after_instantiation") - EventMesh.publish_async("Alipay_init","",40*1024) + #EventMesh.publish_async("Alipay_init","",40*1024) def get_Alipay_Ui_isOpen(self, event, msg): @@ -98,6 +89,25 @@ class Alipay(Abstract): def set_Alipay_Ui_isOpen(self, event, msg): self.Alipay_Ui_isOpen = msg def Alipay_init(self, event, msg): + if self.alipay == None or type(self.alipay) == int: + try: + self.is_simcard_identify = 255 + self.is_init = 255 + self.upay_bound = 0 #绑定结果 + print("\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',\'{}\',0".format(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self.product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0)) + self.alipay = ALIPAY(self.imei, self.iccid,self.imsi, self.mac, self.sn,self.vendor, self.product_name, self.product_model, self.pk_alipay , self.pk_aliyun, self.ps_aliyun,0) + #print("Alipay init:{}".format(self.alipay)) + #self.alipay = ALIPAY("867387060319491", "898604293619F0549750","460044917509047", "123456", "P1Q22I80C0007530P","ZHIHUISHIXUN", "ZHIHUISHIXUN", "EC800M", "uHTfYqOlGlA" , "a15PcyZ3IHA", "kOGGPhtXAg1Lz1vg",0) + # '826226511997184', '898600811923C9628962','460071677091483', '123456', 'PIQ38706031949100', 'ZHIHUISHIXUN','ZHIHUISHIXUN', 'EG810M', 'uHTfYqOlGlA', 'a15PcyZ3IHA', 'kOGGPhtXAg1Lz1vg',0 + #self.alipay = ALIPAY('826226511997184', '898600811923C9628962', '460071677091483', '123456', "P1Q22I80C0007530P",'ZHSX', 'ZHSX', 'EG810M', 'voPuTFiLcdA', 'a1c7Ojs6HMR', 'TxPFIJ5F1kwa0zO3', 0) + #self.alipay.register_print() + #self.alipay.set_log_limit(5) + self.alipay.set_log_limit(0) + + #self.timer_Alipay.start(20000, 1, self.timeout_Alipay) + except Exception as e: + usys.print_exception(e) + if self.Alipay_init_flag == 1: print("Alipay_init:reuse!!!!!!!!") #self.Alipay_init_flag = 0 @@ -368,7 +378,7 @@ AlipayOpen_img.set_pos(int(70),int(80)) AlipayOpen_img.set_size(100,100) AlipayOpen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) AlipayOpen_img.add_flag(lv.obj.FLAG.CLICKABLE) -AlipayOpen_img.set_src("E:/static/APP/alipay/1.jpg") +AlipayOpen_img.set_src("U:/static/APP/alipay/1.jpg") AlipayOpen_img.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) @@ -387,6 +397,7 @@ class AlipayOpenScreen(Screen): def __init__(self): super().__init__() self.meta = alipay_open_screen + alipay_open_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.alipay_return_cb(e)), lv.EVENT.GESTURE, None) self.timer_AlipayOpen = osTimer() self.timer_AlipayOpen_count = 0 self.flag = 0 @@ -408,7 +419,7 @@ class AlipayOpenScreen(Screen): #初始化成功 未联网 #初始化失败 已联网 - if (EventMesh.publish(constants.EVENT.GET_CONNECT) == 0 and EventMesh.publish("get_alipay_init") != 0) or EventMesh.publish("get_alipay_init") != 0: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0: AlipayOpen_label.clear_flag(lv.obj.FLAG.HIDDEN) else: AlipayOpen_label.add_flag(lv.obj.FLAG.HIDDEN) @@ -434,7 +445,7 @@ class AlipayOpenScreen(Screen): state = EventMesh.publish(constants.EVENT.GET_CONNECT) print("AlipayOpenScreen:state",state) if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0: - if self.timer_AlipayOpen_count > 10: + if self.timer_AlipayOpen_count > 30: self.timer_AlipayOpen_count = 0 EventMesh.publish("return_prev_screen") else: @@ -445,8 +456,8 @@ class AlipayOpenScreen(Screen): EventMesh.publish("alipay_1") else : #print("timeout_AlipayOpen:!!!!!!!!!!",self.timer_AlipayOpen_count) - if self.timer_AlipayOpen_count>10 or self.timer_AlipayOpen_count == 0: - if self.timer_AlipayOpen_count > 10: + if (self.timer_AlipayOpen_count % 10 == 0) or self.timer_AlipayOpen_count == 0: + if self.timer_AlipayOpen_count > 30: self.timer_AlipayOpen_count = 0 EventMesh.publish("return_prev_screen") return @@ -461,13 +472,25 @@ class AlipayOpenScreen(Screen): def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) + def alipay_return_cb(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def Close(self): self.flag = 0 self.timer_AlipayOpen.stop() EventMesh.publish("set_Alipay_Ui_isOpen",0) pass - + def done_return(self): + EventMesh.publish("return_alipay") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def btn1_release(self): EventMesh.publish("return_alipay") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -487,7 +510,7 @@ alipay_imgbtn_3.set_pos(8,10) alipay_imgbtn_3.set_size(224,69) alipay_imgbtn_3.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) alipay_imgbtn_3.add_flag(lv.obj.FLAG.CLICKABLE) -alipay_imgbtn_3.set_src("E:/static/APP/alipay/1_13.png") +alipay_imgbtn_3.set_src("U:/static/APP/alipay/1_13.png") alipay_imgbtn_3.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #收钱 alipay_imgbtn_2 = lv.img(alipay_1_1_screen) @@ -495,7 +518,7 @@ alipay_imgbtn_2.set_pos(8,86) alipay_imgbtn_2.set_size(224,69) alipay_imgbtn_2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) alipay_imgbtn_2.add_flag(lv.obj.FLAG.CLICKABLE) -alipay_imgbtn_2.set_src("E:/static/APP/alipay/1_12.png") +alipay_imgbtn_2.set_src("U:/static/APP/alipay/1_12.png") alipay_imgbtn_2.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #家长设置 alipay_imgbtn_1 = lv.img(alipay_1_1_screen) @@ -503,7 +526,7 @@ alipay_imgbtn_1.set_pos(8,168) alipay_imgbtn_1.set_size(224,69) alipay_imgbtn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) alipay_imgbtn_1.add_flag(lv.obj.FLAG.CLICKABLE) -alipay_imgbtn_1.set_src("E:/static/APP/alipay/1_11.png") +alipay_imgbtn_1.set_src("U:/static/APP/alipay/1_11.png") alipay_imgbtn_1.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) class Alipay_1_1(Screen): @@ -513,15 +536,16 @@ class Alipay_1_1(Screen): super().__init__() self.timer = osTimer() self.meta = alipay_1_1_screen + alipay_1_1_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,1)), lv.EVENT.GESTURE, None) #付款码 - alipay_imgbtn_3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.alipay_paycode(e)), - lv.EVENT.PRESSED, None) + alipay_imgbtn_3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,2)), + lv.EVENT.SHORT_CLICKED, None) #收钱 - alipay_imgbtn_2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.alipay_collect(e)), - lv.EVENT.PRESSED, None) + alipay_imgbtn_2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,3)), + lv.EVENT.SHORT_CLICKED, None) #家长设置 - alipay_imgbtn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.alipay_parent(e)), - lv.EVENT.PRESSED, None) + alipay_imgbtn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,4)), + lv.EVENT.SHORT_CLICKED, None) def initialization(self): EventMesh.publish("set_Alipay_Ui_isOpen",1) @@ -529,9 +553,33 @@ class Alipay_1_1(Screen): def Close(self): EventMesh.publish("set_Alipay_Ui_isOpen",0) pass - + + def calling_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + self.timer.start(1*1000,1,self.fun) + elif msg == 3: + EventMesh.publish("get_collect_code") + elif msg == 4: + EventMesh.publish("get_parent_code") + def alipay_paycode(self,e): - self.timer.start(1*1000,1,self.fun) + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + self.timer.start(1*1000,1,self.fun) # Alipay.alipay.msg_send(3,"","") #发送获取付款码消息 def fun(self,*agrc): @@ -547,13 +595,30 @@ class Alipay_1_1(Screen): # EventMesh.publish("get_payment_code") def alipay_collect(self,e): - EventMesh.publish("get_collect_code") + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + + EventMesh.publish("get_collect_code") # EventMesh.publish("load_screen", {"screen": "alipay_collect"}) def Close(self): self.timer.stop() def alipay_parent(self,e): - EventMesh.publish("get_parent_code") + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + EventMesh.publish("get_parent_code") def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -575,7 +640,7 @@ alipay_invite_screen.add_style(style_alipay_screen_default, lv.PART.MAIN|lv.STAT alipay_invite_bg = lv.img(alipay_invite_screen) alipay_invite_bg.center() alipay_invite_bg.set_size(240,320) -alipay_invite_bg.set_src("E:/static/APP/alipay/1_2.png") +alipay_invite_bg.set_src("U:/static/APP/alipay/1_2.png") alipay_invite_bg.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #提示词 @@ -602,6 +667,7 @@ class Alipay_invite(Screen): def __init__(self): super().__init__() self.meta = alipay_invite_screen + alipay_invite_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), lv.EVENT.GESTURE, None) self.alipay_invite_time = osTimer() @@ -617,6 +683,15 @@ class Alipay_invite(Screen): print("alipay_invite:",str(self.meta_info)) alipay_invite_alipay_qr.update(self.alipay_qr_data,len(self.alipay_qr_data)) + def calling_cb(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def alipay_invite(self, *args): print("alipay_invite:") EventMesh.publish("system_sleep_rest")#防止黑屏 @@ -677,7 +752,9 @@ class Alipay_inviting(Screen): self.timer_alipay_inviting.stop() EventMesh.publish("set_Alipay_Ui_isOpen",0) pass - + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def btn1_release(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -695,7 +772,7 @@ alipay_success_screen.add_style(style_alipay_screen_default, lv.PART.MAIN|lv.STA alipay_success_bg = lv.img(alipay_success_screen) alipay_success_bg.set_pos(56,30) alipay_success_bg.set_size(128,127) -alipay_success_bg.set_src("E:/static/APP/alipay/1_2_1.png") +alipay_success_bg.set_src("U:/static/APP/alipay/1_2_1.png") alipay_success_bg.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #提示词 @@ -730,7 +807,10 @@ class Alipay_success(Screen): self.timer_Alipay_success.stop() EventMesh.publish("set_Alipay_Ui_isOpen",0) pass - + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def btn1_release(self): EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) @@ -821,7 +901,7 @@ alipay_paycode_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DE style_font_youyuan_black_20 = lv.style_t() style_font_youyuan_black_20.init() style_font_youyuan_black_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -style_font_youyuan_black_20.set_text_font_v2("font_28.bin",28,0) +style_font_youyuan_black_20.set_text_font(lv.K01_font_16_ALL) # alipay_barcode_num = lv.label(alipay_paycode_screen) # alipay_barcode_num.set_pos(0, 130) @@ -905,6 +985,7 @@ class Alipay_paycode(Screen): def __init__(self): super().__init__() self.meta = alipay_paycode_screen + alipay_paycode_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun_bt(e)), lv.EVENT.GESTURE, None) self.timer = osTimer() EventMesh.subscribe("set_alipay_code",self.set_alipay_code) EventMesh.subscribe("get_alipay_code",self.get_alipay_code) @@ -921,6 +1002,15 @@ class Alipay_paycode(Screen): alipay_paycode_alipay_qr.update(self.alipay_qr_data,len(self.alipay_qr_data)) self.update_page_state = code_128_generate_barcode1(alipay_paycode_screen,self.alipay_qr_data,240,100) + def fun_bt(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) + def initialization(self): print("alipay_paycode:initialization") self.count = 0 @@ -974,6 +1064,8 @@ class Alipay_paycode(Screen): EventMesh.publish("get_payment_code") EventMesh.publish("publish_message_event_ui",{"func":self.update_show,"data":0}) + # def done_left_to_right(self): + def done_return(self): EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) @@ -982,6 +1074,7 @@ class Alipay_paycode(Screen): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -995,7 +1088,7 @@ alipay_pay_success_screen.add_style(style_alipay_screen_default, lv.PART.MAIN|lv alipay_pay_bg = lv.img(alipay_pay_success_screen) alipay_pay_bg.set_pos(82, 120) alipay_pay_bg.set_size(78,78) -alipay_pay_bg.set_src("E:/static/APP/alipay/1_13_1_1.png") +alipay_pay_bg.set_src("U:/static/APP/alipay/1_13_1_1.png") alipay_pay_bg.add_flag(lv.obj.FLAG.CLICKABLE) alipay_pay_bg.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) @@ -1043,14 +1136,17 @@ class Alipay_pay_success(Screen): def Close(self): EventMesh.publish("set_Alipay_Ui_isOpen",0) pass + def done_left_to_right(self): + EventMesh.publish("load_screen", {"screen": "alipay_paycode"}) def done_return(self): - EventMesh.publish("load_screen", {"screen": "main_menu"}) + EventMesh.publish("load_screen", {"screen": "alipay_paycode"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) alipay_collect_screen = lv.obj() @@ -1083,7 +1179,7 @@ class Alipay_collect(Screen): def __init__(self): super().__init__() self.meta = alipay_collect_screen - + alipay_collect_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) def initialization(self): @@ -1097,6 +1193,14 @@ class Alipay_collect(Screen): def Close(self): EventMesh.publish("set_Alipay_Ui_isOpen",0) pass + def fun(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) def done_return(self): EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) @@ -1105,6 +1209,7 @@ class Alipay_collect(Screen): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) alipay_parent_screen = lv.obj() @@ -1117,7 +1222,7 @@ alipay_parent_screen.add_style(style_alipay_screen_default, lv.PART.MAIN|lv.STAT alipay_parent_bg = lv.img(alipay_parent_screen) alipay_parent_bg.set_pos(8,12) alipay_parent_bg.set_size(81,81) -alipay_parent_bg.set_src("E:/static/APP/alipay/1_11_1.png") +alipay_parent_bg.set_src("U:/static/APP/alipay/1_11_1.png") alipay_parent_bg.add_style(style_alipay_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) #提示词 @@ -1150,7 +1255,7 @@ alipay_parent_bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5) alipay_parent_fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4) alipay_parent_alipay_qr = lv.qrcode(alipay_parent_screen, 150, alipay_parent_fg_color, alipay_parent_bg_color) -alipay_parent_alipay_qr.set_pos(45,171) +alipay_parent_alipay_qr.set_pos(45,120) # Add a border with bg_color alipay_parent_alipay_qr.set_style_border_color(alipay_parent_bg_color, 0) alipay_parent_alipay_qr.set_style_border_width(5, 0) @@ -1162,10 +1267,11 @@ class Alipay_parent(Screen): def __init__(self): super().__init__() self.meta = alipay_parent_screen - + alipay_parent_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) def initialization(self): + EventMesh.publish("set_Alipay_Ui_isOpen",1) def post_processor_after_initialization(self): @@ -1175,13 +1281,22 @@ class Alipay_parent(Screen): def Close(self): EventMesh.publish("set_Alipay_Ui_isOpen",0) - pass + + def fun(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) def done_return(self): - EventMesh.publish("load_screen", {"screen": "alipay_1_1"}) + EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py new file mode 100644 index 00000000..12121e2c --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appFactoryMode.py @@ -0,0 +1,723 @@ +import osTimer +import lvgl as lv +import EventMesh +import osTimer +import constants +import ujson +import ql_fs +import audio +from machine import Pin +from ui import style_screen,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn +import audio +import utime +#import ALIPAY +import usys +from misc import Power +factorymode_cont_y = 0 +factorymode_screen = lv.obj() +print("factorymode_screen") +factorymode_screen.center() +factorymode_screen.set_size(240, 320) +factorymode_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +style_btn_1 = lv.style_t() +style_btn_1.init() +style_btn_1.set_bg_opa(0) +style_btn_1.set_shadow_opa(0) +style_btn_1.set_border_width(0) +style_btn_1.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) +style_btn_1.set_bg_grad_color(lv.color_make(0x00, 0xff, 0x2a)) +style_btn_1.set_bg_grad_dir(lv.GRAD_DIR.NONE) + +style_font_W_B_28 = lv.style_t() +style_font_W_B_28.init() +style_font_W_B_28.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_W_B_28.set_text_font(lv.K01_font_16_ALL) +style_font_W_B_28.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) + +factorymode_title = lv.label(factorymode_screen) +factorymode_title.set_pos(0, 10) +factorymode_title.set_size(240, 40) +factorymode_title.set_text("-工厂模式-") +factorymode_title.set_long_mode(lv.label.LONG.WRAP) +factorymode_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +factorymode_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_cont_style = lv.style_t() +factorymode_cont_style.init() +factorymode_cont_style.set_radius(0) +factorymode_cont_style.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +factorymode_cont_style.set_bg_grad_color(lv.color_make(0x00, 0x00, 0x00)) +factorymode_cont_style.set_bg_grad_dir(lv.GRAD_DIR.VER) +factorymode_cont_style.set_bg_opa(255) +factorymode_cont_style.set_border_width(0) +factorymode_cont_style.set_pad_left(0) +factorymode_cont_style.set_pad_right(0) +factorymode_cont_style.set_pad_top(0) +factorymode_cont_style.set_pad_bottom(0) + +factorymode_cont = lv.obj(factorymode_screen) +factorymode_cont.set_pos(0, 50) +factorymode_cont.set_size(240, 270) +factorymode_cont.add_style(factorymode_cont_style,lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_location = lv.btn(factorymode_cont) +factorymode_location.set_pos(0, factorymode_cont_y) +factorymode_location.set_size(240, 60) +factorymode_location_label = lv.label(factorymode_location) +factorymode_location_label.set_text("定位测试") +factorymode_location.set_style_pad_all(0, lv.STATE.DEFAULT) +factorymode_location_label.align(lv.ALIGN.LEFT_MID, 70, 0) +factorymode_location_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +factorymode_location_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +factorymode_location.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_cont_y+=60 +factorymode_bat_test = lv.btn(factorymode_cont) +factorymode_bat_test.set_pos(0, factorymode_cont_y) +factorymode_bat_test.set_size(240, 60) +factorymode_bat_test_label = lv.label(factorymode_bat_test) +factorymode_bat_test_label.set_text("电池测试") +factorymode_bat_test.set_style_pad_all(0, lv.STATE.DEFAULT) +factorymode_bat_test_label.align(lv.ALIGN.LEFT_MID, 70, 0) +factorymode_bat_test_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +factorymode_bat_test_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +factorymode_bat_test.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_cont_y+=60 +factorymode_hsensor_test = lv.btn(factorymode_cont) +factorymode_hsensor_test.set_pos(0, factorymode_cont_y) +factorymode_hsensor_test.set_size(240, 60) +factorymode_hsensor_test_label = lv.label(factorymode_hsensor_test) +factorymode_hsensor_test_label.set_text("心率测试") +factorymode_hsensor_test.set_style_pad_all(0, lv.STATE.DEFAULT) +factorymode_hsensor_test_label.align(lv.ALIGN.LEFT_MID, 70, 0) +factorymode_hsensor_test_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +factorymode_hsensor_test_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +factorymode_hsensor_test.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_cont_y+=60 +factorymode_step = lv.btn(factorymode_cont) +factorymode_step.set_pos(0, factorymode_cont_y) +factorymode_step.set_size(240, 60) +factorymode_step_label = lv.label(factorymode_step) +factorymode_step_label.set_text("计步测试") +factorymode_step.set_style_pad_all(0, lv.STATE.DEFAULT) +factorymode_step_label.align(lv.ALIGN.LEFT_MID, 70, 0) +factorymode_step_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +factorymode_step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +factorymode_step.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +factorymode_cont_y+=60 +factorymode_log = lv.btn(factorymode_cont) +factorymode_log.set_pos(0, factorymode_cont_y) +factorymode_log.set_size(240, 60) +factorymode_log_label = lv.label(factorymode_log) +factorymode_log_label.set_text("日志") +factorymode_log.set_style_pad_all(0, lv.STATE.DEFAULT) +factorymode_log_label.align(lv.ALIGN.LEFT_MID, 70, 0) +factorymode_log_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +factorymode_log_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +factorymode_log.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + +# factorymode_cont_y+=200 +# factorymode_alipay_init = lv.btn(factorymode_cont) +# factorymode_alipay_init.set_pos(0, factorymode_cont_y) +# factorymode_alipay_init.set_size(240, 60) +# factorymode_alipay_init_label = lv.label(factorymode_alipay_init) +# factorymode_alipay_init_label.set_text("支付宝初始化") +# factorymode_alipay_init.set_style_pad_all(0, lv.STATE.DEFAULT) +# factorymode_alipay_init_label.align(lv.ALIGN.LEFT_MID, 70, 0) +# factorymode_alipay_init_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# factorymode_alipay_init_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# factorymode_alipay_init.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + + +class FactoryModeScreen(Screen): + NAME = "factorymode" + def __init__(self): + super().__init__() + self.is_sliding = 0 + self.meta = factorymode_screen + factorymode_location.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeLocation")), lv.EVENT.SHORT_CLICKED, None) + #factorymode_alipay_init.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "FactoryModeAlipayInit"})), lv.EVENT.CLICKED, None) + factorymode_bat_test.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeBatTest")), lv.EVENT.SHORT_CLICKED, None) + factorymode_hsensor_test.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeHsensorTest")), lv.EVENT.SHORT_CLICKED, None) + factorymode_log.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeLog")), lv.EVENT.SHORT_CLICKED, None) + factorymode_step.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModestep")), lv.EVENT.SHORT_CLICKED, None) + + factorymode_location.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeLocation")), lv.EVENT.PRESSING, None) + #factorymode_alipay_init.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "FactoryModeAlipayInit"})), lv.EVENT.CLICKED, None) + factorymode_bat_test.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeBatTest")), lv.EVENT.PRESSING, None) + factorymode_hsensor_test.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeHsensorTest")), lv.EVENT.PRESSING, None) + factorymode_log.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModeLog")), lv.EVENT.PRESSING, None) + + factorymode_step.add_event_cb(lambda e: EventMesh.callback_wrapper(self.location_mode(e, "FactoryModestep")), lv.EVENT.PRESSING, None) + + def initialization(self): + self.is_sliding = 0 + pass + + def location_mode(self, e, msg): + code = e.get_code() + EventMesh.publish("publish_message_event_ui",{"func":self.location_mode_do,"data":[code,msg]}) + def location_mode_do(self, data): + #code = e.get_code() + + code = data[0] + msg = data[1] + + #print("code!!!!!!!!",code,msg) + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) + print("2self.is_sliding",self.is_sliding) + + self.is_sliding =0 + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +#显示txt日志 +FactoryModeLog_screen = lv.obj() +FactoryModeLog_screen.center() +FactoryModeLog_screen.set_size(240, 320) +FactoryModeLog_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + +FactoryModeLog_label_obj = lv.obj(FactoryModeLog_screen) +FactoryModeLog_label_obj.center() +FactoryModeLog_label_obj.set_size(240, 290) +FactoryModeLog_label_obj.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeLog_label_obj.set_pos(0, 0) + +FactoryModeLog_label = lv.label(FactoryModeLog_label_obj) +FactoryModeLog_label.set_text("") +FactoryModeLog_label.set_size(240, lv.SIZE.CONTENT) +FactoryModeLog_label.set_pos(0, 10) +FactoryModeLog_label.set_long_mode(lv.label.LONG.WRAP) +FactoryModeLog_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +FactoryModeLog_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeLogClean_btn = lv.btn(FactoryModeLog_screen) +FactoryModeLogClean_btn.set_pos(5, 290) +FactoryModeLogClean_btn.set_size(110, 30) +FactoryModeLogClean_btn.add_style(style_btn_1, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeLogClean_btn.set_style_pad_all(0, lv.STATE.DEFAULT) +FactoryModeLogClean_label = lv.label(FactoryModeLogClean_btn) +FactoryModeLogClean_label.set_text("清空日志") +FactoryModeLogClean_label.align(lv.ALIGN.CENTER, 0, 0) +FactoryModeLogClean_label.add_style(style_font_W_B_28, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeLogClean_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +FactoryModeLogClean_label.set_style_text_color(lv.color_make(0x16, 0x2c, 0xd4), lv.STATE.DEFAULT) +#FactoryModeLogClean_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeLogNext_btn = lv.btn(FactoryModeLog_screen) +FactoryModeLogNext_btn.set_pos(120, 290) +FactoryModeLogNext_btn.set_size(110, 30) +FactoryModeLogNext_btn.add_style(style_btn_1, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeLogNext_btn.set_style_pad_all(0, lv.STATE.DEFAULT) +FactoryModeLogNext_label = lv.label(FactoryModeLogNext_btn) +FactoryModeLogNext_label.set_text("下一页") +FactoryModeLogNext_label.align(lv.ALIGN.CENTER, 0, 0) +FactoryModeLogNext_label.add_style(style_font_W_B_28, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeLogNext_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +FactoryModeLogNext_label.set_style_text_color(lv.color_make(0x16, 0x2c, 0xd4), lv.STATE.DEFAULT) +#FactoryModeLogNext_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) +screen_log_len = 250 +class FactoryModeLogScreen(Screen): + NAME = "FactoryModeLog" + def __init__(self): + super().__init__() + self.meta = FactoryModeLog_screen + self.Log_timer_count = 0 + self.Log_timer = osTimer() + self.log_data = "" + self.log_count = 0 + FactoryModeLogClean_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.LogClean_cb(e)), lv.EVENT.SHORT_CLICKED, None) + FactoryModeLogNext_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.LogNext_cb(e)), lv.EVENT.SHORT_CLICKED, None) + def initialization(self): + print("FactoryModeLogScreen") + self.Log_timer.start(1000,1,self.Log_timer_cb) + with open("/usr/log.txt","r",encoding="utf-8") as fd: + self.log_data = fd.read() + print(self.log_data) + if len(self.log_data) < screen_log_len: + FactoryModeLog_label.set_text("第1页\n"+self.log_data) + else: + FactoryModeLog_label.set_text("第1页 {}/{}\n".format(self.log_count+1,0,len(self.log_data))+self.log_data[:screen_log_len]) + self.log_count = 0 + def post_processor_after_initialization(self): + pass + + def LogClean_cb(self,e): + self.log_data = "" + with open("/usr/log.txt","w",encoding="utf-8") as fd: + fd.write("") + + def LogNext_cb(self,e): + self.log_count += 1 + if self.log_count*screen_log_len > len(self.log_data): + if self.log_count != 1: + FactoryModeLog_label.set_text("末尾页\n".format(self.log_count+1)+self.log_data[(self.log_count-1)*screen_log_len:]) + self.log_count = 0 + else : + FactoryModeLog_label.set_text("第{}页 {}/{}\n".format(self.log_count+1,(self.log_count)*screen_log_len,len(self.log_data))+self.log_data[(self.log_count-1)*screen_log_len:(self.log_count)*screen_log_len]) + + def Log_timer_cb(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + + + def Close(self): + self.Log_timer.stop() + self.log_data = "" + pass + + + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) +#显示x y z 三轴数据 +FactoryModestep_screen = lv.obj() +FactoryModestep_screen.center() +FactoryModestep_screen.set_size(240, 284) +FactoryModestep_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + +FactoryMode_step_label = lv.label(FactoryModestep_screen) +FactoryMode_step_label.set_text(" ") +FactoryMode_step_label.set_pos(0, 40) +FactoryMode_step_label.set_size(240, 40) +FactoryMode_step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryMode_step_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + +FactoryMode_xyz_label = lv.label(FactoryModestep_screen) +FactoryMode_xyz_label.set_text(" ") +FactoryMode_xyz_label.set_pos(0, 100) +FactoryMode_xyz_label.set_size(240, 100) +FactoryMode_xyz_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryMode_xyz_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +#FactoryModeLogNext_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) + +class FactoryModestepScreen(Screen): + NAME = "FactoryModestep" + def __init__(self): + super().__init__() + self.meta = FactoryModestep_screen + self.Log_timer_count = 0 + self.Log_timer = osTimer() + + def initialization(self): + step = EventMesh.publish(constants.EVENT.GET_STEP) + FactoryMode_step_label.set_text("步数{}".format(step[0])) + FactoryMode_xyz_label.set_text("X:{}\nY:{}\nZ:{}".format(step[1],step[2],step[3])) + self.Log_timer.start(1*1000,1,self.step_cb) + + def post_processor_after_initialization(self): + + pass + + def step_cb(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + step = EventMesh.publish(constants.EVENT.GET_STEP) + print("FactoryModestepScreen",step) + FactoryMode_step_label.set_text("步数{}".format(step[0])) + FactoryMode_xyz_label.set_text("X:{}\nY:{}\nZ:{}".format(step[1],step[2],step[3])) + pass + + + + def Close(self): + self.Log_timer.stop() + self.log_data = "" + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + +#hsensor测试 +FactoryModeHsensorTest_screen = lv.obj() +FactoryModeHsensorTest_screen.center() +FactoryModeHsensorTest_screen.set_size(240, 284) +FactoryModeHsensorTest_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeHsensorTest_label = lv.label(FactoryModeHsensorTest_screen) +FactoryModeHsensorTest_label.set_text(" 佩戴状态") +FactoryModeHsensorTest_label.set_size(240, 260) +FactoryModeHsensorTest_label.set_pos(0, 0) +FactoryModeHsensorTest_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +FactoryModeHsensorTest_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeHsensorCali_btn = lv.btn(FactoryModeHsensorTest_screen) +FactoryModeHsensorCali_btn.set_pos(5, 260) +FactoryModeHsensorCali_btn.set_size(110, 35) +FactoryModeHsensorCali_btn.add_style(style_btn_1, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeHsensorCali_btn.set_style_pad_all(0, lv.STATE.DEFAULT) +FactoryModeHsensorCali_label = lv.label(FactoryModeHsensorCali_btn) +FactoryModeHsensorCali_label.set_text("活体校准") +FactoryModeHsensorCali_label.align(lv.ALIGN.CENTER, 0, 0) +FactoryModeHsensorCali_label.add_style(style_font_W_B_28, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeHsensorCali_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +FactoryModeHsensorCali_label.set_style_text_color(lv.color_make(0x16, 0x2c, 0xd4), lv.STATE.DEFAULT) +#FactoryModeHsensorCali_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeHsensorLeakLight_btn = lv.btn(FactoryModeHsensorTest_screen) +FactoryModeHsensorLeakLight_btn.set_pos(120, 260) +FactoryModeHsensorLeakLight_btn.set_size(110, 35) +FactoryModeHsensorLeakLight_btn.add_style(style_btn_1, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeHsensorLeakLight_btn.set_style_pad_all(0, lv.STATE.DEFAULT) +FactoryModeHsensorLeakLight_label = lv.label(FactoryModeHsensorLeakLight_btn) +FactoryModeHsensorLeakLight_label.set_text("漏光检测") +FactoryModeHsensorLeakLight_label.align(lv.ALIGN.CENTER, 0, 0) +FactoryModeHsensorLeakLight_label.add_style(style_font_W_B_28, lv.PART.MAIN | lv.STATE.DEFAULT) +FactoryModeHsensorLeakLight_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +FactoryModeHsensorLeakLight_label.set_style_text_color(lv.color_make(0x16, 0x2c, 0xd4), lv.STATE.DEFAULT) +#FactoryModeHsensorLeakLight_label.set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) + +class FactoryModeHsensorTestScreen(Screen): + NAME = "FactoryModeHsensorTest" + def __init__(self): + super().__init__() + self.meta = FactoryModeHsensorTest_screen + self.hsensorTest_timer_count = 0 + self.hsensorTest_timer = osTimer() + self.Hsensor = None + FactoryModeHsensorCali_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.HsensorCali_cb(e)), lv.EVENT.SHORT_CLICKED, None) + FactoryModeHsensorLeakLight_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.HsensorLeakLight_cb(e)), lv.EVENT.SHORT_CLICKED, None) + def initialization(self): + print("FactoryModeHsensorTestScreen") + self.hsensorTest_timer.start(1000,1,self.hsensorTest_timer_cb) + if self.Hsensor == None: + self.Hsensor = EventMesh.publish("get_Hsensor") + #EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN) + def post_processor_after_initialization(self): + pass + + def HsensorCali_cb(self,e): + print("打开校准模式") + self.Hsensor.set_sar(1) + self.Hsensor.open_test(255) #打开校准模式 + utime.sleep_ms(1000) + self.Hsensor.open_heart() + self.hsensorTest_timer_count = 5 + + def HsensorLeakLight_cb(self,e): + print("打开漏光检测") + self.Hsensor.open_test(6) #打开漏光检测 + # utime.sleep_ms(500) + # self.Hsensor.open_heart() + self.hsensorTest_timer_count = 5 + + def hsensorTest_timer_cb(self,e): + + EventMesh.publish("system_sleep_rest")#防止黑屏 + w_data = EventMesh.publish(constants.EVENT.GET_WEAR)#佩戴数据 + + #print("FactoryModeHsensorTest{}".format(data)) + try: + c_data = self.Hsensor.get_test_data()#校准数据和工厂数据 + text_data = " 佩戴状态\n红外:{}活体:{}佩戴:{}\n{},{} \n{},{} \n{},{}\n校准数据:{},{},{},{}\n漏光数据:{},{},{}".format( + c_data[3],c_data[4],w_data,c_data[5],c_data[6],c_data[7],c_data[8],c_data[9],c_data[10], + c_data[11],c_data[12],c_data[13],c_data[14],c_data[0],c_data[1],c_data[2],) + FactoryModeHsensorTest_label.set_text(text_data) + #print("aaa:{},{},{}".format(c_data[9],c_data[13],c_data[14])) + except Exception as e: + FactoryModeHsensorTest_label.set_text("佩戴状态:\n{}".format(w_data)) + if(self.hsensorTest_timer_count != 0): + self.hsensorTest_timer_count -= 1 + if self.hsensorTest_timer_count == 0: + self.Hsensor.close() + utime.sleep_ms(500) + self.Hsensor.init() + + def Close(self): + self.hsensorTest_timer.stop() + #EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +#电池测试 +FactoryModeBatTest_screen = lv.obj() +FactoryModeBatTest_screen.center() +FactoryModeBatTest_screen.set_size(240, 284) +FactoryModeBatTest_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeBatTest_label = lv.label(FactoryModeBatTest_screen) +FactoryModeBatTest_label.set_text("Vbat:0V") +FactoryModeBatTest_label.set_size(240, 100) +FactoryModeBatTest_label.set_pos(0, 100) +FactoryModeBatTest_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +FactoryModeBatTest_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +FactoryModeBatTest_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +class FactoryModeBatTestScreen(Screen): + NAME = "FactoryModeBatTest" + def __init__(self): + super().__init__() + self.meta = FactoryModeBatTest_screen + self.BatTest_timer = osTimer() + + def initialization(self): + print("FactoryModeBatTestScreen") + self.BatTest_timer.start(1000,1,self.BatTest_timer_cb) + + def post_processor_after_initialization(self): + pass + + def BatTest_timer_cb(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + temp = Power.getVbatt() + FactoryModeBatTest_label.set_text("Vbat:{}V".format(temp)) + + def Close(self): + self.BatTest_timer.stop() + pass + def done_return(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +# FactoryModeAlipayInit_screen = lv.obj() +# FactoryModeAlipayInit_screen.center() +# FactoryModeAlipayInit_screen.set_size(240, 320) +# FactoryModeAlipayInit_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +# FactoryModeAlipayInit_label = lv.label(FactoryModeAlipayInit_screen) +# FactoryModeAlipayInit_label.set_text("支付宝初始化成功") +# FactoryModeAlipayInit_label.set_size(240, 100) +# FactoryModeAlipayInit_label.set_pos(50, 100) +# FactoryModeAlipayInit_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# FactoryModeAlipayInit_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# import atcmd + +# class FactoryModeAlipayInitScreen(Screen): +# NAME = "FactoryModeAlipayInit" +# def __init__(self): +# super().__init__() +# self.meta = FactoryModeAlipayInit_screen + +# def initialization(self): +# ret =EventMesh.publish("id2_clean_data") +# print("id2_clean_data:ret:{}".format(ret)) + +# def post_processor_after_initialization(self): +# resp=bytearray(50) +# atcmd.sendSync('AT+RSTSET\r\n',resp,'',200) #清nv +# print("AT+RSTSET:{}".format(resp)) +# utime.sleep(5) +# Power.powerRestart() +# def Close(self): +# pass + +# def done_return(self): +# EventMesh.publish("load_screen", {"screen": "factorymode"}) + +# def btn1_release(self): +# EventMesh.publish("load_screen", {"screen": "factorymode"}) + +# def btn8_press(self): +# EventMesh.publish("load_screen", {"screen": "main_menu"}) + +FactoryModeLocation_screen = lv.obj() +print("FactoryModeLocation_screen") +FactoryModeLocation_screen.center() +FactoryModeLocation_screen.set_size(240, 320) +FactoryModeLocation_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +# FactoryModeLocation_WIFI_label = lv.label(FactoryModeLocation_screen) +# FactoryModeLocation_WIFI_label.set_text("WIFI:") +# FactoryModeLocation_WIFI_label.set_size(240, 120) +# FactoryModeLocation_WIFI_label.set_pos(0, 0) +# FactoryModeLocation_WIFI_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# FactoryModeLocation_WIFI_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# FactoryModeLocation_CALL_label = lv.label(FactoryModeLocation_screen) +# FactoryModeLocation_CALL_label.set_text("CALL:") +# FactoryModeLocation_CALL_label.set_size(240, 100) +# FactoryModeLocation_CALL_label.set_pos(0, 120) +# FactoryModeLocation_CALL_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# FactoryModeLocation_CALL_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +FactoryModeLocation_GNSS_label = lv.label(FactoryModeLocation_screen) +FactoryModeLocation_GNSS_label.set_text("GNSS:\n") +FactoryModeLocation_GNSS_label.set_size(240, lv.SIZE.CONTENT) +FactoryModeLocation_GNSS_label.set_pos(0, 10) +FactoryModeLocation_GNSS_label.set_long_mode(lv.label.LONG.WRAP) +FactoryModeLocation_GNSS_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +FactoryModeLocation_GNSS_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +class FactoryModeLocationScreen(Screen): + NAME = "FactoryModeLocation" + def __init__(self): + super().__init__() + self.meta = FactoryModeLocation_screen + EventMesh.subscribe("PUSH_LOCATION_DATA",self.GET_LOCATION_DATA) + self.timer_FactoryModeLocation = osTimer() + self.time_count = 0 + self.time_GNSS = 0 + self.GNSS_status = 0 + self.timer_c = 0 + def initialization(self): + FactoryModeLocation_GNSS_label.set_text("GNSS:\n") + # FactoryModeLocation_WIFI_label.set_text("WIFI:") + # FactoryModeLocation_CALL_label.set_text("CALL:") + self.timer_FactoryModeLocation.start(1000, 1, self.timer_FactoryModeLocation_cb) + self.time_count = utime.mktime(utime.localtime()) + self.time_GNSS = 0 + self.GNSS_status = 0 + def post_processor_after_initialization(self): + #utime.sleep_ms(1000) + EventMesh.publish(constants.EVENT.START_LOCATION_TEST) #测试模式 + + def timer_FactoryModeLocation_cb(self, *args, **kwargs): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer_c += 1 + if self.timer_c >= 7: + get_location_flag = EventMesh.publish("get_location_flag") + self.timer_c = 0 + if get_location_flag != None: + if(get_location_flag == 0): + EventMesh.publish(constants.EVENT.START_LOCATION_TEST) #测试模式 + self.time_count = utime.mktime(utime.localtime()) + + def GET_LOCATION_DATA(self, event, msg): + # print("GPS:{}".format(msg[0])) + # print("WIFI:{}".format(msg[1])) + # print("CALL:{}".format(msg[2])) + EventMesh.publish("system_sleep_rest")#防止黑屏 + _DATA = "" + time_tmp = utime.mktime(utime.localtime()) + + + if len(msg[0]) > 1 : #GPS + GNSS_DATA = "GNSS:------\n" + gnss_data = msg[0][0] + if gnss_data : + GNSS_DATA = GNSS_DATA + "{},{},{}\n".format("A",gnss_data["latitude"],gnss_data["longitude"]) + + self.time_GNSS = time_tmp-self.time_count + EventMesh.txt_log("test location time:{}".format(self.time_GNSS)) + self.time_count = utime.mktime(utime.localtime()) + else: + + GNSS_DATA = GNSS_DATA + "{},{},{}\n".format("V",0,0) + _DATA += "定位时间:{};{}秒\n".format(self.time_GNSS,time_tmp-self.time_count) + + GSV_dict = msg[0][1] + #print("GET_LOCATION_DATA:{}".format(GSV_dict)) + if GSV_dict : + count = 0 + try: + for j in range(200): + for key in GSV_dict : + + if(key != j): + continue + #print("GSV_dict[key]:len:{}".format(len(GSV_dict[key]))) + if GSV_dict[key] >= 1 : + GNSS_DATA+=" {:<3}:[{:<3}] ".format(key,GSV_dict[key])#:<3 宽度为3左对齐 + count+=1 + if count % 2 == 0: + GNSS_DATA+="\n" + + if count > 50: + break + except Exception as e: + usys.print_exception(e) + #print("GxGSV:{}".format(GNSS_DATA)) + _DATA += GNSS_DATA + #FactoryModeLocation_GNSS_label.set_text(GNSS_DATA) + if msg[1] != [] : #WIFI + WIFI_len = len(msg[1][1]) + _DATA += "\nWIFI:------\n" + if WIFI_len > 3: + WIFI_len = 3 + for i in range(WIFI_len) : + _DATA += "{}".format(msg[1][1][i]) + if msg[2] != [] :#基站 + #print("CALL data:".format(msg[2][0])) + if len(msg[2]) >= 2 : + _DATA += "CALL:------\n{}".format(msg[2][0]) + #FactoryModeLocation_CALL_label.set_text("CALL:{}".format(msg[2][0])) + print("GET_LOCATION_DATA:data:{}".format(_DATA)) + FactoryModeLocation_GNSS_label.set_text(_DATA) + self.timer_c = 0 + def Close(self): + EventMesh.publish(constants.EVENT.CLOSE_LOCATION) + self.timer_FactoryModeLocation.stop() + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "factorymode"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appWechat.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appWechat.py similarity index 87% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appWechat.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appWechat.py index 5cc30794..d95b5eb3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/appWechat.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/appWechat.py @@ -1,35 +1,19 @@ -import osTimer import lvgl as lv import EventMesh +import osTimer import constants import ujson import ql_fs -from ui import style_font_youyuan_20,style_font_youyuan_20_red,style_screen,Screen,style_font_youyuan_20_black,style_img +from ui import style_font_youyuan_20,style_screen,Screen,style_font_youyuan_20_black,style_img,LCD_SIZE_H,LCD_SIZE_W import audio from machine import Pin import utime -import _thread from protocol import ProtoCol,UnicodeHexStr_To_Utf8Str import usys import log -import base64 -import uwebsocket -import sys -import time -import _thread -#本示例演示将分开到达设备的两条长两条短信合并为一条短信 -#本例演示要求短信索引值0和短信索引值1的短信同一条长短信的内容 -import uhashlib -import ubinascii - -import queue -import EventMesh -SHA1 = uhashlib.sha1 -LCD_X = 128 -LCD_Y = 128 Testlog = log.getLogger("WechatLog") log.set_output(usys.stdout) -is_appwechat_log = 1 +is_appwechat_log = 0 def Wechat_log(str): if(is_appwechat_log == 1) : Testlog.info(str) @@ -46,35 +30,19 @@ style_wechat_s_btn.init() style_wechat_s_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) style_wechat_s_btn.set_border_width(0) style_wechat_s_btn.set_shadow_opa(0) -style_wechat_s_btn.set_border_width(0) -style_wechat_s_btn.set_pad_left(0) -style_wechat_s_btn.set_pad_right(0) -style_wechat_s_btn.set_pad_top(0) -style_wechat_s_btn.set_pad_bottom(0) - style_common_bg_rect_btn_pressed = lv.style_t() style_common_bg_rect_btn_pressed.init() style_common_bg_rect_btn_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) -style_common_bg_rect_btn_pressed.set_bg_opa(200) +style_common_bg_rect_btn_pressed.set_bg_opa(100) style_common_bg_rect_btn_pressed.set_border_width(0) style_common_bg_rect_btn_pressed.set_shadow_opa(0) -style_common_bg_rect_btn_pressed.set_border_width(0) -style_common_bg_rect_btn_pressed.set_pad_left(0) -style_common_bg_rect_btn_pressed.set_pad_right(0) -style_common_bg_rect_btn_pressed.set_pad_top(0) -style_common_bg_rect_btn_pressed.set_pad_bottom(0) style_wechat_btn = lv.style_t() style_wechat_btn.init() style_wechat_btn.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) style_wechat_btn.set_border_width(0) style_wechat_btn.set_shadow_opa(0) -style_wechat_btn.set_border_width(0) -style_wechat_btn.set_pad_left(0) -style_wechat_btn.set_pad_right(0) -style_wechat_btn.set_pad_top(0) -style_wechat_btn.set_pad_bottom(0) # -------------------------------------------wechat screen---------------------------------------------------------- wechat_screen = lv.obj() @@ -84,69 +52,44 @@ wechat_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_screen_list_screen = lv.obj(wechat_screen) wechat_screen_list_screen.set_pos(0, 0) -wechat_screen_list_screen.set_size(LCD_X, 95) +wechat_screen_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-60) wechat_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) wechat_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_press_btn = lv.btn(wechat_screen) -wechat_press_btn.set_pos(10, 100) -wechat_press_btn.set_size(LCD_X-20, 26) +wechat_press_btn.set_pos(10, (LCD_SIZE_H-60)+4) +wechat_press_btn.set_size(LCD_SIZE_W-20, 56) wechat_press_btn.add_style(style_wechat_btn, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_press_btn.add_style(style_common_bg_rect_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) wechat_press_btn.set_style_radius(30,0) wechat_press_label = lv.label(wechat_screen) wechat_press_label.set_text("请按住说话") -wechat_press_label.set_size(LCD_X, 20) -wechat_press_label.set_pos(0,103) +wechat_press_label.set_size(LCD_SIZE_W, 38) +wechat_press_label.set_pos(0,(LCD_SIZE_H-60)+22) wechat_press_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) wechat_press_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_label = lv.label(wechat_screen_list_screen) -wechat_label.set_pos(0, 50) -wechat_label.set_size(LCD_X, 20) +wechat_label.set_pos(0, (LCD_SIZE_H//2)-10) +wechat_label.set_size(LCD_SIZE_W, 40) wechat_label.set_long_mode(lv.label.LONG.WRAP) wechat_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) wechat_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_press_label_countdown = lv.label(wechat_screen_list_screen) -wechat_press_label_countdown.set_pos(0, 30) -wechat_press_label_countdown.set_size(LCD_X, 20) +wechat_press_label_countdown.set_pos(0, ((LCD_SIZE_H//2)-10)-40) +wechat_press_label_countdown.set_size(LCD_SIZE_W, 40) wechat_press_label_countdown.set_text(" ") wechat_press_label_countdown.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_press_label_countdown.set_long_mode(lv.label.LONG.WRAP) wechat_press_label_countdown.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# wechat_show_infor_obj = lv.obj(wechat_screen) -# wechat_show_infor_obj.set_pos(0, 5) -# wechat_show_infor_obj.set_size(LCD_X, 90) -# wechat_show_infor_obj.clear_flag(lv.obj.FLAG.HIDDEN) -# wechat_show_infor_obj.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# wechat_show_infor_obj.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -# wechat_pause_img = lv.img(wechat_show_infor_obj) -# wechat_pause_img.set_pos(44, 40) -# wechat_pause_img.set_size(40, 40) -# wechat_pause_img.set_src("U:/static/pause.png") -# wechat_pause_img.add_flag(lv.obj.FLAG.CLICKABLE) -# wechat_pause_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -# wechat_update_one = lv.label(wechat_show_infor_obj) -# wechat_update_one.set_pos(0, 5) -# wechat_update_one.set_size(LCD_X, 20) -# wechat_update_one.set_text("最近一条消息") -# wechat_update_one.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -# wechat_update_one.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) - -# wechat_update_label = lv.label(wechat_show_infor_obj) -# wechat_update_label.set_pos(0, 35) -# wechat_update_label.set_size(LCD_X, 45) -# wechat_update_label.set_text(" ") -# wechat_update_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -# wechat_update_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + class WechatScreen(Screen): @@ -154,7 +97,7 @@ class WechatScreen(Screen): def __init__(self): super().__init__() - self.MXA_MSG = 5 + self.MXA_MSG = 10 self.wechat_recode_list = {} self.wechat_num = 0 self.volum_size = 8 @@ -175,13 +118,13 @@ class WechatScreen(Screen): with open("/usr/static/storage_file/wechat_record.json","w",encoding="utf-8") as fd: ujson.dump(self.wechat_recode_list,fd) # if self.wechat_num != 0: - # with open("/ext/static/storage_file/wechat_record.json","r",encoding="utf-8") as fd:#音频文件记录 + # with open("/usr/static/storage_file/wechat_record.json","r",encoding="utf-8") as fd:#音频文件记录 # self.wechat_recode_list = ujson.load(fd)#读取每一个amr音频文件的时长ui_setting.py self.record_test = audio.Record() self.record_test.gain_set(4,12) self.aud = audio.Audio(0) - # self.aud.set_pa(Pin.GPIO43) + # self.aud.set_pa(Pin.GPIO29) @@ -195,6 +138,8 @@ class WechatScreen(Screen): self.timer = osTimer() self.second_timer = osTimer() self.play_timer = osTimer() + self.update_lcdTimer = osTimer() + @@ -202,8 +147,8 @@ class WechatScreen(Screen): self.startWidth = 0 self.check_json = 0 self.wechat_list = lv.obj(wechat_screen_list_screen) - self.wechat_list.set_pos(0, 2) - self.wechat_list.set_size(128, 94) + self.wechat_list.set_pos(0, 10) + self.wechat_list.set_size(240, 251) self.wechat_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) self.wechat_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) self.wechat_list.set_flex_flow(lv.FLEX_FLOW.COLUMN)#自动排成一列对齐 @@ -337,33 +282,33 @@ class WechatScreen(Screen): #Wechat_log("wechat_list_dict:num:{}".format(self.wechat_list_dict[i]["num"])) value = self.wechat_recode_list[key] - - self.startY = 27*i + + self.startY = 44*i if value.find("S:") != -1 or value.find("R:") != -1: self.msg_tmp = value[2:] self.msg_tmp = int(self.msg_tmp) - self.startWidth = 55+self.msg_tmp*2 + self.startWidth = 55+self.msg_tmp*10 elif value.find("T:") != -1:#文字显示 self.msg_tmp = value[2:] - self.startWidth = 118 + self.startWidth = 230 #wechat_btn = lv.btn(self.wechat_list) # if value.find("R:") != -1:self.wechat_list_dict[i] - self.wechat_list_dict[i]["wechat_obj"].set_size(128,lv.SIZE.CONTENT) + self.wechat_list_dict[i]["wechat_obj"].set_size(240,lv.SIZE.CONTENT) if value.find("R:") != -1 or value.find("T:") != -1 :#显示文字: if value.find("T:") != -1: self.wechat_list_dict[i]["wechat_btn"].set_size(self.startWidth,lv.SIZE.CONTENT) else: - self.wechat_list_dict[i]["wechat_btn"].set_size(self.startWidth,25) + self.wechat_list_dict[i]["wechat_btn"].set_size(self.startWidth,42) self.wechat_list_dict[i]["wechat_btn"].set_pos(10,0 ) #self.wechat_list_dict[i]["wechat_btn"].add_style(style_wechat_s_btn, lv.PART.MAIN | lv.STATE.DEFAULT) self.wechat_list_dict[i]["wechat_btn"].set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) elif value.find("S:") != -1 : - self.wechat_list_dict[i]["wechat_btn"].set_size(self.startWidth,25) - self.wechat_list_dict[i]["wechat_btn"].set_pos(118-self.startWidth,0 ) + self.wechat_list_dict[i]["wechat_btn"].set_size(self.startWidth,42) + self.wechat_list_dict[i]["wechat_btn"].set_pos(230-self.startWidth,0 ) #for k in range(100): #self.wechat_list_dict[i]["wechat_btn"].add_style(style_wechat_r_btn, lv.PART.MAIN | lv.STATE.DEFAULT) self.wechat_list_dict[i]["wechat_btn"].set_style_bg_color(lv.color_make(0x00, 0xff, 0x2a), lv.PART.MAIN | lv.STATE.DEFAULT) @@ -379,8 +324,8 @@ class WechatScreen(Screen): self.wechat_list_dict[i]["_btn_label1"].set_pos(self.startWidth-78, 18) self.wechat_list_dict[i]["_btn_label1"].set_text(str(self.msg_tmp)+'\"') elif value.find("T:") != -1: - self.wechat_list_dict[i]["_btn_label1"].set_size(104, lv.SIZE.CONTENT) - self.wechat_list_dict[i]["_btn_label1"].set_pos(5, 0) + self.wechat_list_dict[i]["_btn_label1"].set_size(216, lv.SIZE.CONTENT) + self.wechat_list_dict[i]["_btn_label1"].set_pos(0, 0) print("self.msg_tmp:{}".format(self.msg_tmp)) self.msg_tmp = self.msg_tmp.replace(':',':\n',1) print("self.msg_tmp:{}".format(self.msg_tmp)) @@ -397,13 +342,13 @@ class WechatScreen(Screen): self.wechat_list_dict[i]["_btn_label2"].set_text('T:'+key) if value.find("R:") != -1 or value.find("S:") != -1: #_btn_img = lv.img(wechat_btn) - self.wechat_list_dict[i]["_btn_img"].set_size(15, 15) + self.wechat_list_dict[i]["_btn_img"].set_size(30, 30) if value.find("R:") != -1: - self.wechat_list_dict[i]["_btn_img"].set_pos(10, 5) - self.wechat_list_dict[i]["_btn_img"].set_src("U:/static/R_3.png") + self.wechat_list_dict[i]["_btn_img"].set_pos(5, 0) + self.wechat_list_dict[i]["_btn_img"].set_src("U:/static/APP/wechat/R_3.png") elif value.find("S:") != -1: - self.wechat_list_dict[i]["_btn_img"].set_pos(self.startWidth-20, 5) - self.wechat_list_dict[i]["_btn_img"].set_src("U:/static/S_3.png") + self.wechat_list_dict[i]["_btn_img"].set_pos(self.startWidth-50, 0) + self.wechat_list_dict[i]["_btn_img"].set_src("U:/static/APP/wechat/S_3.png") #self.wechat_list_dict[i]["_btn_img"].add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) self.wechat_list_dict[i]["_btn_img"].clear_flag(lv.obj.FLAG.HIDDEN) else : @@ -421,10 +366,10 @@ class WechatScreen(Screen): Wechat_log("talking_cb1") EventMesh.publish("publish_message_event_ui",{"func":self.talking,"data":e}) Wechat_log("talking_cb2") - #按下录音.amwav + #按下录音 def talking(self,e): if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 - print("talking1") + Wechat_log("talking1") self.play_timer.stop() self.aud.stop() self.wechat_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏列表选项方框 @@ -442,13 +387,14 @@ class WechatScreen(Screen): self.wechat_num += 1 self.wechat_show = self.wechat_num self.wechat_recode_list["num"] = self.wechat_num - print("talking1.0") + Wechat_log("talking1.0") self.record_test.start("/usr/static/storage_file/{}.amr".format(self.wechat_num),16) self.second_timer.start(1000, 1, self.reduce_second) + self.update_lcdTimer.start(500, 1, self.update_lcd) self.press_state = 1 self.ble_send = 1 #松开发送 - print("talking2") + Wechat_log("talking2") else: EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) @@ -493,6 +439,7 @@ class WechatScreen(Screen): #写序号 self.record_test.stop() #停止錄音 self.second_timer.stop() #停止计时器 + self.update_lcdTimer.stop() self.countdown_old = self.countdown # Wechat_log("self.countdown :{} self.wechat_num:{} self.wechat_recode_list:{} self.wechat_show:{}".format(self.countdown,self.wechat_num,self.wechat_recode_list,self.wechat_show)) self.wechat_recode_list["%02d"%(self.wechat_show)] = "S:{}".format(str(self.countdown)) @@ -537,9 +484,9 @@ class WechatScreen(Screen): text = self.wechat_list_dict[self.paay_btn_count]["_btn_label2"].get_text() self.play_text = text[0:2] #区分左右喇叭动画显示 "R":左边 "S:"右边 "T:":左边 if self.play_text == "R:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/R_{}.png".format(self.count_img)) + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/R_{}.png".format(self.count_img)) elif self.play_text == "S:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/S_{}.png".format(self.count_img)) + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/S_{}.png".format(self.count_img)) self.sec_num+=1 if self.sec_num % 2 == 0: @@ -549,17 +496,17 @@ class WechatScreen(Screen): if self.play_sec == 0: self.play_timer.stop() if self.play_text == "R:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/R_3.png") + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/R_3.png") elif self.play_text == "S:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/S_3.png") + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/S_3.png") get_play = EventMesh.publish("get_audio_state") if get_play != None: if get_play == 0: self.play_timer.stop() if self.play_text == "R:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/R_3.png") + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/R_3.png") elif self.play_text == "S:": - self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/S_3.png") + self.wechat_list_dict[self.paay_btn_count]["_btn_img"].set_src("U:/static/APP/wechat/S_3.png") Wechat_log("play_img2") def play_label_cb(self,e): #lvgl按钮回调 Wechat_log("play_label_cb1") @@ -582,9 +529,9 @@ class WechatScreen(Screen): text = self.wechat_list_dict[self.paay_btn_old_count]["_btn_label2"].get_text() self.play_text = text[0:2] if self.play_text == "R:": - self.wechat_list_dict[self.paay_btn_old_count]["_btn_img"].set_src("U:/static/R_3.png") + self.wechat_list_dict[self.paay_btn_old_count]["_btn_img"].set_src("U:/static/APP/wechat/R_3.png") elif self.play_text == "S:": - self.wechat_list_dict[self.paay_btn_old_count]["_btn_img"].set_src("U:/static/S_3.png") + self.wechat_list_dict[self.paay_btn_old_count]["_btn_img"].set_src("U:/static/APP/wechat/S_3.png") self.count_img = 0 #喇叭动画显示的数量 @@ -613,7 +560,7 @@ class WechatScreen(Screen): if self.play_text == "R:" or self.play_text == "S:":#过滤掉文字显示 不需要播放音频文件 self.aud = audio.Audio(0) self.aud.stop()# - self.aud.play(1, 1, '/usr/static/storage_file/{}.amr'.format(i)) #文件名前面要加上路径 + self.aud.play(1, 1, '/ext/static/storage_file/{}.amr'.format(i)) #文件名前面要加上路径 self.paay_btn_old_count = self.paay_btn_count Wechat_log("play_label2") @@ -624,11 +571,25 @@ class WechatScreen(Screen): def get_send_state(self, event, msg): return self.ble_send + def lcd_off(self): + self.play_timer.stop() + self.record_test.stop() #停止錄音 + self.second_timer.stop() #停止计时器 + self.update_lcdTimer.stop() + self.aud.stop() + + def update_lcd(self,*args): + EventMesh.publish("publish_message_event_ui",{"func":self.update_lcd_cb,"data":0}) + + def update_lcd_cb(self,data): + Wechat_log("update_lcd_cb") + EventMesh.publish("system_sleep_rest")#防止黑屏 def Close(self): Wechat_log("Close1") self.play_timer.stop() self.record_test.stop() #停止錄音 + self.update_lcdTimer.stop() self.second_timer.stop() #停止计时器 self.aud.stop() num = EventMesh.publish("get_volum_size") @@ -636,8 +597,12 @@ class WechatScreen(Screen): num = 8 self.aud.setVolume(num)#恢复原始音量 Wechat_log("Close2") - def reduce_second(self,*args): + EventMesh.publish("publish_message_event_ui",{"func":self.reduce_second_cb,"data":0}) + + def reduce_second_cb(self,data): + + EventMesh.publish("system_sleep_rest")#防止黑屏 if self.countdown < 15: self.countdown += 1 else: @@ -648,31 +613,30 @@ class WechatScreen(Screen): self.countdown = 15 wechat_press_label_countdown.set_text("{}S".format(str(self.countdown))) - def done_return(self): + + def done_return(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) - + + def done_left_to_right(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) - - - - - #微聊弹窗 wechat_popup_screen = lv.obj() print("wechat_popup_screen") wechat_popup_screen.center() -wechat_popup_screen.set_size(128, 128) +wechat_popup_screen.set_size(LCD_SIZE_W, LCD_SIZE_H) wechat_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) wechat_popup_title = lv.label(wechat_popup_screen) -wechat_popup_title.set_pos(0, 40) -wechat_popup_title.set_size(128, 40) +wechat_popup_title.set_pos(0, (LCD_SIZE_H//2)-10) +wechat_popup_title.set_size(LCD_SIZE_W, 40) wechat_popup_title.set_text("你有新的微聊消息") wechat_popup_title.set_long_mode(lv.label.LONG.WRAP) wechat_popup_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -709,5 +673,7 @@ class NewWechatPopupScreen(Screen): EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) + diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/btn_device_ec800m.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/btn_device_ec800m.py new file mode 100644 index 00000000..8b744ba3 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/btn_device_ec800m.py @@ -0,0 +1,253 @@ +from common import Abstract +import machine +import osTimer +from misc import PowerKey +import EventMesh +from machine import Pin +from machine import ExtInt +import utime +import constants +#import encoder + +class BtnDevice(Abstract): + + def __init__(self, tp=None): + self.pk = PowerKey() + self.__pwk_timer = osTimer() + + #self.keypad = machine.KeyPad(5, 5) + self.__PowerDownTimeOut = 3000 + self.__tp = tp + self.pwk_press = 0 + self.pwk_count = 0 + self.GPIO41_status = 0 + self.powerKey_status = 0 + self.Coder_timer = osTimer() + self.Coder_timer_count = 0 + self.Coder_data_str_1 = "" + self.Coder_data_str_2 = "" + + self.Coder_IO_tmp = 0 + self.Coder_data_tmp = [] + self.Coder_data1 = [] + self.start_timer_a = 0 + self.start_timer_b = 0 + self.start_timer_flag = 0 + self.tmp_a = 1 + self.tmp_b = 1 + def post_processor_after_instantiation(self): + # self.keypad.init() + # self.keypad.set_callback(self.key_callback) + self.pk.powerKeyEventRegister(self.powerKey_callback) + if self.__tp: + self.__tp.set_callback(self.__ui_callback) + + self.extint = ExtInt(ExtInt.GPIO41, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.pwk_extint_cb) + self.extint.enable() + + # self.coder = encoder(Pin.GPIO22,Pin.GPIO21) + # self.coder.set_callback(self.Coder_cb) + self.Coder_A = ExtInt(ExtInt.GPIO22, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.Coder_cb) + self.Coder_A.enable() + + self.Coder_B = ExtInt(ExtInt.GPIO21, ExtInt.IRQ_RISING_FALLING, ExtInt.PULL_PU, self.Coder_cb) + self.Coder_B.enable() + + # def Coder_A_cb(self,args): + # if self.Coder_data == []: + # self.Coder_timer.start(1000, 1, self.Coder_timer_cb) + # if self.Coder_A.read_level() == 1: + # self.Coder_data+=args + # else : + # self.Coder_data+=args + + + def Coder_cb(self,args): + #print("Coder_cb {}".format(args)) + self.Coder_timer_count = 0 + if self.start_timer_flag == 0: + #self.Coder_timer.stop() + #self.Coder_data_str_2 = "11" + self.start_timer_flag = 1 + self.Coder_timer_count = 0 + self.Coder_timer.start(100, 1, self.Coder_timer_cb) + rest_flag = 0 + data_tmp = "" + # if args[0] == 21: + # # if self.Coder_B.read_level() == 1: + # # self.start_timer_b = utime.ticks_us() + # # else : + # diff = utime.ticks_diff(utime.ticks_us(), self.start_timer_b) + # self.start_timer_b = utime.ticks_us() + # if diff > 8000 :#and diff <200000: + # pass + # #data_tmp = "B:{} {} {}\n".format(args[1],diff//1000,self.Coder_B.read_level()) + # else : + # return + # elif args[0] == 22: + # #if self.Coder_A.read_level() == 1: + + # diff = utime.ticks_diff(utime.ticks_us(), self.start_timer_a) + # self.start_timer_a = utime.ticks_us() + # if diff > 8000 :#and diff <200000: + # pass + # #data_tmp = "A:{} {} {}\n".format(args[1],diff//1000,self.Coder_A.read_level()) + # else : + # return + #self.Coder_data_str_1+=data_tmp + if self.Coder_IO_tmp != 0 : + if self.Coder_IO_tmp != args[0] :#上一个中断io和当前中断io不一样 + + if self.Coder_data1 == []: + self.Coder_data1 = self.Coder_data_tmp + if self.Coder_data1[0] == 22 and self.Coder_data1[1] == 1: + #self.Coder_data_str_1 += "-上滑\n" + self.Coder_data_str_2+="上滑 " + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish("done_UP") + #rest_flag = 1 + elif self.Coder_data1[0] == 21 and self.Coder_data1[1] == 1 : + #self.Coder_data_str_1 += "-下滑\n" + self.Coder_data_str_2+="下滑 " + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish("done_DOWN") + else: + rest_flag = 1 + elif args[0] != self.Coder_data1[0] and args[1] == 0:#分段 + #self.Coder_data_str_3 += "Coder_data:{} {}".format(self.Coder_data1,self.Coder_data2) + self.Coder_data_str_2+="||" + #self.Coder_data_str_1+="分段" + rest_flag = 1 + + if rest_flag == 1 :#判断完有效清数据 + self.Coder_data1 = [] + self.Coder_IO_tmp = 0 + else : + + self.Coder_IO_tmp = args[0] + self.Coder_data_tmp =args + + + def Coder_timer_cb(self, *args): + # tmp = self.Coder_A.read_level() + # data_tmp = "" + # if self.tmp_a != tmp : + # if self.start_timer_a != 0: + # data_tmp = "A{} {},".format(self.tmp_a,self.start_timer_a*6) + # self.start_timer_a = 0 + # else: + # self.start_timer_a += 1 + # self.tmp_a = tmp + + # tmp = self.Coder_B.read_level() + # if self.tmp_b != tmp : + # if self.start_timer_b != 0: + # data_tmp = "B{} {},".format(self.tmp_b,self.start_timer_b*6) + # self.start_timer_b = 0 + # else: + # self.start_timer_b += 1 + # self.tmp_b = tmp + # self.Coder_data_str_1+=data_tmp + + self.Coder_timer_count += 1 + if self.Coder_timer_count > 6: + #print("Coder1:\n{}".format(self.Coder_data_str_1)) + #print("Coder2:\n{}".format(self.Coder_data_str_2)) + self.Coder_timer_count = 0 + self.Coder_data_str_1 = "" + self.Coder_data_str_2 = "" + self.Coder_data1 = [] + self.Coder_IO_tmp = 0 + self.start_timer_b = 0 + self.start_timer_a = 0 + self.tmp_a = 1 + self.tmp_b = 1 + self.Coder_timer.stop() + self.start_timer_flag=0 + def pwk_extint_cb(self,args): + #print('### interrupt {} '.format(args)) # args[0]:gpio号 args[1]:上升沿或下降沿 + + #print('==pwr:', status)# 0 1 0 + self.GPIO41_status = self.extint.read_level() + #print("1GPIO_extint_cb:self.GPIO41_status:{} self.pwk_press:{} args:{}".format(self.GPIO41_status,self.pwk_press,args)) + if self.GPIO41_status == 0:#按下 + if(self.pwk_press == 0) : + self.pwk_press = 1 + self.__pwk_timer.start(100, 1, self.pwk_press_cb) + print("1GPIO_extint_cb:self.__pwk_timer.start!!!!\n") + def pwk_press_cb(self, *args): + '''KEY2:联动屏幕右下角或返回键长按关机''' + if self.pwk_press == 1 : + #print("3pwk_press_cb:self.pwk_count:{} self.GPIO41_status:{}".format(self.pwk_count,self.GPIO41_status)) + self.pwk_count += 1 + # + if self.GPIO41_status == 1:#松开 + if(self.pwk_count >= 1): #防抖100ms + self.__pwk_timer.stop() + self.pwk_count = 0 + self.pwk_press = 0 + EventMesh.publish("btn8_press") + if self.pwk_count > (self.__PowerDownTimeOut//100): #长按 + self.__pwk_timer.stop() + self.pwk_count = 0 + self.pwk_press = 0 + EventMesh.publish("btn8_long_press") + + def __ui_callback(self, para): + # print("para = {}".format(para)) + if para == 0: + EventMesh.publish("done_left_to_right") + #print("<-") + elif para == 1: + EventMesh.publish("done_right_to_left") + #print("->") + elif para == 2: + EventMesh.publish("done_bottom_to_top") + #print("^") + elif para == 3: + EventMesh.publish("done_top_to_bottom") + #print("V") + elif para == 4: + EventMesh.publish("done_return") + #print("return") + elif para == 5: + EventMesh.publish("done_click") + #print("CLICK") + elif para == 6: + EventMesh.publish("done_press") + #print("press") + elif (para == 6): + EventMesh.publish("done_error") + #print("error") + + def key_callback(self, l_list): + print("key_callback:",str(l_list)) + if l_list[0] == 1: + # 马达震动预留 + pass + if (l_list[1] == 3) and (l_list[2] == 0): + if l_list[0] == 1: + #self.pwk_press = 0 + EventMesh.publish("btn1_press") + else: + pass + # EventMesh.publish("btn1_press") + + + + + def powerKey_callback(self, status): + print('==pwr:', status)# 0 1 0 + self.powerKey_status = status + if self.pwk_press == 1: #按按钮时不处理 + return + + + + def start(self): + self.post_processor_after_instantiation() + +if __name__ == "__main__": + a = BtnDevice() \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py new file mode 100644 index 00000000..e74c2074 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/capacitive_hynitron_cst816d_update.py @@ -0,0 +1,972 @@ +""" +// ic type: cst8xx +// proj name: CSW_2311097_CST816D_COB_DWS_HY_HTY1384183CG_C06_AKL_G3.hex +// check sum: 0xa796 +// create time: 2023/11/8 10:14:38 +""" + +app_bin_816d = [ +0x00, 0x00, 0x00, 0x3c, 0x61, 0x8c, +0x02, 0x29, 0xeb, 0x75, 0x91, 0xcc, 0x75, 0x91, 0x00, 0x32, 0x32, 0x22, 0x02, 0x00, 0x03, 0x02, +0x2e, 0x51, 0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x25, 0x02, 0x0f, 0xac, +0x00, 0x02, 0x30, 0xbf, 0x8f, 0x22, 0x8d, 0x23, 0x12, 0x08, 0xae, 0xe2, 0x70, 0x03, 0x02, 0x05, +0x5d, 0x12, 0x05, 0xf0, 0x12, 0x09, 0xe9, 0x50, 0x18, 0x12, 0x06, 0x39, 0x12, 0x08, 0xae, 0xe4, +0xf2, 0xfa, 0xa9, 0x07, 0x7b, 0xfe, 0xef, 0x24, 0x06, 0x7f, 0x06, 0x12, 0x06, 0x60, 0x02, 0x01, +0x5a, 0x12, 0x0a, 0xd6, 0xe2, 0x70, 0x53, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x2a, 0x12, 0x06, 0xea, +0x12, 0x0a, 0x00, 0x12, 0x06, 0xe4, 0x12, 0x09, 0x6a, 0x12, 0x05, 0xf0, 0x74, 0x17, 0x93, 0x75, +0x34, 0x00, 0xf5, 0x35, 0xaf, 0x2b, 0xae, 0x2a, 0x12, 0x3a, 0x14, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x29, 0xae, 0x28, 0x12, 0x3a, 0x14, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0xd3, 0xef, +0x95, 0x35, 0xee, 0x95, 0x34, 0x40, 0x08, 0x12, 0x0a, 0xd6, 0x74, 0x01, 0xf2, 0x80, 0x20, 0xe4, +0xf5, 0x28, 0xf5, 0x29, 0xf5, 0x2a, 0xf5, 0x2b, 0x80, 0x15, 0x12, 0x0a, 0x15, 0x12, 0x06, 0xea, +0x12, 0x0a, 0x00, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x08, 0x12, 0x06, 0xea, 0x12, 0x09, 0x6a, 0x12, +0x09, 0x09, 0xc0, 0x04, 0x12, 0x06, 0x7c, 0x78, 0x79, 0xe6, 0x24, 0x15, 0x12, 0x06, 0x32, 0x12, +0x08, 0xc6, 0xd0, 0x00, 0x12, 0x0e, 0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x23, 0xab, 0x07, 0xae, 0x28, 0xaf, 0x29, 0x12, 0x08, 0xc2, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, +0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x8d, 0x12, 0x31, 0x90, 0x8e, 0x28, 0x8f, 0x29, 0x12, +0x09, 0x09, 0xc0, 0x04, 0x12, 0x06, 0x7c, 0x78, 0x79, 0xe6, 0x24, 0x17, 0x12, 0x06, 0x32, 0x12, +0x08, 0xc6, 0xd0, 0x00, 0x12, 0x0e, 0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0xaf, +0x23, 0xab, 0x07, 0xae, 0x2a, 0xaf, 0x2b, 0x12, 0x08, 0xc2, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, +0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x8d, 0x12, 0x31, 0x90, 0x8e, 0x2a, 0x8f, 0x2b, 0x78, +0x79, 0xe6, 0xff, 0x24, 0x15, 0xf8, 0xe5, 0x28, 0xf2, 0x08, 0xe5, 0x29, 0xf2, 0xa8, 0x07, 0xe8, +0x24, 0x17, 0xf8, 0xe5, 0x2a, 0xf2, 0x08, 0xe5, 0x2b, 0xf2, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, +0xff, 0x12, 0x09, 0xf7, 0x9f, 0x50, 0x03, 0x02, 0x05, 0x4c, 0x78, 0x79, 0xe6, 0xfb, 0x24, 0x06, +0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x28, 0xa2, 0xe7, 0x13, 0xfe, 0xe5, 0x29, +0x12, 0x07, 0xe4, 0xa8, 0x03, 0x12, 0x0a, 0x31, 0x12, 0x0a, 0xc8, 0xd8, 0xfb, 0xff, 0x12, 0x05, +0xf0, 0x74, 0x01, 0x93, 0xfc, 0x74, 0x02, 0x93, 0xfd, 0x12, 0x34, 0xc0, 0x8e, 0x24, 0x8f, 0x25, +0x78, 0x79, 0xe6, 0xfb, 0x24, 0x08, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xfd, 0xac, 0x06, 0xe5, 0x2a, +0xa2, 0xe7, 0x13, 0xfe, 0xe5, 0x2b, 0x12, 0x07, 0xe4, 0xa8, 0x03, 0xe8, 0x24, 0x02, 0xf8, 0x12, +0x0a, 0x31, 0x12, 0x0a, 0xc8, 0xd8, 0xfb, 0xff, 0x12, 0x05, 0xf0, 0x74, 0x03, 0x93, 0xfc, 0x74, +0x04, 0x93, 0xfd, 0x12, 0x34, 0xc0, 0x8e, 0x26, 0x8f, 0x27, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, +0x24, 0x0a, 0xff, 0xe4, 0x33, 0xfe, 0x78, 0x79, 0xe6, 0xfd, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9f, +0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x50, 0x54, 0xa8, 0x05, 0xe8, 0x24, 0x15, 0x12, 0x06, +0x32, 0x12, 0x3a, 0x14, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, 0xfd, 0x78, 0x79, 0xe6, 0xf9, 0x12, +0x08, 0x73, 0x24, 0x89, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0x12, 0x09, 0xcb, 0xa8, 0x01, 0xe8, 0x24, +0x17, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0x12, 0x05, 0xf0, 0x74, 0x1e, 0x93, 0xfd, 0x78, 0x79, +0xe6, 0x12, 0x08, 0x73, 0x24, 0x9d, 0xf5, 0x82, 0xe4, 0x34, 0x00, 0x12, 0x09, 0xcb, 0x75, 0x38, +0x00, 0x75, 0x39, 0x80, 0x75, 0x3a, 0x00, 0x75, 0x3b, 0x80, 0x02, 0x03, 0xbe, 0x12, 0x08, 0x7e, +0x24, 0x92, 0xf9, 0x74, 0x00, 0x35, 0xf0, 0xfa, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, +0x78, 0x79, 0xe6, 0x24, 0x15, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0xad, 0x07, 0xd0, 0x01, 0xd0, +0x02, 0xd0, 0x03, 0x12, 0x33, 0xe6, 0x8e, 0x34, 0x8f, 0x35, 0x12, 0x08, 0x7e, 0x24, 0xa6, 0xf9, +0x74, 0x00, 0x35, 0xf0, 0xfa, 0x7b, 0x01, 0xc0, 0x03, 0xc0, 0x02, 0xc0, 0x01, 0x78, 0x79, 0xe6, +0x24, 0x17, 0x12, 0x06, 0x32, 0x12, 0x3a, 0x14, 0xad, 0x07, 0xd0, 0x01, 0xd0, 0x02, 0xd0, 0x03, +0x12, 0x33, 0xe6, 0x8e, 0x36, 0x8f, 0x37, 0x12, 0x0a, 0xdd, 0x40, 0x18, 0xe5, 0x35, 0xae, 0x34, +0x78, 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, 0xf9, 0xff, 0xe5, 0x37, 0x24, 0x01, 0xfd, 0xe4, +0x35, 0x36, 0x80, 0x16, 0xe5, 0x37, 0xae, 0x36, 0x78, 0x03, 0xc3, 0x33, 0xce, 0x33, 0xce, 0xd8, +0xf9, 0xff, 0xe5, 0x35, 0x24, 0x01, 0xfd, 0xe4, 0x35, 0x34, 0xfc, 0x12, 0x0c, 0x7a, 0xab, 0x07, +0xaa, 0x06, 0x78, 0x79, 0xe6, 0xf9, 0x24, 0x0f, 0x12, 0x06, 0x32, 0x12, 0x07, 0xea, 0xef, 0x2b, +0xff, 0xee, 0x3a, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xfb, 0xaa, +0x06, 0xc3, 0x94, 0x28, 0xea, 0x94, 0x00, 0x50, 0x06, 0x7a, 0x00, 0x7b, 0x28, 0x80, 0x0d, 0xd3, +0xeb, 0x94, 0x46, 0xea, 0x94, 0x00, 0x40, 0x04, 0x7a, 0x00, 0x7b, 0x46, 0x7c, 0x00, 0x7d, 0x0a, +0xaf, 0x03, 0xae, 0x02, 0x12, 0x0c, 0x68, 0xef, 0x24, 0xf0, 0xf5, 0x39, 0xee, 0x34, 0xfe, 0xf5, +0x38, 0xeb, 0x25, 0xe0, 0xff, 0xea, 0x33, 0xfe, 0xc3, 0x74, 0xd0, 0x9f, 0xf5, 0x3b, 0xe4, 0x9e, +0xf5, 0x3a, 0x12, 0x0a, 0xdd, 0x40, 0x12, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x85, 0x3a, 0x38, +0x85, 0x3b, 0x39, 0x85, 0x34, 0x3a, 0x85, 0x35, 0x3b, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0f, 0xf8, +0xea, 0xf2, 0x08, 0xeb, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x11, 0x12, 0x06, 0x32, 0x12, 0x07, 0xea, +0xe5, 0x39, 0x2f, 0xff, 0xe5, 0x38, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, +0xd8, 0xf9, 0xf5, 0x39, 0x8e, 0x38, 0x78, 0x79, 0xe6, 0xfb, 0x24, 0x13, 0x12, 0x06, 0x32, 0x12, +0x07, 0xea, 0xe5, 0x3b, 0x2f, 0xff, 0xe5, 0x3a, 0x3e, 0xfe, 0xef, 0x78, 0x02, 0xce, 0xc3, 0x13, +0xce, 0x13, 0xd8, 0xf9, 0xf5, 0x3b, 0x8e, 0x3a, 0xeb, 0x24, 0x11, 0xf8, 0xe5, 0x38, 0xf2, 0x08, +0xe5, 0x39, 0xf2, 0xe9, 0x24, 0x13, 0xf8, 0xe5, 0x3a, 0xf2, 0x08, 0xe5, 0x3b, 0xf2, 0x12, 0x05, +0x8c, 0x7c, 0x00, 0x7d, 0x02, 0x12, 0x0c, 0xcf, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xa0, 0xd0, +0xe0, 0x2f, 0xf5, 0x35, 0xd0, 0xe0, 0x3e, 0xf5, 0x34, 0x12, 0x05, 0xf0, 0xae, 0x34, 0xaf, 0x35, +0x12, 0x08, 0xcd, 0x25, 0x35, 0xf5, 0x35, 0xee, 0x35, 0x34, 0xf5, 0x34, 0xd3, 0xe5, 0x35, 0x95, +0x39, 0xe5, 0x34, 0x95, 0x38, 0x40, 0x06, 0x85, 0x38, 0x34, 0x85, 0x39, 0x35, 0x78, 0x79, 0xe6, +0x24, 0x06, 0x12, 0x06, 0x32, 0xc3, 0xe5, 0x39, 0x95, 0x35, 0xfd, 0xe5, 0x38, 0x95, 0x34, 0xfc, +0x12, 0x0f, 0xbe, 0x8f, 0x2f, 0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0xae, 0x24, 0xaf, 0x25, 0x12, +0x08, 0x69, 0xae, 0x34, 0xaf, 0x35, 0x12, 0x0a, 0x9c, 0xef, 0x25, 0x2f, 0xff, 0xee, 0x35, 0x2e, +0xfe, 0xed, 0x35, 0x2d, 0xfd, 0xec, 0x35, 0x2c, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x38, 0xc3, +0x13, 0xfe, 0xe5, 0x39, 0x12, 0x0a, 0xa3, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0a, 0x3e, 0xc0, 0x06, +0xc0, 0x07, 0xae, 0x38, 0xaf, 0x39, 0xab, 0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, +0x0e, 0xa2, 0x8f, 0x2f, 0x8e, 0x2e, 0x8d, 0x2d, 0x8c, 0x2c, 0x12, 0x05, 0xa0, 0x7c, 0x00, 0x7d, +0x02, 0x12, 0x0c, 0xcf, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0x8c, 0xd0, 0xe0, 0x2f, 0xf5, 0x37, +0xd0, 0xe0, 0x3e, 0xf5, 0x36, 0x12, 0x05, 0xf0, 0xae, 0x36, 0xaf, 0x37, 0x12, 0x08, 0xcd, 0x25, +0x37, 0xf5, 0x37, 0xee, 0x35, 0x36, 0xf5, 0x36, 0xd3, 0xe5, 0x37, 0x95, 0x3b, 0xe5, 0x36, 0x95, +0x3a, 0x40, 0x06, 0x85, 0x3a, 0x36, 0x85, 0x3b, 0x37, 0x78, 0x79, 0xe6, 0x24, 0x08, 0x12, 0x06, +0x32, 0xc3, 0xe5, 0x3b, 0x95, 0x37, 0xfd, 0xe5, 0x3a, 0x95, 0x36, 0xfc, 0x12, 0x0f, 0xbe, 0x8f, +0x33, 0x8e, 0x32, 0x8d, 0x31, 0x8c, 0x30, 0xae, 0x26, 0xaf, 0x27, 0x12, 0x08, 0x69, 0xae, 0x36, +0xaf, 0x37, 0x12, 0x0a, 0x9c, 0xef, 0x25, 0x33, 0xff, 0xee, 0x35, 0x32, 0xfe, 0xed, 0x35, 0x31, +0xfd, 0xec, 0x35, 0x30, 0xfc, 0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x3a, 0xc3, 0x13, 0xfe, 0xe5, 0x3b, +0x12, 0x0a, 0xa3, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0a, 0x3e, 0xc0, 0x06, 0xc0, 0x07, 0xae, 0x3a, +0xaf, 0x3b, 0xab, 0x07, 0xaa, 0x06, 0xe4, 0xd0, 0x07, 0xd0, 0x06, 0x12, 0x0e, 0xa2, 0x8f, 0x33, +0x8e, 0x32, 0x8d, 0x31, 0x8c, 0x30, 0x12, 0x05, 0xf0, 0x74, 0x16, 0x93, 0xf4, 0x60, 0x2d, 0x78, +0x79, 0xe6, 0xff, 0x24, 0x0c, 0xf8, 0xe2, 0xb4, 0x01, 0x15, 0xa8, 0x07, 0xe5, 0x2e, 0xf2, 0x08, +0xe5, 0x2f, 0xf2, 0x12, 0x0a, 0x23, 0xe5, 0x32, 0xf2, 0x08, 0xe5, 0x33, 0xf2, 0x80, 0x0d, 0x78, +0x79, 0x12, 0x06, 0xd4, 0x12, 0x0a, 0x23, 0xec, 0xf2, 0x08, 0xed, 0xf2, 0x12, 0x09, 0xf7, 0x94, +0x14, 0x50, 0x03, 0xe2, 0x04, 0xf2, 0x12, 0x0a, 0x2a, 0x74, 0x01, 0xf2, 0x22, 0x12, 0x0a, 0x2a, +0xe2, 0xd3, 0x94, 0x00, 0x40, 0x03, 0xe2, 0x14, 0xf2, 0xe2, 0x70, 0x1f, 0x78, 0x79, 0xe6, 0xff, +0x24, 0x0d, 0xf8, 0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x11, 0x12, 0x0a, 0xab, 0x24, 0x13, 0x12, +0x0a, 0xab, 0x24, 0x0f, 0xf8, 0xe4, 0xf2, 0x08, 0x74, 0x28, 0xf2, 0x22, 0x78, 0x79, 0xe6, 0x24, +0x09, 0xf8, 0xc3, 0xe2, 0x95, 0x27, 0xff, 0x18, 0xe2, 0x95, 0x26, 0xfe, 0x12, 0x3a, 0x14, 0x22, +0x78, 0x79, 0xe6, 0x24, 0x07, 0xf8, 0xc3, 0xe2, 0x95, 0x25, 0xff, 0x18, 0xe2, 0x95, 0x24, 0xfe, +0x12, 0x3a, 0x14, 0x22, 0xe4, 0x7b, 0x02, 0xfa, 0xf9, 0xf8, 0xaf, 0x00, 0xae, 0x00, 0xad, 0x00, +0xac, 0x00, 0x12, 0x0e, 0xa2, 0xef, 0x25, 0x00, 0xff, 0xee, 0x35, 0x00, 0xfe, 0xed, 0x35, 0x00, +0xfd, 0xec, 0x35, 0x00, 0xfc, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0x12, 0x0e, 0xa2, +0xef, 0x24, 0xe0, 0xfb, 0xee, 0x34, 0xff, 0xfa, 0xed, 0x34, 0xff, 0xf9, 0xec, 0x34, 0xff, 0xf8, +0x85, 0x4a, 0x82, 0x85, 0x49, 0x83, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, +0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, +0x00, 0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, +0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, 0xc3, 0x02, 0x0f, 0x4a, 0xe5, 0x2f, 0x25, 0xe0, 0x25, 0xe0, +0x24, 0x5f, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x22, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0c, 0xf8, +0xe4, 0xf2, 0xa8, 0x07, 0xe8, 0x24, 0x15, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xa8, 0x07, 0xe8, 0x24, +0x17, 0xf8, 0xe4, 0xf2, 0x08, 0xf2, 0xfa, 0xa9, 0x07, 0x7b, 0xfe, 0xef, 0x24, 0x2a, 0x7f, 0x04, +0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x02, 0x0b, 0xc8, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, +0xa8, 0x00, 0x93, 0xff, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xa8, 0x04, 0xa9, 0x05, 0xaa, 0x06, +0xab, 0x07, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x41, 0xf8, 0x22, 0xab, 0x00, 0xaa, +0x00, 0xa9, 0x00, 0xe5, 0x00, 0x75, 0xf0, 0x02, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x02, 0x0d, +0x46, 0x74, 0x1d, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, 0xe4, 0xfc, 0xfd, 0x12, 0x0e, 0x17, +0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, 0x00, 0x8e, 0x00, 0x8d, 0x00, 0x8c, +0x00, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, 0x00, 0xe4, 0xfc, 0xfd, +0xc3, 0x02, 0x0f, 0x4a, 0xe6, 0xff, 0x24, 0x2a, 0xf8, 0xe2, 0xfd, 0x08, 0xe2, 0xa8, 0x07, 0xcd, +0xf2, 0x08, 0xed, 0xf2, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x2c, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, +0x22, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x85, 0x00, 0x82, 0x75, 0x83, 0x00, 0xe5, 0x00, 0x12, +0x0c, 0x46, 0xe5, 0x00, 0x25, 0xe0, 0x25, 0xe0, 0x24, 0x43, 0xf8, 0x22, 0xef, 0x2b, 0xff, 0xee, +0x3a, 0xfe, 0xed, 0x39, 0xfd, 0xec, 0x38, 0xfc, 0x22, 0x7a, 0x00, 0x79, 0x01, 0x7b, 0xfe, 0x7e, +0x00, 0x7f, 0x06, 0x02, 0x0b, 0xc8, 0xe5, 0x00, 0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xfe, 0xef, +0x24, 0xff, 0xff, 0xee, 0x34, 0xff, 0xfe, 0xe4, 0xfc, 0xfd, 0x22, 0x78, 0x41, 0x7c, 0x00, 0x7d, +0x00, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x45, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0x75, 0x45, +0xff, 0x22, 0x93, 0xff, 0xee, 0x33, 0x95, 0xe0, 0xfd, 0xfc, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x32, +0xfa, 0xf9, 0xf8, 0x12, 0x31, 0x90, 0xe5, 0x28, 0x2f, 0xf5, 0x2e, 0xe5, 0x27, 0x3e, 0xf5, 0x2d, +0xd3, 0xe5, 0x2e, 0x94, 0x00, 0xe5, 0x2d, 0x64, 0x80, 0x94, 0x80, 0x22, 0xf8, 0xe2, 0x2f, 0xf5, +0x26, 0x18, 0xe2, 0x3e, 0xf5, 0x25, 0xe5, 0x2f, 0x25, 0xe0, 0x25, 0xe0, 0x22, 0xeb, 0x7b, 0x64, +0x2f, 0xff, 0xea, 0x3e, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, 0xfc, 0xe4, 0xfa, 0xf9, 0xf8, 0x22, +0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x2f, 0xff, 0x18, 0xe2, 0x3e, 0x22, 0xe5, 0x00, 0x25, 0xe0, +0x25, 0xe0, 0x24, 0x42, 0xf8, 0x22, 0x74, 0x1c, 0x93, 0x24, 0x64, 0xff, 0xe4, 0x33, 0xfe, 0xe4, +0xfc, 0xfd, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x64, 0xfa, 0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8f, 0x00, +0x8e, 0x00, 0x8d, 0x00, 0x8c, 0x00, 0x22, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x01, 0xf8, 0xee, 0xf2, +0x08, 0xef, 0xf2, 0x22, 0x13, 0x2d, 0xff, 0xee, 0x3c, 0xfe, 0x7c, 0x00, 0x7d, 0x03, 0x02, 0x0c, +0x68, 0xe6, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xad, 0x00, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xc3, 0x22, +0x7f, 0x08, 0x7d, 0xff, 0x7a, 0x00, 0x79, 0x41, 0x12, 0x0f, 0xeb, 0xe4, 0xf5, 0x43, 0xf5, 0x44, +0xf5, 0x47, 0xf5, 0x48, 0x22, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, 0xff, 0xe4, 0xfc, 0xfd, +0x02, 0x0f, 0x7a, 0x74, 0x1a, 0x93, 0xff, 0x33, 0x95, 0xe0, 0xfe, 0xfd, 0xfc, 0xeb, 0x2f, 0x22, +0xaf, 0x00, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xab, 0x00, 0xaa, +0x00, 0xa9, 0x00, 0x8f, 0x82, 0xf5, 0x83, 0x02, 0x0d, 0x46, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x07, +0xaa, 0x06, 0xc3, 0xe5, 0x00, 0x9b, 0xfb, 0xe5, 0x00, 0x9a, 0xfa, 0xe5, 0x00, 0x94, 0x00, 0xf9, +0xe5, 0x00, 0x94, 0x00, 0x22, 0x8e, 0x2d, 0x8f, 0x2e, 0xab, 0x07, 0xaa, 0x06, 0xea, 0x33, 0x95, +0xe0, 0xf9, 0x22, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9d, 0xfd, 0xe4, 0x94, 0x00, 0xfc, 0xe5, 0x22, +0x75, 0xf0, 0x0a, 0xa4, 0x22, 0xae, 0x00, 0xaf, 0x00, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0xa8, +0x00, 0x22, 0xe5, 0x00, 0x25, 0xe0, 0xff, 0xe5, 0x00, 0x33, 0xab, 0x07, 0xfa, 0xe4, 0xf9, 0xf8, +0x22, 0x7e, 0x00, 0x7a, 0x00, 0x79, 0x01, 0x7d, 0x00, 0x7b, 0xfe, 0x02, 0x0f, 0xeb, 0x78, 0x79, +0xe6, 0xff, 0x24, 0x04, 0xf8, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, +0xfe, 0x22, 0xe4, 0xfa, 0xf9, 0xf8, 0xee, 0x33, 0x95, 0xe0, 0xfd, 0xfc, 0x22, 0x74, 0x18, 0x93, +0xfb, 0x7c, 0x00, 0x7d, 0x0a, 0x12, 0x0c, 0x7a, 0xad, 0x03, 0x7c, 0x00, 0x12, 0x0f, 0xbe, 0xef, +0x22, 0xc3, 0x13, 0xf5, 0x00, 0xef, 0x13, 0xf5, 0x00, 0xd3, 0x74, 0x10, 0x93, 0x95, 0x00, 0x74, +0x0f, 0x93, 0x95, 0x00, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xff, 0xe5, 0x00, 0x95, 0x00, 0xfe, +0xe4, 0x95, 0x00, 0xfd, 0xe4, 0x95, 0x00, 0xfc, 0x22, 0xc3, 0x74, 0x64, 0x95, 0x23, 0xff, 0xe4, +0x94, 0x00, 0xfe, 0xe4, 0xfc, 0xfd, 0x22, 0xc3, 0xe5, 0x00, 0x95, 0x00, 0xfb, 0xe5, 0x00, 0x95, +0x00, 0xfa, 0xe4, 0x95, 0x00, 0xf9, 0xe4, 0x95, 0x00, 0x22, 0xe5, 0x00, 0x25, 0x00, 0xff, 0xe5, +0x00, 0x35, 0x00, 0xfe, 0xe4, 0x35, 0x00, 0xfd, 0xe4, 0x35, 0x00, 0xfc, 0x22, 0x74, 0x03, 0x93, +0xfe, 0x74, 0x04, 0x93, 0xff, 0x78, 0x7a, 0xe6, 0xfd, 0x7c, 0x00, 0x02, 0x0c, 0x7a, 0x93, 0xff, +0xe4, 0xfc, 0xfd, 0x12, 0x0f, 0x7a, 0x12, 0x0e, 0x17, 0xe4, 0x7b, 0x02, 0xfa, 0xf9, 0xf8, 0x22, +0x3c, 0xfe, 0xd3, 0xe5, 0x00, 0x9f, 0xe5, 0x00, 0x9e, 0x22, 0xa8, 0x07, 0xe8, 0x24, 0x03, 0xf8, +0xc3, 0xe2, 0x9d, 0xf5, 0x2b, 0x18, 0xe2, 0x9c, 0xf5, 0x2a, 0x22, 0xf8, 0xe2, 0x2f, 0xf5, 0x28, +0x18, 0xe2, 0x3e, 0xf5, 0x27, 0x22, 0xe6, 0xff, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xef, 0x2d, 0xff, +0xe4, 0x3c, 0xc3, 0x13, 0xef, 0x13, 0x22, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x22, 0x25, 0xe0, +0x24, 0x5d, 0xf8, 0xe2, 0x22, 0x85, 0x40, 0x82, 0x85, 0x3f, 0x83, 0x75, 0xf0, 0x09, 0xe5, 0x21, +0x02, 0x0f, 0xac, 0x24, 0x2a, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xef, 0x22, 0xc3, 0xe5, 0x00, 0x9d, +0xf5, 0x00, 0xe5, 0x00, 0x9c, 0xf5, 0x00, 0xa8, 0x07, 0xe8, 0x22, 0xf5, 0x83, 0xe5, 0x82, 0x2d, +0xf5, 0x82, 0xe5, 0x83, 0x3c, 0xf5, 0x83, 0xef, 0xf0, 0x22, 0xf5, 0x00, 0xea, 0x3e, 0xf5, 0x00, +0xe9, 0x3d, 0xf5, 0x00, 0xe8, 0x3c, 0xf5, 0x00, 0x22, 0x74, 0x1e, 0x93, 0xfe, 0xa8, 0x07, 0xe8, +0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x9e, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0d, 0xf8, 0xe2, 0xc3, 0x22, +0xa8, 0x07, 0xc3, 0x08, 0xe2, 0x9d, 0xf5, 0x29, 0x18, 0xe2, 0x9c, 0xf5, 0x28, 0x22, 0x75, 0xf0, +0x2e, 0xa4, 0x24, 0x03, 0x22, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x06, 0x22, 0xff, 0xae, 0xf0, 0xe4, +0xfc, 0xfd, 0x22, 0xa8, 0x07, 0xe8, 0x24, 0x02, 0xf8, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0e, 0xf8, +0x22, 0xe2, 0xfc, 0x08, 0xe2, 0x2f, 0xff, 0xee, 0x3c, 0xfe, 0xef, 0x78, 0x02, 0x22, 0xef, 0x2b, +0xff, 0xee, 0x3a, 0xfe, 0xe9, 0x3d, 0xfd, 0xe8, 0x3c, 0xfc, 0x22, 0xe4, 0x7f, 0x01, 0xfe, 0xfd, +0xfc, 0x22, 0xab, 0x00, 0xaa, 0x00, 0xa9, 0x00, 0x22, 0xc3, 0xe5, 0x00, 0x9f, 0xf5, 0x00, 0xe5, +0x00, 0x9e, 0xf5, 0x00, 0x22, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xfe, 0x22, 0x78, 0x66, 0x12, +0x0f, 0x6e, 0x78, 0x62, 0x12, 0x0f, 0x7a, 0xeb, 0x22, 0xe5, 0x31, 0x25, 0x31, 0xf5, 0x31, 0xe5, +0x30, 0x33, 0xf5, 0x30, 0x22, 0xc3, 0xe5, 0x26, 0x95, 0x28, 0xff, 0xe5, 0x25, 0x95, 0x27, 0xfe, +0x22, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0x75, 0xf0, 0x02, 0xe5, 0x00, 0x22, 0xf8, 0xe4, 0xfc, 0xfd, +0x02, 0x0e, 0x17, 0x13, 0xfb, 0xaa, 0x06, 0xe4, 0xf9, 0xf8, 0x22, 0xf8, 0xe4, 0xf2, 0x08, 0x74, +0x80, 0xf2, 0xa8, 0x07, 0xe8, 0x22, 0xe4, 0xfc, 0xfd, 0xeb, 0x25, 0x00, 0xff, 0xea, 0x35, 0x00, +0x22, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x01, 0x22, 0xce, 0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, 0x78, +0x79, 0xe6, 0x24, 0x19, 0xf8, 0x22, 0x78, 0x79, 0xe6, 0x24, 0x0c, 0xf8, 0x22, 0xd3, 0xe5, 0x35, +0x95, 0x37, 0xe5, 0x34, 0x95, 0x36, 0x22, 0xe2, 0x2f, 0xf5, 0x26, 0x18, 0xe2, 0x3e, 0xf5, 0x25, +0x22, 0x24, 0x40, 0xff, 0xe4, 0x3e, 0xfe, 0x22, 0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, +0xe7, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x3e, 0x88, 0x82, 0x8c, 0x83, 0xe7, 0x09, 0xf0, 0xa3, +0xdf, 0xfa, 0x80, 0x32, 0xe3, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x78, 0xe3, 0x09, 0xf2, 0x08, +0xdf, 0xfa, 0x80, 0x70, 0x88, 0x82, 0x8c, 0x83, 0xe3, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x64, +0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x58, 0x89, 0x82, 0x8a, 0x83, +0xe0, 0xa3, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x4c, 0x80, 0xd2, 0x80, 0xfa, 0x80, 0xc6, 0x80, 0xd4, +0x80, 0x69, 0x80, 0xf2, 0x80, 0x33, 0x80, 0x10, 0x80, 0xa6, 0x80, 0xea, 0x80, 0x9a, 0x80, 0xa8, +0x80, 0xda, 0x80, 0xe2, 0x80, 0xca, 0x80, 0x33, 0x89, 0x82, 0x8a, 0x83, 0xec, 0xfa, 0xe4, 0x93, +0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, +0xc5, 0x83, 0xcc, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0x0d, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, +0xf6, 0x08, 0xdf, 0xf9, 0xec, 0xfa, 0xa9, 0xf0, 0xed, 0xfb, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xec, +0xfa, 0xe0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, +0xc8, 0xcc, 0xc5, 0x83, 0xcc, 0xdf, 0xea, 0xde, 0xe8, 0x80, 0xdb, 0x89, 0x82, 0x8a, 0x83, 0xe4, +0x93, 0xa3, 0xf2, 0x08, 0xdf, 0xf9, 0x80, 0xcc, 0x88, 0xf0, 0xef, 0x60, 0x01, 0x0e, 0x4e, 0x60, +0xc3, 0x88, 0xf0, 0xed, 0x24, 0x02, 0xb4, 0x04, 0x00, 0x50, 0xb9, 0xf5, 0x82, 0xeb, 0x24, 0x02, +0xb4, 0x04, 0x00, 0x50, 0xaf, 0x23, 0x23, 0x45, 0x82, 0x23, 0x90, 0x0b, 0x48, 0x73, 0xbb, 0x01, +0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, +0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, +0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, +0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, +0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, +0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xf8, 0xbb, 0x01, 0x0d, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, +0x83, 0x3a, 0xf5, 0x83, 0xe8, 0xf0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xc8, 0xf6, 0x22, 0xbb, +0xfe, 0x05, 0xe9, 0x25, 0x82, 0xc8, 0xf2, 0x22, 0xef, 0x8d, 0xf0, 0xa4, 0xa8, 0xf0, 0xcf, 0x8c, +0xf0, 0xa4, 0x28, 0xce, 0x8d, 0xf0, 0xa4, 0x2e, 0xfe, 0x22, 0xbc, 0x00, 0x0b, 0xbe, 0x00, 0x29, +0xef, 0x8d, 0xf0, 0x84, 0xff, 0xad, 0xf0, 0x22, 0xe4, 0xcc, 0xf8, 0x75, 0xf0, 0x08, 0xef, 0x2f, +0xff, 0xee, 0x33, 0xfe, 0xec, 0x33, 0xfc, 0xee, 0x9d, 0xec, 0x98, 0x40, 0x05, 0xfc, 0xee, 0x9d, +0xfe, 0x0f, 0xd5, 0xf0, 0xe9, 0xe4, 0xce, 0xfd, 0x22, 0xed, 0xf8, 0xf5, 0xf0, 0xee, 0x84, 0x20, +0xd2, 0x1c, 0xfe, 0xad, 0xf0, 0x75, 0xf0, 0x08, 0xef, 0x2f, 0xff, 0xed, 0x33, 0xfd, 0x40, 0x07, +0x98, 0x50, 0x06, 0xd5, 0xf0, 0xf2, 0x22, 0xc3, 0x98, 0xfd, 0x0f, 0xd5, 0xf0, 0xea, 0x22, 0xc2, +0xd5, 0xec, 0x30, 0xe7, 0x09, 0xb2, 0xd5, 0xe4, 0xc3, 0x9d, 0xfd, 0xe4, 0x9c, 0xfc, 0xee, 0x30, +0xe7, 0x15, 0xb2, 0xd5, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x12, 0x0c, 0x7a, 0xc3, 0xe4, +0x9d, 0xfd, 0xe4, 0x9c, 0xfc, 0x80, 0x03, 0x12, 0x0c, 0x7a, 0x30, 0xd5, 0x07, 0xc3, 0xe4, 0x9f, +0xff, 0xe4, 0x9e, 0xfe, 0x22, 0xc5, 0xf0, 0xf8, 0xa3, 0xe0, 0x28, 0xf0, 0xc5, 0xf0, 0xf8, 0xe5, +0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x38, 0xf0, 0x22, 0xbb, 0x01, 0x0a, 0x89, 0x82, +0x8a, 0x83, 0xe0, 0xf5, 0xf0, 0xa3, 0xe0, 0x22, 0x50, 0x06, 0x87, 0xf0, 0x09, 0xe7, 0x19, 0x22, +0xbb, 0xfe, 0x07, 0xe3, 0xf5, 0xf0, 0x09, 0xe3, 0x19, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, +0xf5, 0xf0, 0x74, 0x01, 0x93, 0x22, 0xbb, 0x01, 0x10, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, +0x3a, 0xf5, 0x83, 0xe0, 0xf5, 0xf0, 0xa3, 0xe0, 0x22, 0x50, 0x09, 0xe9, 0x25, 0x82, 0xf8, 0x86, +0xf0, 0x08, 0xe6, 0x22, 0xbb, 0xfe, 0x0a, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0xf5, 0xf0, 0x08, 0xe2, +0x22, 0xe5, 0x83, 0x2a, 0xf5, 0x83, 0xe9, 0x93, 0xf5, 0xf0, 0xa3, 0xe9, 0x93, 0x22, 0xbb, 0x01, +0x0d, 0xc5, 0x82, 0x29, 0xc5, 0x82, 0xc5, 0x83, 0x3a, 0xc5, 0x83, 0x02, 0x0d, 0x05, 0x50, 0x11, +0xc5, 0x82, 0x29, 0xf8, 0x08, 0xe5, 0xf0, 0x26, 0xf6, 0x18, 0xf5, 0xf0, 0xe5, 0x82, 0x36, 0xf6, +0x22, 0xbb, 0xfe, 0x11, 0xc5, 0x82, 0x29, 0xf8, 0x08, 0xe2, 0x25, 0xf0, 0xf5, 0xf0, 0xf2, 0x18, +0xe2, 0x35, 0x82, 0xf2, 0x22, 0xf8, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x2a, 0xf5, 0x83, +0x74, 0x01, 0x93, 0x25, 0xf0, 0xf5, 0xf0, 0xe4, 0x93, 0x38, 0x22, 0xbb, 0x01, 0x0a, 0x89, 0x82, +0x8a, 0x83, 0xf0, 0xe5, 0xf0, 0xa3, 0xf0, 0x22, 0x50, 0x06, 0xf7, 0x09, 0xa7, 0xf0, 0x19, 0x22, +0xbb, 0xfe, 0x06, 0xf3, 0xe5, 0xf0, 0x09, 0xf3, 0x19, 0x22, 0xf8, 0xbb, 0x01, 0x11, 0xe5, 0x82, +0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe8, 0xf0, 0xe5, 0xf0, 0xa3, 0xf0, 0x22, 0x50, +0x09, 0xe9, 0x25, 0x82, 0xc8, 0xf6, 0x08, 0xa6, 0xf0, 0x22, 0xbb, 0xfe, 0x09, 0xe9, 0x25, 0x82, +0xc8, 0xf2, 0xe5, 0xf0, 0x08, 0xf2, 0x22, 0xe8, 0x8f, 0xf0, 0xa4, 0xcc, 0x8b, 0xf0, 0xa4, 0x2c, +0xfc, 0xe9, 0x8e, 0xf0, 0xa4, 0x2c, 0xfc, 0x8a, 0xf0, 0xed, 0xa4, 0x2c, 0xfc, 0xea, 0x8e, 0xf0, +0xa4, 0xcd, 0xa8, 0xf0, 0x8b, 0xf0, 0xa4, 0x2d, 0xcc, 0x38, 0x25, 0xf0, 0xfd, 0xe9, 0x8f, 0xf0, +0xa4, 0x2c, 0xcd, 0x35, 0xf0, 0xfc, 0xeb, 0x8e, 0xf0, 0xa4, 0xfe, 0xa9, 0xf0, 0xeb, 0x8f, 0xf0, +0xa4, 0xcf, 0xc5, 0xf0, 0x2e, 0xcd, 0x39, 0xfe, 0xe4, 0x3c, 0xfc, 0xea, 0xa4, 0x2d, 0xce, 0x35, +0xf0, 0xfd, 0xe4, 0x3c, 0xfc, 0x22, 0x75, 0xf0, 0x08, 0x75, 0x82, 0x00, 0xef, 0x2f, 0xff, 0xee, +0x33, 0xfe, 0xcd, 0x33, 0xcd, 0xcc, 0x33, 0xcc, 0xc5, 0x82, 0x33, 0xc5, 0x82, 0x9b, 0xed, 0x9a, +0xec, 0x99, 0xe5, 0x82, 0x98, 0x40, 0x0c, 0xf5, 0x82, 0xee, 0x9b, 0xfe, 0xed, 0x9a, 0xfd, 0xec, +0x99, 0xfc, 0x0f, 0xd5, 0xf0, 0xd6, 0xe4, 0xce, 0xfb, 0xe4, 0xcd, 0xfa, 0xe4, 0xcc, 0xf9, 0xa8, +0x82, 0x22, 0xb8, 0x00, 0xc1, 0xb9, 0x00, 0x59, 0xba, 0x00, 0x2d, 0xec, 0x8b, 0xf0, 0x84, 0xcf, +0xce, 0xcd, 0xfc, 0xe5, 0xf0, 0xcb, 0xf9, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, +0x33, 0xfd, 0xec, 0x33, 0xfc, 0xeb, 0x33, 0xfb, 0x10, 0xd7, 0x03, 0x99, 0x40, 0x04, 0xeb, 0x99, +0xfb, 0x0f, 0xd8, 0xe5, 0xe4, 0xf9, 0xfa, 0x22, 0x78, 0x18, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, +0xed, 0x33, 0xfd, 0xec, 0x33, 0xfc, 0xc9, 0x33, 0xc9, 0x10, 0xd7, 0x05, 0x9b, 0xe9, 0x9a, 0x40, +0x07, 0xec, 0x9b, 0xfc, 0xe9, 0x9a, 0xf9, 0x0f, 0xd8, 0xe0, 0xe4, 0xc9, 0xfa, 0xe4, 0xcc, 0xfb, +0x22, 0x75, 0xf0, 0x10, 0xef, 0x2f, 0xff, 0xee, 0x33, 0xfe, 0xed, 0x33, 0xfd, 0xcc, 0x33, 0xcc, +0xc8, 0x33, 0xc8, 0x10, 0xd7, 0x07, 0x9b, 0xec, 0x9a, 0xe8, 0x99, 0x40, 0x0a, 0xed, 0x9b, 0xfd, +0xec, 0x9a, 0xfc, 0xe8, 0x99, 0xf8, 0x0f, 0xd5, 0xf0, 0xda, 0xe4, 0xcd, 0xfb, 0xe4, 0xcc, 0xfa, +0xe4, 0xc8, 0xf9, 0x22, 0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, 0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, +0xec, 0x64, 0x80, 0xc8, 0x64, 0x80, 0x98, 0x45, 0xf0, 0x22, 0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, +0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, 0xe8, 0x9c, 0x45, 0xf0, 0x22, 0xe8, 0x60, 0x0f, 0xec, 0xc3, +0x13, 0xfc, 0xed, 0x13, 0xfd, 0xee, 0x13, 0xfe, 0xef, 0x13, 0xff, 0xd8, 0xf1, 0x22, 0xe6, 0xfc, +0x08, 0xe6, 0xfd, 0x08, 0xe6, 0xfe, 0x08, 0xe6, 0xff, 0x22, 0xe6, 0xfb, 0x08, 0xe6, 0xf9, 0x08, +0xe6, 0xfa, 0x08, 0xe6, 0xcb, 0xf8, 0x22, 0xec, 0xf6, 0x08, 0xed, 0xf6, 0x08, 0xee, 0xf6, 0x08, +0xef, 0xf6, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xe4, 0x93, 0xf6, 0x08, 0x74, 0x01, 0x93, 0xf6, 0x08, +0x74, 0x02, 0x93, 0xf6, 0x08, 0x74, 0x03, 0x93, 0xf6, 0x74, 0x04, 0x73, 0xa4, 0x25, 0x82, 0xf5, +0x82, 0xe5, 0xf0, 0x35, 0x83, 0xf5, 0x83, 0x22, 0x8a, 0x83, 0x89, 0x82, 0xe4, 0x73, 0xec, 0x8e, +0xf0, 0xa4, 0xcc, 0xc5, 0xf0, 0xcc, 0xcd, 0xf8, 0xef, 0xa4, 0xce, 0xc5, 0xf0, 0x2d, 0xfd, 0xe4, +0x3c, 0xfc, 0xe8, 0xa4, 0x2e, 0xc8, 0xc5, 0xf0, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xef, 0xa4, 0xff, +0xe5, 0xf0, 0x28, 0xfe, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0x22, 0xef, 0x4e, 0x60, 0x12, 0xef, +0x60, 0x01, 0x0e, 0xed, 0xbb, 0x01, 0x0b, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0xa3, 0xdf, 0xfc, 0xde, +0xfa, 0x22, 0x89, 0xf0, 0x50, 0x07, 0xf7, 0x09, 0xdf, 0xfc, 0xa9, 0xf0, 0x22, 0xbb, 0xfe, 0xfc, +0xf3, 0x09, 0xdf, 0xfc, 0xa9, 0xf0, 0x22, 0x90, 0x36, 0x03, 0x7d, 0x1f, 0x12, 0x32, 0xb1, 0xee, +0x44, 0x80, 0xf5, 0x8f, 0x8f, 0x8e, 0x75, 0x8a, 0xa0, 0x75, 0x8a, 0x0a, 0xe4, 0x90, 0x00, 0xbb, +0xf0, 0x90, 0x00, 0xc1, 0xe0, 0x60, 0x33, 0x14, 0x60, 0x66, 0x24, 0xfc, 0x70, 0x03, 0x02, 0x12, +0x1b, 0x04, 0x60, 0x03, 0x02, 0x12, 0x57, 0xe4, 0xf5, 0x18, 0x75, 0x19, 0x04, 0x78, 0x7d, 0xf6, +0x90, 0x36, 0x12, 0x93, 0x70, 0x0b, 0x75, 0x4d, 0x36, 0x75, 0x4e, 0x2a, 0x12, 0x3a, 0x2b, 0x8f, +0x18, 0x90, 0x01, 0xaa, 0xe5, 0x18, 0xf0, 0x02, 0x12, 0x57, 0xe4, 0x78, 0x7d, 0xf6, 0x12, 0x2f, +0x31, 0xef, 0x64, 0x01, 0x60, 0xf8, 0xaf, 0x4e, 0xae, 0x4d, 0x12, 0x20, 0x21, 0xaf, 0x4e, 0xae, +0x4d, 0x12, 0x34, 0x70, 0xaf, 0x4e, 0xae, 0x4d, 0x12, 0x35, 0x66, 0xe5, 0x4e, 0x24, 0x9d, 0xff, +0xe4, 0x35, 0x4d, 0xfe, 0x12, 0x35, 0x96, 0x12, 0x32, 0xbb, 0xa3, 0x04, 0xf0, 0x02, 0x12, 0x5c, +0xe4, 0xf5, 0x18, 0x78, 0x55, 0xf6, 0x90, 0x01, 0xff, 0xe0, 0xff, 0xb4, 0x01, 0x09, 0x90, 0x00, +0xc1, 0x74, 0x05, 0xf0, 0x02, 0x12, 0x5c, 0xef, 0xb4, 0x02, 0x0e, 0x90, 0x01, 0xc0, 0xe0, 0xb4, +0xca, 0x07, 0x75, 0x4b, 0x01, 0xa3, 0xe0, 0xf5, 0x4c, 0x78, 0x7d, 0x76, 0x01, 0x12, 0x32, 0xc6, +0x12, 0x1c, 0xec, 0x78, 0x55, 0xa6, 0x07, 0x12, 0x32, 0x95, 0x74, 0x87, 0x93, 0x70, 0x03, 0x74, +0x86, 0x93, 0x60, 0x1b, 0x08, 0xe6, 0xf5, 0x19, 0x08, 0xe6, 0xf5, 0x1a, 0x08, 0xe6, 0xfe, 0x08, +0xe6, 0xff, 0x78, 0x56, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x08, 0xa6, 0x19, 0x08, 0xa6, 0x1a, 0x7f, +0x5d, 0xe5, 0x4e, 0x24, 0x9d, 0xfd, 0xe4, 0x35, 0x4d, 0xfc, 0x12, 0x2b, 0xb9, 0x8f, 0x18, 0x12, +0x32, 0xc6, 0x75, 0x1f, 0x36, 0x75, 0x20, 0x23, 0xad, 0x18, 0x12, 0x19, 0x5d, 0x8f, 0x18, 0x78, +0x55, 0xe6, 0xb4, 0x02, 0x17, 0xe4, 0xf5, 0x19, 0xe5, 0x18, 0x64, 0x05, 0x60, 0x05, 0xe5, 0x18, +0xb4, 0x0c, 0x03, 0x43, 0x18, 0x80, 0x78, 0x55, 0xa6, 0x0a, 0x80, 0x04, 0xe4, 0x78, 0x55, 0xf6, +0x78, 0x5a, 0xe6, 0x70, 0x03, 0x02, 0x11, 0xce, 0xe5, 0x4b, 0x60, 0x03, 0x02, 0x11, 0xce, 0x90, +0x01, 0xea, 0xe0, 0xff, 0x30, 0xe2, 0x0b, 0x78, 0x85, 0xe2, 0x24, 0x01, 0xf2, 0x18, 0xe2, 0x34, +0x00, 0xf2, 0x78, 0x60, 0xe6, 0x60, 0x04, 0xef, 0x20, 0xe0, 0x0c, 0xe5, 0x18, 0xb4, 0xaa, 0x0f, +0x90, 0x01, 0xea, 0xe0, 0x30, 0xe1, 0x08, 0x90, 0x00, 0xc0, 0xe0, 0x04, 0xf0, 0x80, 0x08, 0x90, +0x00, 0xc0, 0xe0, 0x60, 0x02, 0x14, 0xf0, 0x90, 0x36, 0x08, 0xe4, 0x93, 0x75, 0xf0, 0x64, 0xa4, +0xff, 0xd3, 0x78, 0x85, 0xe2, 0x9f, 0x18, 0xe2, 0x95, 0xf0, 0x50, 0x1b, 0x12, 0x32, 0x95, 0x74, +0xc0, 0x93, 0x24, 0x02, 0xff, 0xe4, 0x33, 0xfe, 0x90, 0x00, 0xc0, 0xe0, 0xd3, 0x9f, 0xee, 0x64, +0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x17, 0x12, 0x31, 0xd4, 0x7f, 0x01, 0x12, 0x3a, 0x36, 0xe4, +0x78, 0x5a, 0xf6, 0x78, 0x60, 0xf6, 0x78, 0x5b, 0x76, 0x04, 0x78, 0x61, 0x76, 0x04, 0x12, 0x32, +0xc6, 0x78, 0x55, 0xe6, 0xf5, 0x1f, 0xad, 0x18, 0x12, 0x13, 0x0a, 0x78, 0x5a, 0xe6, 0x60, 0x19, +0x90, 0x36, 0x06, 0x7d, 0x64, 0x12, 0x32, 0xb1, 0xc3, 0x78, 0x7f, 0xe6, 0x9f, 0x18, 0xe6, 0x9e, +0x50, 0x6a, 0xa6, 0x06, 0x08, 0xa6, 0x07, 0x80, 0x63, 0x90, 0x01, 0xfe, 0xe0, 0x70, 0x17, 0x78, +0x7f, 0xe6, 0x18, 0x46, 0x60, 0x09, 0x08, 0xe6, 0x16, 0x18, 0x70, 0x0a, 0x16, 0x80, 0x07, 0x78, +0x7e, 0x76, 0x00, 0x08, 0x76, 0x14, 0x12, 0x32, 0xbb, 0x80, 0x41, 0x12, 0x31, 0xd4, 0x12, 0x32, +0x95, 0xe4, 0x93, 0x90, 0x01, 0xcb, 0xf0, 0x90, 0x01, 0xff, 0xe0, 0xb4, 0x01, 0x2e, 0x75, 0x1e, +0x01, 0x75, 0x1f, 0x01, 0x75, 0x20, 0x40, 0x75, 0x21, 0x01, 0x75, 0x22, 0x01, 0x75, 0x23, 0x80, +0x7b, 0x01, 0x7a, 0x01, 0x79, 0xc0, 0x12, 0x1e, 0x88, 0xe4, 0x90, 0x01, 0xff, 0xf0, 0x75, 0x8a, +0xa0, 0x90, 0x00, 0xb8, 0xf0, 0x80, 0xd0, 0xe4, 0x90, 0x00, 0xc1, 0xf0, 0x90, 0x01, 0xe5, 0xe0, +0x64, 0x03, 0x60, 0x08, 0x90, 0x01, 0xb5, 0xe0, 0x64, 0x03, 0x70, 0x64, 0x90, 0x36, 0x0e, 0xe4, +0x93, 0xf5, 0x18, 0x12, 0x31, 0xd4, 0x7f, 0x01, 0x12, 0x34, 0x9a, 0xe5, 0x18, 0x70, 0x05, 0x90, +0xff, 0x11, 0x80, 0x0d, 0xe5, 0x18, 0xb4, 0x01, 0x0c, 0x90, 0xff, 0x10, 0xe0, 0x44, 0x18, 0xf0, +0xa3, 0xe0, 0x44, 0x18, 0xf0, 0x90, 0x01, 0xb5, 0xe0, 0xb4, 0x03, 0x15, 0x90, 0xff, 0x12, 0xe0, +0x54, 0xe3, 0xf0, 0x90, 0xff, 0x11, 0xe0, 0x54, 0xe3, 0xf0, 0x90, 0xff, 0x10, 0xe0, 0x54, 0xe3, +0xf0, 0x75, 0x8f, 0x87, 0x75, 0x8e, 0xff, 0x75, 0x8d, 0x87, 0x75, 0x8c, 0xff, 0x12, 0x32, 0x9c, +0x75, 0x8a, 0xa0, 0xf0, 0x12, 0x35, 0x04, 0x12, 0x32, 0x9c, 0x75, 0x8a, 0xa0, 0xf0, 0x80, 0xed, +0x75, 0x18, 0x27, 0x75, 0x19, 0x10, 0xe5, 0x89, 0x30, 0xe7, 0x0f, 0x75, 0x89, 0x80, 0x90, 0x00, +0xbb, 0xe0, 0xc3, 0x94, 0xff, 0x50, 0x03, 0xe0, 0x04, 0xf0, 0x90, 0x00, 0xbb, 0xe0, 0xc3, 0x78, +0x7d, 0x96, 0x50, 0x15, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, +0x08, 0x12, 0x34, 0xe3, 0x12, 0x32, 0x9c, 0x80, 0xe1, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, 0x89, 0x1d, +0x8d, 0x1e, 0x90, 0x01, 0xfa, 0xe0, 0xf5, 0x20, 0xe4, 0xf5, 0x21, 0x85, 0x1f, 0x1f, 0xe5, 0x1e, +0x60, 0x04, 0x90, 0x00, 0xc3, 0xf0, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0x75, 0x22, 0x01, +0x75, 0x23, 0x00, 0x78, 0x82, 0xe6, 0xff, 0x70, 0x0b, 0x74, 0x20, 0x25, 0x23, 0xf5, 0x23, 0xe4, +0x35, 0x22, 0xf5, 0x22, 0x74, 0x00, 0x2f, 0xf9, 0xe4, 0x34, 0x01, 0xfa, 0x7b, 0x01, 0xa8, 0x23, +0xac, 0x22, 0x7d, 0x01, 0x7e, 0x00, 0x7f, 0x20, 0x12, 0x0b, 0xc8, 0x7e, 0x00, 0x7f, 0x0b, 0x7d, +0xff, 0xe5, 0x23, 0x24, 0x09, 0xfb, 0xe4, 0x35, 0x22, 0xfa, 0xa9, 0x03, 0x7b, 0x01, 0x12, 0x0f, +0xeb, 0x05, 0x23, 0xe5, 0x23, 0xae, 0x22, 0x70, 0x02, 0x05, 0x22, 0x14, 0xf5, 0x82, 0x8e, 0x83, +0xe4, 0xf0, 0x12, 0x2b, 0x9e, 0x90, 0x00, 0x0a, 0x12, 0x2b, 0x5f, 0xff, 0x90, 0x00, 0x04, 0x12, +0x0c, 0x07, 0x2f, 0xf5, 0x21, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xb4, 0x04, 0x09, 0x12, 0x2b, +0x84, 0x70, 0x04, 0x90, 0x00, 0xc2, 0xf0, 0x90, 0x00, 0xc2, 0xe0, 0x60, 0x55, 0x14, 0xf0, 0xe0, +0xff, 0x7e, 0x04, 0x60, 0x02, 0x7e, 0x08, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x05, 0xee, 0x12, 0x0c, +0x46, 0xef, 0x60, 0x0b, 0x12, 0x2b, 0xa8, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0x80, 0x10, 0x90, +0x00, 0xc3, 0xe0, 0xff, 0xb4, 0x05, 0x02, 0x80, 0x02, 0x7f, 0x00, 0xef, 0x7f, 0x00, 0xfe, 0x12, +0x2b, 0x46, 0x12, 0x2b, 0x5c, 0xc4, 0x54, 0xf0, 0xfe, 0x12, 0x2b, 0xa8, 0x12, 0x0d, 0x1b, 0xfd, +0xe5, 0xf0, 0x54, 0x0f, 0xfc, 0xe4, 0x2d, 0xff, 0xee, 0x3c, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x02, +0x15, 0x0f, 0x12, 0x2b, 0x5c, 0x70, 0x09, 0x12, 0x2b, 0x84, 0x70, 0x04, 0xe5, 0x1e, 0x60, 0x51, +0x12, 0x2b, 0x8a, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x5c, 0x60, 0x14, 0xc4, 0x54, 0xf0, 0xfe, 0x12, +0x0d, 0x1b, 0x24, 0x00, 0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2b, 0x21, 0x12, 0x2b, 0x68, 0x12, +0x2b, 0x7e, 0x60, 0x32, 0xc4, 0x54, 0xf0, 0xfe, 0x90, 0x00, 0x06, 0x12, 0x0d, 0x46, 0x24, 0x00, +0xff, 0xee, 0x35, 0xf0, 0xfe, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x08, 0x12, 0x0d, +0x46, 0x24, 0x00, 0xff, 0xe5, 0xf0, 0x34, 0x10, 0xfe, 0x12, 0x2b, 0x46, 0x12, 0x2b, 0x68, 0x80, +0x05, 0xe4, 0x90, 0x00, 0xc3, 0xf0, 0x90, 0x01, 0xfe, 0xe0, 0xd3, 0x94, 0xf0, 0x50, 0x03, 0x02, +0x15, 0x0f, 0x12, 0x2b, 0x9e, 0xe5, 0x1f, 0x60, 0x14, 0x12, 0x2b, 0x8c, 0x12, 0x2b, 0x46, 0x7e, +0x00, 0x7f, 0x08, 0x7d, 0x00, 0x12, 0x2b, 0xa8, 0x12, 0x0f, 0xeb, 0x80, 0x21, 0x12, 0x2b, 0x8a, +0x12, 0x2b, 0x46, 0x12, 0x2b, 0x97, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0x12, 0x2b, 0x21, 0x90, +0x00, 0x06, 0x12, 0x2b, 0x3a, 0x12, 0x2b, 0x97, 0x90, 0x00, 0x08, 0x12, 0x2b, 0x40, 0x90, 0x01, +0x40, 0x74, 0x40, 0xf0, 0x90, 0x01, 0x60, 0x74, 0x60, 0xf0, 0x75, 0x2a, 0x01, 0x75, 0x2b, 0x41, +0x75, 0x28, 0x01, 0x75, 0x29, 0x61, 0xe4, 0xf5, 0x27, 0xaf, 0x27, 0x12, 0x3a, 0x3b, 0xe5, 0x2b, +0xfd, 0x24, 0x02, 0xf5, 0x2b, 0xe5, 0x2a, 0xfc, 0x34, 0x00, 0xf5, 0x2a, 0x12, 0x2b, 0xaf, 0xaf, +0x27, 0x12, 0x35, 0xe9, 0xef, 0xd3, 0x94, 0x1c, 0x40, 0x06, 0x7e, 0x0f, 0x7f, 0xff, 0x80, 0x05, +0xaf, 0x27, 0x12, 0x3a, 0x08, 0xe5, 0x29, 0xfd, 0x24, 0x02, 0xf5, 0x29, 0xe5, 0x28, 0xfc, 0x34, +0x00, 0xf5, 0x28, 0x12, 0x2b, 0xaf, 0x05, 0x27, 0xe5, 0x27, 0xc3, 0x94, 0x10, 0x40, 0xba, 0x78, +0x82, 0xe6, 0x7f, 0x00, 0x70, 0x02, 0x7f, 0x20, 0x78, 0x82, 0xa6, 0x07, 0xe5, 0x20, 0x20, 0xe7, +0x2a, 0x30, 0xe6, 0x0a, 0x12, 0x2b, 0x5c, 0x70, 0x22, 0x12, 0x2b, 0x84, 0x70, 0x1d, 0xe5, 0x20, +0x30, 0xe5, 0x0f, 0x12, 0x2b, 0x7e, 0xff, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0x4f, 0x54, 0x84, +0x70, 0x09, 0xe5, 0x20, 0x30, 0xe4, 0x0c, 0xe5, 0x1e, 0x60, 0x08, 0x90, 0x01, 0xed, 0xe0, 0xff, +0x12, 0x33, 0xb4, 0x22, 0x8f, 0x23, 0xef, 0x12, 0x06, 0x85, 0xe6, 0xf5, 0x2f, 0x12, 0x05, 0xf0, +0x12, 0x09, 0x3d, 0x8e, 0x30, 0x8f, 0x31, 0xe5, 0x2f, 0x70, 0x60, 0x75, 0x24, 0x01, 0x12, 0x0a, +0x79, 0xe4, 0xf5, 0x29, 0xf5, 0x2a, 0x78, 0x5f, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x5e, 0x12, +0x0a, 0xe7, 0x78, 0x63, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x62, 0x12, 0x09, 0x7c, 0xc3, 0x74, +0x09, 0x93, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0x12, 0x0a, 0x85, 0x80, 0x04, 0xae, 0x27, 0xaf, +0x28, 0x12, 0x08, 0x65, 0x12, 0x05, 0xef, 0x74, 0x09, 0x93, 0xfe, 0x74, 0x0a, 0x12, 0x07, 0x52, +0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0x8e, 0x27, 0x8f, 0x28, +0x78, 0x67, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0x78, 0x66, 0x80, 0x72, 0x78, 0x7a, 0xe6, 0x14, 0x65, +0x2f, 0x70, 0x75, 0xf5, 0x24, 0x12, 0x0a, 0x79, 0x12, 0x05, 0xf0, 0x74, 0x03, 0x93, 0xf5, 0x29, +0x74, 0x04, 0x93, 0xf5, 0x2a, 0x12, 0x06, 0x2a, 0x12, 0x07, 0x86, 0x24, 0x5e, 0x12, 0x07, 0x7c, +0x24, 0x5b, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, 0x5a, 0x12, 0x09, 0x7b, 0xc3, 0x74, 0x0b, +0x93, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0x12, 0x0a, 0x85, 0x80, 0x04, 0xae, 0x27, 0xaf, 0x28, +0x12, 0x08, 0x65, 0x12, 0x05, 0xef, 0x74, 0x0b, 0x93, 0xfe, 0x74, 0x0c, 0x12, 0x07, 0x52, 0x40, +0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x01, 0x8e, 0x27, 0x8f, 0x28, 0x12, +0x07, 0x86, 0x24, 0x57, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, 0x56, 0xf8, 0xe2, 0x2f, 0xf5, +0x2c, 0x18, 0xe2, 0x3e, 0xf5, 0x2b, 0x80, 0x79, 0xe5, 0x2f, 0xfd, 0x7c, 0x00, 0xae, 0x30, 0xaf, +0x31, 0x12, 0x0c, 0x68, 0xac, 0x06, 0xad, 0x07, 0xe5, 0x30, 0xc3, 0x13, 0xfe, 0xe5, 0x31, 0x13, +0x2d, 0xf5, 0x2a, 0xec, 0x3e, 0xf5, 0x29, 0x12, 0x07, 0x86, 0x24, 0x5b, 0x12, 0x06, 0x32, 0x12, +0x07, 0x86, 0x24, 0x5a, 0x12, 0x07, 0x7c, 0x24, 0x63, 0x12, 0x06, 0x32, 0x12, 0x07, 0x86, 0x24, +0x62, 0x12, 0x09, 0x7b, 0xd3, 0xe5, 0x26, 0x95, 0x28, 0xe5, 0x27, 0x64, 0x80, 0xf8, 0xe5, 0x25, +0x64, 0x80, 0x98, 0x40, 0x11, 0xe4, 0xf5, 0x24, 0x85, 0x27, 0x2b, 0x85, 0x28, 0x2c, 0x85, 0x25, +0x27, 0x85, 0x26, 0x28, 0x80, 0x0f, 0x75, 0x24, 0x01, 0x85, 0x25, 0x2b, 0x85, 0x26, 0x2c, 0x85, +0x27, 0x27, 0x85, 0x28, 0x28, 0x12, 0x06, 0x2a, 0x12, 0x07, 0x86, 0x24, 0x5e, 0xf8, 0x12, 0x0a, +0xe7, 0xc3, 0xe5, 0x26, 0x95, 0x2c, 0xf5, 0x26, 0xe5, 0x25, 0x95, 0x2b, 0xf5, 0x25, 0xc3, 0x64, +0x80, 0x94, 0x80, 0x50, 0x05, 0xe4, 0xf5, 0x25, 0xf5, 0x26, 0xc3, 0xe5, 0x28, 0x95, 0x2c, 0xf5, +0x28, 0xe5, 0x27, 0x95, 0x2b, 0xf5, 0x27, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x05, 0xe4, 0xf5, +0x27, 0xf5, 0x28, 0x85, 0x27, 0x2b, 0x85, 0x28, 0x2c, 0xae, 0x2b, 0xaf, 0x2c, 0x12, 0x08, 0xc6, +0xe4, 0x7b, 0x80, 0xfa, 0xf9, 0xf8, 0x12, 0x06, 0x77, 0xae, 0x30, 0xaf, 0x31, 0x12, 0x0a, 0x9d, +0xc0, 0x06, 0xc0, 0x07, 0xe5, 0x26, 0x25, 0x28, 0xcf, 0xe5, 0x25, 0x35, 0x27, 0xcf, 0x24, 0x01, +0xcf, 0x34, 0x00, 0xab, 0x07, 0xfa, 0x33, 0x95, 0xe0, 0xf9, 0xf8, 0xd0, 0x07, 0xd0, 0x06, 0x12, +0x0e, 0xa2, 0xef, 0x12, 0x0a, 0xf1, 0xe4, 0x3d, 0xfd, 0xe4, 0x3c, 0xfc, 0xe4, 0x7b, 0x80, 0xfa, +0xf9, 0xf8, 0x12, 0x0e, 0xa2, 0x8e, 0x2b, 0x8f, 0x2c, 0xe5, 0x24, 0x60, 0x0e, 0xe5, 0x2a, 0x25, +0x2c, 0xf5, 0x2c, 0xe5, 0x29, 0x35, 0x2b, 0xf5, 0x2b, 0x80, 0x0d, 0xc3, 0xe5, 0x2a, 0x95, 0x2c, +0xf5, 0x2c, 0xe5, 0x29, 0x95, 0x2b, 0xf5, 0x2b, 0xe5, 0x23, 0x12, 0x0a, 0x0e, 0xf8, 0xe5, 0x2b, +0xf2, 0x08, 0xe5, 0x2c, 0xf2, 0x22, 0x43, 0xad, 0x04, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, +0xff, 0x58, 0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x74, 0x26, 0x93, 0xff, 0x90, 0xff, 0x48, +0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, 0x74, 0x27, 0x93, 0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, +0x40, 0x74, 0x6c, 0xf0, 0x90, 0xff, 0x57, 0x74, 0xff, 0xf0, 0x90, 0xff, 0x56, 0xe4, 0xf0, 0x90, +0xff, 0x5f, 0x74, 0xff, 0xf0, 0x90, 0xff, 0x5e, 0xe4, 0xf0, 0x85, 0x52, 0x82, 0x85, 0x51, 0x83, +0x22, 0x78, 0x6f, 0xe6, 0xff, 0x78, 0x82, 0xe2, 0xfc, 0x08, 0xe2, 0x2f, 0xf5, 0x82, 0xe4, 0x3c, +0xf5, 0x83, 0xe0, 0xff, 0x22, 0xe5, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, +0x34, 0x02, 0xf5, 0x83, 0x22, 0x78, 0x6f, 0xe6, 0xff, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x02, +0xf5, 0x83, 0xe0, 0x90, 0xff, 0x54, 0xf0, 0x18, 0xe6, 0x24, 0xb5, 0xf5, 0x82, 0xe4, 0x34, 0x02, +0xf5, 0x83, 0xe0, 0x90, 0xff, 0x5c, 0xf0, 0xef, 0xc3, 0x13, 0xff, 0xe5, 0x52, 0x24, 0x1a, 0xf5, +0x82, 0xe4, 0x35, 0x51, 0xf5, 0x83, 0xe5, 0x82, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x83, 0xf5, 0x83, +0xe4, 0x93, 0x90, 0xff, 0x55, 0xf0, 0x22, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x75, +0x8f, 0x80, 0x75, 0x8e, 0x20, 0x75, 0x8a, 0xa0, 0xf0, 0x90, 0xff, 0x43, 0x74, 0x5f, 0xf0, 0x22, +0xe0, 0xfc, 0xa3, 0xe0, 0xfd, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x54, 0xe0, 0x90, 0x01, 0xf0, 0xf0, 0x90, 0xff, 0x5c, 0xe0, +0x90, 0x01, 0xf1, 0xf0, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0x22, 0xa8, 0x0f, 0xe6, 0xfd, +0x08, 0x08, 0xe6, 0xfa, 0x08, 0xe6, 0xf5, 0x82, 0x8a, 0x83, 0x22, 0xe5, 0x22, 0x75, 0xf0, 0x0a, +0xa4, 0x24, 0x03, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0x22, 0xff, 0xfe, 0xfd, 0xfc, 0xab, +0x2e, 0xaa, 0x2d, 0xa9, 0x2c, 0xa8, 0x2b, 0x22, 0xab, 0x28, 0xaa, 0x29, 0xa9, 0x2a, 0x22, 0x7f, +0xb4, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0x01, 0x02, 0x0f, 0xeb, 0x90, 0xff, 0x5e, 0xf0, 0x90, 0xff, +0x56, 0xe0, 0xff, 0xa3, 0xe0, 0xd3, 0x9f, 0x22, 0xce, 0xa2, 0xe7, 0x13, 0xce, 0x13, 0x22, 0x78, +0x82, 0xe2, 0xfc, 0x08, 0xe2, 0x22, 0x74, 0xb5, 0x25, 0x22, 0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, +0x83, 0xe0, 0xff, 0xe5, 0x24, 0x22, 0x85, 0x1c, 0x82, 0x85, 0x1b, 0x83, 0xe4, 0x93, 0xff, 0x22, +0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0x22, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, 0x22, +0xd3, 0x74, 0x05, 0x93, 0x9f, 0x74, 0x04, 0x93, 0x9e, 0x22, 0x90, 0xff, 0x54, 0xf0, 0x90, 0xff, +0x5c, 0xf0, 0x22, 0xed, 0x25, 0x1e, 0xf5, 0x82, 0xe4, 0x3c, 0xf5, 0x83, 0x22, 0x90, 0xff, 0x43, +0x74, 0x9f, 0xf0, 0x22, 0x78, 0x81, 0xe2, 0x90, 0xff, 0x40, 0xf0, 0x22, 0x74, 0x28, 0x93, 0x90, +0xff, 0x55, 0xf0, 0xef, 0xc3, 0x94, 0x08, 0x22, 0xe5, 0x52, 0x24, 0x2b, 0xff, 0xe4, 0x35, 0x51, +0xa9, 0x07, 0x22, 0xa3, 0xe0, 0xff, 0xe5, 0x00, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0xa3, 0xe0, +0xff, 0xe5, 0x00, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, 0x90, 0x00, 0x02, 0x12, 0x0d, 0x46, 0xff, +0xae, 0xf0, 0x22, 0xe6, 0xff, 0xc3, 0x95, 0x00, 0xf0, 0xe5, 0x00, 0x2f, 0x22, 0x8b, 0x1b, 0x8a, +0x1c, 0x89, 0x1d, 0x8d, 0x1e, 0xe4, 0xf5, 0x21, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xf5, 0x22, +0x90, 0x00, 0x0b, 0x12, 0x0c, 0x07, 0x60, 0x08, 0xe4, 0x78, 0x86, 0xf2, 0x90, 0x00, 0xb7, 0xf0, +0xe5, 0x22, 0xb4, 0x80, 0x29, 0x78, 0x86, 0x74, 0xff, 0xf2, 0x12, 0x33, 0x52, 0x90, 0x00, 0xb1, +0xe5, 0xf0, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x33, 0x63, 0x90, 0x00, 0xb3, 0xe5, 0xf0, 0xf0, 0xa3, +0xef, 0xf0, 0xe4, 0xa3, 0xf0, 0xa3, 0xf0, 0xa3, 0xe0, 0x04, 0xf0, 0x02, 0x1a, 0xf6, 0xe5, 0x22, +0x64, 0x08, 0x60, 0x03, 0x02, 0x1a, 0x98, 0x12, 0x33, 0x52, 0xc3, 0x90, 0x00, 0xb2, 0xe0, 0x90, +0x00, 0xb1, 0x12, 0x1b, 0x1b, 0x8e, 0x23, 0x8f, 0x24, 0x12, 0x33, 0x5d, 0xc3, 0x90, 0x00, 0xb4, +0xe0, 0x90, 0x00, 0xb3, 0x12, 0x1b, 0x1b, 0x12, 0x33, 0x4b, 0x74, 0x01, 0x93, 0xfc, 0x74, 0x02, +0x12, 0x33, 0x6b, 0x40, 0x0f, 0x90, 0x01, 0xec, 0xe0, 0x30, 0xe0, 0x08, 0x78, 0x86, 0xe2, 0x54, +0xfe, 0x12, 0x33, 0x79, 0xe5, 0x24, 0x2f, 0xfd, 0xe5, 0x23, 0x3e, 0xfc, 0x12, 0x33, 0x4b, 0x74, +0x05, 0x93, 0xfb, 0xd3, 0xed, 0x9b, 0xec, 0x94, 0x00, 0x40, 0x08, 0x78, 0x86, 0xe2, 0x54, 0xfc, +0x12, 0x33, 0x79, 0x12, 0x33, 0x4b, 0x74, 0x03, 0x93, 0xfc, 0x74, 0x04, 0x12, 0x33, 0x6b, 0x40, +0x13, 0x78, 0x86, 0xe2, 0x20, 0xe1, 0x04, 0xe5, 0x1e, 0x60, 0x09, 0x75, 0x21, 0x0c, 0xe4, 0x78, +0x86, 0xf2, 0xf5, 0x1e, 0x78, 0x86, 0xe2, 0x54, 0x3c, 0x70, 0x03, 0x02, 0x1a, 0xf6, 0x12, 0x33, +0x4b, 0x74, 0x06, 0x93, 0xfd, 0x7c, 0x00, 0xd3, 0xe5, 0x24, 0x9d, 0xe5, 0x23, 0x9c, 0x50, 0x09, +0xef, 0x9d, 0xee, 0x9c, 0x50, 0x03, 0x02, 0x1a, 0xf6, 0xd3, 0xef, 0x95, 0x24, 0xee, 0x95, 0x23, +0x40, 0x17, 0x12, 0x33, 0x5d, 0xd3, 0x90, 0x00, 0xb4, 0xe0, 0x9f, 0x90, 0x00, 0xb3, 0xe0, 0x95, +0xf0, 0x7f, 0x02, 0x40, 0x02, 0x7f, 0x01, 0x80, 0x15, 0x12, 0x33, 0x52, 0xd3, 0x90, 0x00, 0xb2, +0xe0, 0x9f, 0x90, 0x00, 0xb1, 0xe0, 0x95, 0xf0, 0x7f, 0x04, 0x40, 0x02, 0x7f, 0x03, 0x8f, 0x21, +0x78, 0x86, 0xe2, 0x54, 0xc3, 0xf2, 0x80, 0x5e, 0xe5, 0x22, 0xb4, 0x04, 0x09, 0xe4, 0x90, 0x00, +0xb5, 0xf0, 0xa3, 0xf0, 0x80, 0x50, 0x12, 0x33, 0x4b, 0x74, 0x01, 0x93, 0xfe, 0x74, 0x02, 0x93, +0xff, 0xd3, 0x90, 0x00, 0xb6, 0xe0, 0x9f, 0x90, 0x00, 0xb5, 0xe0, 0x9e, 0x50, 0x15, 0x90, 0x01, +0xec, 0xe0, 0x30, 0xe0, 0x0e, 0x54, 0x11, 0x64, 0x11, 0x70, 0x2b, 0x90, 0x00, 0xb7, 0xe0, 0x64, +0x02, 0x70, 0x23, 0x78, 0x86, 0xe2, 0xff, 0x30, 0xe0, 0x1c, 0x90, 0x00, 0xb7, 0xe0, 0xfe, 0xd3, +0x94, 0x02, 0x50, 0x0a, 0xee, 0x7e, 0x0b, 0xb4, 0x01, 0x02, 0x7e, 0x05, 0x8e, 0x21, 0xef, 0x54, +0xfe, 0x78, 0x86, 0x12, 0x33, 0x79, 0xc3, 0x90, 0x00, 0xb5, 0xe0, 0x94, 0xff, 0x50, 0x13, 0x12, +0x33, 0x4b, 0xe4, 0x93, 0xff, 0x90, 0x00, 0xb6, 0xe0, 0x2f, 0xf0, 0x90, 0x00, 0xb5, 0xe0, 0x34, +0x00, 0xf0, 0xe5, 0x1e, 0xaf, 0x1e, 0x70, 0x02, 0xaf, 0x21, 0x22, 0x9f, 0xff, 0xe0, 0x95, 0xf0, +0xfe, 0x12, 0x3a, 0x14, 0x22, 0x8f, 0x26, 0x8d, 0x27, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, +0xf9, 0x74, 0x02, 0x35, 0xf0, 0x75, 0x28, 0x01, 0xf5, 0x29, 0x89, 0x2a, 0x78, 0x77, 0xe6, 0x60, +0x01, 0x16, 0x12, 0x18, 0x98, 0x12, 0x19, 0x49, 0xe4, 0xfc, 0xfd, 0xa8, 0x04, 0xc0, 0x05, 0xc0, +0x06, 0xc0, 0x07, 0x12, 0x0d, 0x1b, 0xff, 0xae, 0xf0, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xc3, +0xef, 0x9b, 0xf5, 0x2e, 0xee, 0x9a, 0xf5, 0x2d, 0xed, 0x99, 0xf5, 0x2c, 0xec, 0x98, 0xf5, 0x2b, +0x12, 0x18, 0x98, 0x90, 0x00, 0x05, 0x12, 0x0c, 0x07, 0xf5, 0x2f, 0xe4, 0xff, 0xfe, 0x12, 0x18, +0x8f, 0xd3, 0x12, 0x0f, 0x34, 0x40, 0x06, 0xae, 0x2d, 0xaf, 0x2e, 0x80, 0x04, 0x7e, 0x00, 0x7f, +0x00, 0xe5, 0x26, 0x25, 0xe0, 0x24, 0x5d, 0xf8, 0xee, 0xf2, 0x08, 0xef, 0xf2, 0x78, 0x77, 0xe6, +0x60, 0x20, 0x90, 0x36, 0x0b, 0xe4, 0x93, 0x60, 0x03, 0x02, 0x1c, 0x97, 0x12, 0x18, 0x8b, 0xd3, +0x12, 0x0f, 0x34, 0x7f, 0x00, 0x40, 0x02, 0x7f, 0x01, 0xef, 0x78, 0x77, 0x56, 0x60, 0x03, 0x02, +0x1c, 0x97, 0xae, 0x2d, 0xaf, 0x2e, 0x12, 0x3a, 0x14, 0x12, 0x17, 0xba, 0xc3, 0x12, 0x18, 0xf1, +0x50, 0x11, 0xe4, 0x12, 0x18, 0x8b, 0x12, 0x0f, 0x34, 0x40, 0x04, 0x05, 0x2f, 0x80, 0x70, 0x15, +0x2f, 0x80, 0x6c, 0x12, 0x18, 0x98, 0x90, 0x00, 0x04, 0x12, 0x0c, 0x07, 0xff, 0x33, 0x95, 0xe0, +0xfe, 0xfd, 0xfc, 0xe5, 0x2e, 0x2f, 0xf5, 0x2e, 0xe5, 0x2d, 0x3e, 0xf5, 0x2d, 0xe5, 0x2c, 0x3d, +0xf5, 0x2c, 0xe5, 0x2b, 0x3c, 0xf5, 0x2b, 0xe4, 0x7f, 0x78, 0x12, 0x18, 0x8c, 0xd3, 0x12, 0x0f, +0x34, 0x40, 0x0c, 0x12, 0x18, 0x98, 0x90, 0x00, 0x02, 0xe4, 0x75, 0xf0, 0x01, 0x80, 0x1c, 0xe5, +0x2e, 0x24, 0x78, 0xe4, 0x35, 0x2d, 0xe4, 0x35, 0x2c, 0xfd, 0xe4, 0x35, 0x2b, 0xfc, 0x33, 0x12, +0x18, 0x98, 0x50, 0x10, 0x90, 0x00, 0x02, 0x74, 0xff, 0xf5, 0xf0, 0x12, 0x0d, 0x7e, 0x90, 0x00, +0x04, 0xe4, 0x80, 0x05, 0x90, 0x00, 0x04, 0xe5, 0x2e, 0x12, 0x0c, 0x46, 0xe4, 0xf5, 0x2f, 0x12, +0x17, 0xba, 0x74, 0x01, 0x93, 0xff, 0xd3, 0x64, 0x80, 0xf8, 0xe5, 0x2f, 0x64, 0x80, 0x98, 0x50, +0x17, 0xef, 0x33, 0x95, 0xe0, 0xfe, 0xad, 0x2f, 0xed, 0x33, 0x95, 0xe0, 0xfc, 0xed, 0x2f, 0xec, +0x3e, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x50, 0x14, 0xe4, 0xf5, 0x2f, 0x12, 0x18, 0x98, 0x12, 0x0d, +0x1b, 0xff, 0x90, 0x00, 0x02, 0xe5, 0xf0, 0x8f, 0xf0, 0x12, 0x0d, 0xea, 0x12, 0x18, 0x98, 0x90, +0x00, 0x05, 0xe5, 0x2f, 0x12, 0x0c, 0x46, 0x78, 0x77, 0xe6, 0x70, 0x39, 0x12, 0x18, 0x98, 0x12, +0x19, 0x49, 0x90, 0x00, 0x08, 0x12, 0x0d, 0x46, 0xc3, 0x9f, 0xff, 0xe5, 0xf0, 0x9e, 0xfe, 0x12, +0x3a, 0x14, 0xaa, 0x06, 0xab, 0x07, 0x12, 0x17, 0xba, 0x74, 0x04, 0x93, 0xfe, 0x74, 0x05, 0x93, +0xff, 0x7c, 0x00, 0x7d, 0x03, 0x12, 0x0c, 0x68, 0xd3, 0xeb, 0x9f, 0xea, 0x9e, 0x40, 0x06, 0x78, +0x75, 0xe6, 0x44, 0x10, 0xf6, 0x05, 0x26, 0x74, 0x0a, 0x25, 0x2a, 0xf5, 0x2a, 0xe4, 0x35, 0x29, +0xf5, 0x29, 0x15, 0x27, 0xe5, 0x27, 0x60, 0x03, 0x02, 0x1b, 0x42, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, +0x89, 0x1d, 0xe4, 0xf5, 0x1e, 0xfe, 0x7f, 0x0c, 0xfd, 0x12, 0x0f, 0xeb, 0x7f, 0x06, 0x12, 0x08, +0xa1, 0x7e, 0x00, 0x7f, 0x06, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x08, 0xa7, 0x78, 0x7c, 0xe6, 0x14, +0x60, 0x26, 0x04, 0x60, 0x03, 0x02, 0x1e, 0x81, 0xe4, 0x78, 0x7b, 0xf6, 0xff, 0x12, 0x3a, 0x36, +0x12, 0x22, 0xbc, 0x78, 0x75, 0xe6, 0x30, 0xe4, 0x03, 0x02, 0x1e, 0x85, 0x7f, 0x5c, 0x12, 0x08, +0xa1, 0x78, 0x7c, 0x76, 0x01, 0x02, 0x1e, 0x79, 0x12, 0x22, 0xbc, 0x78, 0x75, 0xe6, 0xff, 0x30, +0xe4, 0x07, 0xe5, 0x4b, 0x70, 0x03, 0x02, 0x1e, 0x82, 0xef, 0x20, 0xe3, 0x03, 0x02, 0x1e, 0x25, +0x90, 0x00, 0x87, 0xe0, 0x30, 0xe1, 0x69, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x20, 0x12, 0x27, 0x4f, +0xef, 0x60, 0x5d, 0xe5, 0x20, 0x60, 0x59, 0xe4, 0xf5, 0x21, 0x90, 0x00, 0x87, 0x74, 0x02, 0xf0, +0x78, 0x05, 0x14, 0xf2, 0x85, 0x40, 0x82, 0x85, 0x3f, 0x83, 0xe4, 0x93, 0xff, 0xe5, 0x21, 0xd3, +0x9f, 0x50, 0x3d, 0x74, 0x01, 0x7e, 0x00, 0xa8, 0x21, 0x08, 0x80, 0x05, 0xc3, 0x33, 0xce, 0x33, +0xce, 0xd8, 0xf9, 0xff, 0xef, 0x55, 0x20, 0x60, 0x23, 0x12, 0x09, 0xa5, 0x74, 0x06, 0x93, 0xff, +0x74, 0x07, 0x93, 0x78, 0x01, 0xcf, 0xf2, 0x08, 0xef, 0xf2, 0x12, 0x09, 0xa5, 0x74, 0x08, 0x93, +0xff, 0x74, 0x09, 0x93, 0x08, 0xcf, 0xf2, 0x08, 0xef, 0xf2, 0x80, 0x04, 0x05, 0x21, 0x80, 0xb4, +0x90, 0x00, 0x87, 0xe0, 0x30, 0xe0, 0x54, 0x75, 0x25, 0x00, 0x75, 0x26, 0x00, 0x75, 0x27, 0x41, +0x75, 0x28, 0x00, 0x75, 0x29, 0x00, 0x75, 0x2a, 0x45, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x5d, 0x12, +0x26, 0x51, 0xe4, 0xf5, 0x1f, 0xe5, 0x1f, 0x12, 0x06, 0x85, 0xe6, 0xf4, 0x60, 0x1b, 0xe5, 0x1f, +0x12, 0x0a, 0xc1, 0xf9, 0xe4, 0xfa, 0x7b, 0xfe, 0xad, 0x1f, 0x12, 0x39, 0xfc, 0xe5, 0x1f, 0x75, +0xf0, 0x2e, 0xa4, 0x24, 0x05, 0xf8, 0x74, 0x01, 0xf2, 0x05, 0x1f, 0xe5, 0x1f, 0xc3, 0x94, 0x02, +0x40, 0xd3, 0x12, 0x28, 0x49, 0x90, 0x00, 0x87, 0x74, 0x01, 0xf0, 0x78, 0x75, 0xe6, 0x30, 0xe5, +0x04, 0x78, 0x7b, 0x76, 0x01, 0x90, 0x00, 0x87, 0xe0, 0xf5, 0x1e, 0x78, 0x79, 0x76, 0x01, 0xe4, +0xf5, 0x1f, 0xe5, 0x1f, 0xc3, 0x94, 0x02, 0x50, 0x19, 0x90, 0x00, 0x87, 0xe0, 0x30, 0xe0, 0x05, +0xaf, 0x1f, 0x12, 0x35, 0xf6, 0x12, 0x2d, 0xdb, 0x05, 0x1f, 0x78, 0x79, 0x74, 0x2e, 0x26, 0xf6, +0x80, 0xe0, 0xa8, 0x1d, 0xac, 0x1c, 0xad, 0x1b, 0x12, 0x07, 0x19, 0xe5, 0x1d, 0x24, 0x06, 0xf9, +0xe4, 0x35, 0x1c, 0xa8, 0x01, 0xfc, 0xad, 0x1b, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x07, 0x1d, 0x78, +0x0c, 0xe2, 0x70, 0x11, 0x78, 0x3a, 0xe2, 0x70, 0x0c, 0x90, 0x00, 0x87, 0x74, 0x03, 0xf0, 0x80, +0x04, 0xe4, 0x78, 0x7c, 0xf6, 0xaf, 0x1e, 0x22, 0x8b, 0x1b, 0x8a, 0x1c, 0x89, 0x1d, 0x43, 0xad, +0x04, 0x90, 0xff, 0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x43, 0x95, 0x80, 0x90, 0xff, 0x41, 0x74, 0x37, +0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0xe4, 0xf5, 0x24, 0xf5, 0x24, 0x12, 0x32, 0xf0, 0xe5, +0x24, 0xc3, 0x9f, 0x50, 0x22, 0xe9, 0x24, 0x0c, 0xf9, 0xe4, 0x3a, 0x12, 0x32, 0xe1, 0xe4, 0xfd, +0x12, 0x34, 0x16, 0x12, 0x32, 0xd7, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x32, 0xd7, 0xe4, 0xfd, +0x12, 0x31, 0x4c, 0x05, 0x24, 0x80, 0xd5, 0x90, 0xff, 0x4a, 0xe4, 0xf0, 0x90, 0xff, 0x50, 0x74, +0x0f, 0xf0, 0x90, 0xff, 0x58, 0xe4, 0xf0, 0x90, 0xff, 0x40, 0x74, 0x08, 0xf0, 0x90, 0xff, 0x43, +0x74, 0x9f, 0xf0, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x12, 0x0b, 0xee, 0x90, 0xff, 0x48, 0xf0, +0x90, 0x00, 0x01, 0x12, 0x0c, 0x07, 0x90, 0xff, 0x42, 0xf0, 0x90, 0x00, 0x02, 0x12, 0x0c, 0x07, +0x90, 0xff, 0x55, 0xf0, 0x90, 0x00, 0x03, 0x12, 0x0c, 0x07, 0x90, 0xff, 0x54, 0xf0, 0x90, 0xff, +0x5c, 0xe4, 0xf0, 0xf5, 0x24, 0x12, 0x32, 0xf0, 0xe5, 0x24, 0xc3, 0x9f, 0x50, 0x5b, 0xe4, 0xf5, +0x25, 0x75, 0x26, 0x64, 0x90, 0xff, 0x50, 0xe0, 0x20, 0xe7, 0x03, 0x43, 0x25, 0x01, 0xe5, 0x25, +0x64, 0x01, 0x60, 0x03, 0xd5, 0x26, 0xed, 0x12, 0x32, 0xfe, 0x12, 0x32, 0xd7, 0x7d, 0x06, 0x12, +0x30, 0x65, 0x90, 0xff, 0x40, 0x74, 0x29, 0xf0, 0x90, 0xff, 0x40, 0xe0, 0x20, 0xe0, 0xf9, 0x12, +0x32, 0xd7, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xab, +0x1e, 0xe5, 0x20, 0xf9, 0x24, 0x02, 0xf5, 0x20, 0xe5, 0x1f, 0xfa, 0x34, 0x00, 0xf5, 0x1f, 0xee, +0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x05, 0x24, 0x80, 0x9c, 0xe4, 0xf5, 0x24, 0x90, 0xff, 0x54, 0xf0, +0x75, 0x25, 0x01, 0xe4, 0xf5, 0x26, 0xf5, 0x27, 0x12, 0x33, 0x07, 0xf5, 0x83, 0x74, 0xff, 0x12, +0x32, 0xd4, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x90, 0xff, 0x55, 0x74, 0x64, 0xf0, 0xe4, 0xf5, 0x26, +0x00, 0x90, 0xff, 0x50, 0xe0, 0x30, 0xe7, 0x07, 0x05, 0x26, 0xe5, 0x26, 0xb4, 0xfa, 0xf1, 0xe5, +0x25, 0x24, 0x02, 0x90, 0xff, 0x55, 0xf0, 0xe4, 0xf5, 0x26, 0x00, 0x00, 0x05, 0x26, 0xe5, 0x26, +0xb4, 0xfa, 0xf7, 0xe4, 0xf5, 0x26, 0x90, 0xff, 0x50, 0xe0, 0x20, 0xe7, 0x09, 0x05, 0x27, 0xe5, +0x27, 0xd3, 0x94, 0x28, 0x50, 0x13, 0x05, 0x26, 0xe5, 0x26, 0xb4, 0x64, 0xe9, 0x12, 0x32, 0xfe, +0x05, 0x25, 0xe5, 0x25, 0xc3, 0x94, 0x64, 0x40, 0xc6, 0x12, 0x33, 0x07, 0x75, 0x83, 0x00, 0xe5, +0x25, 0x12, 0x32, 0xd4, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x32, 0xfe, 0x12, 0x32, 0xf0, 0x05, +0x24, 0xe5, 0x24, 0xc3, 0x9f, 0x50, 0x03, 0x02, 0x1f, 0x90, 0x90, 0xff, 0x50, 0xe4, 0xf0, 0xff, +0x22, 0x8e, 0x1b, 0x8f, 0x1c, 0xe4, 0x78, 0x74, 0xf6, 0x85, 0x1b, 0x51, 0x85, 0x1c, 0x52, 0xe5, +0x1c, 0x24, 0x2c, 0xff, 0xe4, 0x35, 0x1b, 0xfa, 0xa9, 0x07, 0x7b, 0xff, 0x78, 0x70, 0x7c, 0x00, +0x7d, 0x00, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0x78, 0x82, 0x74, 0x01, 0xf2, 0x08, 0x74, +0xcc, 0xf2, 0x12, 0x18, 0xd6, 0x7e, 0x00, 0xe5, 0x1c, 0x24, 0x06, 0xfd, 0xe4, 0x35, 0x1b, 0xfa, +0xa9, 0x05, 0x7b, 0xff, 0x18, 0xe2, 0xfc, 0x08, 0xe2, 0xf8, 0x7d, 0x01, 0x12, 0x0b, 0xc8, 0x90, +0x01, 0xa7, 0xe0, 0xff, 0x12, 0x2f, 0x9f, 0x90, 0x00, 0xb9, 0xe0, 0x64, 0x80, 0x70, 0x04, 0xa3, +0xe0, 0x64, 0x75, 0x70, 0x3d, 0xf5, 0x1e, 0x12, 0x18, 0xd6, 0xe5, 0x1e, 0xc3, 0x9f, 0x50, 0x32, +0xe4, 0xf5, 0x1f, 0x12, 0x18, 0xbf, 0xfd, 0x25, 0x1e, 0x12, 0x17, 0xcc, 0xe5, 0x1f, 0x90, 0x3a, +0x3f, 0x93, 0xfe, 0xef, 0x6e, 0x60, 0x0b, 0xe5, 0x1f, 0xc3, 0x94, 0x0f, 0x50, 0x04, 0x05, 0x1f, +0x80, 0xe1, 0xe5, 0x1f, 0x90, 0x3a, 0x4e, 0x93, 0xff, 0x12, 0x19, 0x03, 0xef, 0xf0, 0x05, 0x1e, +0x80, 0xc5, 0x90, 0x00, 0xb9, 0xe0, 0x64, 0x80, 0x70, 0x04, 0xa3, 0xe0, 0x64, 0x78, 0x70, 0x26, +0xf5, 0x1e, 0x12, 0x18, 0xd6, 0xe5, 0x1e, 0xc3, 0x9f, 0x50, 0x1b, 0x12, 0x18, 0xbf, 0xfd, 0x25, +0x1e, 0x12, 0x17, 0xcc, 0x64, 0x54, 0x60, 0x04, 0xef, 0xb4, 0x56, 0x06, 0x12, 0x19, 0x03, 0x74, +0x15, 0xf0, 0x05, 0x1e, 0x80, 0xdc, 0x7e, 0x00, 0x7d, 0x00, 0x12, 0x18, 0x9f, 0x78, 0x81, 0x74, +0x09, 0xf2, 0x78, 0x72, 0xe6, 0xff, 0x20, 0xe3, 0x06, 0x78, 0x81, 0xe2, 0x44, 0x04, 0xf2, 0xef, +0x20, 0xe2, 0x06, 0x78, 0x81, 0xe2, 0x44, 0x20, 0xf2, 0xe4, 0x78, 0x76, 0xf6, 0x43, 0x95, 0x80, +0x78, 0x72, 0xe6, 0x7f, 0x00, 0x30, 0xe1, 0x02, 0x7f, 0x40, 0xef, 0x44, 0x37, 0x90, 0xff, 0x41, +0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, 0x75, 0x1d, 0x11, 0xe5, 0x1d, 0xf4, 0x60, 0x0c, 0xe4, +0xfd, 0xaf, 0x1d, 0x12, 0x31, 0x4c, 0xe4, 0xfd, 0x12, 0x21, 0x60, 0x75, 0x1d, 0x16, 0xe5, 0x1d, +0xf4, 0x60, 0x0c, 0xe4, 0xfd, 0xaf, 0x1d, 0x12, 0x31, 0x4c, 0x7d, 0x01, 0x12, 0x21, 0x60, 0x22, +0xaf, 0x1d, 0x12, 0x34, 0x16, 0x7d, 0x08, 0xaf, 0x1d, 0x12, 0x30, 0x65, 0x7d, 0x07, 0xaf, 0x1d, +0x12, 0x30, 0x65, 0x22, 0x8f, 0x23, 0xef, 0x12, 0x06, 0x85, 0xe6, 0xff, 0x70, 0x04, 0xf5, 0x24, +0x80, 0x18, 0x78, 0x7a, 0xe6, 0xfe, 0x14, 0xb5, 0x07, 0x09, 0xee, 0x25, 0xe0, 0x24, 0xfa, 0xf5, +0x24, 0x80, 0x07, 0xef, 0x25, 0xe0, 0x24, 0xfe, 0xf5, 0x24, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x61, +0x12, 0x06, 0x32, 0xe5, 0x24, 0x12, 0x07, 0xa0, 0xfe, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x66, 0x12, +0x07, 0xa4, 0xfe, 0xe4, 0xfc, 0xfd, 0x78, 0x62, 0x12, 0x0f, 0x87, 0xe5, 0x24, 0x25, 0xe0, 0x24, +0x63, 0x12, 0x06, 0x32, 0xe5, 0x24, 0x25, 0xe0, 0x24, 0x60, 0x12, 0x07, 0xa4, 0xfe, 0xe5, 0x24, +0x25, 0xe0, 0x24, 0x68, 0x12, 0x07, 0xa4, 0xfe, 0xe4, 0xfc, 0xfd, 0x78, 0x66, 0x12, 0x0f, 0x87, +0x12, 0x05, 0xf0, 0x74, 0x07, 0x93, 0xfe, 0x74, 0x08, 0x78, 0x66, 0x12, 0x09, 0x4e, 0x12, 0x0e, +0x17, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xf0, 0x78, 0x66, 0x12, 0x08, +0x15, 0x12, 0x0e, 0x17, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0x12, 0x07, 0x0c, 0xc0, +0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x05, 0xf0, 0x74, 0x05, 0x93, 0xfe, 0x74, 0x06, +0x78, 0x62, 0x12, 0x09, 0x4e, 0x12, 0x06, 0x77, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, +0xc3, 0xef, 0x9b, 0xff, 0xee, 0x9a, 0xfe, 0xed, 0x99, 0xfd, 0xec, 0x98, 0xfc, 0x78, 0x6a, 0x12, +0x0f, 0x87, 0x78, 0x6a, 0x12, 0x0f, 0x6e, 0xec, 0x33, 0x50, 0x0b, 0x78, 0x62, 0x12, 0x0f, 0x93, +0x00, 0x00, 0x00, 0x01, 0x80, 0x5b, 0x12, 0x0a, 0x6d, 0x7b, 0x02, 0x12, 0x07, 0x90, 0x12, 0x0e, +0xa2, 0x78, 0x6a, 0x12, 0x0f, 0x7a, 0x12, 0x07, 0x0c, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, +0x07, 0x12, 0x0a, 0x6d, 0x2f, 0xfb, 0xea, 0x3e, 0xfa, 0xe9, 0x3d, 0xf9, 0xe8, 0x3c, 0xf8, 0xd0, +0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, 0x12, 0x0e, 0xa2, 0x78, 0x62, 0x12, 0x0f, 0x87, 0x12, +0x05, 0xf0, 0x78, 0x62, 0x12, 0x08, 0x15, 0xd3, 0x12, 0x0f, 0x4a, 0x40, 0x14, 0x12, 0x05, 0xf0, +0x74, 0x02, 0x93, 0x24, 0xff, 0xff, 0x74, 0x01, 0x93, 0x12, 0x07, 0x34, 0x78, 0x62, 0x12, 0x0f, +0x87, 0x78, 0x62, 0x12, 0x0f, 0x6e, 0xe5, 0x23, 0x12, 0x07, 0xd7, 0x22, 0xe4, 0x78, 0x75, 0xf6, +0x18, 0xe6, 0x14, 0x70, 0x03, 0x02, 0x23, 0x4d, 0x14, 0x70, 0x03, 0x02, 0x23, 0xc7, 0x24, 0x02, +0x60, 0x03, 0x02, 0x23, 0xe9, 0x12, 0x17, 0xba, 0xe4, 0x93, 0x78, 0x78, 0xf6, 0x12, 0x31, 0xd4, +0x12, 0x30, 0x05, 0x78, 0x70, 0xe6, 0xf5, 0x23, 0x75, 0x24, 0x20, 0x76, 0x40, 0x7e, 0x00, 0x7f, +0x12, 0x7d, 0x20, 0x7b, 0x01, 0x7a, 0x02, 0x79, 0xb5, 0x12, 0x0f, 0xeb, 0xe5, 0x24, 0xd3, 0x94, +0x01, 0x40, 0x42, 0x12, 0x23, 0xee, 0xe5, 0x22, 0xc3, 0x78, 0x78, 0x96, 0x50, 0x2f, 0x12, 0x17, +0xba, 0x74, 0x02, 0x93, 0x75, 0xf0, 0xa3, 0xa4, 0xff, 0xae, 0xf0, 0x12, 0x17, 0xd5, 0xe0, 0xfc, +0xa3, 0xe0, 0xc3, 0x9f, 0xec, 0x9e, 0x50, 0x08, 0x12, 0x18, 0xc6, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, +0x12, 0x18, 0xc6, 0xc3, 0x13, 0xfe, 0xef, 0x4e, 0xf0, 0x05, 0x22, 0x80, 0xc9, 0xe5, 0x24, 0xc3, +0x13, 0xf5, 0x24, 0x80, 0xb7, 0x78, 0x70, 0xa6, 0x23, 0x78, 0x74, 0x76, 0x01, 0x12, 0x17, 0xba, +0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x25, 0x74, 0x04, 0x93, 0x33, 0xf5, 0x24, 0xe4, 0x78, 0x77, +0xf6, 0xfe, 0xfd, 0x12, 0x18, 0x9f, 0x7e, 0x00, 0x7f, 0x24, 0x7d, 0x00, 0x7b, 0xfe, 0x7a, 0x00, +0x79, 0x5d, 0x12, 0x0f, 0xeb, 0x75, 0x23, 0x04, 0x12, 0x31, 0xd4, 0x12, 0x23, 0xee, 0xe5, 0x22, +0xc3, 0x78, 0x78, 0x96, 0x50, 0x3a, 0x12, 0x17, 0xd5, 0xe0, 0xfe, 0xa3, 0xe0, 0x78, 0x02, 0xce, +0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0x12, 0x18, 0x7b, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0x05, +0x12, 0x18, 0x7b, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x22, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x09, +0xf5, 0x82, 0xe4, 0x34, 0x02, 0xf5, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x05, 0x22, 0x80, 0xbe, +0xd5, 0x23, 0xb8, 0x78, 0x74, 0x76, 0x02, 0x12, 0x31, 0xd4, 0x12, 0x29, 0x1e, 0x78, 0x78, 0xe6, +0xfd, 0xe4, 0xff, 0x12, 0x2e, 0xc1, 0x78, 0x75, 0xe6, 0x30, 0xe1, 0x04, 0x78, 0x77, 0x76, 0x28, +0x78, 0x78, 0xe6, 0xfd, 0xe4, 0xff, 0x02, 0x1b, 0x25, 0xe4, 0x78, 0x74, 0xf6, 0x22, 0x12, 0x29, +0x1e, 0x12, 0x31, 0xd4, 0xe4, 0xf5, 0x22, 0x22, 0x8b, 0x1e, 0x8a, 0x1f, 0x89, 0x20, 0x43, 0xad, +0x04, 0x43, 0x95, 0x80, 0x90, 0xff, 0x41, 0x74, 0x80, 0xf0, 0x90, 0xff, 0x49, 0x74, 0x0d, 0xf0, +0xa3, 0xe4, 0xf0, 0x90, 0xff, 0x42, 0x04, 0xf0, 0x90, 0xff, 0x55, 0x74, 0x7d, 0xf0, 0x90, 0xff, +0x54, 0xe4, 0xf0, 0x90, 0xff, 0x5c, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x10, 0xf0, 0xe4, 0xf5, 0x25, +0xf5, 0x26, 0xf5, 0x27, 0xf5, 0x28, 0xf5, 0x24, 0xe4, 0x12, 0x35, 0x33, 0xf4, 0x60, 0x0d, 0xe4, +0xfd, 0x12, 0x31, 0x4c, 0x12, 0x35, 0x3b, 0x7d, 0x08, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, +0x60, 0x0d, 0xe4, 0xfd, 0x12, 0x31, 0x4c, 0x12, 0x35, 0x25, 0x7d, 0x08, 0x12, 0x30, 0x65, 0xe4, +0xff, 0x00, 0x0f, 0xbf, 0xc8, 0xfb, 0x74, 0x03, 0x12, 0x35, 0x33, 0xf4, 0x60, 0x0d, 0xe4, 0xfd, +0x12, 0x34, 0x16, 0x12, 0x35, 0x3b, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, 0x60, +0x0d, 0x7d, 0x01, 0x12, 0x34, 0x16, 0x12, 0x35, 0x25, 0x7d, 0x07, 0x12, 0x30, 0x65, 0x90, 0xff, +0x43, 0x74, 0x9f, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x07, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0x90, 0xff, +0x40, 0x74, 0x09, 0xf0, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x90, 0xff, 0x43, 0xe0, +0x30, 0xe4, 0xf9, 0x90, 0xff, 0x43, 0x74, 0x9f, 0xf0, 0x90, 0xff, 0x52, 0xe0, 0xfe, 0xa3, 0xe0, +0x25, 0x26, 0xf5, 0x26, 0xee, 0x35, 0x25, 0xf5, 0x25, 0x90, 0xff, 0x5a, 0xe0, 0xfe, 0xa3, 0xe0, +0x25, 0x28, 0xf5, 0x28, 0xee, 0x35, 0x27, 0xf5, 0x27, 0x05, 0x24, 0xe5, 0x24, 0xc3, 0x94, 0x04, +0x50, 0x03, 0x02, 0x24, 0x38, 0xe5, 0x26, 0xae, 0x25, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, +0xd8, 0xf9, 0xff, 0xab, 0x21, 0xaa, 0x22, 0xa9, 0x23, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0xe5, +0x28, 0xae, 0x27, 0x78, 0x02, 0xce, 0xc3, 0x13, 0xce, 0x13, 0xd8, 0xf9, 0xff, 0xab, 0x21, 0xaa, +0x22, 0xa9, 0x23, 0x90, 0x00, 0x02, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xea, 0x12, 0x35, 0x3b, 0xf4, +0x60, 0x05, 0xe4, 0xfd, 0x12, 0x30, 0x65, 0x12, 0x35, 0x25, 0xf4, 0x60, 0x05, 0xe4, 0xfd, 0x12, +0x30, 0x65, 0x22, 0x15, 0x0f, 0x15, 0x0f, 0x15, 0x0f, 0xa8, 0x0f, 0xa6, 0x03, 0x08, 0xa6, 0x02, +0x08, 0xa6, 0x01, 0x15, 0x0f, 0x12, 0x19, 0x0d, 0x78, 0x73, 0xe6, 0x7f, 0x08, 0x30, 0xe0, 0x02, +0x7f, 0x05, 0xa8, 0x0f, 0xa6, 0x07, 0x12, 0x17, 0xc1, 0x12, 0x18, 0x6c, 0x12, 0x0f, 0xbc, 0x78, +0x73, 0xe6, 0x64, 0x03, 0x78, 0x6e, 0x60, 0x08, 0x12, 0x17, 0xc3, 0x12, 0x18, 0x6c, 0x80, 0x0a, +0x12, 0x17, 0xc3, 0xa8, 0x0f, 0x12, 0x18, 0x70, 0x7d, 0x08, 0x12, 0x0f, 0xbc, 0x12, 0x18, 0xe0, +0xff, 0x78, 0x6f, 0xe6, 0x12, 0x18, 0x46, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x12, 0x18, 0xe8, 0xff, +0x18, 0xe6, 0x12, 0x18, 0x46, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x02, 0x00, 0xe0, 0x60, 0x2e, +0x08, 0xe6, 0xff, 0x12, 0x17, 0xd7, 0x12, 0x18, 0x40, 0x12, 0x26, 0x43, 0x12, 0x17, 0xba, 0x12, +0x18, 0xf0, 0x40, 0x1a, 0x78, 0x6e, 0xe6, 0xff, 0x12, 0x17, 0xd7, 0x12, 0x18, 0x40, 0x12, 0x26, +0x43, 0x12, 0x17, 0xba, 0x12, 0x18, 0xf0, 0x40, 0x05, 0xe4, 0x90, 0x02, 0x00, 0xf0, 0x90, 0x02, +0x00, 0xe0, 0x70, 0x1b, 0x78, 0x6f, 0x06, 0x06, 0x18, 0x06, 0x06, 0x78, 0x76, 0x16, 0x78, 0x72, +0xe6, 0x7f, 0x00, 0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, 0x02, 0x00, 0xef, 0xf0, 0x80, 0x05, 0xe4, +0x90, 0x02, 0x00, 0xf0, 0x78, 0x76, 0xe6, 0x70, 0x0a, 0x90, 0xff, 0x50, 0xf0, 0x90, 0xff, 0x58, +0xf0, 0x80, 0x39, 0x12, 0x17, 0xe5, 0xa8, 0x0f, 0x76, 0x64, 0x90, 0xff, 0x58, 0xe0, 0xff, 0x90, +0xff, 0x50, 0xe0, 0x4f, 0x30, 0xe7, 0x06, 0xa8, 0x0f, 0x16, 0xe6, 0x70, 0xed, 0x12, 0x17, 0xc1, +0xa8, 0x0f, 0x12, 0x18, 0x70, 0x7d, 0x06, 0x12, 0x0f, 0xbc, 0x78, 0x6e, 0x12, 0x17, 0xc3, 0xa8, +0x0f, 0x12, 0x18, 0x70, 0x7d, 0x06, 0x12, 0x0f, 0xbc, 0x12, 0x19, 0x14, 0xe5, 0x0f, 0x24, 0x04, +0xf5, 0x0f, 0x22, 0xe0, 0xfe, 0xa3, 0xe0, 0xc3, 0x9d, 0xff, 0xee, 0x9c, 0xfe, 0x12, 0x3a, 0x14, +0x22, 0x8b, 0x22, 0x8a, 0x23, 0x89, 0x24, 0x12, 0x2c, 0x4e, 0x12, 0x2c, 0xd5, 0x12, 0x32, 0x95, +0x74, 0x79, 0x93, 0xf5, 0x2b, 0xe4, 0xf5, 0x2c, 0x12, 0x32, 0xcd, 0x12, 0x0b, 0xee, 0x70, 0x21, +0x12, 0x32, 0x95, 0x74, 0x98, 0x93, 0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0x7f, 0x00, 0x50, +0x02, 0x7f, 0x01, 0x12, 0x27, 0x17, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0x7e, 0x75, 0x2c, 0x03, 0x80, +0x3a, 0x12, 0x32, 0xcd, 0x12, 0x0b, 0xee, 0xff, 0xe5, 0x2b, 0x14, 0x6f, 0x70, 0x2d, 0x12, 0x32, +0x95, 0x74, 0x99, 0x93, 0xf5, 0x2d, 0xc3, 0x64, 0x80, 0x94, 0x80, 0xe5, 0x2b, 0x50, 0x06, 0x25, +0xe0, 0x14, 0xff, 0x80, 0x05, 0x25, 0xe0, 0x24, 0xfe, 0xff, 0x12, 0x27, 0x17, 0xee, 0x8f, 0xf0, +0x12, 0x0d, 0x7e, 0xe5, 0x2b, 0x25, 0xe0, 0x24, 0xfd, 0xf5, 0x2c, 0xe5, 0x2c, 0x60, 0x47, 0x24, +0xff, 0xff, 0xe4, 0x34, 0xff, 0xfe, 0xef, 0x25, 0xe0, 0xff, 0xee, 0x33, 0xab, 0x22, 0xaa, 0x23, +0xa9, 0x24, 0x8f, 0x82, 0xf5, 0x83, 0x12, 0x0d, 0x46, 0xff, 0xae, 0xf0, 0x75, 0xf0, 0x02, 0xe5, +0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x12, 0x0d, 0x46, 0x2f, 0xff, 0xee, 0x35, 0xf0, 0xfe, +0x12, 0x32, 0x95, 0xd3, 0x74, 0x9b, 0x93, 0x9f, 0x74, 0x9a, 0x93, 0x9e, 0x40, 0x08, 0x12, 0x32, +0xcd, 0x74, 0xff, 0x12, 0x0c, 0x34, 0x22, 0x8f, 0x2c, 0xaf, 0x2d, 0xef, 0x33, 0x95, 0xe0, 0xfe, +0x12, 0x3a, 0x14, 0xab, 0x22, 0xaa, 0x23, 0xa9, 0x24, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, +0x82, 0x85, 0xf0, 0x83, 0x12, 0x0d, 0x46, 0xfd, 0xac, 0xf0, 0xcf, 0xcd, 0xcf, 0xce, 0xcc, 0xce, +0x12, 0x0c, 0x7a, 0x75, 0xf0, 0x02, 0xe5, 0x2c, 0xa4, 0xf5, 0x82, 0x85, 0xf0, 0x83, 0x22, 0x8b, +0x22, 0x8a, 0x23, 0x89, 0x24, 0xe4, 0xf5, 0x27, 0xf5, 0x0a, 0xf5, 0x25, 0xf5, 0x26, 0xf5, 0x27, +0x85, 0x09, 0x82, 0x85, 0x08, 0x83, 0xe4, 0x93, 0xff, 0xe5, 0x25, 0xc3, 0x9f, 0x40, 0x03, 0x02, +0x28, 0x16, 0x12, 0x00, 0x18, 0x74, 0x01, 0x93, 0xf5, 0x28, 0x12, 0x00, 0x12, 0x74, 0x02, 0x93, +0xf5, 0x29, 0x12, 0x00, 0x12, 0x74, 0x04, 0x93, 0xfc, 0x74, 0x05, 0x93, 0xfd, 0xe5, 0x28, 0x25, +0xe0, 0x24, 0x5d, 0xf8, 0xe2, 0xfe, 0x08, 0xe2, 0xff, 0xd3, 0x9d, 0xee, 0x9c, 0x40, 0x72, 0x7c, +0x00, 0x7d, 0x05, 0x12, 0x0c, 0x68, 0xe5, 0x29, 0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x24, 0x01, +0xfd, 0x18, 0xe2, 0x34, 0x00, 0xfc, 0x12, 0x0c, 0x7a, 0x8e, 0x2a, 0x8f, 0x2b, 0x12, 0x00, 0x12, +0x74, 0x03, 0x93, 0x30, 0xe7, 0x2b, 0x54, 0x7f, 0xc3, 0x95, 0x2b, 0xff, 0xe4, 0x95, 0x2a, 0xfe, +0x12, 0x3a, 0x14, 0xc3, 0x74, 0x03, 0x9f, 0xee, 0x64, 0x80, 0xf8, 0x74, 0x80, 0x98, 0x40, 0x2e, +0xaf, 0x25, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x80, +0x1d, 0x12, 0x00, 0x12, 0x74, 0x03, 0x93, 0xc3, 0x95, 0x2b, 0xe4, 0x95, 0x2a, 0x50, 0x0f, 0xaf, +0x25, 0x74, 0x01, 0xa8, 0x07, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0x42, 0x26, 0x75, 0x27, +0x01, 0x05, 0x25, 0x02, 0x27, 0x60, 0xe5, 0x26, 0x65, 0x0e, 0x60, 0x08, 0x85, 0x26, 0x0e, 0xe4, +0xf5, 0x0b, 0x80, 0x17, 0x85, 0x0d, 0x82, 0x85, 0x0c, 0x83, 0x74, 0x1e, 0x93, 0xff, 0x05, 0x0b, +0xe5, 0x0b, 0xc3, 0x9f, 0x40, 0x05, 0x15, 0x0b, 0x85, 0x26, 0x0a, 0xab, 0x22, 0xaa, 0x23, 0xa9, +0x24, 0xe5, 0x0a, 0x12, 0x0c, 0x34, 0xaf, 0x27, 0x22, 0xe4, 0xf5, 0x22, 0xf5, 0x23, 0xff, 0xfe, +0x78, 0x33, 0xe2, 0x25, 0xe0, 0xfd, 0x78, 0x05, 0xe2, 0x2d, 0xfd, 0x78, 0x0b, 0xe2, 0xc4, 0x54, +0xf0, 0x2d, 0xfd, 0x78, 0x39, 0xe2, 0xfc, 0xc4, 0x33, 0x54, 0xe0, 0x2d, 0x24, 0xfe, 0x60, 0x1c, +0x24, 0xf0, 0x60, 0x18, 0x14, 0x60, 0x1d, 0x24, 0xf2, 0x60, 0x11, 0x24, 0xfe, 0x60, 0x25, 0x24, +0xf0, 0x60, 0x35, 0x24, 0x02, 0x70, 0x66, 0xe4, 0xfd, 0xff, 0x80, 0x1c, 0x75, 0x22, 0x00, 0x75, +0x23, 0x01, 0x80, 0x59, 0xe4, 0xfd, 0xff, 0x12, 0x31, 0x06, 0x8e, 0x22, 0x8f, 0x23, 0xe4, 0xfd, +0x7f, 0x01, 0x80, 0x0f, 0x7d, 0x01, 0x7f, 0x01, 0x12, 0x31, 0x06, 0x8e, 0x22, 0x8f, 0x23, 0x7d, +0x01, 0xe4, 0xff, 0x12, 0x31, 0x06, 0x80, 0x35, 0x7d, 0x01, 0x7f, 0x01, 0x12, 0x31, 0x06, 0xc0, +0x06, 0xc0, 0x07, 0xe4, 0xfd, 0xff, 0x12, 0x31, 0x06, 0xd0, 0xe0, 0x2f, 0xf5, 0x23, 0xd0, 0xe0, +0x3e, 0xf5, 0x22, 0xe4, 0xfd, 0x7f, 0x01, 0x12, 0x31, 0x06, 0xc0, 0x06, 0xc0, 0x07, 0x7d, 0x01, +0xe4, 0xff, 0x12, 0x31, 0x06, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0xd3, 0xe5, 0x23, +0x9f, 0xe5, 0x22, 0x9e, 0x40, 0x27, 0x78, 0x24, 0x7c, 0x00, 0x7d, 0x00, 0x12, 0x07, 0x19, 0x78, +0x01, 0x7c, 0x00, 0x7d, 0xfe, 0x7b, 0xfe, 0x7a, 0x00, 0x79, 0x2f, 0x12, 0x07, 0x1f, 0x78, 0x2f, +0x7c, 0x00, 0x7d, 0xfe, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x24, 0x12, 0x07, 0x1f, 0x22, 0x12, 0x30, +0x05, 0x90, 0xff, 0x4a, 0x74, 0x71, 0xf0, 0x90, 0xff, 0x50, 0x74, 0x0f, 0xf0, 0x90, 0xff, 0x58, +0xf0, 0x90, 0xff, 0x40, 0xe4, 0xf0, 0x12, 0x19, 0x0d, 0xe4, 0x12, 0x18, 0xfa, 0x78, 0x71, 0xe6, +0x90, 0xff, 0x42, 0xf0, 0x90, 0xff, 0x55, 0x74, 0x28, 0xf0, 0x90, 0xff, 0x48, 0x74, 0x02, 0xf0, +0x43, 0xad, 0x04, 0x12, 0x19, 0x14, 0x90, 0xff, 0x43, 0xe0, 0x20, 0xe4, 0x05, 0x12, 0x34, 0xe3, +0x80, 0xf4, 0x12, 0x19, 0x0d, 0xe4, 0x78, 0x6f, 0xf6, 0x18, 0x76, 0x01, 0x78, 0x78, 0xe6, 0xc3, +0x13, 0x78, 0x76, 0xf6, 0x78, 0x71, 0xe6, 0x90, 0xff, 0x42, 0xf0, 0x18, 0xe6, 0x90, 0xff, 0x48, +0xf0, 0xe5, 0x4b, 0x60, 0x06, 0x90, 0xff, 0x42, 0xe5, 0x4c, 0xf0, 0x78, 0x72, 0xe6, 0x7f, 0x00, +0x20, 0xe4, 0x02, 0x7f, 0x01, 0x90, 0x02, 0x00, 0xef, 0xf0, 0x12, 0x17, 0xe5, 0x08, 0x12, 0x17, +0xc3, 0x7d, 0x06, 0x12, 0x30, 0x65, 0x78, 0x6e, 0x12, 0x17, 0xc3, 0x7d, 0x06, 0x12, 0x30, 0x65, +0x78, 0x81, 0xe2, 0xff, 0x90, 0xff, 0x40, 0xf0, 0x78, 0x72, 0xe6, 0x30, 0xe7, 0x26, 0x43, 0xad, +0x04, 0xef, 0xf0, 0x90, 0xff, 0x43, 0xe0, 0x20, 0xe4, 0x05, 0x12, 0x34, 0xe3, 0x80, 0xf4, 0x7b, +0xff, 0x7a, 0x30, 0x79, 0x65, 0x12, 0x25, 0x33, 0x12, 0x18, 0x64, 0xf0, 0x78, 0x76, 0xe6, 0x70, +0xe2, 0x02, 0x31, 0xd4, 0x53, 0xad, 0xfb, 0x12, 0x19, 0x14, 0x22, 0x78, 0xff, 0xe4, 0xf6, 0xd8, +0xfd, 0x90, 0x00, 0x00, 0x7f, 0x00, 0x7e, 0x03, 0xe4, 0xf0, 0xa3, 0xdf, 0xfc, 0xde, 0xfa, 0x75, +0x81, 0x83, 0x75, 0xa0, 0x00, 0x02, 0x2a, 0x43, 0x02, 0x33, 0x11, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, +0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, +0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, +0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, +0x20, 0x40, 0x80, 0x90, 0x3a, 0x31, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, +0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, +0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, +0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, +0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0x90, 0x36, 0x0a, 0xe4, 0x93, 0x70, 0x05, 0x43, +0x90, 0x10, 0x80, 0x03, 0x53, 0x90, 0xef, 0x90, 0x36, 0x0c, 0xe4, 0x93, 0xff, 0x7c, 0x01, 0x7d, +0x00, 0x12, 0x32, 0x56, 0x90, 0x36, 0x0d, 0xe4, 0x93, 0xb4, 0x01, 0x07, 0x90, 0xff, 0x10, 0xe0, +0x44, 0x18, 0xf0, 0x7e, 0x01, 0x7f, 0x00, 0x7d, 0x00, 0x7b, 0x01, 0x7a, 0x01, 0x79, 0x00, 0x12, +0x0f, 0xeb, 0x7d, 0x01, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0x7d, 0x03, 0x7f, 0x12, 0x12, 0x30, 0x65, +0x90, 0xff, 0x1b, 0xe0, 0x54, 0xfb, 0xf0, 0x90, 0xff, 0x14, 0xe0, 0x44, 0x04, 0xf0, 0x90, 0x36, +0x09, 0xe4, 0x93, 0x90, 0x01, 0xfa, 0xf0, 0x90, 0x36, 0x07, 0xe4, 0x93, 0x90, 0x01, 0xea, 0xf0, +0x90, 0x36, 0x11, 0xe4, 0x93, 0x90, 0x01, 0xed, 0xf0, 0x78, 0xa7, 0x7c, 0x01, 0x7d, 0x01, 0x7b, +0xff, 0x7a, 0x36, 0x79, 0x00, 0x7e, 0x00, 0x7f, 0x03, 0x12, 0x0b, 0xc8, 0xe4, 0x90, 0x01, 0xec, +0xf0, 0x90, 0x01, 0xfe, 0x04, 0xf0, 0xe4, 0x78, 0x82, 0xf6, 0x90, 0x00, 0xc2, 0xf0, 0xa3, 0xf0, +0x22, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, 0x26, 0xe5, 0x25, 0xfa, 0x34, 0x00, 0xf5, +0x25, 0xee, 0x8f, 0xf0, 0x12, 0x0d, 0xcb, 0x90, 0x00, 0x02, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, +0x12, 0x0d, 0x46, 0xff, 0xae, 0xf0, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, 0x26, 0xe5, +0x25, 0xfa, 0x34, 0x00, 0xf5, 0x25, 0xee, 0x8f, 0xf0, 0x02, 0x0d, 0xcb, 0x90, 0x00, 0x05, 0xab, +0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x02, 0x0c, 0x07, 0xab, 0x24, 0xe5, 0x26, 0xf9, 0x24, 0x02, 0xf5, +0x26, 0xe5, 0x25, 0xfa, 0x34, 0x00, 0xf5, 0x25, 0xe4, 0xf5, 0xf0, 0x02, 0x0d, 0xcb, 0xab, 0x1b, +0xaa, 0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x0b, 0x02, 0x0c, 0x07, 0xe5, 0x1e, 0xfe, 0x7c, 0x00, 0xe4, +0x25, 0x21, 0xff, 0xec, 0x3e, 0xfe, 0x22, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x22, 0x75, 0x24, +0x01, 0x85, 0x22, 0x25, 0x85, 0x23, 0x26, 0x22, 0xab, 0x24, 0xaa, 0x25, 0xa9, 0x26, 0x22, 0x8d, +0x82, 0x8c, 0x83, 0xee, 0xf0, 0xa3, 0xef, 0xf0, 0x22, 0x8f, 0x1b, 0x8c, 0x1c, 0x8d, 0x1d, 0xe4, +0xff, 0x79, 0x01, 0xe4, 0xf5, 0x1e, 0xfe, 0x12, 0x39, 0xef, 0xe5, 0x82, 0x2e, 0xf5, 0x82, 0xe4, +0x35, 0x83, 0xf5, 0x83, 0xe4, 0x93, 0x25, 0xe0, 0x25, 0x1b, 0xf8, 0xe2, 0xfc, 0x08, 0xe2, 0xfd, +0x12, 0x39, 0xef, 0x74, 0x04, 0x93, 0xfa, 0x74, 0x05, 0x93, 0xfb, 0xc3, 0xed, 0x9b, 0xec, 0x9a, +0x40, 0x02, 0x05, 0x1e, 0x0e, 0xbe, 0x04, 0xcf, 0x12, 0x39, 0xef, 0x74, 0x06, 0x93, 0xfd, 0xe5, +0x1e, 0xc3, 0x9d, 0x50, 0x04, 0xe4, 0xf9, 0x80, 0x04, 0x0f, 0xbf, 0x05, 0xb6, 0x90, 0x00, 0xc5, +0xe0, 0xb5, 0x01, 0x07, 0xe4, 0x90, 0x00, 0xc4, 0xf0, 0x80, 0x28, 0x90, 0x00, 0xc4, 0xe0, 0x04, +0xf0, 0x85, 0x1d, 0x82, 0x85, 0x1c, 0x83, 0x74, 0x23, 0x93, 0xff, 0x90, 0x00, 0xc4, 0xe0, 0xfd, +0x33, 0x95, 0xe0, 0xfc, 0xd3, 0xed, 0x9f, 0x74, 0x80, 0xf8, 0x6c, 0x98, 0x40, 0x05, 0xe4, 0xf0, +0xa3, 0xe9, 0xf0, 0x90, 0x00, 0xc5, 0xe0, 0x7f, 0x00, 0x60, 0x02, 0x7f, 0xaa, 0x22, 0xe4, 0x78, +0x62, 0xf6, 0x08, 0xf6, 0xfe, 0xfb, 0x12, 0x08, 0x00, 0xf9, 0xf5, 0x30, 0xf5, 0x2e, 0x75, 0x2f, +0xff, 0x78, 0x7a, 0xe6, 0xff, 0xe9, 0xc3, 0x9f, 0x50, 0x63, 0xe9, 0x12, 0x06, 0x2c, 0xe9, 0x25, +0xe0, 0x25, 0xe0, 0x24, 0x5e, 0xf8, 0xe2, 0x2f, 0xf5, 0x32, 0x18, 0xe2, 0x3e, 0xf5, 0x31, 0x12, +0x09, 0x97, 0x74, 0x04, 0x93, 0xfe, 0x74, 0x05, 0x93, 0xff, 0x78, 0x62, 0xe6, 0xfc, 0x08, 0xe6, +0xfd, 0xef, 0x2d, 0xfb, 0xee, 0x3c, 0xfa, 0xd3, 0xe5, 0x32, 0x9b, 0xe5, 0x31, 0x9a, 0x40, 0x06, +0x75, 0x30, 0x01, 0x18, 0x80, 0x1d, 0xe5, 0x32, 0x2f, 0xff, 0xe5, 0x31, 0x3e, 0xfe, 0xd3, 0xed, +0x9f, 0xec, 0x9e, 0x40, 0x15, 0xe5, 0x30, 0x60, 0x08, 0xe4, 0xf5, 0x30, 0x12, 0x32, 0x15, 0x05, +0x2e, 0x78, 0x62, 0xa6, 0x31, 0x08, 0xa6, 0x32, 0x89, 0x2f, 0x09, 0x80, 0x94, 0xe5, 0x30, 0x60, +0x03, 0x12, 0x32, 0x15, 0x22, 0xe4, 0xfb, 0xeb, 0x12, 0x06, 0x85, 0xe6, 0xfa, 0xf4, 0x60, 0x67, +0xea, 0x70, 0x0c, 0x12, 0x05, 0xf0, 0x74, 0x11, 0x93, 0xf5, 0x2e, 0x74, 0x12, 0x80, 0x1d, 0x78, +0x7a, 0xe6, 0x14, 0xb5, 0x02, 0x0c, 0x12, 0x05, 0xf0, 0x74, 0x13, 0x93, 0xf5, 0x2e, 0x74, 0x14, +0x80, 0x0a, 0x12, 0x05, 0xf0, 0x74, 0x0f, 0x93, 0xf5, 0x2e, 0x74, 0x10, 0x93, 0xf5, 0x2f, 0x78, +0x0c, 0xe2, 0x70, 0x05, 0x78, 0x3a, 0xe2, 0x60, 0x14, 0xe5, 0x2f, 0x25, 0xe0, 0xff, 0xe5, 0x2e, +0x33, 0xfe, 0x7c, 0x00, 0x7d, 0x03, 0x12, 0x0c, 0x7a, 0x8e, 0x2e, 0x8f, 0x2f, 0xea, 0x12, 0x06, +0x2c, 0xea, 0x25, 0xe0, 0x12, 0x07, 0xa0, 0xfe, 0xc3, 0xef, 0x95, 0x2f, 0xee, 0x95, 0x2e, 0x50, +0x06, 0xeb, 0x12, 0x06, 0x85, 0x76, 0xff, 0x0b, 0xeb, 0x64, 0x02, 0x70, 0x8a, 0xe5, 0x41, 0xb4, +0xff, 0x08, 0xe5, 0x45, 0xf4, 0x60, 0x03, 0x12, 0x07, 0x3b, 0x22, 0xef, 0x54, 0x07, 0xfe, 0x74, +0x01, 0xa8, 0x06, 0x08, 0x80, 0x02, 0xc3, 0x33, 0xd8, 0xfc, 0xf9, 0xf4, 0xfe, 0xef, 0x54, 0xf0, +0xf5, 0x3e, 0x64, 0x10, 0x70, 0x1e, 0xbd, 0x08, 0x02, 0x7d, 0x02, 0x90, 0xff, 0x12, 0xed, 0x30, +0xe2, 0x05, 0xe0, 0x49, 0xf0, 0x80, 0x03, 0xe0, 0x5e, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x14, +0x15, 0x83, 0x80, 0x10, 0xe5, 0x3e, 0x13, 0x13, 0x54, 0x3f, 0x24, 0x11, 0xfb, 0xe4, 0x34, 0xff, +0xf5, 0x83, 0x8b, 0x82, 0xed, 0x24, 0xfb, 0x60, 0x14, 0x14, 0x60, 0x20, 0x24, 0xfe, 0x70, 0x2a, +0xe0, 0x5e, 0xf0, 0xe5, 0x82, 0x15, 0x82, 0x70, 0x1e, 0x15, 0x83, 0x80, 0x1a, 0xe0, 0x5e, 0xf0, +0xe5, 0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x49, 0xf0, 0x22, 0xe0, 0x49, 0xf0, 0xe5, +0x82, 0x15, 0x82, 0x70, 0x02, 0x15, 0x83, 0xe0, 0x5e, 0xf0, 0x22, 0xe4, 0xf5, 0x22, 0x12, 0x08, +0xae, 0xe2, 0x60, 0x11, 0xa8, 0x07, 0xe8, 0x24, 0x0a, 0xf8, 0xe2, 0x7f, 0x80, 0x60, 0x02, 0x7f, +0x08, 0x8f, 0x22, 0x80, 0x19, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x0a, 0xf8, 0xe2, 0x60, 0x0f, 0xa8, +0x07, 0xe8, 0x24, 0x0e, 0xf8, 0xe2, 0x7f, 0x04, 0x60, 0x02, 0x7f, 0x08, 0x8f, 0x22, 0xe5, 0x22, +0xb4, 0x04, 0x1f, 0x12, 0x0a, 0x15, 0xf9, 0x7a, 0x00, 0x7b, 0xfe, 0xc0, 0x01, 0xa9, 0x07, 0xa8, +0x01, 0x7c, 0x00, 0x7d, 0xfe, 0xd0, 0x01, 0x12, 0x07, 0x1f, 0x78, 0x79, 0xe6, 0x24, 0x04, 0xf8, +0xe4, 0xf2, 0x78, 0x79, 0xe6, 0xff, 0x24, 0x05, 0xf8, 0xe5, 0x22, 0xf2, 0x7a, 0x00, 0xa9, 0x07, +0x7b, 0xfe, 0xef, 0x24, 0x06, 0xf8, 0x7c, 0x00, 0x7d, 0xfe, 0x7e, 0x00, 0x7f, 0x06, 0x02, 0x0b, +0xc8, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x10, 0x78, 0x53, 0xa6, 0xa3, +0x08, 0xa6, 0xa6, 0x75, 0xa3, 0x08, 0xe6, 0xff, 0x30, 0xe4, 0x07, 0x75, 0xd1, 0xdf, 0x78, 0x81, +0x76, 0x00, 0x78, 0x53, 0xe6, 0x30, 0xe0, 0x40, 0xef, 0x20, 0xe0, 0x39, 0x78, 0x81, 0xe6, 0xff, +0x70, 0x18, 0x90, 0x02, 0xf8, 0xe0, 0xfe, 0xf5, 0xd6, 0x18, 0xee, 0xf6, 0xc3, 0x94, 0x10, 0x50, +0x24, 0x78, 0x82, 0xe6, 0x25, 0xd6, 0xf5, 0xd6, 0x80, 0x1b, 0x74, 0xf8, 0x2f, 0xf5, 0x82, 0xe4, +0x34, 0x02, 0xf5, 0x83, 0xe0, 0xff, 0x78, 0x80, 0xe6, 0x06, 0x25, 0x50, 0xf5, 0x82, 0xe4, 0x35, +0x4f, 0xf5, 0x83, 0xef, 0xf0, 0x78, 0x81, 0x06, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, +0x32, 0xab, 0x07, 0xaa, 0x05, 0xe4, 0x78, 0x75, 0xf6, 0xeb, 0x12, 0x17, 0xd7, 0xe0, 0xf5, 0x28, +0xa3, 0xe0, 0xf5, 0x29, 0x78, 0x70, 0xe6, 0x75, 0x26, 0x00, 0xf5, 0x27, 0xae, 0x26, 0xff, 0x7c, +0x00, 0x7d, 0xfc, 0x12, 0x0c, 0x68, 0xd3, 0xe5, 0x29, 0x9f, 0xe5, 0x28, 0x9e, 0x40, 0x06, 0x78, +0x75, 0xe6, 0x44, 0x20, 0xf6, 0x12, 0x17, 0xba, 0x74, 0x05, 0x93, 0x25, 0xe0, 0xf5, 0x29, 0x74, +0x04, 0x93, 0x33, 0xf5, 0x28, 0xeb, 0x12, 0x18, 0x7d, 0xe0, 0xfe, 0xa3, 0xe0, 0x25, 0x29, 0xff, +0xe5, 0x28, 0x3e, 0xfe, 0xeb, 0x12, 0x17, 0xd7, 0xe0, 0xfc, 0xa3, 0xe0, 0xd3, 0x9f, 0xec, 0x9e, +0x40, 0x09, 0x78, 0x75, 0xe6, 0x44, 0x02, 0xf6, 0x44, 0x08, 0xf6, 0x0b, 0x1a, 0xea, 0x70, 0x99, +0x22, 0xe4, 0xf5, 0x1b, 0x78, 0x1c, 0x7c, 0x00, 0xfd, 0x7b, 0xff, 0x7a, 0x3a, 0x79, 0x65, 0xfe, +0x7f, 0x02, 0x12, 0x0b, 0xc8, 0x75, 0x21, 0x01, 0x75, 0x22, 0x00, 0x75, 0x23, 0xbc, 0x7b, 0x00, +0x7a, 0x00, 0x79, 0x1c, 0x12, 0x23, 0xf8, 0xe5, 0x1c, 0xf4, 0x60, 0x14, 0x90, 0x00, 0xbc, 0x12, +0x32, 0xa5, 0x40, 0x09, 0xd3, 0xef, 0x94, 0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, 0x75, 0x1b, 0x01, +0xe5, 0x1d, 0xf4, 0x60, 0x14, 0x90, 0x00, 0xbe, 0x12, 0x32, 0xa5, 0x40, 0x09, 0xd3, 0xef, 0x94, +0xb8, 0xee, 0x94, 0x0b, 0x40, 0x03, 0x75, 0x1b, 0x01, 0x78, 0xb0, 0x7c, 0x01, 0x7d, 0x01, 0x7b, +0x01, 0x7a, 0x00, 0x79, 0xbc, 0x7e, 0x00, 0x7f, 0x04, 0x12, 0x0b, 0xc8, 0xaf, 0x1b, 0x22, 0xad, +0x07, 0x7f, 0x3a, 0x12, 0x35, 0x80, 0x90, 0x00, 0xb9, 0xe4, 0xf0, 0xa3, 0xef, 0xf0, 0x7f, 0x3b, +0x12, 0x35, 0x80, 0xef, 0xfb, 0x7a, 0x00, 0x90, 0x00, 0xba, 0xe0, 0xfe, 0xe4, 0x2b, 0xff, 0xea, +0x3e, 0x90, 0x00, 0xb9, 0xf0, 0xa3, 0xef, 0xf0, 0x90, 0x00, 0xb9, 0xe0, 0xb4, 0x80, 0x08, 0xa3, +0xe0, 0xb4, 0x67, 0x03, 0xbd, 0xb6, 0xf1, 0x90, 0x00, 0xb9, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x64, +0x77, 0x70, 0x03, 0xee, 0x64, 0x80, 0x60, 0x06, 0xbe, 0x80, 0x08, 0xbf, 0x78, 0x05, 0xed, 0x64, +0xb5, 0x60, 0xe4, 0x90, 0x00, 0xb9, 0xe0, 0xb4, 0x80, 0x0a, 0xa3, 0xe0, 0xb4, 0x78, 0x05, 0xed, +0x64, 0xb8, 0x60, 0xef, 0x22, 0x78, 0x73, 0xe6, 0x30, 0xe0, 0x08, 0x75, 0x27, 0x05, 0x75, 0x28, +0x01, 0x80, 0x06, 0x75, 0x27, 0x08, 0xe4, 0xf5, 0x28, 0xe4, 0xf5, 0x26, 0xe5, 0x26, 0xc3, 0x78, +0x78, 0x96, 0x50, 0x40, 0x12, 0x18, 0xbf, 0x25, 0x26, 0x12, 0x19, 0x06, 0xe0, 0xf5, 0x29, 0xe5, +0x26, 0x54, 0x01, 0xfd, 0xaf, 0x29, 0x12, 0x34, 0x16, 0xad, 0x28, 0xaf, 0x29, 0x12, 0x31, 0x4c, +0xad, 0x27, 0xaf, 0x29, 0x12, 0x30, 0x65, 0x78, 0x73, 0xe6, 0xb4, 0x03, 0x13, 0xe5, 0x26, 0x30, +0xe0, 0x0e, 0xe4, 0xfd, 0xaf, 0x29, 0x12, 0x31, 0x4c, 0x7d, 0x08, 0xaf, 0x29, 0x12, 0x30, 0x65, +0x05, 0x26, 0x80, 0xb8, 0x22, 0xef, 0x54, 0x07, 0x90, 0x3a, 0x5d, 0x93, 0xfe, 0xf4, 0xf9, 0xef, +0x54, 0xf0, 0xff, 0x64, 0x10, 0x60, 0x11, 0xef, 0x13, 0x13, 0x54, 0x3f, 0x24, 0x11, 0xf5, 0x82, +0xe4, 0x34, 0xff, 0xfa, 0xab, 0x82, 0x80, 0x1a, 0xbd, 0x08, 0x02, 0x7d, 0x02, 0x7a, 0xff, 0x7b, +0x12, 0xed, 0x30, 0xe2, 0x05, 0x12, 0x35, 0x56, 0x80, 0x03, 0x12, 0x35, 0x5e, 0xeb, 0x1b, 0x70, +0x01, 0x1a, 0xed, 0x30, 0xe1, 0x05, 0x12, 0x35, 0x56, 0x80, 0x03, 0x12, 0x35, 0x5e, 0xeb, 0x1b, +0x70, 0x01, 0x1a, 0xed, 0x30, 0xe0, 0x04, 0x12, 0x35, 0x56, 0x22, 0x12, 0x35, 0x5e, 0x22, 0xc0, +0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, +0xc0, 0x02, 0xc0, 0x03, 0xc0, 0x04, 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x19, 0x0d, 0x12, +0x00, 0x0a, 0x7b, 0xff, 0x7a, 0x2d, 0x79, 0x5b, 0x12, 0x25, 0x33, 0xd0, 0x07, 0xd0, 0x06, 0xd0, +0x05, 0xd0, 0x04, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x82, 0xd0, +0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0x8f, 0x2a, 0x8d, 0x2b, 0xe5, 0x2b, 0x75, 0xf0, 0x2e, 0xa4, +0x24, 0x09, 0x12, 0x06, 0x32, 0xe5, 0x2a, 0x12, 0x0a, 0x0e, 0x12, 0x31, 0x3d, 0xc0, 0x06, 0xc0, +0x07, 0xe5, 0x2b, 0x75, 0xf0, 0x2e, 0xa4, 0x24, 0x07, 0x12, 0x06, 0x32, 0xe5, 0x2a, 0x12, 0x0a, +0xc1, 0x12, 0x31, 0x3d, 0xd0, 0xe0, 0x2f, 0xff, 0xd0, 0xe0, 0x3e, 0xfe, 0x22, 0xf8, 0xe2, 0xfc, +0x08, 0xe2, 0xc3, 0x9f, 0xff, 0xec, 0x9e, 0xfe, 0x12, 0x3a, 0x14, 0x22, 0x12, 0x35, 0x46, 0x60, +0x3e, 0xee, 0x64, 0x01, 0x70, 0x18, 0xed, 0x60, 0x07, 0x78, 0x83, 0xe6, 0x4c, 0xf6, 0x80, 0x06, +0xec, 0xf4, 0x78, 0x83, 0x56, 0xf6, 0x78, 0x83, 0xe6, 0x90, 0xff, 0x18, 0xf0, 0x22, 0xaf, 0x06, +0xef, 0x75, 0xf0, 0x04, 0xa4, 0x24, 0x12, 0xff, 0xe5, 0xf0, 0x34, 0xff, 0x8f, 0x82, 0xf5, 0x83, +0xed, 0x60, 0x04, 0xe0, 0x4c, 0xf0, 0x22, 0xe0, 0xff, 0xec, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0x22, +0xc2, 0xd5, 0xe8, 0x30, 0xe7, 0x0f, 0xb2, 0xd5, 0xe4, 0xc3, 0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, +0x99, 0xf9, 0xe4, 0x98, 0xf8, 0xec, 0x30, 0xe7, 0x17, 0xb2, 0xd5, 0x12, 0x31, 0xc6, 0x12, 0x0e, +0xa2, 0xe4, 0xc3, 0x9b, 0xfb, 0xe4, 0x9a, 0xfa, 0xe4, 0x99, 0xf9, 0xe4, 0x98, 0xf8, 0x80, 0x03, +0x12, 0x0e, 0xa2, 0x30, 0xd5, 0x0d, 0xe4, 0xc3, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0xe4, 0x9d, 0xfd, +0xe4, 0x9c, 0xfc, 0x22, 0x78, 0x76, 0xe6, 0xf5, 0x26, 0x78, 0x76, 0xe6, 0x60, 0x13, 0x12, 0x34, +0xe3, 0xe5, 0x26, 0x78, 0x76, 0x66, 0x60, 0xf1, 0xe6, 0xf5, 0x26, 0x12, 0x18, 0x64, 0xf0, 0x80, +0xe8, 0xe4, 0xf5, 0x26, 0xe5, 0x26, 0xc3, 0x78, 0x78, 0x96, 0x50, 0x18, 0xe5, 0x26, 0x12, 0x18, +0x46, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xe5, 0x26, 0x12, 0x17, 0xd7, 0xee, 0xf0, 0xa3, 0xef, 0xf0, +0x05, 0x26, 0x80, 0xe0, 0x22, 0x78, 0x62, 0xe6, 0xfa, 0x08, 0xe6, 0xfb, 0xad, 0x2f, 0xaf, 0x2e, +0xef, 0xc3, 0x94, 0x02, 0x50, 0x10, 0xef, 0x12, 0x06, 0x85, 0xa6, 0x05, 0xef, 0x12, 0x07, 0x04, +0xa6, 0x02, 0x08, 0xa6, 0x03, 0x22, 0xd3, 0xeb, 0x95, 0x44, 0xea, 0x95, 0x43, 0x40, 0x07, 0x8d, +0x41, 0x8a, 0x43, 0x8b, 0x44, 0x22, 0xd3, 0xeb, 0x95, 0x48, 0xea, 0x95, 0x47, 0x40, 0x06, 0x8d, +0x45, 0x8a, 0x47, 0x8b, 0x48, 0x22, 0x8c, 0x4f, 0x8d, 0x50, 0x12, 0x35, 0xb5, 0x44, 0x18, 0x12, +0x35, 0xac, 0x90, 0xff, 0x14, 0xe0, 0x44, 0x18, 0xf0, 0x90, 0xff, 0x1b, 0xe0, 0x44, 0x18, 0xf0, +0x75, 0xa3, 0x08, 0xef, 0x44, 0x80, 0xf5, 0xa1, 0x75, 0xa6, 0x28, 0x75, 0xa2, 0xc1, 0xaf, 0x50, +0x85, 0x4f, 0xd7, 0x8f, 0xd6, 0x75, 0xd5, 0x02, 0x75, 0xd4, 0xf8, 0x75, 0xd2, 0x01, 0x75, 0xd1, +0xdf, 0x53, 0xac, 0xef, 0x22, 0x85, 0x4e, 0x82, 0x85, 0x4d, 0x83, 0x22, 0x75, 0x8a, 0xa0, 0xe4, +0x90, 0x00, 0xb8, 0xf0, 0x22, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xc3, 0x94, 0x78, 0xee, 0x94, 0x00, +0x22, 0xe4, 0x93, 0xff, 0x7e, 0x00, 0x7c, 0x00, 0x02, 0x0c, 0x68, 0xe4, 0x78, 0x84, 0xf2, 0x08, +0xf2, 0x90, 0x00, 0xc0, 0xf0, 0x22, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x56, 0x22, 0xab, 0x25, 0xaa, +0x26, 0xa9, 0x27, 0x22, 0x12, 0x0c, 0x46, 0xab, 0x1b, 0xe5, 0x1d, 0x24, 0x0c, 0xf9, 0xe4, 0x35, +0x1c, 0xfa, 0x7e, 0x00, 0xe9, 0x25, 0x24, 0xf9, 0xee, 0x3a, 0xfa, 0x12, 0x0b, 0xee, 0xff, 0x22, +0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x0b, 0x12, 0x0c, 0x07, 0xff, 0x22, 0x75, 0x8a, +0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x22, 0xab, 0x21, 0xaa, 0x22, 0xa9, 0x23, 0x85, 0x24, 0x82, +0x22, 0xc2, 0xaf, 0x12, 0x34, 0x45, 0xe5, 0x9b, 0xb4, 0x5a, 0x16, 0xe5, 0x9a, 0xb4, 0xa5, 0x11, +0xe5, 0x99, 0xb4, 0xf0, 0x0c, 0xe5, 0x98, 0xb4, 0x0f, 0x07, 0x90, 0xff, 0x85, 0xe0, 0x44, 0x20, +0xf0, 0x75, 0x8a, 0x0a, 0xd2, 0xaf, 0x7f, 0x0a, 0x12, 0x33, 0x80, 0x12, 0x35, 0xc1, 0x12, 0x10, +0x17, 0x75, 0x8a, 0xa0, 0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x80, 0xf3, 0x85, 0x20, 0x82, 0x85, 0x1f, +0x83, 0x22, 0xab, 0x1b, 0xaa, 0x1c, 0xa9, 0x1d, 0x12, 0x0d, 0x1b, 0xff, 0x22, 0xab, 0x1b, 0xaa, +0x1c, 0xa9, 0x1d, 0x90, 0x00, 0x02, 0x12, 0x0d, 0x46, 0xff, 0x22, 0x93, 0xfd, 0xd3, 0x90, 0x00, +0xb6, 0xe0, 0x9d, 0x90, 0x00, 0xb5, 0xe0, 0x9c, 0x22, 0xf2, 0xe4, 0x90, 0x00, 0xb7, 0xf0, 0x22, +0xe4, 0x90, 0x00, 0xb8, 0xf0, 0x90, 0x00, 0xbb, 0xf0, 0xef, 0x70, 0x0e, 0x75, 0x88, 0x08, 0xf5, +0x8d, 0xf5, 0x8c, 0xf5, 0x8f, 0xf5, 0x8e, 0xf5, 0x88, 0x22, 0x75, 0x88, 0x08, 0xe4, 0xf5, 0x8d, +0xf5, 0x8c, 0xef, 0x75, 0xf0, 0x20, 0xa4, 0xff, 0xe5, 0xf0, 0x44, 0x80, 0xf5, 0x8f, 0x8f, 0x8e, +0x75, 0x88, 0xa0, 0x22, 0x8f, 0x2c, 0xe4, 0xfd, 0x7f, 0x12, 0x12, 0x31, 0x4c, 0xaf, 0x2c, 0x15, +0x2c, 0xef, 0x60, 0x1b, 0x75, 0xb1, 0x11, 0x75, 0xb4, 0x63, 0x75, 0xb0, 0x0d, 0xe5, 0xb1, 0x20, +0xe0, 0x05, 0x12, 0x34, 0xe3, 0x80, 0xf6, 0xe4, 0xf5, 0xb0, 0x75, 0xb1, 0x01, 0x80, 0xde, 0x7d, +0x01, 0x7f, 0x12, 0x02, 0x31, 0x4c, 0xe4, 0xf5, 0x3c, 0xf5, 0x3d, 0xff, 0x12, 0x0b, 0xee, 0x25, +0x3d, 0xf5, 0x3d, 0xe4, 0x35, 0x3c, 0xf5, 0x3c, 0x90, 0xff, 0xff, 0x12, 0x0c, 0x07, 0x12, 0x0c, +0x34, 0x74, 0xff, 0x29, 0xf9, 0x74, 0xff, 0x3a, 0xfa, 0x0f, 0xbf, 0x09, 0xdf, 0xed, 0x12, 0x0c, +0x34, 0xae, 0x3c, 0xaf, 0x3d, 0x22, 0x12, 0x35, 0x46, 0x60, 0x29, 0x90, 0xff, 0x13, 0xee, 0xd3, +0x94, 0x03, 0x40, 0x11, 0xaf, 0x06, 0xef, 0x75, 0xf0, 0x04, 0xa4, 0x25, 0x82, 0xf5, 0x82, 0xe5, +0xf0, 0x35, 0x83, 0xf5, 0x83, 0xed, 0x60, 0x04, 0xe0, 0x4c, 0xf0, 0x22, 0xe0, 0xff, 0xec, 0xf4, +0xfe, 0xef, 0x5e, 0xf0, 0x22, 0x75, 0x9b, 0x5a, 0x75, 0x9a, 0xa5, 0x75, 0x99, 0xf0, 0x75, 0x98, +0x0f, 0x75, 0xac, 0xff, 0x75, 0xad, 0xff, 0x90, 0xff, 0x88, 0x74, 0x40, 0xf0, 0x74, 0xc0, 0xf0, +0x90, 0xff, 0x01, 0x74, 0x01, 0xf0, 0x75, 0x95, 0xf1, 0xe4, 0xf5, 0x96, 0x75, 0x97, 0xc7, 0x22, +0xe4, 0x78, 0x7c, 0xf6, 0x8f, 0x82, 0x8e, 0x83, 0x74, 0x79, 0x93, 0x78, 0x7a, 0xf6, 0xef, 0x24, +0x79, 0xf5, 0x4a, 0xe4, 0x3e, 0xf5, 0x49, 0xef, 0x24, 0x30, 0xf5, 0x40, 0xe4, 0x3e, 0xf5, 0x3f, +0x78, 0x00, 0xe2, 0x54, 0xfe, 0xf2, 0x54, 0xfb, 0xf2, 0x22, 0xef, 0x60, 0x0f, 0x43, 0xac, 0x10, +0x12, 0x35, 0xb5, 0x54, 0xe7, 0x12, 0x35, 0xac, 0xe4, 0xf5, 0xa2, 0x22, 0x12, 0x35, 0xad, 0xa3, +0xe0, 0x44, 0x18, 0xf0, 0xa3, 0xe0, 0x54, 0xe7, 0xf0, 0x75, 0xa2, 0xc1, 0x53, 0xac, 0xef, 0x22, +0xc3, 0xef, 0x94, 0x01, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, +0x11, 0xd3, 0xef, 0x9d, 0xee, 0x9c, 0x40, 0x0a, 0xed, 0x24, 0xff, 0xff, 0xec, 0x34, 0xff, 0xfe, +0x80, 0x00, 0x22, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, 0xe0, 0x04, 0xf0, +0x75, 0x91, 0xc1, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, +0xe0, 0x04, 0xf0, 0x22, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, 0x03, 0xe0, 0x04, +0xf0, 0x75, 0x91, 0xc3, 0xe4, 0xf5, 0x91, 0xe5, 0x89, 0x30, 0xe7, 0x08, 0x12, 0x3a, 0x20, 0x50, +0x03, 0xe0, 0x04, 0xf0, 0x22, 0xab, 0x1e, 0xaa, 0x1f, 0xa9, 0x20, 0x90, 0x00, 0x01, 0x12, 0x0c, +0x07, 0xff, 0x22, 0x90, 0xff, 0x50, 0xf0, 0x90, 0xff, 0x58, 0xf0, 0xab, 0x1e, 0xaa, 0x1f, 0xa9, +0x20, 0x12, 0x0b, 0xee, 0xff, 0x22, 0xef, 0x54, 0x07, 0x90, 0x3a, 0x5d, 0x93, 0xfc, 0xef, 0xc4, +0x54, 0x0f, 0xfe, 0xef, 0xf4, 0x22, 0x8b, 0x82, 0x8a, 0x83, 0xe0, 0x4e, 0xf0, 0x22, 0x8b, 0x82, +0x8a, 0x83, 0xe0, 0x59, 0xf0, 0x22, 0xef, 0x24, 0x79, 0xf5, 0x0d, 0xe4, 0x3e, 0xf5, 0x0c, 0xef, +0x24, 0x30, 0xf5, 0x09, 0xe4, 0x3e, 0xf5, 0x08, 0xe4, 0xf5, 0x0b, 0xf5, 0x0e, 0xf5, 0x0a, 0x22, +0x90, 0xff, 0x00, 0x74, 0x02, 0xf0, 0x90, 0xff, 0x04, 0xe4, 0xf0, 0x90, 0xff, 0x03, 0xef, 0xf0, +0x90, 0xff, 0x07, 0xe0, 0xff, 0x22, 0xe4, 0x90, 0x00, 0xc5, 0xf0, 0x8f, 0x82, 0x8e, 0x83, 0x74, +0x23, 0x93, 0xff, 0xc3, 0x74, 0x40, 0x9f, 0x90, 0x00, 0xc4, 0xf0, 0x22, 0xf0, 0x90, 0xff, 0x10, +0xe0, 0x54, 0xe7, 0xf0, 0x22, 0x90, 0xff, 0x12, 0xe0, 0x54, 0xe7, 0xf0, 0x90, 0xff, 0x11, 0xe0, +0x22, 0x12, 0x2a, 0x88, 0x78, 0x7e, 0x76, 0x00, 0x08, 0x76, 0x28, 0x90, 0x00, 0xc1, 0x74, 0x04, +0xf0, 0xe4, 0xf5, 0x4b, 0x22, 0xef, 0x75, 0xf0, 0x0a, 0xa4, 0x24, 0x01, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0x22, 0x74, 0xb5, 0x2f, 0xf5, 0x82, 0xe4, 0x34, +0x02, 0xf5, 0x83, 0xe0, 0xff, 0x22, 0x12, 0x32, 0x95, 0x74, 0x9c, 0x93, 0xfd, 0x02, 0x00, 0x24, +0xb6, 0x48, 0x01, 0x0a, 0x14, 0x01, 0x02, 0x05, 0x3c, 0x70, 0x00, 0x00, 0x15, 0x01, 0x02, 0x01, +0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, +0x00, 0x00, 0x03, 0x0a, 0x00, 0xc8, 0x03, 0xe8, 0x0f, 0x1e, 0x0c, 0x10, 0x3c, 0x01, 0x00, 0x50, +0x43, 0x41, 0x44, 0x51, 0x45, 0x52, 0x46, 0x53, 0x56, 0x54, 0x17, 0x54, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x19, 0x28, 0x28, 0x28, 0x28, 0x00, 0x28, +0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x78, 0x2e, 0x90, 0x01, 0x01, 0x0a, 0x0a, 0x85, 0x00, 0x96, +0x02, 0x6c, 0x02, 0x6c, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, +0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, +0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, +0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, +0x28, 0x02, 0x58, 0x05, 0x00, 0xf0, 0x01, 0x18, 0x00, 0x23, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xc8, 0x00, 0xc8, 0x00, 0xc8, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, 0x00, +0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x1e, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x00, 0x01, +0x08, 0x09, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, 0x00, 0xc8, 0x04, 0x02, 0x03, 0x07, 0x06, +0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, 0x01, 0x00, +0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x00, +0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, 0x00, +0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, +0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, +0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, +0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, +0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, 0x00, +0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, +0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, +0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, 0x01, +0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, +0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, 0x85, +0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, +0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, +0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, +0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, +0xc8, 0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, 0x00, +0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, +0x00, 0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, 0x03, +0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x10, 0x3c, +0x01, 0x00, 0x50, 0x44, 0x41, 0x45, 0x51, 0x46, 0x52, 0x56, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, +0x1e, 0x00, 0x28, 0x05, 0x0b, 0x28, 0xff, 0xff, 0xff, 0x64, 0x1e, 0x90, 0x01, 0x00, 0x08, 0x08, +0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, +0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, +0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, +0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, +0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x04, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x46, 0x00, 0x46, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, 0x04, +0x00, 0x00, 0x00, 0x00, 0x02, 0x64, 0x9c, 0x00, 0x0a, 0x14, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, +0x04, 0x00, 0x01, 0x06, 0x07, 0x01, 0x2c, 0x04, 0x02, 0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x02, +0x03, 0x05, 0x04, 0x01, 0x2c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0e, 0x10, +0x3c, 0x01, 0x00, 0x64, 0x10, 0x41, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x46, 0x45, 0x44, 0x43, +0x17, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, +0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0x22, 0x90, 0x00, 0x00, 0x08, +0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, +0x58, 0x0a, 0x02, 0x85, 0x00, 0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, +0x14, 0x02, 0x58, 0x09, 0x09, 0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x0a, 0x02, 0x85, 0x00, +0xc8, 0x00, 0x3c, 0x02, 0x58, 0x08, 0x08, 0x85, 0x00, 0xc8, 0x00, 0x14, 0x02, 0x58, 0x09, 0x09, +0x85, 0x00, 0xc8, 0x00, 0x28, 0x02, 0x58, 0x07, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x01, 0x2c, 0x05, 0x01, 0x0a, 0x01, +0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0xfa, 0x00, 0x64, 0x14, 0x02, 0x03, 0x0b, 0x0a, 0x00, +0xc8, 0x04, 0x00, 0x01, 0x0c, 0x0d, 0x00, 0x96, 0x04, 0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, +0x02, 0x03, 0x0b, 0x0a, 0x00, 0xc8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x85, +0x1d, 0x82, 0x85, 0x1c, 0x83, 0x75, 0xf0, 0x07, 0xef, 0x02, 0x0f, 0xac, 0x8d, 0x22, 0xaf, 0x22, +0x12, 0x21, 0x74, 0xaf, 0x22, 0x02, 0x15, 0x54, 0xef, 0x25, 0xe0, 0x24, 0x5d, 0xf8, 0xe2, 0xfe, +0x08, 0xe2, 0xff, 0x22, 0xee, 0x30, 0xe7, 0x07, 0xc3, 0xe4, 0x9f, 0xff, 0xe4, 0x9e, 0xfe, 0x22, +0x75, 0x89, 0x80, 0x90, 0x00, 0xbb, 0xe0, 0xc3, 0x94, 0xff, 0x22, 0x7f, 0x30, 0x12, 0x35, 0x80, +0x22, 0x41, 0x00, 0xc0, 0x00, 0x00, 0x78, 0x74, 0xa6, 0x07, 0x22, 0x12, 0x35, 0xd5, 0x22, 0x11, +0x10, 0x41, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x46, 0x45, 0x44, 0x43, 0x17, 0x16, 0x11, 0x40, +0x41, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x46, 0x45, 0x44, 0x43, 0x42, 0x16, 0x01, 0x02, 0x04, +0x08, 0x10, 0x20, 0x40, 0x80, 0x11, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xb6, 0x02, 0x40, 0x52, 0x48, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x8c, +] + +#endif /*CAPACITIVE_HYNITRON_CST816D_UPDATE_H__*/ diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/code.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/code.py new file mode 100644 index 00000000..c6e3a2a0 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/code.py @@ -0,0 +1,73 @@ +import lvgl as lv +import code128 +# 界面风格1 +# style_bar = lv.style_t() +# style_bar.init() +# style_bar.set_border_width(0) +# style_bar.set_radius(0) +# style_bar.set_pad_top(0) +# style_bar.set_pad_bottom(0) +# style_bar.set_pad_left(0) +# style_bar.set_pad_right(0) +style_bar = lv.style_t() +style_bar.init() +style_bar.set_radius(0) +style_bar.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_bar.set_bg_opa(255) +style_bar.set_border_width(0) +style_bar.set_pad_left(0) +style_bar.set_pad_right(0) +style_bar.set_pad_top(0) +style_bar.set_pad_bottom(0) +#screen = lv.obj() + + + +def code_128_generate_barcode(screen, data, width=180, height=80): + + left_curr_line = 0 + + # 删除上次的container + old_container = screen.get_child(-1) + old_container.add_flag(lv.obj.FLAG.HIDDEN) + + # 生成二进制码 + binary_data = code128.encode(data) + if not binary_data: + return + # print("binary_data is ",binary_data) + + # 在LVGL中创建一个容器对象 + container = lv.obj(screen) + container.set_size(width, height) + container.set_pos(0, 33) + container.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + container.add_style(style_bar,lv.PART.MAIN | lv.STATE.DEFAULT) + container.add_flag(lv.obj.FLAG.HIDDEN) + # 计算每个条的宽度 + bar_width = width // (len(binary_data)) + # print("bar_width is :{} len(binary_data):{}".format(bar_width,len(binary_data))) + # 按照二进制码中的1和0,分别创建LVGL矩形对象 + for i in range(len(binary_data)): + # print("left_curr_line is :{} width:{}".format(left_curr_line,width)) + bar = lv.obj(container) + bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) + real_width = bar_width * 1 + bar.set_size(1,90) + left = (width - len(binary_data))//2#240-152 = 88 //2 ==44 + bar.set_pos(left+left_curr_line,0) + if binary_data[i] == 0xff: + bar.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff), lv.PART.MAIN | lv.STATE.DEFAULT) + else: + bar.set_style_bg_color(lv.color_make(0x00, 0x00, 0x00), lv.PART.MAIN | lv.STATE.DEFAULT) + left_curr_line += real_width + container.clear_flag(lv.obj.FLAG.HIDDEN) + old_container.clear_flag(lv.obj.FLAG.HIDDEN) + if old_container: + old_container.delete() + + +# if __name__ == "__main__": +# code_39_generate_barcode(screen,"A123 321") +# lv.scr_load(screen) + diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/constants.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/constants.py new file mode 100644 index 00000000..975bed48 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/constants.py @@ -0,0 +1,209 @@ +class PROTOCOL: + LK_SEND = "LK_SEND" + LK_RECV = "LK_RECV" + + PING_SEND = "PING_SEND" + PING_RECV = "PING_RECV" + + KA_SEND = "KA_SEND" + KA_RECV = "KA_RECV" + + UD_SEND = "UD_SEND" + UD_RECV = "UD_RECV" + + CR_SEND = "CR_SEND" + CR_RECV = "CR_RECV" + + FIND_SEND = "FIND_SEND" + FIND_RECV = "FIND_RECV" + + POWEROFF_SEND = "POWEROFF_SEND" + POWEROFF_RECV = "POWEROFF_RECV" + + PHL_SEND = "PHL_SEND" + PHL_RECV = "PHL_RECV" + + TK_SEND = "TK_SEND" + TK_RECV = "TK_RECV" + + MESSAGE_SEND = "MESSAGE_SEND" + MESSAGE_RECV = "MESSAGE_RECV" + + WT_SEND = "WT_SEND" + WT_RECV = "WT_RECV" + + REMIND_SEND = "REMIND_SEND" + REMIND_RECV = "REMIND_RECV" + + HRTSTART_SEND = "hrtstart_SEND" + HRTSTART_RECV = "hrtstart_RECV" + + HEART_SEND = "heart_SEND" + HEART_RECV = "heart_RECV" + + OXYGEN_SEND = "oxygen_SEND" + OXYGEN_RECV = "oxygen_RECV" + + OXSTART_SEND = "oxstart_SEND" + OXSTART_RECV = "oxstart_RECV" + + TEMP_SEND = "temp_SEND" + TEMP_RECV = "temp_RECV" + + DLT_SEND = "DLT_SEND" + DLT_RECV = "DLT_RECV" + + UPLOAD_SEND = "UPLOAD_SEND" + UPLOAD_RECV = "UPLOAD_RECV" + + CENTER_SEND = "CENTER_SEND" + CENTER_RECV = "CENTER_RECV" + + MONITOR_SEND = "MONITOR_SEND" + MONITOR_RECV = "MONITOR_RECV" + + SOS_SEND = "SOS_SEND" + SOS_RECV = "SOS_RECV" + + BOOTOFF_SEND = "BOOTOFF_SEND" + BOOTOFF_RECV = "BOOTOFF_RECV" + + WDSTART_SEND ="wdstart_SEND" + WDSTART_RECV ="wdstart_RECV" + + + LOWBAT_SEND = "LOWBAT_SEND" + LOWBAT_RECV = "LOWBAT_RECV" + + TIME_SEND = "Time_SEND" + TIME_RECV = "Time_RECV" + + WLKEY_SEND = "WLKEY_SEND" + WLKEY_RECV = "WLKEY_RECV" + + SILENCETIME2_SEND = "SILENCETIME2_SEND" + SILENCETIME2_RECV = "SILENCETIME2_RECV" + + KEYBRD_SEND = "KEYBRD_SEND" + KEYBRD_RECV = "KEYBRD_RECV" + + SILENCETIMEFS_SEND = "SILENCETIMEFS_SEND" + SILENCETIMEFS_RECV = "SILENCETIMEFS_RECV" + + BODYTEMP_SEND ="bodytemp_SEND" + BODYTEMP_RECV ="bodytemp_RECV" + + BODYTEMP2_SEND ="bodytemp2_SEND" + BODYTEMP2_RECV ="bodytemp2_RECV" + + BTEMP2_SEND ="btemp2_SEND" + BTEMP2_RECV ="btemp2_RECV" + + SCREEN_SHOW_SEND = "SCREEN_SHOW_SEND" + SCREEN_SHOW_RECV = "SCREEN_SHOW_RECV" + + TKS_SEND = "TKS_SEND" + TKS_SEND = "TKS_SEND" + + BLOOD_SEND = "blood_SEND" + BLOOD_RECV = "blood_RECV" + + BLDSTART_SEND ="bldstart_SEND" + BLDSTART_RECV = "bldstart_RECV" + + AL_SEND = "AL_SEND" + AL_RECV = "AL_RECV" + + FALLDOWN_SEND = "FALLDOWN_SEND" + FALLDOWN_RECV = "FALLDOWN_RECV" + + REMOVE_SEND = "REMOVE_SEND" + REMOVE_RECV = "REMOVE_RECV" + + FACTORY_SEND = "FACTORY_SEND" + FACTORY_RECV = "FACTORY_RECV" + + SLEEPTIME_SEND = "SLEEPTIME_SEND" + SLEEPTIME_RECV = "SLEEPTIME_RECV" + + MESSAGE_SOS_SEND = "MESSAGE_SOS_SEND" + MESSAGE_SOS_RECV = "MESSAGE_SOS_RECV" + + MSGQ_SEND = "MSGQ_SEND" + MSGQ_RECV = "MSGQ_RECV" + + PROFILE_SEND = "profile_SEND" + PROFILE_RECV = "profile_RECV" + + JPREG_SEND = "JPREG_SEND" + JPREG_RECV = "JPREG_RECV" + + MEMBERS_SEND = "MEMBERS_SEND" + MEMBERS_RECV = "MEMBERS_RECV" + + CALLING_SEND = "CALLING_SEND" + CALLING_RECV = "CALLING_RECV" + + + RCALLING_SEND = "RCALLING_SEND" + RCALLING_RECV = "RCALLING_RECV" + + AGTALK_SEND = "AGTALK_SEND" + AGTALK_RECV = "AGTALK_RECV" + + RTALK_SEND = "RTALK_SEND" + RTALK_RECV = "RTALK_RECV" + + JMEMBERS_SEND = "JMEMBERS_SEND" + JMEMBERS_RECV = "JMEMBERS_RECV" + + RINGING_SEND = "RINGING_SEND" + RINGING_RECV = "RINGING_RECV" + + HANGUP_SEND = "HANGUP_SEND" + HANGUP_RECV = "HANGUP_RECV" + + CALLCANCEL_SEND ="CALLCANCEL_SEND" + CALLCANCEL_RECV = "CALLCANCEL_RECV" + +class EVENT: + CHANNEL_SOCKET_SEND = "CHANNEL_SOCKET_SEND" + START_LOCATION = "START_LOCATION" + START_LOCATION_TEST = "START_LOCATION_TEST" + READ_LOCATION = "READ_LOCATION" + CLOSE_LOCATION = "CLOSE_LOCATION" + GPSOPEN = "GPSOPEN" + GPSCLOSE = "GPSCLOSE" + GPSINFO = "GPSINFO" + WIFISCANOPEN = "WIFISCANOPEN" + WIFIINFO = "WIFIINFO" + + GET_KEY = "GET_KEY" + SET_KEY = "SET_KEY" + GET_IMEI = "GET_IMEI" + GET_CID = "GET_CID" + SET_CID = "SET_CID" + GET_IMSI = "GET_IMSI" + GET_PASSWORD = "GET_PASSWORD" + SET_PASSWORD = "SET_PASSWORD" + GET_BATTERY = "GET_BATTERY" + PERSISTENT_CONFIG_GET = "PERSISTENT_CONFIG_GET" + PERSISTENT_CONFIG_STORE = "PERSISTENT_CONFIG_STORE" + SET_PING = "SET_PING" + GET_PING = "GET_PING" + SET_CONNECT = "SET_CONNECT" + GET_CONNECT = "GET_CONNECT" + GET_STEP = "GET_STEP" + PUSH_STEP = "PUSH_STEP" + SYSTEM_SLEEP = "SYSTEM_SLEEP" + SYSTEM_UP = "SYSTEM_UP" + START_HEART = "START_HEART" + GET_HEART = "GET_HEART" + STOP_HEART = "STOP_HEART" + GET_WEAR = "GET_WEAR" + START_TEMP = "START_TEMP" + STOP_TEMP = "STOP_TEMP" + GET_TEMP = "GET_TEMP" + START_BLOOD_OXYGEN = "STARTT_BLOOD_OXYGEN" + GET_BLOOD_OXYGEN = "GET_BLOOD_OXYGEN" + STOP_BLOOD_OXYGEN = "STOP_BLOOD_OXYGEN" diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py similarity index 71% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py index 29fbabe0..3aaff247 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lcd.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd.py @@ -7,115 +7,100 @@ import EventMesh from misc import PWM init_data = ( - 0, 0, 0xfe, + 2, 0, 10, 0, 0, 0xfe, - 0, 0, 0xEF, - - 0, 0, 0x20, + 0, 0, 0xef, - 0, 1, 0x36, - 1, 1, 0x00, + #0, 0, 0x21, - 0, 1, 0x3A, - 1, 1, 0x05, + 0, 1, 0x36, + 1, 1, 0x48, 0, 1, 0x35, 1, 1, 0x00, - 0, 1, 0xA8, - 1, 1, 0x22, + 0, 1, 0x3a, + 1, 1, 0x05, - 0, 1, 0xB4, - 1, 1, 0x00, - - 0, 1, 0xc6, - 1, 1, 0x3f, + 0, 0, 0x20, - 0, 1, 0xB0, - 1, 1, 0xC0, + 0, 1, 0x86, + 1, 1, 0x98, - 0, 1, 0xB2, - 1, 1, 0x2F, - 0, 1, 0xB3, + 0, 1, 0x89, 1, 1, 0x13, - - 0, 1, 0xB6, - 1, 1, 0x19, - - 0, 1, 0xB7, - 1, 1, 0x01, - - 0, 1, 0xAC, - 1, 1, 0xC8, - - 0, 1, 0xAB, + 0, 1, 0x8b, + 1, 1, 0x80, + 0, 1, 0x8d, + 1, 1, 0x33, + 0, 1, 0x8e, 1, 1, 0x0f, - 0, 1, 0xb8, - 1, 1, 0x08, - - 0, 1, 0xE8, - 1, 1, 0x27, + 0, 3, 0xec, + 1, 1, 0x33, + 1, 1, 0x07, + 1, 1, 0xaf, - 2, 0, 12, - - 0, 1, 0xE9, - 1, 1, 0x47, - - 0, 1, 0xea, - 1, 1, 0x44, - - 0, 1, 0xeb, - 1, 1, 0xb0, + 0, 1, 0xc9, + 1, 1, 0x05, - # 0, 1, 0xed, - # 1, 1, 0x03, - - 0, 1, 0x44, + 0, 2, 0xe8,#frame rate + 1, 1, 0x15, #1dot 71hz 1, 1, 0x00, - - - - 0, 1, 0xc7, - 1, 1, 0x1D, - - 0, 14, 0xF0, - 1, 1, 0x0F, - 1, 1, 0x24, - 1, 1, 0x2c, - 1, 1, 0x38, - 1, 1, 0x67, - 1, 1, 0x39, - 1, 1, 0x20, - 1, 1, 0x60, - 1, 1, 0x04, - 1, 1, 0x14, + + 0, 1, 0xc3, 1, 1, 0x10, + 0, 1, 0xc4, 1, 1, 0x10, - 1, 1, 0x0c, - 1, 1, 0x1f, + + 0, 1, 0xff, + 1, 1, 0x62, + + 0, 1, 0x99, + 1, 1, 0x3e, + 0, 1, 0x9d, + 1, 1, 0x4b, + 0, 1, 0x98, + 1, 1, 0x3e, + 0, 1, 0x9c, + 1, 1, 0x4b, + + 0, 6, 0xF0, + 1, 1, 0xC7, + 1, 1, 0x08, + 1, 1, 0x08, + 1, 1, 0x08, + 1, 1, 0x05, + 1, 1, 0x2E, + + 0, 6, 0xF1, + 1, 1, 0x45, + 1, 1, 0x8F, + 1, 1, 0x6F, + 1, 1, 0x33, + 1, 1, 0x36, + 1, 1, 0x4f, - 0, 14, 0xF1, - 1, 1, 0x1f, - 1, 1, 0x38, - 1, 1, 0x3f, + 0, 6, 0xF2, + 1, 1, 0xC7, + 1, 1, 0x08, + 1, 1, 0x08, + 1, 1, 0x08, + 1, 1, 0x05, + 1, 1, 0x2E, + + 0, 6, 0xF3, + 1, 1, 0x45, + 1, 1, 0x8F, + 1, 1, 0x6F, + 1, 1, 0x33, + 1, 1, 0x36, 1, 1, 0x4f, - 1, 1, 0xd7, - 1, 1, 0x24, - 1, 1, 0x3f, - 1, 1, 0x60, - 1, 1, 0x00, - 1, 1, 0x03, - 1, 1, 0x09, - 1, 1, 0x14, - 1, 1, 0x10, - 1, 1, 0x1F, - 0, 3, 0xf4, - 1, 1, 0x00, - 1, 1, 0x00, - 1, 1, 0xff, + 0, 2, 0x44, + 1, 1, 0x00, + 1, 1, 0x70, 0, 0, 0x11, 2, 0, 120, @@ -133,7 +118,6 @@ XEND_L = 0xE1 YEND_H = 0xE2 YEND_L = 0xE3 - XSTART = 0xD0 XEND = 0xD1 YSTART = 0xD2 @@ -193,15 +177,15 @@ lcd_ctrl = Pin(Pin.GPIO18, Pin.OUT, Pin.PULL_DISABLE, 1) #lcd.lcd_init(init_buf, 240,320,4,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 3, 31) #lcd.lcd_init(init_buf, 128, 128,4,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 4, 31,) #2是spi_cs引脚的GPIO号,4是DC引脚的GPIO号,5是RST引脚的GPIO号 -lcd.lcd_init(init_buf, 128,128,5,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 4, 5,) -lcd.lcd_set_offset(0,32) +lcd.lcd_init(init_buf, 240,284,5,1,4,0,invalid,displayon,displayoff,None,1, 0, 0, 2, 4, 5,) +lcd.lcd_set_offset(0,0) # gpio_backlight = Pin(Pin.GPIO37, Pin.OUT, Pin.PULL_DISABLE, 0) # gpio_backlight.write(1) PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1000) PWM_backlight.open() -LCD_SIZE_W = 128 -LCD_SIZE_H = 128 +LCD_SIZE_W = 240 +LCD_SIZE_H = 284 # pwm.close() # 初始化lvgl lv.init() @@ -264,7 +248,17 @@ style_font_youyuan_40 = lv.style_t() style_font_youyuan_40.init() style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) style_font_youyuan_40.set_text_font(lv.K01_font_16_ALL) -#style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) + +style_font_youyuan_black_40 = lv.style_t() +style_font_youyuan_black_40.init() +style_font_youyuan_black_40.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_youyuan_black_40.set_text_font(lv.K01_font_16_ALL) + +style_font_youyuan_20_op = lv.style_t() +style_font_youyuan_20_op.init() +style_font_youyuan_20_op.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20_op.set_text_font(lv.K01_font_16_ALL) + lcd.lcd_display_on() utime.sleep_ms(2) @@ -275,14 +269,15 @@ print("power_on_screen") power_on_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) power_on_label = lv.label(power_on_screen) +power_on_label.set_pos(0, (LCD_SIZE_H//2)-10) +power_on_label.set_size(LCD_SIZE_W, 40) power_on_label.set_text("系统初始化中") -power_on_label.set_pos(0, 50) -power_on_label.set_size(128, 20) power_on_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -power_on_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) +power_on_label.add_style(style_font_youyuan_20_op, lv.PART.MAIN | lv.STATE.DEFAULT) print("power_on_screen init...") + lv.scr_load(power_on_screen) utime.sleep_ms(200) print("power_on_screen end...") diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lc128x128.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py similarity index 65% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lc128x128.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py index b11cf752..e27ab6e4 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/lc128x128.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/lcd_k5.py @@ -8,125 +8,97 @@ from misc import PWM init_data = ( - 0, 0, 0xfe, - 0, 0, 0xfe, - 0, 0, 0xEF, - - 0, 1, 0x36, - 1, 1, 0xd8, - 0, 1, 0x3A, - 1, 1, 0x05, + 0, 0, 0x11, + 2, 0, 120, - 0, 1, 0x35, + 0, 1, 0x36, 1, 1, 0x00, - 0, 1, 0xA8, - 1, 1, 0x0c, - - 0, 1, 0xB4, + 0, 1, 0x35, 1, 1, 0x00, - 0, 1, 0xB0, - 0, 0, 0xC0, - - 0, 1, 0xB2, - 1, 1, 0x2F, - - 0, 1, 0xB3, - 1, 1, 0x13, + 0, 1, 0x3a, + 1, 1, 0x05, - 0, 1, 0xB6, - 1, 1, 0x19, + 0, 5, 0xB2, + 1, 1, 0x0c, + 1, 1, 0x0c, + 1, 1, 0x00, + 1, 1, 0x33, + 1, 1, 0x33, 0, 1, 0xB7, - 1, 1, 0x01, - - 0, 1, 0xAC, - 1, 1, 0xC8, - - 0, 1, 0xAB, - 1, 1, 0x07, - - - 0, 1, 0xb8, - 1, 1, 0x08, + 1, 1, 0x77, - 0, 1, 0xE8, - 1, 1, 0x27, - - 0, 1, 0xE9, - 1, 1, 0x47, - - 0, 1, 0xea, - 1, 1, 0x44, + 0, 1, 0xBB, + 1, 1, 0x2c, + + 0, 1, 0xC0, + 1, 1, 0x2C, - 0, 1, 0xeb, - 1, 1, 0xe0, + 0, 1, 0xC2, + 1, 1, 0x01, - 0, 1, 0x44, - 1, 1, 0x00, + 0, 1, 0xC3, + 1, 1, 0x21, - 0, 1, 0xc6, + 0, 1, 0xC4, 1, 1, 0x20, - 0, 1, 0xc7, - 1, 1, 0x14, + 0, 1, 0xC6, + 1, 1, 0x10, - + 0, 2, 0xD0, + 1, 1, 0xA4, + 1, 1, 0xA1, - 0, 14, 0xF0, - 1, 1, 0x1d, - 1, 1, 0x38, - 1, 1, 0x09, - 1, 1, 0x4d, - 1, 1, 0x92, - 1, 1, 0x2f, - 1, 1, 0x35, - 1, 1, 0x52, - 1, 1, 0x1e, - 1, 1, 0x0c, - 1, 1, 0x40, + 0, 14, 0xE0, + 1, 1, 0xd0, + 1, 1, 0x03, + 1, 1, 0x08, + 1, 1, 0x0e, 1, 1, 0x12, - 1, 1, 0x14, - 1, 1, 0x1f, - - 0, 14, 0xF1, - 1, 1, 0x16, - 1, 1, 0x40, - 1, 1, 0x1c, - 1, 1, 0x54, - 1, 1, 0xa9, 1, 1, 0x2d, - 1, 1, 0x2e, - 1, 1, 0x56, - 1, 1, 0x10, - 1, 1, 0x0d, - 1, 1, 0x0c, - 1, 1, 0x1a, - 1, 1, 0x14, - 1, 1, 0x1F, - - 0, 3, 0xF4, - 1, 1, 0x00, - 1, 1, 0x00, - 1, 1, 0xff, + 1, 1, 0x42, + 1, 1, 0x45, + 1, 1, 0x53, + 1, 1, 0x29, + 1, 1, 0x16, + 1, 1, 0x15, + 1, 1, 0x22, + 1, 1, 0x24, - 0, 0, 0x11, - 2, 0, 120, + 0, 14, 0xE1, + 1, 1, 0xd0, + 1, 1, 0x03, + 1, 1, 0x08, + 1, 1, 0x0e, + 1, 1, 0x13, + 1, 1, 0x2c, + 1, 1, 0x42, + 1, 1, 0x54, + 1, 1, 0x50, + 1, 1, 0x2c, + 1, 1, 0x16, + 1, 1, 0x16, + 1, 1, 0x20, + 1, 1, 0x27, + #0, 0, 0x11, + 0, 0, 0x21, 0, 0, 0x29, - 0, 0, 0x2c, - + #0, 1, 0xe7, + #1, 1, 0x11, ) -XSTART_H = 0xf0+36 -XSTART_L = 0xf1+36 -YSTART_H = 0xf2+36 -YSTART_L = 0xf3+36 -XEND_H = 0xE0+36 -XEND_L = 0xE1+36 -YEND_H = 0xE2+36 -YEND_L = 0xE3+36 +XSTART_H = 0xf0 +XSTART_L = 0xf1 +YSTART_H = 0xf2 +YSTART_L = 0xf3 +XEND_H = 0xE0 +XEND_L = 0xE1 +YEND_H = 0xE2 +YEND_L = 0xE3 XSTART = 0xD0 XEND = 0xD1 @@ -149,7 +121,6 @@ init_data2 = ( 1, 1, YEND_H, 1, 1, YEND_L, 0, 0, 0x2c, - ) invalid = bytearray(init_data2) @@ -157,15 +128,13 @@ init_data3 = ( 0, 0, 0x28, 2, 0, 120, 0, 0, 0x10, - ) displayoff = bytearray(init_data3) init_data4 = ( 0, 0, 0x11, - 2, 0, 120, + 2, 0, 20, 0, 0, 0x29, - ) displayon = bytearray(init_data4) # CST816初始化 @@ -180,16 +149,15 @@ from btn_device_ec800m import BtnDevice btn_device = BtnDevice(tp_cst816) btn_device.start() -print("lcd_init2 ...") lcd_ctrl = Pin(Pin.GPIO18, Pin.OUT, Pin.PULL_DISABLE, 1) -lcd.lcd_init(init_buf, 128, 128, 26000, 1, 4, 0, invalid, displayon, displayoff, None,TESel = True,TEPin = 17) +lcd.lcd_init(init_buf, 240, 320, 52000, 1, 4, 0, invalid, displayon, displayoff, None,TESel = True,TEPin = 17) # gpio_backlight = Pin(Pin.GPIO37, Pin.OUT, Pin.PULL_DISABLE, 0) # gpio_backlight.write(1) -PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1) +PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_MS, 0, 1) PWM_backlight.open() -LCD_SIZE_W = 128 -LCD_SIZE_H = 128 +LCD_SIZE_W = 240 +LCD_SIZE_H = 320 # pwm.close() # 初始化lvgl lv.init() @@ -251,23 +219,31 @@ style_screen.set_pad_bottom(0) style_font_youyuan_40 = lv.style_t() style_font_youyuan_40.init() style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) -#style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) +style_font_youyuan_40.set_text_font_v2("font_40.bin",40,0) + +style_font_youyuan_black_40 = lv.style_t() +style_font_youyuan_black_40.init() +style_font_youyuan_black_40.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_youyuan_black_40.set_text_font_v2("font_40.bin",40,0) -lcd.lcd_display_on() -utime.sleep_ms(2) -lv.autoSleep(0) +style_font_youyuan_20_op = lv.style_t() +style_font_youyuan_20_op.init() +style_font_youyuan_20_op.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20_op.set_text_font(lv.K01_font_16_ALL) power_on_screen = lv.obj() print("power_on_screen") power_on_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) power_on_label = lv.label(power_on_screen) -power_on_label.set_text("WELCOME") -power_on_label.align(lv.ALIGN.CENTER, 0, 0) -power_on_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) +power_on_label.set_pos(0, 150) +power_on_label.set_size(240, 40) +power_on_label.set_text("系统初始化中") +power_on_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +power_on_label.add_style(style_font_youyuan_20_op, lv.PART.MAIN | lv.STATE.DEFAULT) print("power_on_screen init...") lv.scr_load(power_on_screen) utime.sleep_ms(200) print("power_on_screen end...") -PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 6, 10) -PWM_backlight.open() \ No newline at end of file +PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_MS, 6, 10) +PWM_backlight.open() diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/location.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/location.py new file mode 100644 index 00000000..ff9fa44f --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/location.py @@ -0,0 +1,1024 @@ +# Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import ure +import net +import math +import utime +import osTimer +import _thread +import wifiScan +import cellLocator + +from queue import Queue +from machine import UART, Pin + +try: + from wifilocator import wifilocator +except: + wifilocator = None + +from log import getLogger + +try: + import quecgnss +except ImportError: + quecgnss = None + +log = getLogger(__name__) + +_gps_read_lock = _thread.allocate_lock() +_gps_data_set_lock = _thread.allocate_lock() + +EE = 0.00669342162296594323 +EARTH_RADIUS = 6378.137 # Approximate Earth Radius(km) +M_PI = math.pi + + +class _loc_method(object): + gps = 0x1 + cell = 0x2 + wifi = 0x4 + + +class _gps_mode(object): + none = 0x0 + internal = 0x1 + external = 0x2 + + +def transformLat(x, y): + ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * math.sqrt(math.fabs(x)) + ret += (20.0 * math.sin(6.0 * x * M_PI) + 20.0 * math.sin(2.0 * x * M_PI)) * 2.0 / 3.0 + ret += (20.0 * math.sin(y * M_PI) + 40.0 * math.sin(y / 3.0 * M_PI)) * 2.0 / 3.0 + ret += (160.0 * math.sin(y / 12.0 * M_PI) + 320 * math.sin(y * M_PI / 30.0)) * 2.0 / 3.0 + return ret + + +def transformLon(x, y): + ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * math.sqrt(math.fabs(x)) + ret += (20.0 * math.sin(6.0 * x * M_PI) + 20.0 * math.sin(2.0 * x * M_PI)) * 2.0 / 3.0 + ret += (20.0 * math.sin(x * M_PI) + 40.0 * math.sin(x / 3.0 * M_PI)) * 2.0 / 3.0 + ret += (150.0 * math.sin(x / 12.0 * M_PI) + 300.0 * math.sin(x / 30.0 * M_PI)) * 2.0 / 3.0 + return ret + + +def WGS84ToGCJ02(lon, lat): + dLat = transformLat(lon - 105.0, lat - 35.0) + dLon = transformLon(lon - 105.0, lat - 35.0) + radLat = lat / 180.0 * M_PI + magic = math.sin(radLat) + magic = 1 - magic * magic * EE + sqrtMagic = math.sqrt(magic) + + dLat = (dLat * 180.0) / ((EARTH_RADIUS * 1000 * (1 - EE)) / (magic * sqrtMagic) * M_PI) + dLon = (dLon * 180.0) / (EARTH_RADIUS * 1000 / sqrtMagic * math.cos(radLat) * M_PI) + lon02 = lon + dLon + lat02 = lat + dLat + + return lon02, lat02 + + +class GPSMatch(object): + """This class is match gps NEMA 0183""" + + def GxRMC(self, gps_data): + """Match Recommended Minimum Specific GPS/TRANSIT Data(RMC) + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: RMC NMEA string. + """ + if gps_data: + rmc_re = ure.search( + r"\$G[NP]RMC,\d*\.*\d*,*[AV],*\d*\.*\d*,*[NS],*\d*\.*\d*,*[EW],*\d*\.*\d*,*\d*\.*\d*,*\d*,*\d*\.*\d*,*[EW]*,*[ADEN]*,*[SCUV]*\**(\d|\w)*", + gps_data) + if rmc_re: + return rmc_re.group(0) + return "" + + def GxGGA(self, gps_data): + """Match Global Positioning System Fix Data(GGA) + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: GGA NMEA string. + """ + if gps_data: + gga_re = ure.search( + r"\$G[BLPN]GGA,\d*\.*\d*,*\d*\.*\d*,*[NS],*\d*\.*\d*,*[EW],*[0126],*\d*,*\d*\.*\d*,*-*\d*\.*\d*,*M,*-*\d*\.*\d*,*M,*\d*,*\**(\d|\w)*", + gps_data) + if gga_re: + return gga_re.group(0) + return "" + + def GxVTG(self, gps_data): + """Match Track Made Good and Ground Speed(VTG) + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: VTG NMEA string. + """ + if gps_data: + vtg_re = ure.search(r"\$G[NP]VTG,\d*\.*\d*,*T,*\d*\.*\d*,*M,*\d*\.*\d*,*N,*\d*\.*\d*,*K,*[ADEN]*\*(\d|\w)*", + gps_data) + if vtg_re: + return vtg_re.group(0) + return "" + + def GxGSV(self, gps_data): + """Mactch GPS Satellites in View(GSV) + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: GSV NMEA string. + """ + if gps_data: + gsv_re = ure.search( + r"\$G[NP]GSV,\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*\**(\d|\w)*", + gps_data) + if gsv_re: + return gsv_re.group(0) + return "" + + def GxGLL(self, gps_data): + """Geographic Position + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: GLL NMEA string. + """ + if gps_data: + gll_re = ure.search(r"\$G[NP]GLL,\d*\.*\d*,*[NS]*,*\d*\.*\d*,*[EW]*,*\d*\.*\d*,*[AV]*,*[ADEN]*\**(\d|\w)*", + gps_data) + if gll_re: + return gll_re.group(0) + + def GxGSA(self, gps_data): + """GNSS DOP and Active Satellites + + Args: + gps_data(str): GPS NMEA string. + + Returns: + str: GSA NMEA string. + """ + if gps_data: + gsa_re = ure.search( + r"\$G[NP]GSA,[MA]*,*[123]*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*,*\d*\.*\d*,*\d*\.*\d*,*\d*\.*\d*,*(\d|\w)*\**(\d|\w)*", + gps_data) + if gsa_re: + return gsa_re.group(0) + + +class GPSParse(object): + """Parse details from gps data""" + + def GxGGA_satellite_num(self, gga_data): + """Parse satellite num from GGA""" + if gga_data: + satellite_num_re = ure.search(r",[EW],[0126],\d+,", gga_data) + if satellite_num_re: + return satellite_num_re.group(0).split(",")[-2] + return "" + + def GxGGA_latitude(self, gga_data): + """Parse latitude from GGA""" + if gga_data: + latitude_re = ure.search(r",[0-9]+\.[0-9]+,[NS],", gga_data) + if latitude_re: + latitude = latitude_re.group(0)[1:-3] + return str(float(latitude[:2]) + float(latitude[2:]) / 60) + return "" + + def GxGGA_longitude(self, gga_data): + """Parse longitude from GGA""" + if gga_data: + longitude_re = ure.search(r",[0-9]+\.[0-9]+,[EW],", gga_data) + if longitude_re: + longitude = longitude_re.group(0)[1:-3] + return str(float(longitude[:3]) + float(longitude[3:]) / 60) + return "" + + def GxGGA_altitude(self, gga_data): + """Parse altitude from GGA""" + if gga_data: + altitude_re = ure.search(r",-*[0-9]+\.[0-9]+,M,", gga_data) + if altitude_re: + return altitude_re.group(0)[1:-3] + return "" + + def GxVTG_speed(self, vtg_data): + """Parse speed from VTG""" + if vtg_data: + speed_re = ure.search(r",N,\d+\.\d+,K,", vtg_data) + if speed_re: + return speed_re.group(0)[3:-3] + return "" + + def GxGSV_satellite_num(self, gsv_data): + """Parse satellite num from GSV""" + if gsv_data: + satellite_num_re = ure.search(r"\$G[NP]GSV,\d+,\d+,\d+,", gsv_data) + if satellite_num_re: + return satellite_num_re.group(0).split(",")[-2] + return "" + + def GxRMC_loc_status(self, rmc_data): + if rmc_data: + loc_status_re = ure.search(r"\$G[NP]RMC,\d*\.*\d*,[AV],", rmc_data) + if loc_status_re: + loc_status = loc_status_re.group(0).split(",")[-2] + return True if loc_status == "A" else False + return False + + def __nmea_parse(self, nmea): + return tuple(nmea[1:].split("*")[0].split(",")) if nmea else () + + def GxRMC(self, rmc_data): + return self.__nmea_parse(rmc_data) + + def GxGGA(self, gga_data): + return self.__nmea_parse(gga_data) + + def GxGSV(self, gsv_data): + return self.__nmea_parse(gsv_data) + + def GxGSA(self, gsa_data): + return self.__nmea_parse(gsa_data) + + def GxVTG(self, vtg_data): + return self.__nmea_parse(vtg_data) + + def GxGLL(self, gll_data): + return self.__nmea_parse(gll_data) + + +class GPS(object): + """This class if for reading gps data. + + Now support external gps and internal gps. + + Sleep power consumption: + power off < backup < standby + """ + + __RMC = 0 + __GGA = 1 + __GSV = 2 + __GSA = 3 + __VTG = 4 + __GLL = 5 + __NMEA = 0b010111 + + def __init__(self, UARTn, buadrate, databits, parity, stopbits, flowctl, PowerPin, StandbyPin, BackupPin, gps_mode): + """Init GPS module + + [description] + + Args: + UARTn(int): UART No. + buadrate(int): baud rate + databits(int): data bits (5 ~ 8) + parity(int): parity (0 – NONE,1 – EVEN,2 - ODD) + stopbits(int): stop bit + flowctl(int): hardware control flow (0 – FC_NONE, 1 – FC_HW) + PowerPin(int): Power GIPO Pin + StandbyPin(int): Standby GPIO Pin + BackupPin(int): Back GPIO Pin + gps_mode(int): GPS mode + 0 - None + 1 - internal GPS + 2 - external GPS + """ + self.__UARTn = UARTn + self.__buadrate = buadrate + self.__databits = databits + self.__parity = parity + self.__stopbits = stopbits + self.__flowctl = flowctl + self.__PowerPin = PowerPin + self.__StandbyPin = StandbyPin + self.__BackupPin = BackupPin + self.__gps_mode = gps_mode + + self.__external_obj = None + self.__internal_obj = quecgnss + self.__gps_match = GPSMatch() + self.__gps_parse = GPSParse() + self.__gps_power_gpio = None + self.__gps_standby_gpio = None + self.__gps_backup_gpio = None + + self.__external_retrieve_queue = None + self.__queue_size = 2 + self.__first_break = 0 + self.__break = 0 + self.__gps_data = "" + self.__rmc_data = "" + self.__gga_data = "" + self.__vtg_data = "" + self.__gsv_data = "" + self.__gps_timer = osTimer() + self.__gps_data_check_timer = osTimer() + + if self.__gps_mode & _gps_mode.external: + self.__external_init() + elif self.__gps_mode & _gps_mode.internal: + self.__internal_init() + #print("GPS:__init__%d",self.__gps_mode) + def __gps_power_control(self, GPIOn, onoff, method): + if method == "power_switch": + if self.__gps_power_gpio is None: + self.__gps_power_gpio = Pin(GPIOn, Pin.OUT, Pin.PULL_DISABLE, onoff) + gpio_obj = self.__gps_power_gpio + elif method == "standby": + if self.__gps_standby_gpio is None: + self.__gps_standby_gpio = Pin(GPIOn, Pin.OUT, Pin.PULL_DISABLE, onoff) + gpio_obj = self.__gps_standby_gpio + elif method == "backup": + if self.__gps_backup_gpio is None: + self.__gps_backup_gpio = Pin(GPIOn, Pin.OUT, Pin.PULL_DISABLE, onoff) + gpio_obj = self.__gps_backup_gpio + else: + raise TypeError("Param method %s is not compare." % method) + + if gpio_obj.read() != onoff: + gpio_obj.write(onoff) + if gpio_obj.read() != onoff: + return False + return True + + def __reverse_gps_data(self, this_gps_data): + """Reverse GPS data for regular match get the latest data""" + log.debug("this_gps_data: \n%s" % this_gps_data) + delimiter = "\r\n" + if this_gps_data: + _gps_data = self.__get_gps_data() + if _gps_data: + _gps_data = delimiter.join(_gps_data.split(delimiter)[::-1]) + _gps_data += this_gps_data.strip().replace("\r", "").replace("\n", "").replace("$", delimiter + "$") + _gps_data = delimiter.join(_gps_data.split(delimiter)[::-1]) + self.__set_gps_data(_gps_data) + + def __read_latitude(self, gps_data): + """Read latitude from gps data""" + return self.__gps_parse.GxGGA_latitude(self.__gps_match.GxGGA(gps_data)) + + def __read_longitude(self, gps_data): + """Read longitude from gps data""" + return self.__gps_parse.GxGGA_longitude(self.__gps_match.GxGGA(gps_data)) + + def __read_altitude(self, gps_data): + """Read altitude from gps data""" + return self.__gps_parse.GxGGA_altitude(self.__gps_match.GxGGA(gps_data)) + + def __set_gps_data(self, gps_data): + self.__gps_data = gps_data + + def __get_gps_data(self): + return self.__gps_data + + def __gps_timer_callback(self, args): + """GPS read timer callback + When over time to get uart data, break queue wait + """ + self.__break = 1 + if self.__external_retrieve_queue is not None: + self.__external_retrieve_queue.put(False) + + def __gps_data_check_callback(self, args): + """GPS read old data clean timer callback + When GPS read over time, clean old gps data, wait to read new gps data. + """ + clean = False + if "" in (self.__rmc_data, self.__gga_data, self.__gsv_data): + clean = True + else: + if self.__nmea_statement_exist(self.__GSA) and not self.__gsa_data: + clean = True + elif self.__nmea_statement_exist(self.__VTG) and not self.__vtg_data: + clean = True + elif self.__nmea_statement_exist(self.__GLL) and not self.__gll_data: + clean = True + + if clean: + self.__gps_nmea_data_clean() + + def __external_init(self): + """External GPS init""" + self.__external_retrieve_queue = Queue(maxsize=self.__queue_size) + + def __external_open(self): + """External GPS start, UART init""" + self.power_switch(1) + self.__external_obj = UART( + self.__UARTn, + self.__buadrate, + self.__databits, + self.__parity, + self.__stopbits, + self.__flowctl + ) + self.__external_obj.set_callback(self.__external_retrieve_cb) + + def __external_close(self): + """External GPS close, UART close, NOT GPS stop""" + self.__external_obj.close() + + def __external_retrieve_cb(self, args): + """ + GPS data retrieve callback from UART + When data comes, send a message to queue of data length + """ + # log.debug("GPS __external_retrieve_cb args: %s" % str(args)) + if self.__external_retrieve_queue.size() >= self.__queue_size: + self.__external_retrieve_queue.get() + self.__external_retrieve_queue.put(True) + + def __internal_init(self): + """Internal GPS init""" + if self.__internal_obj: + if self.__internal_obj.init() != 0: + self.__internal_open() + log.error("GNSS INIT Failed.") + else: + log.debug("GNSS INIT Success.") + else: + log.error("Module quecgnss Import Error.") + + def __internal_open(self): + """Internal GPS enable""" + if self.__internal_obj.get_state() == 0: + return True if self.__internal_obj.gnssEnable(1) == 0 else False + else: + return True + + def __internal_close(self): + """Internal GPS close""" + return True if self.__internal_obj.gnssEnable(0) == 0 else False + + def __nmea_statement_exist(self, nmea_item): + return (self.__NMEA & (0b1 << nmea_item)) >> nmea_item + + def __gps_nmea_data_clean(self): + self.__set_gps_data("") + self.__rmc_data = "" + self.__gga_data = "" + self.__gsv_data = "" + self.__gsa_data = "" + self.__vtg_data = "" + self.__gll_data = "" + + def __check_gps_valid(self, gps_data): + self.__reverse_gps_data(gps_data) + + if not self.__rmc_data: + self.__rmc_data = self.__gps_match.GxRMC(self.__get_gps_data()) + loc_status = self.__gps_parse.GxRMC_loc_status(self.__rmc_data) + + if self.__rmc_data and loc_status: + if self.__nmea_statement_exist(self.__GGA) and not self.__gga_data: + self.__gga_data = self.__gps_match.GxGGA(self.__get_gps_data()) + # if self.__nmea_statement_exist(self.__GSV) and not self.__gsv_data: + # self.__gsv_data = self.__gps_match.GxGSV(self.__get_gps_data()) + # if self.__nmea_statement_exist(self.__GSA) and not self.__gsa_data: + # self.__gsa_data = self.__gps_match.GxGSA(self.__get_gps_data()) + if self.__nmea_statement_exist(self.__VTG) and not self.__vtg_data: + self.__vtg_data = self.__gps_match.GxVTG(self.__get_gps_data()) + # if self.__nmea_statement_exist(self.__GLL) and not self.__gll_data: + # self.__gll_data = self.__gps_match.GxGLL(self.__get_gps_data()) + + if self.__nmea_statement_exist(self.__GGA) and not self.__gga_data: + return False + # if self.__nmea_statement_exist(self.__GSV) and not self.__gsv_data: + # return False + # if self.__nmea_statement_exist(self.__GSA) and not self.__gsa_data: + # return False + # if self.__nmea_statement_exist(self.__VTG) and not self.__vtg_data: + # return False + # if self.__nmea_statement_exist(self.__GLL) and not self.__gll_data: + # return False + return True + + return False + + def __external_read(self): + """Read external GPS data + + Return: + $GPTXT,01,01,02,ANTSTATUS=OPEN*2B + $GNRMC,073144.000,A,3149.330773,N,11706.946971,E,0.00,337.47,150422,,,D,V*07 + $GNVTG,337.47,T,,M,0.00,N,0.00,K,D*22 + $GNGGA,073144.000,3149.330773,N,11706.946971,E,2,19,0.66,85.161,M,-0.335,M,,*56 + $GNGSA,A,3,01,195,06,03,21,194,19,17,30,14,,,0.94,0.66,0.66,1*02 + $GNGSA,A,3,13,26,07,10,24,25,08,03,22,,,,0.94,0.66,0.66,4*03 + $GPGSV,3,1,12,14,84,210,31,195,67,057,46,17,52,328,28,50,51,161,33,1*54 + $GPGSV,3,2,12,194,49,157,33,03,48,090,37,19,36,305,32,06,34,242,32,1*58 + $GPGSV,3,3,12,01,32,041,35,30,17,204,22,21,07,051,13,07,03,183,,1*6B + $BDGSV,5,1,18,07,86,063,30,10,75,322,30,08,60,211,34,03,52,192,33,1*71 + $BDGSV,5,2,18,24,44,276,33,13,43,215,33,01,43,135,30,26,40,208,37,1*71 + $BDGSV,5,3,18,02,38,230,,04,32,119,,22,26,135,30,19,25,076,,1*70 + $BDGSV,5,4,18,05,17,251,,25,06,322,27,09,02,211,22,21,02,179,,1*78 + $BDGSV,5,5,18,29,02,075,,20,01,035,,1*72 + $GNGLL,3149.330773,N,11706.946971,E,073144.000,A,D*4E + """ + self.__external_open() + log.debug("__external_read start") + + while self.__break == 0: + self.__gps_timer.start(50, 0, self.__gps_timer_callback) + signal = self.__external_retrieve_queue.get() + log.debug("[first] signal: %s" % signal) + if signal: + to_read = self.__external_obj.any() + log.debug("[first] to_read: %s" % to_read) + if to_read > 0: + self.__set_gps_data(self.__external_obj.read(to_read).decode()) + self.__gps_timer.stop() + self.__break = 0 + + self.__gps_nmea_data_clean() + self.__gps_data_check_timer.start(2000, 1, self.__gps_data_check_callback) + cycle = 0 + while self.__break == 0: + self.__gps_timer.start(1500, 0, self.__gps_timer_callback) + signal = self.__external_retrieve_queue.get() + log.debug("[second] signal: %s" % signal) + if signal: + to_read = self.__external_obj.any() + log.debug("[second] to_read: %s" % to_read) + if to_read > 0: + if self.__check_gps_valid(self.__external_obj.read(to_read).decode()): + self.__break = 1 + + self.__gps_timer.stop() + cycle += 1 + if cycle >= self.__retry: + self.__break = 1 + if self.__break != 1: + utime.sleep(1) + self.__gps_data_check_timer.stop() + self.__break = 0 + + # To check GPS data is usable or not. + self.__gps_data_check_callback(None) + self.__external_close() + log.debug("__external_read data: %s" % self.__get_gps_data()) + return self.__get_gps_data() + + def __internal_read(self): + import EventMesh + log.debug("__internal_read start.") + """Read internal GPS data + + Return: + $GPTXT,01,01,02,ANTSTATUS=OPEN*2B + $GNRMC,073144.000,A,3149.330773,N,11706.946971,E,0.00,337.47,150422,,,D,V*07 + $GNVTG,337.47,T,,M,0.00,N,0.00,K,D*22 + $GNGGA,073144.000,3149.330773,N,11706.946971,E,2,19,0.66,85.161,M,-0.335,M,,*56 + $GNGSA,A,3,01,195,06,03,21,194,19,17,30,14,,,0.94,0.66,0.66,1*02 + $GNGSA,A,3,13,26,07,10,24,25,08,03,22,,,,0.94,0.66,0.66,4*03 + $GPGSV,3,1,12,14,84,210,31,195,67,057,46,17,52,328,28,50,51,161,33,1*54 + $GPGSV,3,2,12,194,49,157,33,03,48,090,37,19,36,305,32,06,34,242,32,1*58 + $GPGSV,3,3,12,01,32,041,35,30,17,204,22,21,07,051,13,07,03,183,,1*6B + $BDGSV,5,1,18,07,86,063,30,10,75,322,30,08,60,211,34,03,52,192,33,1*71 + $BDGSV,5,2,18,24,44,276,33,13,43,215,33,01,43,135,30,26,40,208,37,1*71 + $BDGSV,5,3,18,02,38,230,,04,32,119,,22,26,135,30,19,25,076,,1*70 + $BDGSV,5,4,18,05,17,251,,25,06,322,27,09,02,211,22,21,02,179,,1*78 + $BDGSV,5,5,18,29,02,075,,20,01,035,,1*72 + $GNGLL,3149.330773,N,11706.946971,E,073144.000,A,D*4E + """ + + #self.__gps_nmea_data_clean() + + cycle = 0 + #while self.__break == 0: + gnss_data = quecgnss.read(1024*3) + #print("__internal_read") + #print(gnss_data) + if gnss_data and gnss_data[1]: + this_gps_data = gnss_data[1].decode() if len(gnss_data) > 1 and gnss_data[1] else "" + _gps_valid = self.__check_gps_valid(this_gps_data) + log.debug("_gps_valid: %s" % _gps_valid) + + #print("_gps_valid:",_gps_valid) + #print(str(_gps_valid),self.__get_gps_data()) + if _gps_valid == True : + #EventMesh.publish("time", [self.__get_gps_data(),"0",str(_gps_valid),"0"]) + return self.__get_gps_data() + else : + EventMesh.publish("time", [self.__get_gps_data(),"0",str(_gps_valid),"0"]) + return "" + + def read(self, retry=30): + """For user to read gps data + + Return: (res_code, gps_data) + res_code: + - 0: Success + - -1: Failed + gps_data: + $GPTXT,01,01,02,ANTSTATUS=OPEN*2B + $GNRMC,073144.000,A,3149.330773,N,11706.946971,E,0.00,337.47,150422,,,D,V*07 + $GNVTG,337.47,T,,M,0.00,N,0.00,K,D*22 + $GNGGA,073144.000,3149.330773,N,11706.946971,E,2,19,0.66,85.161,M,-0.335,M,,*56 + $GNGSA,A,3,01,195,06,03,21,194,19,17,30,14,,,0.94,0.66,0.66,1*02 + $GNGSA,A,3,13,26,07,10,24,25,08,03,22,,,,0.94,0.66,0.66,4*03 + $GPGSV,3,1,12,14,84,210,31,195,67,057,46,17,52,328,28,50,51,161,33,1*54 + $GPGSV,3,2,12,194,49,157,33,03,48,090,37,19,36,305,32,06,34,242,32,1*58 + $GPGSV,3,3,12,01,32,041,35,30,17,204,22,21,07,051,13,07,03,183,,1*6B + $BDGSV,5,1,18,07,86,063,30,10,75,322,30,08,60,211,34,03,52,192,33,1*71 + $BDGSV,5,2,18,24,44,276,33,13,43,215,33,01,43,135,30,26,40,208,37,1*71 + $BDGSV,5,3,18,02,38,230,,04,32,119,,22,26,135,30,19,25,076,,1*70 + $BDGSV,5,4,18,05,17,251,,25,06,322,27,09,02,211,22,21,02,179,,1*78 + $BDGSV,5,5,18,29,02,075,,20,01,035,,1*72 + $GNGLL,3149.330773,N,11706.946971,E,073144.000,A,D*4E + """ + self.__retry = retry + gps_data = "" + if self.__gps_mode & _gps_mode.external: + gps_data = self.__external_read() + elif self.__gps_mode & _gps_mode.internal: + gps_data = self.__internal_read() + + res = 0 if gps_data else -1 + return (res, gps_data) + + def read_coordinates(self, gps_data): + """Read positioning coordinates. + + Params: + gps_data: read gps data. + map_coordinate_system: `WGS84` or GCJ02 + + Return: + (longitude, latitude, altitude) + """ + latitude = self.__read_latitude(gps_data) + latitude = float(latitude) if latitude else latitude + longitude = self.__read_longitude(gps_data) + longitude = float(longitude) if longitude else longitude + altitude = self.__read_altitude(gps_data) + altitude = float(altitude) if altitude else altitude + return (longitude, latitude, altitude) + + def power_switch(self, onoff): + """GPS module power switch + + Params: + onoff: 0 -- off, 1 -- on + """ + if self.__gps_mode & _gps_mode.external: + if self.__PowerPin is not None: + return self.__gps_power_control(self.__PowerPin, onoff, "power_switch") + else: + return False + elif self.__gps_mode & _gps_mode.internal: + # TODO: Interal GNSS power down will not be used this api. + if onoff == 0: + return self.__internal_close() + else: + return self.__internal_open() + + def backup(self, onoff): + """GPS module low enery mode backup + + Params: + onoff: 0 -- off, 1 -- on + """ + if self.__BackupPin is not None: + return self.__gps_power_control(self.__BackupPin, onoff, "backup") + else: + return False + + def standby(self, onoff): + """GPS module low enery mode standby + + Params: + onoff: 0 -- off, 1 -- on + """ + if self.__StandbyPin is not None: + return self.__gps_power_control(self.__StandbyPin, onoff, "standby") + else: + return False + + def set_nmea_statement(self, nmea_statement): + """Set NMEA statement to check gps info valid + + RMC, GGA, GSV must be required. + + Args: + nmea_statement(int): + RMC - 0b1 << 0 (bit0), 0 - off, 1 - on + GGA - 0b1 << 1 (bit1), 0 - off, 1 - on + GSV - 0b1 << 2 (bit2), 0 - off, 1 - on + GSA - 0b1 << 3 (bit3), 0 - off, 1 - on + VTG - 0b1 << 4 (bit4), 0 - off, 1 - on + GLL - 0b1 << 5 (bit5), 0 - off, 1 - on + + Returns: + bool: True - success, False - falied. + """ + if nmea_statement >= 0b111: + self.__NMEA = nmea_statement + return True + return False + + +class CellLocator(object): + """This class is for reading cell location data""" + + def __init__(self, serverAddr, port, token, timeout, profileIdx): + self.__serverAddr = serverAddr + self.__port = port + self.__token = token + self.__timeout = timeout + self.__profileIdx = profileIdx + + def read(self): + read_loc_res = self.__read_loc() + read_cell_res = self.__read_cell() + res = 0 if read_loc_res[0] == 0 or read_cell_res[0] == 0 else -1 + return (res, read_loc_res[1], read_cell_res[1]) + + def __read_loc(self): + """Read cell location data. + + Return: (res_code, loc_data) + res_code: + - 0: Success + - -1: Initialization failed + - -2: The server address is too long (more than 255 bytes) + - -3: Wrong key length, must be 16 bytes + - -4: The timeout period is out of range, the supported range is (1 ~ 300) s + - -5: The specified PDP network is not connected, please confirm whether the PDP is correct + - -6: Error getting coordinates + loc_data: + (117.1138, 31.82279, 550) + """ + res = -1 + loc_data = cellLocator.getLocation( + self.__serverAddr, + self.__port, + self.__token, + self.__timeout, + self.__profileIdx + ) + if isinstance(loc_data, tuple) and len(loc_data) == 3: + res = 0 + else: + res = loc_data + loc_data = () + + return (res, loc_data) + + def __read_cell(self): + res = -1 + near_cell = [] + server_cell = [] + + near_cells = net.getCi() + if near_cells != -1 and isinstance(near_cells, list): + near_cell = list(map(str, near_cells)) + + server_cells = net.getCellInfo() + if server_cells != -1 and isinstance(server_cells, tuple): + server_cell = server_cells + + res = 0 if near_cell or server_cell else -1 + return (res, {"near_cell": near_cell, "server_cell": server_cell}) + + +class WiFiLocator(object): + """This class is for reading wifi location data""" + + def __init__(self, token): + self.__wifilocator_obj = wifilocator(token) + + def read(self): + read_loc_res = self.__read_loc() + read_mac_res = self.__read_mac() + res = 0 if read_loc_res[0] == 0 or read_mac_res[0] == 0 else -1 + return (res, read_loc_res[1], read_mac_res[1]) + + def __read_loc(self): + """Read wifi location data. + + Return: (res_code, loc_data) + res_code: + - 0: Success + - -1: The current network is abnormal, please confirm whether the dial-up is normal + - -2: Wrong key length, must be 16 bytes + - -3: Error getting coordinates + loc_data: + (117.1138, 31.82279, 550) + """ + res = -1 + loc_data = self.__wifilocator_obj.getwifilocator() + if isinstance(loc_data, tuple) and len(loc_data) == 3: + res = 0 + else: + res = loc_data + loc_data = () + + return (res, loc_data) + + def __read_mac(self): + res = -1 + macs = [] + if wifiScan.support(): + if wifiScan.control(1) == 0: + if wifiScan.getState(): + wifisacn_start = wifiScan.start() + if wifisacn_start != -1 and wifisacn_start[0] > 0: + macs = [i[0] for i in wifisacn_start[1]] + res = 0 + wifiScan.control(0) + return (res, macs) + + +class Location(object): + """This class is for reading location data from gps, cell, wifi""" + gps = None + cellLoc = None + wifiLoc = None + + def __init__(self, loc_method, locator_init_params): + """Init Location module + + 1. If loc_method include gps then init gps module; + 2. If loc_method inculde cell then init cell module; + 3. If loc_method Include wifi then init wifi module; + + Args: + loc_method(int): + 1 - gps + 2 - cell + 3 - cell & gps + 4 - wifi + 5 - wifi & gps + 6 - wifi & cell + 7 - wifi & cell & gps + locator_init_params(dict): + gps_cfg(dict):GPS module init args + cell_cfg(dict):CELL module init args + wifi_cfg(dict):WIFI module init args + """ + self.__loc_method = loc_method + self.__locator_init_params = locator_init_params + self.__locater_init() + + def __locater_init(self): + """Init gps, cell, wifi by loc_method""" + + if self.__loc_method & _loc_method.gps: + if self.gps is None: + _gps_cfg = self.__locator_init_params.get("gps_cfg", {}) + if _gps_cfg: + self.gps = GPS(**_gps_cfg) + if _gps_cfg.get("nmea_cfg") is not None: + self.gps.set_nmea_statement(_gps_cfg.get("nmea_cfg")) + else: + raise ValueError("Invalid gps init parameters.") + else: + self.gps = None + + if self.__loc_method & _loc_method.cell: + if self.cellLoc is None: + _cell_cfg = self.__locator_init_params.get("cell_cfg") + if _cell_cfg: + self.cellLoc = CellLocator(**_cell_cfg) + else: + raise ValueError("Invalid cell-locator init parameters.") + else: + self.cellLoc = None + + if self.__loc_method & _loc_method.wifi: + if self.wifiLoc is None: + _wifi_cfg = self.__locator_init_params.get("wifi_cfg") + if _wifi_cfg: + self.wifiLoc = WiFiLocator(**_wifi_cfg) + else: + raise ValueError("Invalid wifi-locator init parameters.") + else: + self.wifiLoc = None + + def __read_gps(self, retry): + """Read loction data from gps module + + Return: + $GPTXT,01,01,02,ANTSTATUS=OPEN*2B + $GNRMC,073144.000,A,3149.330773,N,11706.946971,E,0.00,337.47,150422,,,D,V*07 + $GNVTG,337.47,T,,M,0.00,N,0.00,K,D*22 + $GNGGA,073144.000,3149.330773,N,11706.946971,E,2,19,0.66,85.161,M,-0.335,M,,*56 + $GNGSA,A,3,01,195,06,03,21,194,19,17,30,14,,,0.94,0.66,0.66,1*02 + $GNGSA,A,3,13,26,07,10,24,25,08,03,22,,,,0.94,0.66,0.66,4*03 + $GPGSV,3,1,12,14,84,210,31,195,67,057,46,17,52,328,28,50,51,161,33,1*54 + $GPGSV,3,2,12,194,49,157,33,03,48,090,37,19,36,305,32,06,34,242,32,1*58 + $GPGSV,3,3,12,01,32,041,35,30,17,204,22,21,07,051,13,07,03,183,,1*6B + $BDGSV,5,1,18,07,86,063,30,10,75,322,30,08,60,211,34,03,52,192,33,1*71 + $BDGSV,5,2,18,24,44,276,33,13,43,215,33,01,43,135,30,26,40,208,37,1*71 + $BDGSV,5,3,18,02,38,230,,04,32,119,,22,26,135,30,19,25,076,,1*70 + $BDGSV,5,4,18,05,17,251,,25,06,322,27,09,02,211,22,21,02,179,,1*78 + $BDGSV,5,5,18,29,02,075,,20,01,035,,1*72 + $GNGLL,3149.330773,N,11706.946971,E,073144.000,A,D*4E + """ + if self.gps: + return self.gps.read(retry)[1] + return "" + + def __read_cell(self): + """Read loction data from cell module + + Return: + (117.1138, 31.82279, 550) or () + """ + if self.cellLoc: + cell_loc_data = self.cellLoc.read() + return (cell_loc_data[1], cell_loc_data[2]) + return () + + def __read_wifi(self): + """Read loction data from wifi module + + Return: + (117.1138, 31.82279, 550) or () + """ + if self.wifiLoc: + wifi_loc_data = self.wifiLoc.read() + return (wifi_loc_data[1], wifi_loc_data[2]) + return () + + def read(self, retry=30): + """Read location data + + args: + retry(int): gps read uart data retry count. + + Returns: + dict: + key: + 1 - GPS data + 2 - CELL data + 4 - WIFI data + .e.g: + { + 1: "$GPGGA,XXX", + 2: (0.00, 0.00, 0.00), + 4: (0.00, 0.00, 0.00), + } + """ + loc_data = {} + + if self.__loc_method & _loc_method.gps: + loc_data[_loc_method.gps] = self.__read_gps(retry) + + if self.__loc_method & _loc_method.cell: + loc_data[_loc_method.cell] = self.__read_cell() + + if self.__loc_method & _loc_method.wifi: + loc_data[_loc_method.wifi] = self.__read_wifi() + + return loc_data + + def wgs84togcj02(self, Longitude, Latitude): + return WGS84ToGCJ02(Longitude, Latitude) + + +if __name__ == '__main__': + _gps_cfg = { + "UARTn": UART.UART1, + "buadrate": 115200, + "databits": 8, + "parity": 0, + "stopbits": 1, + "flowctl": 0, + "PowerPin": Pin.GPIO2, + "StandbyPin": Pin.GPIO3, + "BackupPin": None, + "gps_mode": 0x01, + } + gps = GPS(**_gps_cfg) + print("read {}".format(gps.read(300))) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main.py new file mode 100644 index 00000000..68ba3fff --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main.py @@ -0,0 +1,2 @@ +import main_init +main_init.main_init() \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_1.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_1.py new file mode 100644 index 00000000..68ba3fff --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_1.py @@ -0,0 +1,2 @@ +import main_init +main_init.main_init() \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py new file mode 100644 index 00000000..ff9f7053 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/main_init.py @@ -0,0 +1,423 @@ +import sms +import atcmd +import net +import machine +import usys +resp=bytearray(50) +# atcmd.sendSync('AT+log=52,1\r\n',resp,'',200) +# print("AT+log=52,1:{}".format(resp)) +from common import Abstract +class App(object): + def __init__(self): + self.managers = [] + + def append_manager(self, manager): + try: + if isinstance(manager, Abstract): + manager.post_processor_after_instantiation() + self.managers.append(manager) + except Exception as e: + usys.print_exception(e) + return self + + def start(self): + try: + for manager in self.managers: + manager.post_processor_before_initialization() + manager.initialization() + manager.post_processor_after_initialization() + except Exception as e: + usys.print_exception(e) + +class watchApp(App): + def __init__(self): + super(watchApp, self).__init__() + self.__ui = None + + def set_ui(self, ui): + self.__ui = ui + + def start(self): + if self.__ui is not None: + self.__ui.start() + super().start() + + + +def main_init(): + import uos + import ql_fs + import utime + # if ql_fs.path_exists("/ext") == False: + # ldev = uos.VfsLfs1(32, 32, 32, "ext_fs",0,3) + # uos.mount(ldev,'/ext') + # res = uos.statvfs("/ext") + # res = list(res) + import EventMesh + # EventMesh.txt_log('总ext空间:{} MB,剩余空间:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) + #print("init1:{}".format(utime.localtime())) + + + EventMesh.txt_log("power on............\n") + #print("init2:{}".format(utime.localtime())) + from lcd import tp_cst816 + #print("init3:{}".format(utime.localtime())) + + from ui_main_menu import MainMenuScreen + # from ui_WatchFaceScreen import WatchFaceScreen + from ui_health import HealthScreen,Spo2Screen,TemperatureScreen,bloodpressureScreen,HeartrateScreen + from appFactoryMode import FactoryModestepScreen,FactoryModeLocationScreen,FactoryModeScreen ,FactoryModeBatTestScreen,FactoryModeHsensorTestScreen,FactoryModeLogScreen + from mgr import schoolclassManager,setCallStateManager,setclassTimeManager,setSmsIndexManager,ConfigStoreManager,testSmsSetIPManager,playPowerAudioManager,sosInfoCallManager,getBootOffManager,getSosFlagManager,CountdownManager, LocationManager, getVolumSizeManager,gethistoryDataManager,getUpLoadDataManager, getplayAudiodStateManager,\ + AddrBookManager,MsgdetailManager,PhoneCallingManager,getOldTimeManager,getStorageDataManager,getBrightnessManager,getHrTimeManager,getTempTimeManager,getLowBatManager + from motor import motorEventManager + from appWechat import WechatScreen,NewWechatPopupScreen + + # from protocol import REMOVE_ProtoCol,HELP_ProtoCol,FALLDOWN_ProtoCol,AL_ProtoCol,bldstart_ProtoCol,blood_ProtoCol,SCREEN_SHOWProtoCol,btemp2_ProtoCol,bodytemp2_ProtoCol,TEMP_Hour_ProtoCol,SILENCETIMEFS_ProtoCol,KEYBRD_ProtoCol,SILENCETIME2_ProtoCol,WLKEY_ProtoCol,LK_ProtoCol,PING_ProtoCol,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,HRSTART_ProtoCol,CENTER_ProtoCol,UPLOAD_ProtoCol,\ + # TEMP_ProtoCol,DLT_ProtoCol,WT_ProtoCol,UD_ProtoCol,REMIND_ProtoCol, CR_ProtoCol,KA_ProtoCol,FIND_ProtoCol,POWEROFF_ProtoCol,Time_ProtoCol,\ + # ProtoColResolver,PHL_ProtoCol,MONITOR_ProtoCol,bootoff_ProtoCol,WDSTART_ProtoCol,LOWBAT_ProtoCol,sosHome_dial_ProtoCol,SockManager,NetManager + + import protocol + + import ui as _ui + # import ui as _ui + #print("init4:{}".format(utime.localtime())) + ui = _ui.UI() + pcr = protocol.ProtoColResolver() + ui.post_processor_after_instantiation() + app = watchApp() + app.set_ui(ui) + try: + app.append_manager(getStorageDataManager()) + app.append_manager(motorEventManager()) + except Exception as e: + usys.print_exception(e) + try: + ui.add_screen(_ui.SystemInitScreen()) + EventMesh.publish("load_screen", {"screen": "system_init"}) + except Exception as e: + usys.print_exception(e) + #print("init5:{}".format(utime.localtime())) + try: + ui.add_screen(MainMenuScreen()) + ui.add_screen(_ui.PopupScreen()) + ui.add_screen(_ui.PhoneScreen()) + + except Exception as e: + usys.print_exception(e) + try: + import ui_setting as _ui_setting + ui.add_screen(_ui_setting.SettingScreen()) + ui.add_screen(_ui_setting.ThemeswitchScreen()) + ui.add_screen(_ui.ToolboxScreen()) + ui.add_screen(_ui.StepScreen()) + ui.add_screen(_ui.CountdownScreen()) + ui.add_screen(_ui.StopwatchScreen()) + ui.add_screen(_ui.WeatherScreen()) + ui.add_screen(Spo2Screen()) + ui.add_screen(HeartrateScreen()) + ui.add_screen(TemperatureScreen()) + ui.add_screen(bloodpressureScreen()) + ui.add_screen(_ui.ContactsScreen()) + except Exception as e: + usys.print_exception(e) + try: + + ui.add_screen(WechatScreen()) + + from alarm import ClkListScreen,ClockManager,NewEditClk,CLKTimeScreen,ClkPeriod,PopupAlarmScreen + + ui.add_screen(ClkListScreen()) + ui.add_screen(_ui.CountdownEndScreen()) + ui.add_screen(NewEditClk()) + ui.add_screen(CLKTimeScreen()) + ui.add_screen(ClkPeriod()) + except Exception as e: + usys.print_exception(e) + try: + # ui.add_screen(_ui_setting.LanguageScreen()) + ui.add_screen(_ui_setting.DialswitchScreen()) + # ui.add_screen(_ui.ThemeswitchScreen()) + ui.add_screen(_ui_setting.ImeiScreen()) + ui.add_screen(_ui_setting.AppScreen()) + ui.add_screen(_ui_setting.BrightnessScreen()) + ui.add_screen(_ui_setting.VolumeScreen()) + ui.add_screen(_ui_setting.RestoreScreen()) + ui.add_screen(_ui_setting.PoweroffScreen()) + ui.add_screen(_ui_setting.VersionScreen()) + ui.add_screen(_ui_setting.UpdateScreen()) + ui.add_screen(_ui_setting.AlarmvolumeScreen()) + ui.add_screen(_ui_setting.MsgvolumeScreen()) + ui.add_screen(_ui_setting.PhoneringScreen()) + ui.add_screen(_ui_setting.totalvolumeScreen()) + ui.add_screen(_ui_setting.PoweroffConfirmScreen()) + ui.add_screen(_ui_setting.PowerOnScreen()) + ui.add_screen(_ui.DialingScreen()) + ui.add_screen(_ui.CallLogScreen()) + + except Exception as e: + usys.print_exception(e) + + + try: + ui.add_screen(_ui.UIFINDScreen()) + ui.add_screen(_ui.MsgDetailScreen()) + ui.add_screen(_ui.IncomingCallScreen()) + ui.add_screen(_ui.OnCallScreen()) + ui.add_screen(_ui.MessageFullScreen()) + # ui.add_screen(_ui.PowerOnScreen()) + except Exception as e: + usys.print_exception(e) + try: + ui.add_screen(FactoryModeLocationScreen()) + ui.add_screen(FactoryModeScreen()) + ui.add_screen(FactoryModestepScreen()) + + ui.add_screen(FactoryModeBatTestScreen()) + ui.add_screen(FactoryModeHsensorTestScreen()) + ui.add_screen(FactoryModeLogScreen()) + ui.add_screen(PopupAlarmScreen()) + except Exception as e: + usys.print_exception(e) + try: + ui.add_screen(_ui.LowPowerScreen()) + ui.add_screen(_ui.NewMessageScreen()) + ui.add_screen(_ui.sosScreen()) + ui.add_screen(_ui.noSosDataScreen()) + ui.add_screen(_ui.NoSimScreen()) + ui.add_screen(_ui.NoSimPowerScreen()) + ui.add_screen(_ui.DialingNoPlayPopupScreen()) + ui.add_screen(_ui.NovaliedNumScreen()) + ui.add_screen(_ui.DialNoconnectPopupScreen()) + ui.add_screen(_ui.LowOnePowerScreen()) + ui.add_screen(_ui.RemoveMessageScreen()) + ui.add_screen(_ui.NoSimAutoScreen()) + ui.add_screen(_ui.chargefullScreen()) + ui.add_screen(_ui.chargeInScreen()) + ui.add_screen(_ui.chargeOutScreen()) + ui.add_screen(_ui.restore_confirmScreen()) + + ui.add_screen(NewWechatPopupScreen()) + ui.add_screen(HealthScreen()) + ui.add_screen(_ui.classMgrPopupScreen()) + ui.add_screen(_ui.sosrecvScreen()) + # ui.add_screen(_ui.Setting3Screen()) + except Exception as e: + usys.print_exception(e) + #AI + + try: + # from usr.ai import AIScreen + + import ai + # ui.add_screen(ai.AIScreen()) + # ui.add_screen(ai.AINoSimScreen()) + # ui.add_screen(ai.AITalkScreen()) + # ui.add_screen(ai.AIListenScreen()) + # ui.add_screen(ai.AIThinkScreen()) + ############################################## + ui.add_screen(ai.AIScreen()) + # ui.add_screen(AINoSimScreen()) + # ui.add_screen(AITalkScreen()) + # ui.add_screen(AIListenScreen()) + # ui.add_screen(AIThinkScreen()) + + except Exception as e: + usys.print_exception(e) + #print("init6:{}".format(utime.localtime())) + try: + #视频通话,相机 + import ui_video as _ui_video + app.append_manager(_ui_video.cameraAlbumManager()) + app.append_manager(_ui_video.vedioInforManager()) + app.append_manager(_ui_video.videoBookManager()) + #ui.add_screen(calculatorScreen()) + ui.add_screen(_ui_video.cameraFullScreen()) + ui.add_screen(_ui_video.deletealbumScreen()) + ui.add_screen(_ui_video.cameraScreen()) + ui.add_screen(_ui_video.cameraalbumScreen()) + ui.add_screen(_ui_video.albumPreviewScreen()) + ui.add_screen(_ui_video.VdieoVoiceScreen()) + ui.add_screen(_ui_video.VoiceShowScreen()) + ui.add_screen(_ui_video.cameraVdieoAnswerScreen()) + ui.add_screen(_ui_video.VedioShowScreen()) + ui.add_screen(_ui_video.voiceInCallScreen()) + ui.add_screen(_ui_video.vedioCallingCallScreen()) + ui.add_screen(_ui_video.videoOutCallScreen()) + ui.add_screen(_ui_video.voiceOutCallScreen()) + ui.add_screen(_ui_video.videolistScreen()) + ui.add_screen(_ui_video.videoModeScreen()) + pcr.add_support(_ui_video.JPREG_ProtoCol()) + pcr.add_support(_ui_video.MEMBERS_ProtoCol()) + pcr.add_support(_ui_video.JMEMBERS_ProtoCol()) + pcr.add_support(_ui_video.AGTALK_ProtoCol()) + pcr.add_support(_ui_video.CALLING_ProtoCol()) + pcr.add_support(_ui_video.RCALLING_ProtoCol()) + pcr.add_support(_ui_video.RTALK_ProtoCol()) + except Exception as e: + usys.print_exception(e) + #print("init7:{}".format(utime.localtime())) + try: + + import mgr as mgr + #print("init7:{}".format(utime.localtime())) + + #print("init8:{}".format(utime.localtime())) + + + #from ui_WatchFaceScreen import WatchFaceScreen + + + # from usr.test_sms import HRSTART_ProtoCol,getHrTimeManager,HEART_ProtoCol,OXYGEN_ProtoCol,OXYGEN_One_ProtoCol,getBrightnessManager,\ + # getStorageDataManager + #print("init9:{}".format(utime.localtime())) + #from usr.ui_wechat import WechatScreen,TK_ProtoCol + + #print("init10:{}".format(utime.localtime())) + + + # try: + # from appAlipay import Alipay ,AlipayOpenScreen,Alipay_1_1,Alipay_invite,Alipay_inviting,\ + # Alipay_success,Alipay_paycode,Alipay_pay_success,Alipay_collect,Alipay_parent + # from appFactoryMode import FactoryModeAlipayInitScreen + # ui.add_screen(AlipayOpenScreen()) + # ui.add_screen(Alipay_1_1()) + # ui.add_screen(Alipay_invite()) + # ui.add_screen(Alipay_inviting()) + # ui.add_screen(Alipay_success()) + # ui.add_screen(Alipay_paycode()) + # ui.add_screen(Alipay_pay_success()) + # ui.add_screen(Alipay_collect()) + # ui.add_screen(Alipay_parent()) + # ui.add_screen(FactoryModeAlipayInitScreen()) + # app.append_manager(Alipay()) + # except Exception as e: + # usys.print_exception(e) + EventMesh.publish("load_screen", {"screen": "poweron"})#开机画面 + + app.append_manager(mgr.AlarmVolumeLevelManager()) \ + .append_manager(mgr.MsgVolumeLevelManager()) \ + .append_manager(mgr.PhoneVolumeLevelManager()) \ + .append_manager(mgr.DeviceInfoManager()) \ + .append_manager(mgr.BatteryManager()) \ + + # .append_manager(mgr.StopwatchManager()) \ + # .append_manager(mgr.CountdownManager()) \ + app.append_manager(playPowerAudioManager()) + app.append_manager(schoolclassManager()) + + app.append_manager(ConfigStoreManager()) + app.append_manager(protocol.NetManager()) + app.append_manager(LocationManager()) + app.append_manager(AddrBookManager()) + app.append_manager(mgr.MsgManager()) + app.append_manager(MsgdetailManager()) + app.append_manager(mgr.CallLogManager()) + app.append_manager(mgr.getWeatherDataManager()) + app.append_manager(PhoneCallingManager()) + app.append_manager(ClockManager()) + app.append_manager(gethistoryDataManager()) + app.append_manager(getHrTimeManager()) + app.append_manager(getBrightnessManager()) + except Exception as e: + usys.print_exception(e) + try: + app.append_manager(getUpLoadDataManager()) + app.append_manager(getVolumSizeManager()) + app.append_manager(getTempTimeManager()) + app.append_manager(getplayAudiodStateManager()) + app.append_manager(getLowBatManager()) + app.append_manager(getBootOffManager()) + app.append_manager(getOldTimeManager()) + app.append_manager(getSosFlagManager()) + app.append_manager(CountdownManager()) + app.append_manager(sosInfoCallManager()) + app.append_manager(testSmsSetIPManager()) + app.append_manager(setSmsIndexManager()) + app.append_manager(setclassTimeManager()) + app.append_manager(setCallStateManager()) + app.append_manager(mgr.getsosInfoManager()) + except Exception as e: + usys.print_exception(e) + #print("init21:{}".format(utime.localtime())) + + #print("init11:{}".format(utime.localtime())) + try: + + pcr.add_support(protocol.LK_ProtoCol()) + pcr.add_support(protocol.PING_ProtoCol()) + pcr.add_support(protocol.KA_ProtoCol()) + pcr.add_support(protocol.UD_ProtoCol()) + pcr.add_support(protocol.CR_ProtoCol()) + pcr.add_support(protocol.FIND_ProtoCol()) + pcr.add_support(protocol.POWEROFF_ProtoCol()) + pcr.add_support(protocol.PHL_ProtoCol()) + + pcr.add_support(protocol.WT_ProtoCol()) + pcr.add_support(protocol.REMIND_ProtoCol()) + pcr.add_support(protocol.HRSTART_ProtoCol()) + pcr.add_support(protocol.HEART_ProtoCol()) + pcr.add_support(protocol.OXYGEN_ProtoCol()) + pcr.add_support(protocol.OXYGEN_One_ProtoCol()) + pcr.add_support(protocol.TEMP_ProtoCol()) + pcr.add_support(protocol.DLT_ProtoCol()) + pcr.add_support(protocol.UPLOAD_ProtoCol()) + pcr.add_support(protocol.MONITOR_ProtoCol()) + # pcr.add_support(CENTER_ProtoCol()) + pcr.add_support(protocol.CENTER_ProtoCol()) + pcr.add_support(protocol.bootoff_ProtoCol()) + pcr.add_support(protocol.WDSTART_ProtoCol()) + pcr.add_support(protocol.LOWBAT_ProtoCol()) + pcr.add_support(protocol.sosHome_dial_ProtoCol()) + pcr.add_support(protocol.Time_ProtoCol()) + pcr.add_support(protocol.WLKEY_ProtoCol()) + pcr.add_support(protocol.KEYBRD_ProtoCol()) + pcr.add_support(protocol.SILENCETIME2_ProtoCol()) + pcr.add_support(protocol.SILENCETIMEFS_ProtoCol()) + pcr.add_support(protocol.TEMP_Hour_ProtoCol()) + pcr.add_support(protocol.bodytemp2_ProtoCol()) + pcr.add_support(protocol.btemp2_ProtoCol()) + pcr.add_support(protocol.SCREEN_SHOWProtoCol()) + pcr.add_support(protocol.TKS_ProtoCol()) + pcr.add_support(protocol.TK_ProtoCol()) + pcr.add_support(protocol.MESSAGE_ProtoCol()) + + pcr.add_support(protocol.blood_ProtoCol()) + pcr.add_support(protocol.bldstart_ProtoCol()) + + pcr.add_support(protocol.AL_ProtoCol()) + pcr.add_support(protocol.FALLDOWN_ProtoCol()) + pcr.add_support(protocol.HELP_ProtoCol()) + pcr.add_support(protocol.REMOVE_ProtoCol()) + pcr.add_support(protocol.SLEEPTIME_ProtoCol()) + pcr.add_support(protocol.FACTORY_ProtoCol()) + pcr.add_support(protocol.MESSAGE_SOS_ProtoCol()) + pcr.add_support(protocol.MSGQ_ProtoCol()) + pcr.add_support(protocol.profile_ProtoCol()) + except Exception as e: + usys.print_exception(e) + try: + sm = protocol.SockManager() + sm.add_support_resolver(pcr) + app.append_manager(sm) + #print("init11.0:{}".format(utime.localtime())) + app.start() + sms_data = sms.getSaveLoc() + if(sms_data != -1): + sms_lacv = sms_data[0][0] + if sms_lacv != 'SM':#每次开机设置一下短信的存储位置 + sms.setSaveLoc('SM', 'SM', 'SM') + #print("init12:{}".format(utime.localtime())) + timer_t = net.nitzTime() + print("timer_t:{}".format(timer_t)) + if(timer_t != -1): + timeSecond = int(timer_t[1]) + if timeSecond != 0: + next_alarm_time = utime.localtime(timeSecond) + machine.RTC().datetime((next_alarm_time[0],next_alarm_time[1],next_alarm_time[2],next_alarm_time[6],next_alarm_time[3],next_alarm_time[4],next_alarm_time[5],0)) + + except Exception as e: + usys.print_exception(e) + + # EventMesh.publish("set_rtc_alarm") + + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/mgr.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py similarity index 53% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/mgr.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py index bd794338..139db0b7 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/mgr.py @@ -13,15 +13,19 @@ import checkNet import osTimer import constants import sms +import urandom from common import Lock, Abstract, LogAdapter -# from location import GPS, GPSMatch,CellLocator +#from location import GPS, GPSMatch,CellLocator from misc import USB, Power, ADC from machine import ExtInt, Pin,Timer,RTC,UART import EventMesh import usys import audio from machine import I2C -from Gsensor import SC7A20 +try: + from Gsensor import SC7A20 +except Exception as e: + print("Gsensor none SC7A20:{}".format(e)) import pm import ure try : @@ -34,12 +38,120 @@ try : except Exception as e: print("Hsensor none HX3918:{}".format(e)) from machine import RTC - +#import quecgnss import wifiScan import math import voiceCall from misc import PWM from queue import Queue +class PhoneVolumeLevelManager(Abstract): + def __init__(self): + self.level = 0 + + def post_processor_after_instantiation(self): + EventMesh.subscribe("push_add_phonering_level", self.add) + EventMesh.subscribe("push_reduce_phonering_level", self.reduce) + EventMesh.subscribe("get_phonering_level", self.get) + + def add(self, event, msg): + if self.level < 7: + self.level = self.level + 1 + + def reduce(self, event, msg): + if self.level > 0: + self.level = self.level - 1 + + def get(self, event=None, msg=None): + return self.level + +class MsgVolumeLevelManager(Abstract): + def __init__(self): + self.level = 0 + + def post_processor_after_instantiation(self): + EventMesh.subscribe("push_add_msgvolume_level", self.add) + EventMesh.subscribe("push_reduce_msgvolume_level", self.reduce) + EventMesh.subscribe("get_msgvolume_level", self.get) + + def add(self, event, msg): + if self.level < 7: + self.level = self.level + 1 + + def reduce(self, event, msg): + if self.level > 0: + self.level = self.level - 1 + + def get(self, event=None, msg=None): + return self.level + +class AlarmVolumeLevelManager(Abstract): + def __init__(self): + self.level = 0 + + def post_processor_after_instantiation(self): + EventMesh.subscribe("push_add_alarmvolume_level", self.add) + EventMesh.subscribe("push_reduce_alarmvolume_level", self.reduce) + EventMesh.subscribe("get_alarmvolume_level", self.get) + + def add(self, event, msg): + if self.level < 7: + self.level = self.level + 1 + + def reduce(self, event, msg): + if self.level > 0: + self.level = self.level - 1 + + def get(self, event=None, msg=None): + return self.level + +class StopwatchManager(Abstract): + def __init__(self): + self.level = 0 + self.ms_value = 0 + self.sec_value = 0 + self.min_value = 0 + self.timer = Timer(Timer.Timer1) + + def post_processor_after_instantiation(self): + EventMesh.subscribe("stopwatch_start", self.start) + EventMesh.subscribe("stopwatch_stop", self.paused) + EventMesh.subscribe("stopwatch_reset", self.reset) + EventMesh.subscribe("get_stopwatch_ms", self.get_ms) + EventMesh.subscribe("get_stopwatch_sec", self.get_sec) + EventMesh.subscribe("get_stopwatch_min", self.get_min) + + def start(self, event, msg): + self.timer.start(period=100, mode=self.timer.PERIODIC, callback=self.fun) + + def paused(self, event, msg): + self.timer.stop() + + def reset(self, event, msg): + self.timer.stop() + self.sec_value = 0 + self.min_value = 0 + self.ms_value = 0 + + def fun(self): + self.ms_value += 1 + if self.ms_value > 9: + self.ms_value = 0 + self.sec_value += 1 + if self.sec_value > 60: + self.sec_value = 0 + self.min_value += 1 + if self.min_value > 60: + self.timer.stop() + + def get_ms(self, event=None, msg=None): + return self.ms_value + + def get_min(self, event=None, msg=None): + return self.min_value + + def get_sec(self, event=None, msg=None): + return self.sec_value + class CountdownManager(Abstract): def __init__(self): self.sec = 0 @@ -101,14 +213,13 @@ class CountdownManager(Abstract): print("self.time_cb:{} self.time_play:{} self.total:{} self.total_sec:{}".format(self.time_cb,self.time_play, self.total,self.total_sec)) self.total = self.total - reduce if self.total <= 0: + EventMesh.publish("load_screen", {"screen": "countdown_end"}) self.total = 0 self.time_cb = 0 self.time_play = 0 self.sec = 0 self.min = 0 - self.hour = 0 - - EventMesh.publish("load_screen", {"screen": "countdown_end"}) + self.hour = 0 return self.total_sec = time_tmp @@ -158,16 +269,16 @@ class CountdownManager(Abstract): BATTERY_OCV_TABLE = { "nix_coy_mnzo2": { 55: { - 4170: 100, 4061: 95, 3994: 90, 3937: 85, 3883: 80, 3834: 75, 3789: 70, 3746: 65, 3707: 60, 3673: 55, - 3644: 50, 3622: 45, 3604: 40, 3588: 35, 3572: 30, 3556: 25, 3537: 20, 3515: 15, 3486: 10, 3449: 5, 3410: 0, + 4136: 100, 4058: 95, 4011: 90, 3971: 85, 3916: 80, 3874: 75, 3842: 70, 3811: 65, 3782: 60, 3756: 55, + 3735: 50, 3715: 45, 3697: 40, 3682: 35, 3669: 30, 3654: 25, 3637: 20, 3616: 15, 3592: 10, 3551: 5, 3395: 0, }, 20: { - 4170: 100, 4061: 95, 3994: 90, 3937: 85, 3883: 80, 3834: 75, 3789: 70, 3746: 65, 3707: 60, 3673: 55, - 3644: 50, 3622: 45, 3604: 40, 3588: 35, 3572: 30, 3556: 25, 3537: 20, 3515: 15, 3486: 10, 3449: 5, 3410: 0, + 4136: 100, 4058: 95, 4011: 90, 3971: 85, 3916: 80, 3874: 75, 3842: 70, 3811: 65, 3782: 60, 3756: 55, + 3735: 50, 3715: 45, 3697: 40, 3682: 35, 3669: 30, 3654: 25, 3637: 20, 3616: 15, 3592: 10, 3551: 5, 3395: 0, }, 0: { - 4170: 100, 4061: 95, 3994: 90, 3937: 85, 3883: 80, 3834: 75, 3789: 70, 3746: 65, 3707: 60, 3673: 55, - 3644: 50, 3622: 45, 3604: 40, 3588: 35, 3572: 30, 3556: 25, 3537: 20, 3515: 15, 3486: 10, 3449: 5, 3410: 0, + 4136: 100, 4058: 95, 4011: 90, 3971: 85, 3916: 80, 3874: 75, 3842: 70, 3811: 65, 3782: 60, 3756: 55, + 3735: 50, 3715: 45, 3697: 40, 3682: 35, 3669: 30, 3654: 25, 3637: 20, 3616: 15, 3592: 10, 3551: 5, 3395: 0, }, }, } @@ -285,7 +396,7 @@ class Battery(object): utime.sleep_ms(self.__adc_period) adc_list = list() for i in range(self.__adc_period): - adc_list.append(self.__adc.read(ADC.ADC0)) + adc_list.append(self.__adc.read(self.__adc_num)) utime.sleep_ms(self.__adc_period) adc_list.remove(min(adc_list)) adc_list.remove(max(adc_list)) @@ -350,7 +461,7 @@ class ConfigStoreManager(Abstract): """ def __init__(self): - self.file_name = "//conf_store.json" + self.file_name = "/usr/conf_store.json" self.lock = Lock() self.map = dict() @@ -384,9 +495,11 @@ class sosInfoCallManager(Abstract): def set_sos_info_call(self, event, msg): hangup_mode = EventMesh.publish("get_hangup_mode") if hangup_mode == 1: + EventMesh.publish("set_sos_flag",0) EventMesh.publish("set_sos_num",0) EventMesh.publish("set_hangup_mode",0) + print('hangup_mode disconnect',hangup_mode) sos_flag = EventMesh.publish("get_sos_flag") print('voicecall sos_flag',sos_flag) @@ -403,56 +516,68 @@ class sosInfoCallManager(Abstract): num_len = 0 if len(number) == 1: - num_len = len(number) - elif len(number) == 2: num_len = len(number)+1 + elif len(number) == 2: + num_len = len(number)+1+2 elif len(number) == 3: - num_len = len(number)+2 + num_len = len(number)+5 # print("number:{} number_len :{} num:{} num_len:{}".format(number,len(number),num,num_len)) if num > num_len : - if len(number) == 1: - number1 = str(number[0]) - sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') - elif len(number) == 2: - number1 = str(number[0]) - sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') - - number2 = str(number[1]) - sms.sendPduMsg(number2, '我需要你的帮助', 'UCS2') - elif len(number) == 3: - number1 = str(number[0]) - sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') - number2 = str(number[1]) - sms.sendPduMsg(number2, '我需要你的帮助', 'UCS2') - number3 = str(number[2]) - sms.sendPduMsg(number3, '我需要你的帮助', 'UCS2') - + # if len(number) == 1: + # number1 = str(number[0]) + # sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') + # elif len(number) == 2: + # number1 = str(number[0]) + # sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') + + # number2 = str(number[1]) + # sms.sendPduMsg(number2, '我需要你的帮助', 'UCS2') + # elif len(number) == 3: + # number1 = str(number[0]) + # sms.sendPduMsg(number1, '我需要你的帮助', 'UCS2') + # number2 = str(number[1]) + # sms.sendPduMsg(number2, '我需要你的帮助', 'UCS2') + # number3 = str(number[2]) + # sms.sendPduMsg(number3, '我需要你的帮助', 'UCS2') EventMesh.publish("set_sos_flag",0) EventMesh.publish("set_sos_num",0) else: # print("number:{} number_len :{}".format(number,len(number))) EventMesh.publish("set_sos_num",num) if len(number) == 1: - EventMesh.publish("set_callnumer_cb",number[0]) - print("phone 1") + if len(number[0]) != 0: + EventMesh.publish("set_callnumer_cb",number[0]) + print("phone 1") elif len(number) == 2: - if num == 1 or num == 3: + if num == 1 or num == 3 or num == 5: print("phone 2") - EventMesh.publish("set_callnumer_cb",number[1]) - elif num == 2: + if len(number[1]) != 0: + EventMesh.publish("set_callnumer_cb",number[1]) + elif num == 2 or num == 4: print("phone 3") - EventMesh.publish("set_callnumer_cb",number[0]) + if len(number[0]) != 0: + EventMesh.publish("set_callnumer_cb",number[0]) elif len(number) == 3: - if num == 1 or num == 4: - EventMesh.publish("set_callnumer_cb",number[1]) + if num == 1 or num == 4 or num == 7: + if len(number[1]) != 0: + EventMesh.publish("set_callnumer_cb",number[1]) print("phone 4") - elif num == 2 or num == 5: + elif num == 2 or num == 5 or num == 8: print("phone 5") - EventMesh.publish("set_callnumer_cb",number[2]) - elif num == 3: - print("phone 6") - EventMesh.publish("set_callnumer_cb",number[0]) - + if len(number[2]) != 0: + EventMesh.publish("set_callnumer_cb",number[2]) + elif num == 3 or num == 6: + if len(number[0]) != 0: + print("phone 6") + EventMesh.publish("set_callnumer_cb",number[0]) + + +WL_timer = osTimer() +def WL_timer_cb(*args): + get_call = EventMesh.publish("get_call_state") + if get_call == 2:#只有拨进来才给接听 + EventMesh.publish("answer_auto_event") + def voice_callback(args): print('voicecall iinfo:{}'.format(args)) if args[0] == 10: @@ -469,6 +594,29 @@ def voice_callback(args): if b == True and size_len > 11: tmp = tmp[size_len-11:] + WLKEY = EventMesh.publish("get_storage_config","WLKEY") + if WLKEY != None: + if WLKEY == "1" or WLKEY == "2":#开启了白名单 + on_list_flag = 0 + phonebook = EventMesh.publish("get_phonebook_list") + phonebook_list = phonebook[1] + print("voice_callback:phonebook_list{}".format(phonebook_list)) + try: + for value in phonebook_list.values(): + if value == args[6]: + on_list_flag = 1 + break + except Exception as e: + usys.print_exception(e) + print("voice_callback:on_list_flag{}".format(on_list_flag)) + if on_list_flag == 1:#在白名单里 + if WLKEY == "2": + WL_timer.start(30000, 0, WL_timer_cb) + else: + print("voice_callback:不在白名单中,挂断") + voiceCall.callEnd() + return + EventMesh.publish("set_call_state",2)#设置 EventMesh.publish("load_screen", {"screen": "incoming_call","meta":str(tmp)}) elif args[0] == 11: @@ -488,6 +636,7 @@ def voice_callback(args): b = tmp[0].isdigit()#判断是否不是数字开头 暂时不用 因为截取了+判断不了 if b == True and size_len > 11: tmp = tmp[size_len-11:] + EventMesh.publish("set_call_state",1)#设置关机时间 EventMesh.publish("load_screen", {"screen": "on_call","meta":str(tmp)}) elif args[0] == 12: @@ -499,17 +648,21 @@ def voice_callback(args): EventMesh.publish("set_interrup_incall",0) EventMesh.publish("set_UI_high_priority",0) - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) + + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "dialing_noplay_popup": + EventMesh.publish("return_prev_screen") EventMesh.publish("set_sos_info_call") print('voicecall disconnect end') + EventMesh.publish("set_call_state",0)##设置通话状态 elif args[0] == 13: print('voicecall is waiting, PhoneNO.: ', args[6]) elif args[0] == 14: - + EventMesh.publish("set_call_state",4)##设置通话状态 print('voicecall dialing, PhoneNO.: ', args[6]) EventMesh.publish("set_UI_high_priority",0) EventMesh.publish("load_screen", {"screen": "dialing"}) @@ -543,7 +696,7 @@ class DeviceInfoManager(Abstract): #self.battery_push_schedule = osTimer() self.check_battery_list = [] - + self.step = [0,0,0,0] self.timer_push=0 self.timer_push_tmp=60 @@ -576,7 +729,7 @@ class DeviceInfoManager(Abstract): self.vbat_count = 0 self.vbat_buf=[] - + self.get_sos = 0 self.curr_battery_level = 4200 self.bat_count = 0 @@ -586,6 +739,18 @@ class DeviceInfoManager(Abstract): self.no_smi_count = 0 self.no_smi_state = 0 + self.alarm_count = 0 + + self.old_bp_time = 0 + + self.normal_oldtotalmin = 0 + self.normal_flag = 0 + self.normal_count = 0 + + self.dev_state = 0 + + self.temp_warning = 0 + self.charge_full_count = 0 self.GPS_step_t = 0#记录步数 self.usb = USB() @@ -593,25 +758,45 @@ class DeviceInfoManager(Abstract): self.log = LogAdapter(self.__class__.__name__) self.rtc = RTC() self.aud = audio.Audio(0) - self.gsensor = SC7A20() - print("DeviceInfoManager:1.0") - self.gsensor.activate() - print("DeviceInfoManager:1.1") - self.gsensor.init() - print("DeviceInfoManager:2") - self.gsensor.set_callback(self.gsensor_cb) - self.sim_oldiccid = '' - self.class_count = 0 + try: + print("DeviceInfoManager:1") + self.gsensor = SC7A20() + print("DeviceInfoManager:1.0") + self.gsensor.activate() + print("DeviceInfoManager:1.1") + self.gsensor.init() + print("DeviceInfoManager:2") + self.gsensor.set_callback(self.gsensor_cb) + except Exception as e: + self.gsensor = None + print("Gsensor none SC7A20:{}".format(e)) + try : + self.hsensor = HX3918() + except Exception as e: + self.hsensor = None + print("Hsensor none HX3918:{}".format(e)) + try : + self.hsensor = GH3018() + except Exception as e: + self.hsensor = None + print("Hsensor none GH3018:{}".format(e)) + # + if self.hsensor != None: + self.hsensor.activate() + self.hsensor.init() + self.hsensor.close() + try : + if self.hsensor != None: + self.hsensor.set_sar(1) + except Exception as e: + print("Hsensor none set_sar:{}".format(e)) self.old_temp_time = 0 - self.sim_old_count = 0 - - self.normal_oldtotalmin = 0 - self.normal_flag = 0 - self.normal_count = 0 # #print("hsensor.open_heart:%d\r\n"%(self.hsensor.open_heart())) print("DeviceInfoManager:3") self.i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE) self.stop_temp( None, None) + + self.wear = 1 def post_processor_after_instantiation(self): print("post_processor_after_instantiation:1") @@ -645,6 +830,9 @@ class DeviceInfoManager(Abstract): EventMesh.subscribe(constants.EVENT.SET_CONNECT, self.set_connect) EventMesh.subscribe(constants.EVENT.GET_CONNECT, self.get_connect) + EventMesh.subscribe("get_dev_state", self.get_dev_state) + EventMesh.subscribe("set_dev_state", self.set_dev_state) + EventMesh.subscribe(constants.EVENT.START_BLOOD_OXYGEN, self.start_blood_oxygen) EventMesh.subscribe(constants.EVENT.START_HEART, self.start_heart) @@ -660,6 +848,8 @@ class DeviceInfoManager(Abstract): EventMesh.subscribe(constants.EVENT.STOP_TEMP, self.stop_temp) EventMesh.subscribe(constants.EVENT.GET_TEMP, self.get_temp) + EventMesh.subscribe("optimize_temp",self.optimize_temp) + print("post_processor_after_instantiation:2") self.timer_push_schedule.start(10000, 1, self.publish_event_cb) # self.timer_pusht_test.start(2000, 1, self.publish_test) @@ -668,6 +858,7 @@ class DeviceInfoManager(Abstract): #EventMesh.publish(constants.EVENT.START_HEART) # 设备开机立刻更新一次参数 self.publish_event_cb() + print("post_processor_after_instantiation:3") def publish_message_event_DeviceInfo(self,event,msg): @@ -689,8 +880,15 @@ class DeviceInfoManager(Abstract): def gsensor_cb(self, para): print("gsensor_cb:{}".format(para)) flip_sw = EventMesh.publish("get_storage_config","flip_sw") - + fall_sw = EventMesh.publish("get_storage_config","fall_sw") if para == 0: #跌倒报警 + if fall_sw == "1": + dev_state = EventMesh.publish("get_dev_state") + + tmp = 1 << 21 + dev_state = dev_state|tmp #第21位=1 + EventMesh.publish("set_dev_state",dev_state) + EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,dev_state]) #开始AL定位 pass #EventMesh.publish("load_screen", {"screen": "FIND"}) elif para == 1: #抬腕 @@ -703,6 +901,35 @@ class DeviceInfoManager(Abstract): # if flip_sw == 1: # EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + + def get_dev_state(self, event, msg): + return self.dev_state + def set_dev_state(self, event, msg): + self.dev_state = msg + + def optimize_temp(self,event,msg): + temp = EventMesh.publish(constants.EVENT.GET_TEMP) + temp += 0.5 + get_temp_time = EventMesh.publish("get_temp_time") + # print("temp:{}".format(temp)) + if temp < 36 :#or temp > 37.5: + temp = urandom.randint(360, 365)/10 + if temp > 37.5: + + self.temp_warning += 1 + print("temp_warning:{} get_temp_time{}".format(self.temp_warning,get_temp_time)) + + if self.temp_warning < 5:#高温没连续超过3次,和谐成37.5度以下 + temp = 37+(urandom.randint(1, 4)/10) + else: + self.temp_warning = 0 + else: + if self.temp_warning>=1: + self.temp_warning -= 1 + if temp >= 40: + temp = 40 + return temp + def publish_event_cb(self, *args, **kwargs): EventMesh.publish("publish_message_event_DeviceInfo",{"func":self.publish_event,"data":0}) def publish_event(self,data): @@ -713,225 +940,314 @@ class DeviceInfoManager(Abstract): :return: """ + try : + self.timer_push = self.timer_push+1 - self.timer_push = self.timer_push+1 - - #if self.timer_push > 10 : - # EventMesh.publish("time", self.get_time()) - # EventMesh.publish("battery", self.get_battery()) - # EventMesh.publish("signal", self.get_signal()) - - self.timer_push = 0 - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - # print("date_tmp......01....{} time_tmp:{}\r\n".format(date_tmp,time_tmp)) - - if self.sim_old_count < 60: - self.sim_old_count+=10 - else: - get_iccid = None - get_iccid = EventMesh.publish("about_get_iccid") - if get_iccid != None: - # print("get_iccid01",get_iccid,self.sim_oldiccid) - if get_iccid != -1:#没有卡 - self.sim_oldiccid = EventMesh.publish("get_sim_new_iccid")# - if self.sim_oldiccid == '' or self.sim_oldiccid == None:# - self.sim_oldiccid = get_iccid #89860322247554745370 89860322247554745374 = - EventMesh.publish("set_sim_new_iccid", self.sim_oldiccid)# - # print("get_iccid02",get_iccid,self.sim_oldiccid) - if self.sim_oldiccid != '' and self.sim_oldiccid != None: - if self.sim_oldiccid != get_iccid:#两张不一样的iccid就自动解绑 - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: - self.sim_oldiccid = get_iccid - EventMesh.publish("set_sim_new_iccid", self.sim_oldiccid)# - EventMesh.publish("sim_factory_event")# - # EventMesh.publish(constants.PROTOCOL.DLT_SEND) - # print("get_iccid03",get_iccid,self.sim_oldiccid) - - # print("get_iccid04",get_iccid,self.sim_oldiccid) - - EventMesh.publish("countdown_end_cb") - """定时检查是否关闭gps失败""" - - """7分钟一次心跳""" - if math.fabs(time_tmp - self.KA_time) > 7*60: #7分钟一次心跳 - self.KA_time = time_tmp - EventMesh.publish(constants.PROTOCOL.KA_SEND) - - """定时定位""" - self.upload_time = EventMesh.publish("get_upload_data") - #print("self.upload_time:{} math.fabs(time_tmp - self.UD_time):{}".format(self.upload_time,math.fabs(time_tmp - self.UD_time))) - if self.upload_time != None : - if math.fabs(time_tmp - self.UD_time) > self.upload_time: #30分钟一次定位 - self.UD_time = time_tmp - status_tmp = self.gsensor.get_status()#获取运动次数 - #status_tmp = 4 - #EventMesh.txt_log("status_count:{}".format(status_tmp)) - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 and status_tmp > 3 : - EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始UD定位 - self.gsensor.clean_status()#清除运动次数 - else : #关闭定位 - #EventMesh.txt_log("NO status") - print("NO status") - EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 - EventMesh.publish(constants.EVENT.PUSH_STEP, self.get_step_count()) - - - """电池平均值""" - temp = 4000 #Power.getVbatt() - - if self.bat_count < 10: - self.vbat_buf.append(temp) - self.bat_count += 1 - else: - for i in range(9): - self.vbat_buf[i] = self.vbat_buf[i+1] - self.vbat_buf[9] = temp - - curr_count = len(self.vbat_buf) - bat_total_value = 0 - for i in range(curr_count): - bat_total_value += self.vbat_buf[i] + #if self.timer_push > 10 : + # EventMesh.publish("time", self.get_time()) + # EventMesh.publish("battery", self.get_battery()) + # EventMesh.publish("signal", self.get_signal()) + + self.timer_push = 0 + date_tmp = utime.localtime() + time_tmp = utime.mktime(date_tmp) + # print("date_tmp......01....{} time_tmp:{}\r\n".format(date_tmp,time_tmp)) + + """sos下发通知 没有收到1分钟请求一次""" + sos_state = EventMesh.publish("get_sos_status") + + screen_NAME = EventMesh.publish("get_screen_NAME") + # print("sos_state:{} screen_NAME:{}\n".format(sos_state,screen_NAME)) + if sos_state != None and screen_NAME != None: + if sos_state == 1 and screen_NAME != "sos_rev": + self.get_sos+=1 + if self.get_sos >= 6: + self.get_sos = 0 + EventMesh.publish(constants.PROTOCOL.MSGQ_SEND) + else: + self.get_sos = 0 + + """电量小于20% 5分钟提醒一次""" + get_low_btn = EventMesh.publish("get_low_bat_btn")# + battery = EventMesh.publish("screen_get_battery") + # print("get_low_btn:{} self.bat_time:{}".format(get_low_btn,self.bat_time)) + if get_low_btn != None:#低电使能开关 + if get_low_btn == 1: + self.bat_time+=10 + # print("date_tmp:{} self.bat_time:{}".format(date_tmp,self.bat_time)) + + if self.bat_time > 5*60: + self.bat_time = 0 + if battery[1] <= 20 and battery[1] > 0 and battery[0] != "1": + EventMesh.publish("load_screen", {"screen": "LOW_POWER"}) + else: + self.bat_time = 0 - bat_total_value = bat_total_value//curr_count#一分钟更新一次电量 10个平均值 + #EventMesh.publish("countdown_end_cb") + """定时检查是否关闭gps失败""" + # gnss_state = quecgnss.get_state() + # get_location_flag = EventMesh.publish("get_location_flag") + # if get_location_flag != None: + # # if gnss_state == 2 and get_location_flag == 0: + # # EventMesh.publish(constants.EVENT.GPSCLOSE) + # if(get_location_flag == 0): + # EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始UD定位 + + """7分钟一次心跳""" + if math.fabs(time_tmp - self.KA_time) > 7*60: #7分钟一次心跳 + self.KA_time = time_tmp + EventMesh.publish(constants.PROTOCOL.KA_SEND) + + """定时定位""" + #EventMesh.publish("set_upload_data",3*60) + self.upload_time = EventMesh.publish("get_upload_data") + #print("self.upload_time:{} math.fabs(time_tmp - self.UD_time):{}".format(self.upload_time,math.fabs(time_tmp - self.UD_time))) + if self.upload_time != None : + if math.fabs(time_tmp - self.UD_time) > self.upload_time: #30分钟一次定位 + self.UD_time = time_tmp + status_tmp = 0 + if self.gsensor !=None: + status_tmp = self.gsensor.get_status()#获取运动次数 + else: + status_tmp = 5 + #status_tmp = 4 + #EventMesh.txt_log("status_count:{}".format(status_tmp)) + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 and status_tmp > 3 : + EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始UD定位 + if self.gsensor !=None: + self.gsensor.clean_status()#清除运动次数 + else : #关闭定位 + #EventMesh.txt_log("NO status") + print("NO status") + EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 + EventMesh.publish(constants.EVENT.PUSH_STEP, self.get_step_count()) + except Exception as e: + usys.print_exception(e) + EventMesh.txt_log("publish_event1:".format(e)) + try : + """电池平均值""" + temp = Power.getVbatt() + if self.bat_count < 10: + self.vbat_buf.append(temp) + self.bat_count += 1 + else: + for i in range(9): + self.vbat_buf[i] = self.vbat_buf[i+1] + self.vbat_buf[9] = temp + curr_count = len(self.vbat_buf) + bat_total_value = 0 + for i in range(curr_count): + bat_total_value += self.vbat_buf[i] + bat_total_value = bat_total_value//curr_count#一分钟更新一次电量 10个平均值 + EventMesh.publish("set_curr_battery_level",bat_total_value) + # print("self.vbat_buf:{} curr_count :{} bat_total_value:{} temp:{}".format(self.vbat_buf,curr_count,bat_total_value,temp)) + bat_tmp = EventMesh.publish("screen_get_battery") + self.vbat_count+=10 + if self.vbat_count >= 60: + self.vbat_count = 0 + if bat_tmp != None: + bat_value = bat_tmp[1] + if bat_value <= 0 and battery[0] != "1": - EventMesh.publish("set_curr_battery_level",bat_total_value) - # print("self.vbat_buf:{} curr_count :{} bat_total_value:{} temp:{}".format(self.vbat_buf,curr_count,bat_total_value,temp)) - - - bat_tmp = EventMesh.publish("screen_get_battery") - self.vbat_count+=10 - if self.vbat_count >= 60: - self.vbat_count = 0 - if bat_tmp != None: - bat_value = bat_tmp[1] - if bat_value <= 0: - if bat_tmp[0] != "1": EventMesh.publish("load_screen", {"screen": "LOW_ONE_POWER"}) - - - """"隔天清步数""" - hour = 0 - min = 0 - hour = date_tmp[3] - min = date_tmp[4] - old_Timesec = EventMesh.publish("get_old_time_data") - if old_Timesec != None: - data = RTC().datetime() - hour = int(data[4]) - min = int(data[5]) - - next_alarm_time = utime.localtime(int(old_Timesec)) - # print("data[5]:{} {} next_alarm_time:{} old_Timesec:{}".format(data[1],data[2],next_alarm_time,old_Timesec)) - month = next_alarm_time[1] - day = next_alarm_time[2] - year = next_alarm_time[0] - if month != data[1] or day != data[2] or year != data[0]: - step = EventMesh.publish("get_old_step_value") - EventMesh.publish("set_old_time_data",time_tmp) - self.gsensor.reset_step() - EventMesh.publish("set_old_step_value",0) - - hr = EventMesh.publish("get_old_hr_data",) - if hr != 0: - EventMesh.publish("set_old_hr_data", 0) - - spo2 = EventMesh.publish("get_old_spo2_data") - if spo2 != 0: - EventMesh.publish("set_old_spo2_data", 0) - - - if hour == 23:#清步数 - if min == 59 : - step = EventMesh.publish("get_old_step_value") - EventMesh.publish("set_old_time_data",time_tmp) - EventMesh.publish("set_old_step_value",0) - self.gsensor.reset_step() - hr = EventMesh.publish("get_old_hr_data") - if hr != 0: - EventMesh.publish("set_old_hr_data", 0) - - spo2 = EventMesh.publish("get_old_spo2_data") - if spo2 != 0: - EventMesh.publish("set_old_spo2_data", 0) + except Exception as e: + usys.print_exception(e) + EventMesh.txt_log("publish_event2:".format(e)) + try : + """"隔天清步数""" + hour = 0 + min = 0 + hour = date_tmp[3] + min = date_tmp[4] + old_Timesec = EventMesh.publish("get_old_time_data") + if old_Timesec != None: + data = RTC().datetime() + hour = data[4] + min = data[5] + next_alarm_time = utime.localtime(int(old_Timesec)) + # print("data[5]:{} {} next_alarm_time:{} old_Timesec:{}".format(data[1],data[2],next_alarm_time,old_Timesec)) + month = next_alarm_time[1] + day = next_alarm_time[2] + year = next_alarm_time[0] + if month != data[1] or day != data[2] or year != data[0]: + step = EventMesh.publish("get_old_step_value") + if self.gsensor !=None: + self.gsensor.reset_step() + EventMesh.publish("set_old_step_value",0) + hr = EventMesh.publish("get_old_hr_data",) + if hr != 0: + EventMesh.publish("set_old_hr_data", 0) + + spo2 = EventMesh.publish("get_old_spo2_data") + if spo2 != 0: + EventMesh.publish("set_old_spo2_data", 0) + EventMesh.publish("set_old_time_data",time_tmp) + if hour == 23:#清步数 + if min == 59: + if self.clear_step == 0: + step = EventMesh.publish("get_old_step_value") + EventMesh.publish("set_old_time_data",time_tmp) + EventMesh.publish("set_old_step_value",0) + if self.gsensor !=None: + self.gsensor.reset_step() + hr = EventMesh.publish("get_old_hr_data") + if hr != 0: + EventMesh.publish("set_old_hr_data", 0) + + spo2 = EventMesh.publish("get_old_spo2_data") + if spo2 != 0: + EventMesh.publish("set_old_spo2_data", 0) + self.clear_step = 1 + else: + self.clear_step = 0 else: - self.clear_step = 0 - else: - self.clear_step = 0 - - """电量小于20% 5分钟提醒一次""" - get_low_btn = EventMesh.publish("get_low_bat_btn")# - battery = EventMesh.publish("screen_get_battery") - # print("get_low_btn:{} self.bat_time:{}".format(get_low_btn,self.bat_time)) - if get_low_btn != None:#低电使能开关 - if get_low_btn == 1: - self.bat_time+=10 - # print("date_tmp:{} self.bat_time:{}".format(date_tmp,self.bat_time)) - - if self.bat_time > 5*60: - self.bat_time = 0 - if battery[1] <= 20 and battery[1] > 0: - if battery[0] != "1": - EventMesh.publish("load_screen", {"screen": "LOW_POWER"}) - else: - self.bat_time = 0 - - """未联网提示关机""" - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 - if battery[0] == "0": - self.no_smi_count+=10 - if self.no_smi_count > (15*60) and self.no_smi_state == 0: + if self.clear_step == 1: + self.clear_step = 0 + + + + """未联网提示关机""" + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 0:#未联网提示关机 + if battery[0] == "0": + self.no_smi_count+=10 + if self.no_smi_count > (15*60) and self.no_smi_state == 0: + self.no_smi_count = 0 + self.no_smi_state = 1 + EventMesh.publish("load_screen", {"screen": "no_sim_auto_screen"}) + else: self.no_smi_count = 0 - self.no_smi_state = 1 - EventMesh.publish("load_screen", {"screen": "no_sim_auto_screen"}) + self.no_smi_state = 0 else: self.no_smi_count = 0 self.no_smi_state = 0 - else: - self.no_smi_count = 0 - self.no_smi_state = 0 - if battery[0] == "1": - if battery[1] >= 100: - if self.charge_full_count > 60 and self.charge_full_count % (60*10) == 0:#每十分钟提醒一次 - EventMesh.publish("load_screen", {"screen": "charge_full"}) - self.charge_full_count+=10 - else: - self.charge_full_count = 0 - - """检测短信已满,提示是否清掉""" - msg_nums = sms.getMsgNums() #获取短信条数 - if(msg_nums != -1): - sms_data = sms.getSaveLoc() - sms_max = sms_data[0][2] - if msg_nums >= sms_max-1: - self.sms_full_flag+=10 - if self.sms_full_flag >= 120: - self.sms_full_flag=0 - EventMesh.publish("load_screen", {"screen": "message_full"}) + if battery[0] == "1": + if battery[1] >= 100: + if self.charge_full_count > 60 and self.charge_full_count % (60*10) == 0:#每十分钟提醒一次 + EventMesh.publish("load_screen", {"screen": "charge_full"}) + self.charge_full_count+=10 else: - self.sms_full_flag = 0 - + self.charge_full_count = 0 + + + """检测短信已满,提示是否清掉""" + msg_nums = sms.getMsgNums() #获取短信条数 + if(msg_nums != -1): + sms_data = sms.getSaveLoc() + if sms_data != -1: + sms_max = sms_data[0][2] + if msg_nums >= sms_max-1: + self.sms_full_flag+=10 + if self.sms_full_flag >= 120: + self.sms_full_flag=0 + EventMesh.publish("load_screen", {"screen": "message_full"}) + else: + self.sms_full_flag = 0 + except Exception as e: + usys.print_exception(e) + EventMesh.txt_log("publish_event3:".format(e)) + """定时测量心率,血氧,体温""" WEAR = EventMesh.publish(constants.EVENT.GET_WEAR)#佩戴数据 + if WEAR == None : + WEAR = 0 + + #佩戴检测 + WEAR = EventMesh.publish(constants.EVENT.GET_WEAR)#佩戴数据 + if self.wear != WEAR: + remove_sw = EventMesh.publish("get_storage_config","remove_sw") + if remove_sw == "1":#开启了佩戴检测的开关 + dev_state = EventMesh.publish("get_dev_state") + if WEAR != 1: + tmp = 1 << 3 + tmp = ~tmp + tmp = 1 << 20 + dev_state = dev_state|tmp #第20位=1 + + print("佩戴检测:{}".format(dev_state)) + EventMesh.publish("set_dev_state",dev_state) + EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,dev_state]) #开始AL定位,发送报警 + #EventMesh.publish(constants.PROTOCOL.HELP_SEND,65) + self.wear = WEAR + self.get_hr_state = EventMesh.publish("get_hr_state") + if self.get_hr_state == None : + self.get_hr_state = 0 self.get_spo2_state = EventMesh.publish("get_spo2_state") + if self.get_spo2_state == None : + self.get_spo2_state = 0 get_temp_time = EventMesh.publish("get_temp_time") get_temp_state = EventMesh.publish("get_temp_state") + get_bp_state = EventMesh.publish("get_bp_state") + if get_bp_state == None: + get_bp_state = 0 + if get_temp_state == None : + get_temp_state = 0 hr_time = {} hr_time = EventMesh.publish("get_time_hr_spo2")#获取时间是否大于0 if get_temp_state != None : #突然脱腕 if get_temp_state > 1 and WEAR != 1: EventMesh.publish(constants.EVENT.STOP_TEMP) EventMesh.publish("set_temp_state",0) - if (self.get_hr_state > 1 or self.get_spo2_state > 1) and WEAR != 1: + if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1) and WEAR != 1: if self.get_hr_state > 1 : EventMesh.publish("set_hr_state",0)#2代表后台进入测试,定时测心率 1ui界面测试洗心率 EventMesh.publish(constants.EVENT.STOP_HEART) elif self.get_spo2_state > 1: EventMesh.publish("set_spo2_state",0)#2代表后台进入测试 EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - if 0: + elif get_bp_state > 1: + EventMesh.publish("set_bp_state",0)#2代表后台进入测试 + self.old_bp_time = 0 + EventMesh.publish(constants.EVENT.STOP_HEART) + + + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 and battery[0] != "1"and WEAR == 1: + get_hr_state = EventMesh.publish("get_hr_state") + get_spo2_state = EventMesh.publish("get_spo2_state") + get_bp_state = EventMesh.publish("get_bp_state") + + if time_tmp < self.SENSOR_time: + self.SENSOR_time = time_tmp + + if get_hr_state == None: + get_hr_state = 0 + + if get_spo2_state == None: + get_spo2_state = 0 + + if get_bp_state == None: + get_bp_state = 0 + + + if get_bp_state != None: + if get_bp_state == 3: + self.old_bp_time+=1 + if self.old_bp_time == 1: + EventMesh.publish("set_bp_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_HEART) + # print("self.HR_Onestate....3..:{} {} {} {} {}".format(self.HR_Onestate,self.get_hr_state,self.get_spo2_state,self.Hr_Need_Open,self.Spo2_Need_Open)) + elif self.old_bp_time > 6: + self.old_bp_time = 0 + EventMesh.publish("set_bp_state",0)#2代表后台进入测试 + blood_data = EventMesh.publish("get_autoblood_value") + if blood_data == None: + blood_data[0] = 0 + blood_data[1] = 0 + + max_value = blood_data[0] + min_value = blood_data[1] + if max_value != 0 and min_value != 0: + EventMesh.publish("set_old_blood_data",[max_value,min_value]) + + EventMesh.publish(constants.PROTOCOL.BLOOD_SEND,[max_value,min_value]) + EventMesh.publish(constants.EVENT.STOP_HEART) + else: + self.old_bp_time = 0 + else: + self.old_bp_time = 0 + + # print("get_temp_time:{} self.temp_one_state:{}".format(get_temp_time,self.temp_one_state)) if get_temp_time != None:#定时测量体温 @@ -959,19 +1275,29 @@ class DeviceInfoManager(Abstract): elif (time_tmp-self.temp_time) >= 60 and self.temp_state == 1: self.temp_state = 0 self.temp_one_state = 0 - temp = EventMesh.publish(constants.EVENT.GET_TEMP) - temp += 0.5 - if temp < 25 or temp > 42: + temp = EventMesh.publish("optimize_temp") + if temp == None: temp = 0 - tmp_f = str(temp).split('.')[0] - tmp_f_tmp = int(tmp_f) - + # temp = EventMesh.publish(constants.EVENT.GET_TEMP) + # temp += 0.5 + # if temp < 25 or temp > 42: + # temp = 0 + tmp_f_tmp = 0 + tmp_d_tmp = 0 + if str(temp).find(".") != -1: + tmp_f = str(temp).split('.')[0] + tmp_f_tmp = int(tmp_f) + + tmp_d = str(temp).split('.')[1][:1] + tmp_d_tmp = int(tmp_d) + else: + tmp_f_tmp = temp - tmp_d = str(temp).split('.')[1][:1] - tmp_d_tmp = int(tmp_d) if temp != 0: EventMesh.publish("set_history_temp_value",temp) EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp]) + num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp) + EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num]) EventMesh.publish(constants.EVENT.STOP_TEMP) print("AUTO temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp)) EventMesh.publish("set_temp_state",0) @@ -986,21 +1312,29 @@ class DeviceInfoManager(Abstract): EventMesh.publish(constants.EVENT.START_TEMP) elif self.temp_one_state > 6: self.temp_one_state = 0 - temp = EventMesh.publish(constants.EVENT.GET_TEMP) - temp += 0.5 - if temp < 25 or temp > 42: + # temp = EventMesh.publish(constants.EVENT.GET_TEMP) + # temp += 0.5 + # if temp < 25 or temp > 42: + # temp = 0 + temp = EventMesh.publish("optimize_temp") + if temp == None: temp = 0 - tmp_f = str(temp).split('.')[0] - tmp_f_tmp = int(tmp_f) - - - tmp_d = str(temp).split('.')[1][:1] - tmp_d_tmp = int(tmp_d) + tmp_f_tmp = 0 + tmp_d_tmp = 0 + if str(temp).find(".") != -1: + tmp_f = str(temp).split('.')[0] + tmp_f_tmp = int(tmp_f) + + tmp_d = str(temp).split('.')[1][:1] + tmp_d_tmp = int(tmp_d) + else: + tmp_f_tmp = temp if temp != None: if temp != 0: EventMesh.publish("set_history_temp_value",temp) EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp]) - EventMesh.publish("set_history_temp_value",temp) + num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp) + EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num]) EventMesh.publish(constants.EVENT.STOP_TEMP) print("once temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp)) EventMesh.publish("set_temp_state",0) @@ -1027,326 +1361,348 @@ class DeviceInfoManager(Abstract): EventMesh.publish(constants.EVENT.START_TEMP) elif self.temp_one_state > 6: self.temp_one_state = 0 - temp = EventMesh.publish(constants.EVENT.GET_TEMP) - temp += 0.5 - if temp < 25 or temp > 42: + # temp = EventMesh.publish(constants.EVENT.GET_TEMP) + # temp += 0.5 + # if temp < 25 or temp > 42: + # temp = 0 + temp = EventMesh.publish("optimize_temp") + if temp == None: temp = 0 - tmp_f = str(temp).split('.')[0] - tmp_f_tmp = int(tmp_f) - - tmp_d = str(temp).split('.')[1][:1] - tmp_d_tmp = int(tmp_d) + tmp_f_tmp = 0 + tmp_d_tmp = 0 + if str(temp).find(".") != -1: + tmp_f = str(temp).split('.')[0] + tmp_f_tmp = int(tmp_f) + + tmp_d = str(temp).split('.')[1][:1] + tmp_d_tmp = int(tmp_d) + else: + tmp_f_tmp = temp if temp != None: if temp != 0: EventMesh.publish("set_history_temp_value",temp) EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp]) + num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp) + EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num]) EventMesh.publish(constants.EVENT.STOP_TEMP) print("AUTO once temp:{} tmp_f:{} tmp_f_tmp:{} tmp_d:{} tmp_d_tmp:{}".format(temp,tmp_f,tmp_f_tmp,tmp_d,tmp_d_tmp)) EventMesh.publish("set_temp_state",0) - - self.mearsure_btn = int(hr_time[0]) - self.mearsure_timer = int(hr_time[1]) - if self.mearsure_btn != None and self.mearsure_timer != None: - print("hr......01....{} {}\r\n".format(hr_time[0],hr_time[1])) - if self.mearsure_btn > 0: - if self.mearsure_timer > 0: - #print("get_hr_state:{} get_spo2_state:{} self.old_time:{} mearsure_timer:{}".format(self.get_hr_state,self.get_spo2_state,self.old_time,mearsure_timer)) - if self.get_hr_state != 1 and self.get_spo2_state != 1: - if self.get_hr_state == 0 and self.get_spo2_state == 0: - if self.HR_state == 0 or self.HR_state == 3: - self.HR_Onestate = 0 - self.HR_OneTime = 0 - - if self.old_time != self.mearsure_timer:#重复修改测量间隔时间 - self.SENSOR_time = time_tmp#防止改变时间的时候正在开启测量突然10s就停止测量 - if self.get_hr_state == 2 and self.HR_state == 1:#自动检测的心率还在测量立马关了测试 - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_old_hr_data",heart_value) - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value) - print("stop debug1") - EventMesh.publish(constants.EVENT.STOP_HEART) - self.HR_state = 0 - elif self.get_spo2_state == 2 and self.HR_state == 2: - self.HR_state = 0 - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if spo2_value > 85 and spo2_value != None: - EventMesh.publish("set_old_spo2_data",spo2_value) - EventMesh.publish("set_history_spo2_value",spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - self.old_time = self.mearsure_timer - - if self.HR_state == 3 or self.HR_state == 0:# - if (time_tmp - self.SENSOR_time) >= self.mearsure_timer: - if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量没有完毕优先测量间隔时间测量的 - if self.get_hr_state == 3: - print("stop debug2") + + if hr_time[0] != None: + self.mearsure_btn = int(hr_time[0]) + self.mearsure_timer = int(hr_time[1]) + if self.mearsure_btn != None and self.mearsure_timer != None: + if get_hr_state != None and get_bp_state != None: + if get_bp_state == 0: + print("hr......01....{} {}\r\n".format(hr_time[0],hr_time[1])) + if self.mearsure_btn > 0: + if self.mearsure_timer > 0: + #print("get_hr_state:{} get_spo2_state:{} self.old_time:{} mearsure_timer:{}".format(self.get_hr_state,self.get_spo2_state,self.old_time,mearsure_timer)) + if self.get_hr_state != 1 and self.get_spo2_state != 1: + if self.get_hr_state == 0 and self.get_spo2_state == 0: + if self.HR_state == 0 or self.HR_state == 3: + self.HR_Onestate = 0 + self.HR_OneTime = 0 + + if self.old_time != self.mearsure_timer:#重复修改测量间隔时间 + self.SENSOR_time = time_tmp#防止改变时间的时候正在开启测量突然10s就停止测量 + if self.get_hr_state == 2 and self.HR_state == 1:#自动检测的心率还在测量立马关了测试 + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_old_hr_data",heart_value) + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value) + print("stop debug1") + EventMesh.publish(constants.EVENT.STOP_HEART) + self.HR_state = 0 + elif self.get_spo2_state == 2 and self.HR_state == 2: + self.HR_state = 0 + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + if spo2_value > 85 and spo2_value != None: + EventMesh.publish("set_old_spo2_data",spo2_value) + EventMesh.publish("set_history_spo2_value",spo2_value) + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + self.old_time = self.mearsure_timer + + if self.HR_state == 3 or self.HR_state == 0:# + if (time_tmp - self.SENSOR_time) >= self.mearsure_timer: + if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量没有完毕优先测量间隔时间测量的 + if self.get_hr_state == 3: + print("stop debug2") + EventMesh.publish(constants.EVENT.STOP_HEART) + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_old_hr_data",heart_value) + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value) + + elif self.get_spo2_state == 3: + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + if spo2_value > 85 and spo2_value != None: + EventMesh.publish("set_history_spo2_value",spo2_value) + EventMesh.publish("set_old_spo2_data",spo2_value) + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + + self.HR_state = 0 + self.SENSOR_time = time_tmp + self.SENSOR_time = time_tmp + self.HR_state = 0 + + #print("time_tmp :{} self.SENSOR_time :{} time_tmp - self.SENSOR_time:{} self.HR_state:{}".format(time_tmp,self.SENSOR_time,time_tmp - self.SENSOR_time,self.HR_state)) + if (time_tmp - self.SENSOR_time) == 0 and self.HR_state == 0: + print("START_HEART:1") + EventMesh.publish("set_hr_state",2)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_HEART) + self.HR_state = 1 + self.HR_Onestate = 0 + self.HR_OneTime = 0 + elif (time_tmp - self.SENSOR_time) >= 60 and self.HR_state == 1: + EventMesh.publish("set_hr_state",0)#2代表后台进入测试 + print("stop debug3") EventMesh.publish(constants.EVENT.STOP_HEART) heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: + print("heart_value:{}".format(heart_value)) + if heart_value >= 50 and heart_value != None: EventMesh.publish("set_old_hr_data",heart_value) EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value) - - elif self.get_spo2_state == 3: - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if spo2_value > 85 and spo2_value != None: - EventMesh.publish("set_history_spo2_value",spo2_value) - EventMesh.publish("set_old_spo2_data",spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - - self.HR_state = 0 - self.SENSOR_time = time_tmp - self.SENSOR_time = time_tmp - self.HR_state = 0 - - #print("time_tmp :{} self.SENSOR_time :{} time_tmp - self.SENSOR_time:{} self.HR_state:{}".format(time_tmp,self.SENSOR_time,time_tmp - self.SENSOR_time,self.HR_state)) - if (time_tmp - self.SENSOR_time) == 0 and self.HR_state == 0: - print("START_HEART:1") - EventMesh.publish("set_hr_state",2)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_HEART) - self.HR_state = 1 - self.HR_Onestate = 0 - self.HR_OneTime = 0 - elif (time_tmp - self.SENSOR_time) >= 60 and self.HR_state == 1: - EventMesh.publish("set_hr_state",0)#2代表后台进入测试 - print("stop debug3") - EventMesh.publish(constants.EVENT.STOP_HEART) - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - print("heart_value:{}".format(heart_value)) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_old_hr_data",heart_value) - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - #获取心率数据上传数据app - print("STOP_HEART:") - - self.HR_state = 3 - # EventMesh.publish("set_spo2_state",2)#2代表后台进入血氧测试 - # EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 - # print("START_BLOOD_OXYGEN:") - # elif (time_tmp - self.SENSOR_time) >= 120 and self.HR_state == 2:#有需要再打开 - # print("STOP_BLOOD_OXYGEN:") - # EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - # EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 - # spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - # print("spo2_value:{}".format(spo2_value)) - # if spo2_value > 85 and spo2_value != None: - # EventMesh.publish("set_old_spo2_data",spo2_value) - # EventMesh.publish("set_history_spo2_value",spo2_value) - # EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - # self.HR_state = 3 - else: - self.HR_state = 0 - self.old_time = self.mearsure_timer - - if self.HR_state == 3 or self.HR_state == 0:#只有不在测量的时候才测单次的 - if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量 - self.HR_state = 0 - self.HR_OneTime+=1 - if self.HR_OneTime == 1 and self.HR_Onestate == 0: - print("hr..........\r\n") - if self.get_hr_state == 3: - self.Hr_Need_Open = 1 - EventMesh.publish("set_hr_state",3)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_HEART) - else: - self.Hr_Need_Open = 0 - - if self.get_spo2_state == 3 and self.Hr_Need_Open == 0: - self.Spo2_Need_Open = 1 - EventMesh.publish("set_spo2_state",3)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 + #获取心率数据上传数据app + print("STOP_HEART:") + + self.HR_state = 3 + # EventMesh.publish("set_spo2_state",2)#2代表后台进入血氧测试 + # EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + # print("START_BLOOD_OXYGEN:") + # elif (time_tmp - self.SENSOR_time) >= 120 and self.HR_state == 2:#有需要再打开 + # print("STOP_BLOOD_OXYGEN:") + # EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + # EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 + # spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + # print("spo2_value:{}".format(spo2_value)) + # if spo2_value > 85 and spo2_value != None: + # EventMesh.publish("set_old_spo2_data",spo2_value) + # EventMesh.publish("set_history_spo2_value",spo2_value) + # EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + # self.HR_state = 3 else: - self.Spo2_Need_Open = 0 - self.HR_Onestate = 1 - # print("self.HR_Onestate....3..:{} {} {} {} {}".format(self.HR_Onestate,self.get_hr_state,self.get_spo2_state,self.Hr_Need_Open,self.Spo2_Need_Open)) - elif self.HR_OneTime > 6 and self.HR_Onestate == 1: - # print("self.HR_Onestate...4....:{} {} {} {} {}".format(self.HR_Onestate,self.get_hr_state,self.get_spo2_state,self.Hr_Need_Open,self.Spo2_Need_Open)) - if self.Hr_Need_Open == 1:#需要关闭心率测量 - print("stop debug4") - EventMesh.publish(constants.EVENT.STOP_HEART) - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - EventMesh.publish("set_old_hr_data",heart_value) - - if self.Spo2_Need_Open == 0 and self.get_spo2_state == 3: - EventMesh.publish("set_spo2_state",3)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + self.HR_state = 0 + self.old_time = self.mearsure_timer + + if self.HR_state == 3 or self.HR_state == 0:#只有不在测量的时候才测单次的 + if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量 + self.HR_state = 0 + self.HR_OneTime+=1 + if self.HR_OneTime == 1 and self.HR_Onestate == 0: + print("hr..........\r\n") + if self.get_hr_state == 3: + self.Hr_Need_Open = 1 + EventMesh.publish("set_hr_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_HEART) + else: + self.Hr_Need_Open = 0 + + if self.get_spo2_state == 3 and self.Hr_Need_Open == 0: + self.Spo2_Need_Open = 1 + EventMesh.publish("set_spo2_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + else: + self.Spo2_Need_Open = 0 + self.HR_Onestate = 1 + # print("self.HR_Onestate....3..:{} {} {} {} {}".format(self.HR_Onestate,self.get_hr_state,self.get_spo2_state,self.Hr_Need_Open,self.Spo2_Need_Open)) + elif self.HR_OneTime > 6 and self.HR_Onestate == 1: + # print("self.HR_Onestate...4....:{} {} {} {} {}".format(self.HR_Onestate,self.get_hr_state,self.get_spo2_state,self.Hr_Need_Open,self.Spo2_Need_Open)) + if self.Hr_Need_Open == 1:#需要关闭心率测量 + print("stop debug4") + EventMesh.publish(constants.EVENT.STOP_HEART) + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 + EventMesh.publish("set_old_hr_data",heart_value) - self.HR_Onestate = 2 - self.set_hsenor_crt = 2#血氧关闭 + if self.Spo2_Need_Open == 0 and self.get_spo2_state == 3: + EventMesh.publish("set_spo2_state",3)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + + self.HR_Onestate = 2 + self.set_hsenor_crt = 2#血氧关闭 + else: + self.HR_Onestate = 0 + self.HR_OneTime = 0 + self.set_hsenor_crt = 0# + + EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + else: + if self.Spo2_Need_Open == 1:#停止测试血氧 + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#K开血氧 + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + + if spo2_value > 85 and spo2_value != None: + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + EventMesh.publish("set_old_spo2_data",spo2_value) + EventMesh.publish("set_history_spo2_value",spo2_value) + if self.Hr_Need_Open == 0 and self.get_hr_state == 3: + EventMesh.publish("set_hr_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_HEART) + self.HR_Onestate = 2 + self.set_hsenor_crt = 1#心率 + else: + self.HR_Onestate = 0 + self.HR_OneTime = 0 + self.set_hsenor_crt = 2#血氧关闭 + + + elif self.HR_OneTime > 6+6 and self.HR_Onestate == 2: + print("HR_OneTime:....05") + if self.set_hsenor_crt == 2: + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + if spo2_value > 85 and spo2_value != None: + EventMesh.publish("set_history_spo2_value",spo2_value) + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + EventMesh.publish("set_old_spo2_data",spo2_value) + elif self.set_hsenor_crt == 1: + EventMesh.publish("set_hr_state",0)#0代表g关闭测试 + print("stop debug5") + EventMesh.publish(constants.EVENT.STOP_HEART) + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish("set_old_hr_data",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 + self.HR_Onestate = 0 else: + if self.get_spo2_state == 2 or self.get_hr_state == 2:#单次测量 + if self.get_hr_state == 2: + EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_HEART) + elif self.get_spo2_state == 2: + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + self.HR_state = 0 self.HR_Onestate = 0 self.HR_OneTime = 0 - self.set_hsenor_crt = 0# - - EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - else: - if self.Spo2_Need_Open == 1:#停止测试血氧 - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#K开血氧 - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - - if spo2_value > 85 and spo2_value != None: - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - EventMesh.publish("set_old_spo2_data",spo2_value) - EventMesh.publish("set_history_spo2_value",spo2_value) - if self.Hr_Need_Open == 0 and self.get_hr_state == 3: + self.set_hsenor_crt = 0 + else: + #print("hr......01....{} {} self.HR_Onestate {} {}".format(self.get_hr_state,self.get_spo2_state,self.HR_OneTime,self.HR_Onestate)) + self.SENSOR_time = time_tmp#进入最后一次的时间戳 + self.old_time = 0 + + self.set_hsenor_crt = 0 + if self.get_hr_state != 1 and self.get_spo2_state != 1:#没有设置间隔时间单次测量 + if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量 + self.HR_state = 0 + self.HR_OneTime+=1 + if self.HR_OneTime == 1 and self.HR_Onestate == 0: + if self.get_hr_state == 3: + self.Hr_Need_Open = 1 EventMesh.publish("set_hr_state",3)#2代表后台进入测试 EventMesh.publish(constants.EVENT.START_HEART) - self.HR_Onestate = 2 - self.set_hsenor_crt = 1#心率 else: - self.HR_Onestate = 0 - self.HR_OneTime = 0 - self.set_hsenor_crt = 2#血氧关闭 - - - elif self.HR_OneTime > 6+6 and self.HR_Onestate == 2: - print("HR_OneTime:....05") - if self.set_hsenor_crt == 2: - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if spo2_value > 85 and spo2_value != None: - EventMesh.publish("set_history_spo2_value",spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - EventMesh.publish("set_old_spo2_data",spo2_value) - elif self.set_hsenor_crt == 1: - EventMesh.publish("set_hr_state",0)#0代表g关闭测试 - print("stop debug5") - EventMesh.publish(constants.EVENT.STOP_HEART) - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish("set_old_hr_data",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - self.HR_Onestate = 0 - else: - if self.get_spo2_state == 2 or self.get_hr_state == 2:#单次测量 - if self.get_hr_state == 2: - EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_HEART) - elif self.get_spo2_state == 2: - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) - self.HR_state = 0 - self.HR_Onestate = 0 - self.HR_OneTime = 0 - self.set_hsenor_crt = 0 - else: - #print("hr......01....{} {} self.HR_Onestate {} {}".format(self.get_hr_state,self.get_spo2_state,self.HR_OneTime,self.HR_Onestate)) - self.SENSOR_time = time_tmp#进入最后一次的时间戳 - self.old_time = 0 - - self.set_hsenor_crt = 0 - if self.get_hr_state != 1 and self.get_spo2_state != 1:#没有设置间隔时间单次测量 - if self.get_spo2_state == 3 or self.get_hr_state == 3:#单次测量 - self.HR_state = 0 - self.HR_OneTime+=1 - if self.HR_OneTime == 1 and self.HR_Onestate == 0: - if self.get_hr_state == 3: - self.Hr_Need_Open = 1 - EventMesh.publish("set_hr_state",3)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_HEART) - else: - self.Hr_Need_Open = 0 + self.Hr_Need_Open = 0 - if self.get_spo2_state == 3 and self.Hr_Need_Open == 0: - self.Spo2_Need_Open = 1 - EventMesh.publish("set_spo2_state",3)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 - else: - self.Spo2_Need_Open = 0 - self.HR_Onestate = 1 - - elif self.HR_OneTime > 6 and self.HR_Onestate == 1: - print("stop_heart Onec ") - if self.Hr_Need_Open == 1:#需要关闭心率测量 - print("stop debug6") - EventMesh.publish(constants.EVENT.STOP_HEART) - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - print("stop_heart heart_value:{}".format(heart_value)) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_old_hr_data",heart_value) - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - if self.Spo2_Need_Open == 0 and self.get_spo2_state == 3: - EventMesh.publish("set_spo2_state",3)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 - self.HR_Onestate = 2 - self.set_hsenor_crt = 2#血氧关闭 + if self.get_spo2_state == 3 and self.Hr_Need_Open == 0: + self.Spo2_Need_Open = 1 + EventMesh.publish("set_spo2_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + else: + self.Spo2_Need_Open = 0 + self.HR_Onestate = 1 + + elif self.HR_OneTime > 6 and self.HR_Onestate == 1: + print("stop_heart Onec ") + if self.Hr_Need_Open == 1:#需要关闭心率测量 + print("stop debug6") + EventMesh.publish(constants.EVENT.STOP_HEART) + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + print("stop_heart heart_value:{}".format(heart_value)) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_old_hr_data",heart_value) + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 + if self.Spo2_Need_Open == 0 and self.get_spo2_state == 3: + EventMesh.publish("set_spo2_state",3)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧 + self.HR_Onestate = 2 + self.set_hsenor_crt = 2#血氧关闭 + else: + self.HR_Onestate = 0 + self.HR_OneTime = 0 + self.set_hsenor_crt = 0# + EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + else: + if self.Spo2_Need_Open == 1:#停止测试血氧 + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#K开血氧 + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + print("spo2_value:{}.......01..".format(spo2_value)) + if spo2_value > 85 and spo2_value != None: + EventMesh.publish("set_old_spo2_data",spo2_value) + EventMesh.publish("set_history_spo2_value",spo2_value) + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + if self.Hr_Need_Open == 0 and self.get_hr_state == 3: + EventMesh.publish("set_hr_state",3)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.START_HEART) + self.HR_Onestate = 2 + self.set_hsenor_crt = 1#心率 + else: + self.HR_Onestate = 0 + self.HR_OneTime = 0 + self.set_hsenor_crt = 2#血氧关闭 + print("STOP_BLOOD_OXYGEN:....06.....") + + elif self.HR_OneTime > 6+6 and self.HR_Onestate == 2: + if self.set_hsenor_crt == 2: + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 + spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) + if spo2_value > 85 and spo2_value != None: + EventMesh.publish("set_old_spo2_data",spo2_value) + EventMesh.publish("set_history_spo2_value",spo2_value) + EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) + elif self.set_hsenor_crt == 1: + EventMesh.publish("set_hr_state",0)#0代表g关闭测试 + print("stop debug7") + EventMesh.publish(constants.EVENT.STOP_HEART) + heart_value = EventMesh.publish(constants.EVENT.GET_HEART) + if heart_value >= 50 and heart_value != None: + EventMesh.publish("set_old_hr_data",heart_value) + EventMesh.publish("set_history_hr_value",heart_value) + EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 + self.HR_Onestate = 0 else: + if self.get_spo2_state == 2 or self.get_hr_state == 2:#单次测量 + if self.get_hr_state == 2: + EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_HEART) + elif self.get_spo2_state == 2: + EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 + EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) self.HR_Onestate = 0 self.HR_OneTime = 0 - self.set_hsenor_crt = 0# - EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - else: - if self.Spo2_Need_Open == 1:#停止测试血氧 - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#K开血氧 - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - print("spo2_value:{}.......01..".format(spo2_value)) - if spo2_value > 85 and spo2_value != None: - EventMesh.publish("set_old_spo2_data",spo2_value) - EventMesh.publish("set_history_spo2_value",spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - if self.Hr_Need_Open == 0 and self.get_hr_state == 3: - EventMesh.publish("set_hr_state",3)#2代表后台进入测试 - EventMesh.publish(constants.EVENT.START_HEART) - self.HR_Onestate = 2 - self.set_hsenor_crt = 1#心率 - else: - self.HR_Onestate = 0 - self.HR_OneTime = 0 - self.set_hsenor_crt = 2#血氧关闭 - print("STOP_BLOOD_OXYGEN:....06.....") - - elif self.HR_OneTime > 6+6 and self.HR_Onestate == 2: - if self.set_hsenor_crt == 2: - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)#停止血氧测试 - spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) - if spo2_value > 85 and spo2_value != None: - EventMesh.publish("set_old_spo2_data",spo2_value) - EventMesh.publish("set_history_spo2_value",spo2_value) - EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value) - elif self.set_hsenor_crt == 1: - EventMesh.publish("set_hr_state",0)#0代表g关闭测试 - print("stop debug7") - EventMesh.publish(constants.EVENT.STOP_HEART) - heart_value = EventMesh.publish(constants.EVENT.GET_HEART) - if heart_value > 50 and heart_value != None: - EventMesh.publish("set_old_hr_data",heart_value) - EventMesh.publish("set_history_hr_value",heart_value) - EventMesh.publish(constants.PROTOCOL.HEART_SEND,heart_value)#上传心率数据 - self.HR_Onestate = 0 + self.old_time = 0 else: - if self.get_spo2_state == 2 or self.get_hr_state == 2:#单次测量 - if self.get_hr_state == 2: - EventMesh.publish("set_hr_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_HEART) - elif self.get_spo2_state == 2: - EventMesh.publish("set_spo2_state",0)#2代表后台进入血氧测试 - EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + self.old_temp_time = 0 + self.old_time = 0 + self.SENSOR_time = time_tmp self.HR_Onestate = 0 self.HR_OneTime = 0 - self.old_time = 0 + self.HR_state = 0 + self.old_time = 0 + self.set_hsenor_crt = 0 + else: - self.old_temp_time = 0 - self.old_time = 0 if battery[0] == "1": get_hr_state = EventMesh.publish("get_hr_state") get_spo2_state = EventMesh.publish("get_spo2_state") - if get_hr_state != None and get_spo2_state != None: + get_bp_state = EventMesh.publish("get_bp_state") + if get_hr_state != None and get_spo2_state != None and get_bp_state != None: if get_hr_state == 2 or get_hr_state == 3: EventMesh.publish("set_hr_state",0)#2代表后台进入测试,定时测心率 1ui界面测试洗心率 print("stop debug8") @@ -1354,47 +1710,59 @@ class DeviceInfoManager(Abstract): elif get_spo2_state == 2 or get_spo2_state == 3: EventMesh.publish("set_spo2_state",0)#2代表后台进入测试 EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN) + print("stop debug13") + elif get_bp_state == 2 or get_bp_state == 3: + EventMesh.publish("set_bp_state",0)#2代表后台进入测试 + EventMesh.publish(constants.EVENT.STOP_HEART) + print("stop debug14") if get_temp_time != None: get_temp_state = EventMesh.publish("get_temp_state") if get_temp_state == 2 or get_temp_state == 3: self.temp_one_state = 0 self.temp_state = 0 - temp = EventMesh.publish(constants.EVENT.GET_TEMP) - temp += 0.5 - if temp < 25 or temp > 42: + # temp = EventMesh.publish(constants.EVENT.GET_TEMP) + # temp += 0.5 + # if temp < 25 or temp > 42: + # temp = 0 + temp = EventMesh.publish("optimize_temp") + if temp == None: temp = 0 - - tmp_f = str(temp).split('.')[0] - tmp_f_tmp = int(tmp_f) + tmp_f_tmp = 0 + tmp_d_tmp = 0 + if str(temp).find(".") != -1: + tmp_f = str(temp).split('.')[0] + tmp_f_tmp = int(tmp_f) + + tmp_d = str(temp).split('.')[1][:1] + tmp_d_tmp = int(tmp_d) + else: + tmp_f_tmp = temp - tmp_d = str(temp).split('.')[1][:1] - tmp_d_tmp = int(tmp_d) EventMesh.publish("set_temp_state",0) if temp != None: if temp != 0: EventMesh.publish("set_history_temp_value",temp) EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp]) + num = str(tmp_f_tmp)+"."+ str(tmp_d_tmp) + EventMesh.publish(constants.PROTOCOL.BTEMP2_SEND,[1,num]) EventMesh.publish(constants.EVENT.STOP_TEMP) + self.old_temp_time = 0 + self.old_time = 0 self.SENSOR_time = time_tmp self.HR_Onestate = 0 self.HR_OneTime = 0 self.HR_state = 0 self.old_time = 0 self.set_hsenor_crt = 0 + self.old_bp_time = 0 + - if self.class_count < 60: - self.class_count+=10 - else: - # print("self.class_count",self.class_count) - EventMesh.publish("get_class_in_time_page") - self.normal_alarm() + self.normal_alarm() - - #普通闹钟 + + #普通闹钟 def normal_alarm(self): - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) data = RTC().datetime() hour = data[4] min = data[5] @@ -1411,23 +1779,23 @@ class DeviceInfoManager(Abstract): if self.normal_flag == 1: self.normal_flag = 0 self.normal_count = 0 - normal_alarm_data = [] - normal_alarm_data = EventMesh.publish("get_storage_config","normal_alarm") + normal_alarm = [] + normal_alarm = EventMesh.publish("get_storage_config","normal_alarm") # EventMesh.debug_log("sleep info2",sleep,cur_total_min) if self.normal_flag == 1:#表示闹钟响过清除标志 self.normal_count+=1 if self.normal_count > 6: self.normal_count = 0 self.normal_flag = 0 - if normal_alarm_data != None: - if len(normal_alarm_data) != 0 and normal_alarm_data != []: + if normal_alarm != None: + if len(normal_alarm) != 0 and normal_alarm != []: j = 0 - for i in range(len(normal_alarm_data)): - # EventMesh.debug_log("normal_alarm_data normal_alarm_data 33",normal_alarm,j) - normalalarm_hour = normal_alarm_data[j]["hour"] - normalalarm_min = normal_alarm_data[j]["min"] - normalalarm_day = normal_alarm_data[j]["day"] - normalalarm_enale = normal_alarm_data[j]["enable"] + for i in range(len(normal_alarm)): + # EventMesh.debug_log("normal_alarm normal_alarm 33",normal_alarm,j) + normalalarm_hour = normal_alarm[j]["hour"] + normalalarm_min = normal_alarm[j]["min"] + normalalarm_day = normal_alarm[j]["day"] + normalalarm_enale = normal_alarm[j]["enable"] normalalarm_totalmin = int(normalalarm_hour)*60+int(normalalarm_min) # EventMesh.debug_log("wake alarm",normalalarm_hour,sleep_min,sleep_day,sleep_enale,sleep_totalmin,week) if normalalarm_day == []:#单次闹钟只响一次 @@ -1435,10 +1803,10 @@ class DeviceInfoManager(Abstract): if normalalarm_totalmin == cur_total_min:#14:00 self.normal_count = 0 self.normal_flag = 0 - normal_alarm_data[j]["enable"] = 0 + normal_alarm[j]["enable"] = 0 # EventMesh.debug_log("wakeup wakeup1",sleep,j) - EventMesh.publish("set_storage_config",["normal_alarm",normal_alarm_data])#删除之后重新保存 + EventMesh.publish("set_storage_config",["normal_alarm",normal_alarm])#删除之后重新保存 EventMesh.publish("push_update_alarm_show") # new_data=EventMesh.publish("get_storage_config","normal_alarm") # print("normal wakeup1",new_data,j) @@ -1533,17 +1901,20 @@ class DeviceInfoManager(Abstract): """ 获取步数 """ - XYZ = self.gsensor.get_x_y_z() + XYZ = [0,0,0] + if self.gsensor !=None: + XYZ = self.gsensor.get_x_y_z() tmp = 0 - - tmp = self.gsensor.get_step() + step = [0,0,0,0] + if self.gsensor !=None: + tmp = self.gsensor.get_step() # print("x:%d,y:%d,z:%d tmp %d",XYZ[0],XYZ[1],XYZ[2],tmp) - self.step[0]= tmp - self.step[1] = XYZ[0] - self.step[2] = XYZ[1] - self.step[3] = XYZ[2] + step[0]= tmp + step[1] = XYZ[0] + step[2] = XYZ[1] + step[3] = XYZ[2] - return self.step + return step def get_ic_cid(self, event, msg): """ @@ -1587,17 +1958,17 @@ class DeviceInfoManager(Abstract): # if temp <= 3505: # vbat = 0 # elif temp <= 3699: - # vbat = 20 #"E:/vbat_20.jpg" + # vbat = 20 #"U:/vbat_20.jpg" # elif temp <= 3772: - # vbat = 40 #"E:/vbat_40.jpg" + # vbat = 40 #"U:/vbat_40.jpg" # elif temp <= 3882: - # vbat = 60 #"E:/vbat_60.jpg" + # vbat = 60 #"U:/vbat_60.jpg" # elif temp <= 4070: - # vbat = 80 #"E:/vbat_80.jpg" + # vbat = 80 #"U:/vbat_80.jpg" # elif temp <= 4200: # vbat = 90 # # else: - # vbat = 100 #"E:/vbat_100.jpg" + # vbat = 100 #"U:/vbat_100.jpg" # else: # vbat = 100 @@ -1645,8 +2016,7 @@ class DeviceInfoManager(Abstract): def get_imei(self, topic, msg): if not self.imei: self.imei = modem.getDevImei() - # self.imei = "876226002021444" - # self.imei = "860132060129194" + # self.imei = "826226511027206"#视频通话测试账号 return self.imei def get_cid(self, topic, msg): @@ -1678,43 +2048,78 @@ class DeviceInfoManager(Abstract): return self.connect def start_blood_oxygen(self, topic, msg): - pass + print("start_blood_oxygen!!!") + if self.hsensor != None: + self.hsensor.open_blood_oxygen() def start_heart(self, topic, msg): - pass + print("start_heart!!!") + if self.hsensor != None: + self.hsensor.open_heart() def stop_blood_oxygen(self, topic, msg): - pass + print("stop_blood_oxygen!!!") + if self.hsensor != None: + self.hsensor.close() def stop_heart(self, topic, msg): - pass + print("stop_heart!!!") + if self.hsensor != None: + self.hsensor.close() def get_blood_oxygen(self, topic, msg): - - return 0 + data=[0,0,0,0,0] + if self.hsensor != None: + data = self.hsensor.get_all_data() + return data[1] def get_heart(self, topic, msg): - - return 0 + data=[0,0,0,0,0] + if self.hsensor != None: + data = self.hsensor.get_all_data() + return data[0] def get_wear(self, topic, msg): - return 0 + #data=[0,0,0,0,0] + if self.hsensor != None: + return self.hsensor.get_wear() + else: + return 1 def get_Hsensor(self, topic, msg): - return 0 + if self.hsensor != None: + return self.hsensor + return None def Hsensor_set_sleep(self, topic, msg): - pass + if self.hsensor != None: + self.hsensor.set_sleep() + return None def start_temp(self, topic, msg): - pass + WHO_AM_I = bytearray([0x01, 0]) + I2C_SLAVE_ADDR = 0x49 + r_data = bytearray(2) + data = bytearray([0x61A0, 0]) # 唤醒 + return self.i2c0.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) def stop_temp(self, topic, msg): - pass - + WHO_AM_I = bytearray([0x01, 0]) + I2C_SLAVE_ADDR = 0x49 + r_data = bytearray(2) + data = bytearray([0x60A0, 0]) #休眠 + return self.i2c0.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) def get_temp(self, topic, msg): - - return 0 + WHO_AM_I = bytearray([0x00, 0]) + I2C_SLAVE_ADDR = 0x49 + r_data = bytearray(2) + self.i2c0.read(I2C_SLAVE_ADDR, WHO_AM_I, 1, r_data, 2, 0) + #print("temp_data:{}".format(r_data)) + temp_s = ((r_data[0]<<8) | (r_data[1]))>>4 + #print("temp_s:{}".format(temp_s)) + temp_data = temp_s * 0.0625 + #print("temp_data:{}".format(temp_data)) + return temp_data @@ -1736,19 +2141,16 @@ class DeviceInfoManager(Abstract): def usb_event_cb(self, state): status = state if status == 1:#拔出 - print("USB OUT") screen_NAME = EventMesh.publish("get_screen_NAME") if screen_NAME != None: if screen_NAME == "poweron" or screen_NAME == "system_init": return - bat_tmp = EventMesh.publish("screen_get_battery") if bat_tmp != None: if bat_tmp[0] == "1": EventMesh.publish("load_screen", {"screen": "charge_in"}) - pass + pass elif status == 0:#插入usb - print("USB IN") screen_NAME = EventMesh.publish("get_screen_NAME") if screen_NAME != None: if screen_NAME == "poweron" or screen_NAME == "system_init": @@ -1757,7 +2159,7 @@ class DeviceInfoManager(Abstract): if bat_tmp != None: if bat_tmp[0] == "0": EventMesh.publish("load_screen", {"screen": "charge_out"}) - EventMesh.publish("battery", self.get_battery()) + #EventMesh.publish("battery", self.get_battery()) def get_usb_state(self): state = self.usb.getStatus() @@ -1770,13 +2172,11 @@ def wifiScan_cb(args): EventMesh.publish(constants.EVENT.WIFIINFO, args) wifiScan.control(0) -from protocol import server_init - class LocationManager(Abstract): def __init__(self): self.gps = None - # self.match = GPSMatch() + #self.match = GPSMatch() self.timer_read_GPS_info = osTimer() self.wifi_data = [] self.gps_data = {} @@ -1792,7 +2192,20 @@ class LocationManager(Abstract): self.location_queue = Queue(100) self.lpm_fd = None self.start_agps = 0 - + read_data = EventMesh.publish("get_storage_config","isOpenGNSS")#获取是否打开GNSS + if read_data != None: + self.isOpenGNSS = read_data + else:#默认关闭GNSS + self.isOpenGNSS = "0" + EventMesh.publish("set_storage_config",["isOpenGNSS",self.isOpenGNSS]) + self.isOpenGNSS = EventMesh.publish("get_storage_config","isOpenGNSS") + if self.isOpenGNSS == None: + self.isOpenGNSS = "1" + + if self.isOpenGNSS == "1": + # quecgnss.init() + # quecgnss.gnssEnable(0) + pass @staticmethod def get_date(): return "{:04d}-{:02d}-{:02d}".format(*utime.localtime()[0:3]) @@ -1872,8 +2285,6 @@ class LocationManager(Abstract): def WIFI_scan_open(self, event, msg): #print("WIFI_scan_open") - - if wifiScan.getState() == False : self.wifi_data = [] wifiScan.control(1) @@ -1884,151 +2295,135 @@ class LocationManager(Abstract): else : print("WIFI_scan_open:error1") def gps_open(self, event, msg): - pass - + if self.isOpenGNSS == "1": + #EventMesh.debug_log("publish:gps_open") + # + #quecgnss.gnssEnable(2) + pass def gps_close(self, event, msg): - pass + if self.isOpenGNSS == "1": + #quecgnss.gnssEnable(0) + pass def location_timer(self, *args, **kwargs): self.location_timer_count = self.location_timer_count +1 self.location_check_data_timer_count = self.location_check_data_timer_count+1 def Location_send(self, msg) : - #print("Location_send1") + print("Location_send1") if self.location_queue.empty() == True: return - server_data = server_init() - # print("SockManager:server_data:{}".format(server_data)) - server_addr = server_data[0] - server_port = server_data[1] - ip_infor = EventMesh.publish("get_new_ip_com") - print("ip_infor1:{} \n\n\n".format(ip_infor)) - - if ip_infor != None: #已经改过服务器 - server_addr = ip_infor[0] - server_port = ip_infor[1] - d_server_addr = "device.miwitracker.com" - d_server_port = 8505 - print("server_addr:{} server_port:{}".format(server_addr,server_port)) - self.date_info = "{:04d}{:02d}{:02d},{:02d}{:02d}{:02d}".format(*utime.localtime()[0:6]) - self.date_info = self.date_info[2:] - if server_addr == d_server_addr and server_port == d_server_port: - - data = RTC().datetime() - hour = data[4] - min = data[5] - sec = data[6] - - week = data[3] - - year = data[0]#年 - month = data[1]#月 - day = data[2]#日 - year_date = int(str(year)[2:]) - # print("year_date",year_date) - self.date_info = "%02d"%(day)+"%02d"%(month)+"%02d"%(year_date)+','+"%02d"%(hour)+"%02d"%(min)+"%02d"%(sec)#云米要日月年 - # self.date_info = "%02d"%(utime.localtime()[1])+"%02d"%(utime.localtime()[2])+"%02d"%(year_date)+','+"%02d"%(utime.localtime()[3])+"%02d"%(utime.localtime()[4])+"%02d"%(utime.localtime()[5]) - # print("date_info",self.date_info) - - #date = "180916,025723" - date = self.date_info - #date = "180916,025723" - GPS_type = "V" - latitude = "0.000000,N" - longitude = "0.000000,E" - speed = "0.00" - direction = "0.0" - high = "100.0" - number = "0" - precision = "24" - if msg[0] :#有GPS数据 - GPS_type = "A" - # 纬度 - latitude = msg[0]["latitude"] - # 经度 - longitude = msg[0]["longitude"] - # 速度 - speed = msg[0]["speed"] - # 方向 - direction = "0" - if msg[0]["direction"] : - direction = msg[0]["direction"] - # 高度 - high = msg[0]["high"] - high_tmp = high.split(".") - if len(high_tmp) >= 2 : - high = "%s"%(high_tmp[0]) - # 讯号质量:搜索到的卫星数目 - number = msg[0]["number"] - precision = msg[0]["precision"] - #date = msg[0]["date"] - - #gsm 信号强度 - gsm_sig = str((100//31)*EventMesh.publish("screen_get_sig")) - # 电池电量百分比 - bat_tmp = EventMesh.publish("screen_get_battery") - battery_caption = str(bat_tmp[1]) - #步数 - old_step = 0 - step = 0 - step = EventMesh.publish("get_old_step_value") - if step != 0: - tmp_data = EventMesh.publish("get_storage_config","old_step_new") - if tmp_data != None: - old_step = tmp_data - if old_step != step: - EventMesh.publish("set_storage_config",["old_step",step]) - EventMesh.publish("set_storage_config",["old_step_new",step]) - - old_step = step - # step = str(EventMesh.publish(constants.EVENT.GET_STEP)[0]) - #翻转次数 - turn_count = "0" - #终端状态 - state = "00000000" - #基站数据 - CELL_num = len(msg[2]) - CELL_data = "1," #时延 - if msg[2] != []: - for CELL in msg[2] : - if CELL[0] == 0 : - CELL_data += "%X,"%(int(CELL[2])) #MCC - CELL_data += str(CELL[3]) +","#MNC - CELL_data += str(CELL[5]) +","#tac,区域码 - CELL_data += str(CELL[1]) +","#基站编号 CID - CELL_data += str(int(CELL[7]+140)) +","#信号强度 rssi - else : - CELL_data += str(CELL[5]) +","#tac,区域码 - CELL_data += str(CELL[1]) +","#基站编号 CID - CELL_data += str(int(CELL[7]+140)) +","#信号强度 rssi - CELL_data = CELL_data[:(len(CELL_data)-1)] - #WIFI数据 - WIFI_num = 0 - WIFI_data = "" - if msg[1] : - WIFI_num = msg[1][0] - i = 0 - for MAC in msg[1][1] : - WIFI_data += "wifi%d,%s,%d,"%(i,str(MAC[0]),MAC[1]) - i += 1 - WIFI_data = WIFI_data[:(len(WIFI_data)-1)] - WIFI_data = WIFI_data.lower() - #send_data = "UD ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%d ,%s ,%d ,%s"\ - # %(date,GPS_type,latitude,longitude,speed,direction,high,number,gsm_sig,battery_caption,step,turn_count,state,CELL_num,CELL_data,WIFI_num,WIFI_data) - #定位数据 - send_data = "%s,%s,%s"%(date,GPS_type,latitude) - send_data += ",%s,%s,%s"%(longitude,speed,direction) - send_data += ",%s,%s,%s"%(high,number,gsm_sig,) - send_data += ",%s,%s,%s"%(battery_caption,step,turn_count) - send_data += ",%s,%d,%s"%(state,CELL_num,CELL_data) - send_data += ",%d,%s"%(WIFI_num,WIFI_data) - send_data+=",%s"%(precision) - #print("Location_send2:{} q_size:{}".format(send_data,self.location_queue.size())) + print("Location_send2") while True: if self.location_queue.empty() == False: TYPE = self.location_queue.get() - print("Location_send3:{}-{}".format(TYPE,send_data)) - EventMesh.publish(TYPE,send_data) + date = "{:04d}{:02d}{:02d},{:02d}{:02d}{:02d}".format(*utime.localtime()[0:6]) + date = date[2:] + #date = "180916,025723" + GPS_type = "V" + latitude = "0.000000,N" + longitude = "0.000000,E" + speed = "0.00" + direction = "0.0" + high = "100.0" + number = "0" + precision = "24" + if msg[0] :#有GPS数据 + GPS_type = "A" + # 纬度 + latitude = msg[0]["latitude"] + # 经度 + longitude = msg[0]["longitude"] + # 速度 + speed = msg[0]["speed"] + # 方向 + direction = "0" + if msg[0]["direction"] : + direction = msg[0]["direction"] + # 高度 + high = msg[0]["high"] + high_tmp = high.split(".") + if len(high_tmp) >= 2 : + high = "%s"%(high_tmp[0]) + # 讯号质量:搜索到的卫星数目 + number = msg[0]["number"] + precision = msg[0]["precision"] + #date = msg[0]["date"] + + #gsm 信号强度 + gsm_sig = str((100//31)*EventMesh.publish("screen_get_sig")) + # 电池电量百分比 + bat_tmp = EventMesh.publish("screen_get_battery") + battery_caption = str(bat_tmp[1]) + #步数 + old_step = 0 + step = 0 + step = EventMesh.publish("get_old_step_value") + if step != 0: + tmp_data = EventMesh.publish("get_storage_config","old_step_new") + if tmp_data != None: + old_step = tmp_data + if old_step != step: + EventMesh.publish("set_storage_config",["old_step",step]) + EventMesh.publish("set_storage_config",["old_step_new",step]) + + old_step = step + # step = str(EventMesh.publish(constants.EVENT.GET_STEP)[0]) + #翻转次数 + turn_count = "0" + #终端状态 + state = "%08X"%(EventMesh.publish("get_dev_state")) + #EventMesh.debug_log("TYPE:{}".format(TYPE)) + if type(TYPE) == list:#队列里的数据有终端状态,则用队里的终端状态 + if len(TYPE)>= 2 : + state = "%08X"%(TYPE[1]) + + print("state:{}".format(state)) + #基站数据 + CELL_num = len(msg[2]) + CELL_data = "1," #时延 + if msg[2] != []: + for CELL in msg[2] : + if CELL[0] == 0 : + CELL_data += "%X,"%(int(CELL[2])) #MCC + CELL_data += str(CELL[3]) +","#MNC + CELL_data += str(CELL[5]) +","#tac,区域码 + CELL_data += str(CELL[1]) +","#基站编号 CID + CELL_data += str(int(CELL[7]+140)) +","#信号强度 rssi + else : + CELL_data += str(CELL[5]) +","#tac,区域码 + CELL_data += str(CELL[1]) +","#基站编号 CID + CELL_data += str(int(CELL[7]+140)) +","#信号强度 rssi + CELL_data = CELL_data[:(len(CELL_data)-1)] + #WIFI数据 + WIFI_num = 0 + WIFI_data = "" + if msg[1] : + WIFI_num = msg[1][0] + i = 0 + for MAC in msg[1][1] : + WIFI_data += "wifi%d,%s,%d,"%(i,str(MAC[0]),MAC[1]) + i += 1 + WIFI_data = WIFI_data[:(len(WIFI_data)-1)] + WIFI_data = WIFI_data.lower() + #send_data = "UD ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%s ,%d ,%s ,%d ,%s"\ + # %(date,GPS_type,latitude,longitude,speed,direction,high,number,gsm_sig,battery_caption,step,turn_count,state,CELL_num,CELL_data,WIFI_num,WIFI_data) + #定位数据 + send_data = "%s,%s,%s"%(date,GPS_type,latitude) + send_data += ",%s,%s,%s"%(longitude,speed,direction) + send_data += ",%s,%s,%s"%(high,number,gsm_sig,) + send_data += ",%s,%s,%s"%(battery_caption,step,turn_count) + send_data += ",%s,%d,%s"%(state,CELL_num,CELL_data) + send_data += ",%d,%s"%(WIFI_num,WIFI_data) + send_data+=",%s"%(precision) + #EventMesh.debug_log("Location_send2:{} q_size:{}".format(send_data,self.location_queue.size())) + + + #EventMesh.debug_log("Location_send3:{}:{}".format(TYPE,send_data)) + if type(TYPE) == list: + EventMesh.publish(TYPE[0],send_data) + else: + EventMesh.publish(TYPE,send_data) else : break @@ -2073,7 +2468,7 @@ class LocationManager(Abstract): self.lpm_fd = pm.create_wakelock("test_lock", len("test_lock")) pm.wakelock_lock(self.lpm_fd) print("location_thread:1") - # EventMesh.publish(constants.EVENT.GPSOPEN) + EventMesh.publish(constants.EVENT.GPSOPEN) print("location_thread:2") #self.timer_read_GPS_info.start(1000, 1, self.location_timer) print("location_thread:3") @@ -2097,90 +2492,90 @@ class LocationManager(Abstract): self.location_check_data_timer_count = 0 #print(self.location_timer_count) GSV_dict= {} - - # #检查GNSS数据 - # if ( self.gps_data == {} or self.location_type == 1) and quecgnss.get_state() == 2: - - # pass - # tmp_ok_count = 0 - # tmp_very_ok_count = 0 - # gsv_data = quecgnss.get_gsv() - # rmc_data = quecgnss.get_rmc() - # gga_data = quecgnss.get_gga() - # vtg_data = quecgnss.get_vtg() - # # print("gsv:{}".format(quecgnss.get_gsv())) - # # print("gga:{}".format(quecgnss.get_gga())) - # # print("rmc:{}".format(quecgnss.get_rmc())) - # # print("vtg:{}".format(quecgnss.get_vtg())) - # for i in range(len(gsv_data)) : - - # if i % 2 == 0: - # if i+1 >= len(gsv_data) : - # print("gsv_data num error!!") - # break - # GSV_dict[gsv_data[i]] = gsv_data[i+1] - # #print("type:gsv_data{}".format(type(gsv_data[i+1]))) - # try: - # #print("gsv_tmp[i+3]:{}".format(gsv_tmp[i+3])) - # if gsv_data[i+1] : - # if (gsv_data[i+1])>=20: - # tmp_ok_count +=1 - # if (gsv_data[i+1])>=30: - # tmp_very_ok_count +=1 - - # except Exception as e: - # usys.print_exception(e) + # if self.isOpenGNSS == "1": + # #检查GNSS数据 + # if ( self.gps_data == {} or self.location_type == 1) and quecgnss.get_state() == 2: + + # pass + # tmp_ok_count = 0 + # tmp_very_ok_count = 0 + # gsv_data = quecgnss.get_gsv() + # rmc_data = quecgnss.get_rmc() + # gga_data = quecgnss.get_gga() + # vtg_data = quecgnss.get_vtg() + # # EventMesh.debug_log("gsv:{}".format(quecgnss.get_gsv())) + # # EventMesh.debug_log("gga:{}".format(quecgnss.get_gga())) + # # EventMesh.debug_log("rmc:{}".format(quecgnss.get_rmc())) + # # EventMesh.debug_log("vtg:{}".format(quecgnss.get_vtg())) + # for i in range(len(gsv_data)) : - # if(tmp_ok_count > self.GSV_sig_ok_count ): - # self.GSV_sig_ok_count = tmp_ok_count - # if(tmp_very_ok_count > self.GSV_sig_very_ok_count ): - # self.GSV_sig_very_ok_count = tmp_very_ok_count - # match_rmc_data = rmc_data.split(",") - # if len (match_rmc_data)>3: #有rmc数据 - # if match_rmc_data[2] == 'A': - # match_gga_data = gga_data.split(",") - # if len(match_gga_data) >4: #数据全 - # match_vtg_data = vtg_data.split(",") - # gps_date = "%s,%s"%(match_rmc_data[9],match_rmc_data[1][:6])#日期 - # #gps_data_tmp = self.gps.read_coordinates(gnss_r_data[1]) - # latitude = "0,N" #纬度 - # latitude_tmp = str(self.GxGGA_latitude(gga_data)).split(".") - # if len(latitude_tmp) >= 2 and len(latitude_tmp[1])>=5: - # latitude = "%s.%s"%(latitude_tmp[0],latitude_tmp[1][:6]) - # latitude = "%s,%s"%(latitude,match_rmc_data[4] ) - - # longitude = "0,E"#经度 - # longitude_tmp = str(self.GxGGA_longitude(gga_data)).split(".") - # if len(longitude_tmp) >= 2 and len(longitude_tmp[1])>=5: - # longitude = "%s.%s"%(longitude_tmp[0],longitude_tmp[1][:6]) - # longitude = "%s,%s"%(longitude,match_rmc_data[6] ) #match_rmc_data[6] + str(gnss_r_data[1]) - - # high = "0"#高度 - # high = str(self.GxGGA_altitude(gga_data)) - # number = "0"#可用卫星 - # precision = "5.8"#精度 - # if len(match_gga_data)>5 : - # if match_gga_data[7]: - # number = match_gga_data[7] - # if match_gga_data[8]: - # precision = match_gga_data[8] - # direction = "249.5" #方向 - # speed = '0.00' #速度 - # if(len(match_vtg_data)>5 ): - # if match_vtg_data[1]: - # direction = match_vtg_data[1] - # if match_vtg_data[7]: - # speed = match_vtg_data[7] - # self.gps_data = { - # "latitude": latitude, - # "longitude": longitude, - # "high": high, - # "direction": direction, - # "speed": speed, - # "number": number, - # "date": gps_date, - # "precision": precision - # } + # if i % 2 == 0: + # if i+1 >= len(gsv_data) : + # # EventMesh.debug_log("gsv_data num error!!") + # break + # GSV_dict[gsv_data[i]] = gsv_data[i+1] + # #EventMesh.debug_log("type:gsv_data{}".format(type(gsv_data[i+1]))) + # try: + # #EventMesh.debug_log("gsv_tmp[i+3]:{}".format(gsv_tmp[i+3])) + # if gsv_data[i+1] : + # if (gsv_data[i+1])>=20: + # tmp_ok_count +=1 + # if (gsv_data[i+1])>=30: + # tmp_very_ok_count +=1 + + # except Exception as e: + # usys.print_exception(e) + + # if(tmp_ok_count > self.GSV_sig_ok_count ): + # self.GSV_sig_ok_count = tmp_ok_count + # if(tmp_very_ok_count > self.GSV_sig_very_ok_count ): + # self.GSV_sig_very_ok_count = tmp_very_ok_count + # match_rmc_data = rmc_data.split(",") + # if len (match_rmc_data)>3: #有rmc数据 + # if match_rmc_data[2] == 'A': + # match_gga_data = gga_data.split(",") + # if len(match_gga_data) >4: #数据全 + # match_vtg_data = vtg_data.split(",") + # gps_date = "%s,%s"%(match_rmc_data[9],match_rmc_data[1][:6])#日期 + # #gps_data_tmp = self.gps.read_coordinates(gnss_r_data[1]) + # latitude = "0,N" #纬度 + # latitude_tmp = str(self.GxGGA_latitude(gga_data)).split(".") + # if len(latitude_tmp) >= 2 and len(latitude_tmp[1])>=5: + # latitude = "%s.%s"%(latitude_tmp[0],latitude_tmp[1][:6]) + # latitude = "%s,%s"%(latitude,match_rmc_data[4] ) + + # longitude = "0,E"#经度 + # longitude_tmp = str(self.GxGGA_longitude(gga_data)).split(".") + # if len(longitude_tmp) >= 2 and len(longitude_tmp[1])>=5: + # longitude = "%s.%s"%(longitude_tmp[0],longitude_tmp[1][:6]) + # longitude = "%s,%s"%(longitude,match_rmc_data[6] ) #match_rmc_data[6] + str(gnss_r_data[1]) + + # high = "0"#高度 + # high = str(self.GxGGA_altitude(gga_data)) + # number = "0"#可用卫星 + # precision = "5.8"#精度 + # if len(match_gga_data)>5 : + # if match_gga_data[7]: + # number = match_gga_data[7] + # if match_gga_data[8]: + # precision = match_gga_data[8] + # direction = "249.5" #方向 + # speed = '0.00' #速度 + # if(len(match_vtg_data)>5 ): + # if match_vtg_data[1]: + # direction = match_vtg_data[1] + # if match_vtg_data[7]: + # speed = match_vtg_data[7] + # self.gps_data = { + # "latitude": latitude, + # "longitude": longitude, + # "high": high, + # "direction": direction, + # "speed": speed, + # "number": number, + # "date": gps_date, + # "precision": precision + # } # *********************************************************************************** @@ -2191,11 +2586,12 @@ class LocationManager(Abstract): #检查基站数据 if self.cell_data == []: data_tmp = net.getCellInfo() - if(len(data_tmp)>=2): - for cell in data_tmp: - if cell and cell[0][0] == 0 and len(cell[0]) > 1: - self.cell_data = cell - break + if data_tmp != -1: + if(len(data_tmp)>=2): + for cell in data_tmp: + if cell and cell[0][0] == 0 and len(cell[0]) > 1: + self.cell_data = cell + break if self.location_type == 1: #测试模式 self.location_timer_count = 0 @@ -2210,12 +2606,13 @@ class LocationManager(Abstract): elif self.location_type == 0: #正常模式 if self.gps_data != {} or self.location_timer_count > 100: #or( self.wifi_data != [] and self.cell_data != []): if self.location_queue.empty() == False:#有定位队列 - EventMesh.txt_log("LOCATION timer:{} ok:{} very_ok:{}".format(self.location_timer_count,self.GSV_sig_ok_count,self.GSV_sig_very_ok_count)) + pass + #EventMesh.txt_log("LOCATION timer:{} ok:{} very_ok:{}".format(self.location_timer_count,self.GSV_sig_ok_count)) #EventMesh.txt_log("LOCATION:timer:{} ok_count:{} ".format(self.location_timer_count,self.GSV_sig_ok_count)) if self.gps_data == {}: #定位超时,且信噪比多个大于30,下次启动agps if self.GSV_sig_very_ok_count > 3:#3个超30以上 self.start_agps = 1 - EventMesh.txt_log("open agps:{}".format(GSV_dict)) + #EventMesh.txt_log("open agps:{}".format(GSV_dict)) #upload_time = EventMesh.publish("get_upload_data") self.Location_send([self.gps_data,self.wifi_data,self.cell_data]) #if upload_time > 200 : @@ -2224,28 +2621,21 @@ class LocationManager(Abstract): # self.location_timer_count = 0 # self.GSV_sig_ok_count = 0 + - if self.wifi_data != [] and self.cell_data != [] : # - EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 - EventMesh.txt_log("GSV_sig_ok_count<3:timer:{} ok_count:{} ".format(self.location_timer_count,self.GSV_sig_ok_count)) - self.Location_send([self.gps_data,self.wifi_data,self.cell_data]) - # if self.GSV_sig_ok_count <= 1 and self.wifi_data != [] and self.cell_data != [] and self.location_timer_count > 20: #超过40秒且信号大于30的不足3个 - # EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 - # EventMesh.txt_log("GSV_sig_ok_count<3:timer:{} ok_count:{} ".format(self.location_timer_count,self.GSV_sig_ok_count)) - # self.Location_send([self.gps_data,self.wifi_data,self.cell_data]) - #break - # if self.location_type != 1 and self.location_timer_count >= 60*4 : #4分钟关闭 - # EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 - #break - #EventMesh.txt_log("self.GSV_sig_ok_count :{}".format(self.GSV_sig_ok_count)) - #EventMesh.publish("set_old_step_value",self.location_timer_count) - - #print("location_timer_count:{}".format(self.location_timer_count)) + + if (self.isOpenGNSS != "1" or (self.GSV_sig_ok_count <= 1 and self.location_timer_count > 20)) and self.wifi_data != [] and self.cell_data != [] : #超过40秒且信号大于30的不足3个 + EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 + print("Location_send:CLOSE_LOCATION") + #EventMesh.txt_log("GSV_sig_ok_count<3:timer:{} ok_count:{} ".format(self.location_timer_count,self.GSV_sig_ok_count)) + self.Location_send([self.gps_data,self.wifi_data,self.cell_data]) + + except Exception as e: usys.print_exception(e) EventMesh.txt_log("location_thread:ERROR:".format(e)) - #print("location_thread:ERROR:{}".format(usys.print_exception(e))) + #EventMesh.debug_log("location_thread:ERROR:{}".format(usys.print_exception(e))) print("self.gps_data{},self.wifi_data{},self.cell_data{}".format(self.gps_data,self.wifi_data,self.cell_data)) #self.Location_send([self.gps_data,self.wifi_data,self.cell_data]) EventMesh.publish(constants.EVENT.CLOSE_LOCATION)#关闭定位 @@ -2290,49 +2680,6 @@ class AddrBookManager(Abstract): self.check_json = msg[0] self.read_phonebook = msg[1] -class videoBookManager(Abstract): - # 视频通话账号 - def __init__(self): - self.videobook = {} - self.check_json = 0 - self.check_json = ql_fs.path_exists("/usr/static/storage_file/videobook.json") - - if self.check_json == True: - with open("/usr/static/storage_file/videobook.json","r",encoding="utf-8") as fd: - self.videobook = ujson.load(fd) - print("读取视频通话账号列表") - - def post_processor_after_instantiation(self): - EventMesh.subscribe("get_videobook_list", self.get) - EventMesh.subscribe("set_videobook_list", self.set) - - def get(self, event, msg): - self.check_json = ql_fs.path_exists("/usr/static/storage_file/videobook.json") - return [self.check_json,self.videobook] - - def set(self, event, msg): - print("videolist",msg) - self.check_json = msg[0] - self.videobook = msg[1] - -class AddPPManager(Abstract): - # 添加碰碰好友 - def __init__(self): - self.read_pplist = {} - - def post_processor_after_instantiation(self): - EventMesh.subscribe("get_pplist", self.get) - EventMesh.subscribe("set_pplist", self.set) - - def get(self, event, msg): - - return self.read_pplist - - def set(self, event, msg): - self.read_pplist = msg - print("self.read_pplist",self.read_pplist) - - import sms class MsgManager(Abstract): # 短信 @@ -2374,9 +2721,11 @@ class MsgdetailManager(Abstract): def save_msg_name(self, event, msg): self.msg_name = str(msg) + print("save_msg_name:msg".format(msg)) def save_msg_content(self, event, msg): self.msg_content = str(msg) + print("save_msg_content:msg".format(msg)) def get_msg_content(self, event, msg): return self.msg_content @@ -2448,6 +2797,10 @@ class gethistoryDataManager(Abstract): self.read_histroy_hr_data = [] self.read_histroy_temp_data = [] self.read_histroy_spo2_data = [] + self.read_histroy_blood_data = [] + + self.blMin = 0 + self.blMax = 0 oldHr = EventMesh.publish("get_storage_config","old_hr") if oldHr != None: @@ -2464,25 +2817,36 @@ class gethistoryDataManager(Abstract): if check_hr == True : with open("/usr/static/storage_file/history_hr.json","r") as fd:#音频文件编号 self.read_histroy_hr_data = ujson.load(fd) - + if self.read_histroy_hr_data == None: + self.read_histroy_hr_data = [] check_temp= ql_fs.path_exists("/usr/static/storage_file/history_temp.json") if check_temp == True : with open("/usr/static/storage_file/history_temp.json","r") as fd:#音频文件编号 self.read_histroy_temp_data = ujson.load(fd) - + if self.read_histroy_temp_data == None: + self.read_histroy_temp_data = [] check_spo2= ql_fs.path_exists("/usr/static/storage_file/history_spo2.json") if check_spo2 == True : with open("/usr/static/storage_file/history_spo2.json","r") as fd:#音频文件编号 self.read_histroy_spo2_data = ujson.load(fd) + if self.read_histroy_spo2_data == None: + self.read_histroy_spo2_data = [] + + check_blood= ql_fs.path_exists("/usr/static/storage_file/history_blood.json") + if check_blood == True : + with open("/usr/static/storage_file/history_blood.json","r") as fd:#音频文件编号 + self.read_histroy_blood_data = ujson.load(fd) + if self.read_histroy_blood_data == None: + self.read_histroy_blood_data = [] self.temp_value = 0 # self.read_histroy_hr_data=[{"timeSec":16789890,"value":90},{"timeSec":16789888,"value":78},{"timeSec":16789688,"value":68},{"timeSec":16789898,"value":58},\ # {"timeSec":16789897,"value":88},{"timeSec":16789867,"value":77},{"timeSec":16789895,"value":70}] - def post_processor_after_instantiation(self): - EventMesh.subscribe("set_old_hr_data", self.save_hr_value) - EventMesh.subscribe("get_old_hr_data", self.get_hr_value) - EventMesh.subscribe("set_old_spo2_data", self.save_spo2_value) + #def post_processor_after_instantiation(self): + EventMesh.subscribe("set_old_hr_data", self.set_old_hr_data) + EventMesh.subscribe("get_old_hr_data", self.get_old_hr_data) + EventMesh.subscribe("set_old_spo2_data", self.set_old_spo2_data) EventMesh.subscribe("get_old_spo2_data", self.get_spo2_value) EventMesh.subscribe("get_old_step_value", self.get_old_step_value) @@ -2498,6 +2862,41 @@ class gethistoryDataManager(Abstract): EventMesh.subscribe("get_history_spo2_value", self.get_history_spo2_value) EventMesh.subscribe("set_history_spo2_value", self.set_history_spo2_value) + EventMesh.subscribe("set_old_blood_data", self.set_old_blood_data) + EventMesh.subscribe("get_old_blood_data", self.get_old_blood_data) + + def set_old_blood_data(self, event, msg): + self.blMax = msg[0]#收缩压 + self.blMin = msg[1]#舒张压 + if self.blMax > 0 and self.blMin > 0: + date_tmp = utime.localtime() + time_tmp = utime.mktime(date_tmp) + if len(self.read_histroy_blood_data) >= 7: + sort_new = {} + sort_new = sorted(self.read_histroy_blood_data, key = lambda i: i['timeSec'],reverse = False)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 + print(sort_new) + for i in range(len(self.read_histroy_blood_data)-1): + sort_new[i] = sort_new[i+1]#0==1 1== 2 2== 3 3==4 4==5 5==6 6==7 + self.read_histroy_blood_data[i] = sort_new[i] + pass + self.read_histroy_blood_data[6] = {"timeSec": time_tmp, "blMax": self.blMax,"blMin": self.blMin} + else: + self.read_histroy_blood_data.append({"timeSec": time_tmp, "blMax": self.blMax,"blMin": self.blMin}) + + with open("/usr/static/storage_file/history_blood.json","w",encoding="utf-8") as fd: + ujson.dump(self.read_histroy_blood_data,fd) + print(self.read_histroy_blood_data) + EventMesh.publish("show_history_blood_data") + EventMesh.publish("set_oldblood_value",[self.blMax,self.blMin]) + + def get_old_blood_data(self, event, msg): #近7次血压历史数据统计显示 + if self.read_histroy_blood_data: + return self.read_histroy_blood_data + else : + return [] + + + def get_history_spo2_value(self, event, msg): #近7次血氧历史数据统计显示 return self.read_histroy_spo2_data @@ -2529,17 +2928,22 @@ class gethistoryDataManager(Abstract): with open("/usr/static/storage_file/history_temp.json","w",encoding="utf-8") as fd: ujson.dump(self.read_histroy_temp_data,fd) #print(self.read_histroy_temp_data) + EventMesh.publish("show_history_temp_data") def get_history_hr_value(self, event, msg): #近7次心率历史数据统计显示 - return self.read_histroy_hr_data + if self.read_histroy_hr_data: + return self.read_histroy_hr_data + else : + return [] def set_history_hr_value(self, event, msg): pass - def save_hr_value(self, event, msg): + def set_old_hr_data(self, event, msg): if msg >= 50: + EventMesh.publish("set_storage_config",["old_hr",msg]) self.oldHr = msg @@ -2561,14 +2965,16 @@ class gethistoryDataManager(Abstract): with open("/usr/static/storage_file/history_hr.json","w",encoding="utf-8") as fd: ujson.dump(self.read_histroy_hr_data,fd) + EventMesh.publish("show_history_hr_data") #print(self.read_histroy_hr_data) - def get_hr_value(self, event, msg): + def get_old_hr_data(self, event, msg): return self.oldHr - def save_spo2_value(self, event, msg): + def set_old_spo2_data(self, event, msg): if msg >= 85: + EventMesh.publish("set_storage_config",["old_spo2",msg]) self.oldspo2 = msg @@ -2589,6 +2995,7 @@ class gethistoryDataManager(Abstract): with open("/usr/static/storage_file/history_spo2.json","w",encoding="utf-8") as fd: ujson.dump(self.read_histroy_spo2_data,fd) + EventMesh.publish("show_history_spo2_data") #print(self.read_histroy_spo2_data) def get_spo2_value(self, event, msg): @@ -2596,16 +3003,18 @@ class gethistoryDataManager(Abstract): def set_old_step_value(self, event, msg): self.oldstep = msg - EventMesh.publish("set_storage_config",["old_step",msg]) - + EventMesh.publish("set_storage_config",["old_step",msg]) + def get_old_step_value(self, event, msg): step = EventMesh.publish(constants.EVENT.GET_STEP) + print("get_old_step_value:step:{}",step) self.old_step = self.oldstep + step[0] + print("get_old_step_value:old_step:{}",self.old_step) return self.old_step #获取旧的时间戳 class getOldTimeManager(Abstract): - # 获取天气数据 + # def __init__(self): self.time_sec = 0 tmp_data = EventMesh.publish("get_storage_config","old_time") @@ -2699,13 +3108,19 @@ class getHrTimeManager(Abstract): self.set_hr = msg def get_hr_state(self, event, msg): - return self.set_hr + if self.set_hr: + return self.set_hr + else: + return 0 def set_spo2_state(self, event, msg): self.set_spo2 = msg def get_spo2_state(self, event, msg): - return self.set_spo2 + if self.set_spo2: + return self.set_spo2 + else: + return 0 #体温 class getTempTimeManager(Abstract): @@ -2716,6 +3131,13 @@ class getTempTimeManager(Abstract): if read_data != None: self.set_time = read_data + + self.set_bptime = 0 + self.get_bpstate = 0 + read_data = EventMesh.publish("get_storage_config","bp_time") + + if read_data != None: + self.set_bptime = read_data def post_processor_after_instantiation(self): @@ -2725,23 +3147,53 @@ class getTempTimeManager(Abstract): EventMesh.subscribe("set_temp_state", self.set_temp_state) EventMesh.subscribe("get_temp_state", self.get_temp_state) + EventMesh.subscribe("set_bp_time", self.set_bp_time) + EventMesh.subscribe("get_bp_time", self.get_bp_time) + + EventMesh.subscribe("set_bp_state", self.set_bp_state) + EventMesh.subscribe("get_bp_state", self.get_bp_state) + + def set_bp_time(self, event, msg): + self.set_bptime = msg + EventMesh.publish("set_storage_config",["bp_time",self.set_time]) + + def get_bp_time(self, event, msg): + if self.set_bptime: + return self.set_bptime + else : + return 0 + + def set_bp_state(self, event, msg): + self.get_bpstate = msg + + def get_bp_state(self, event, msg): + if self.get_bpstate: + return self.get_bpstate + else : + return 0 def set_temp_time(self, event, msg): self.set_time = msg EventMesh.publish("set_storage_config",["temp_time",self.set_time]) def get_temp_time(self, event, msg): - return self.set_time + if self.set_time: + return self.set_time + else : + return 0 def set_temp_state(self, event, msg): self.get_temp = msg - def get_temp_state(self, event, msg): - return self.get_temp + def get_temp_state(self, event, msg): + if self.get_temp: + return self.get_temp + else : + return 0 class getBrightnessManager(Abstract):#获取亮度级别 def __init__(self): - self.level = 2#默认值6 + self.level = 6#默认值6 # self.read_data = {} self.time = 5 self.PWM_backlight = None @@ -2784,14 +3236,13 @@ class getBrightnessManager(Abstract):#获取亮度级别 self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, self.level*100, 1000) self.PWM_backlight.open() EventMesh.publish("set_storage_config", ["brightness_level",self.level]) - level = EventMesh.publish("get_storage_config","brightness_level") def reduce(self, event, msg): if self.level > 0: self.level = self.level - 2 if self.level <= 0: - self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 1*100, 1000) + self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 100, 1000) else: self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US,self.level*100, 1000) @@ -2809,16 +3260,13 @@ class getStorageDataManager(Abstract):#获取内存数据 else : self.config_data = {'old_time': 0, 'flip_sw': 0} pass - print("self.config_data:{}".format(self.config_data)) def post_processor_after_instantiation(self): - EventMesh.subscribe("set_storage_data", self.set_storage_data) EventMesh.subscribe("set_storage_config", self.set_storage_config) - EventMesh.subscribe("get_storage_data", self.get_storage_data) EventMesh.subscribe("get_storage_config", self.get_storage_config) def set_storage_data(self, event, msg): - # print("set_storage_data:{}".format(msg)) + print("set_storage_data:{}".format(msg)) if msg != None: self.config_data = msg with open("/usr/static/storage_file/config.json",'w+',encoding="utf-8") as fd: @@ -2831,8 +3279,9 @@ class getStorageDataManager(Abstract):#获取内存数据 self.config_data[msg[0]]=msg[1] # print("set_storage_key_data2:{}".format(self.config_data[msg[0]])) EventMesh.publish("publish_message_event_ui",{"func":self.set_storage_save,"data":0}) + + def set_storage_save(self, data): - # print("set_storage_key_data2:{}".format(self.config_data)) with open("/usr/static/storage_file/config.json",'w+',encoding="utf-8") as fd: ujson.dump(self.config_data,fd) def get_storage_data(self, event, msg): @@ -2854,7 +3303,7 @@ class getStorageDataManager(Abstract):#获取内存数据 #定位频率 class getUpLoadDataManager(Abstract):# def __init__(self): - self.upload_time = 1800 + self.upload_time = 3600 read_data = EventMesh.publish("get_storage_config","upload_time") if read_data != None: self.upload_time = read_data @@ -2868,7 +3317,6 @@ class getUpLoadDataManager(Abstract):# self.upload_time = msg def get_upload_data(self, event, msg): - self.upload_time = EventMesh.publish("get_storage_config","upload_time") return self.upload_time class getplayAudiodStateManager(Abstract):#获取设置播放音频状态 @@ -2938,6 +3386,8 @@ class getSosFlagManager(Abstract):#设置sos EventMesh.subscribe("set_hangup_mode", self.set_hangup_mode) EventMesh.subscribe("get_hangup_mode", self.get_hangup_mode)#获取挂断方式 是对方挂断 还是手表按键主动挂断 + EventMesh.subscribe("send_sos_to_app",self.send_sos_to_app) + EventMesh.subscribe("close_sos_timer",self.close_sos_timer) def get_hangup_mode(self, event, msg): # 1是设备端手表主动挂断 0是手机端 @@ -2951,9 +3401,15 @@ class getSosFlagManager(Abstract):#设置sos if self.sos_flag == 1: number = EventMesh.publish("get_dial_sos_number") - + if number != None: if len(number) > 0: + sos_state = EventMesh.publish("get_dev_state") + tmp = 1 << 16 + sos_state = sos_state|tmp #第16位=1 + EventMesh.publish("set_dev_state",sos_state) + + EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,sos_state]) #开始AL定位 EventMesh.publish("save_phonename",number[0]) EventMesh.publish("save_phonenum",number[0]) EventMesh.publish("set_sos_num",0) @@ -2961,19 +3417,32 @@ class getSosFlagManager(Abstract):#设置sos #voiceCall.callStart(str(number[0])) def set_callnumer_cb(self, event, msg): - self.callnumer = msg - self.call_timer.start(8*1000, 0, self.call_timer_cb)#延迟10S 继续拨打 + if self.sos_flag == 1: + print("sos set_callnumer_cb!!!") + self.callnumer = msg + self.call_timer.start(8000, 0, self.call_timer_cb)#延迟8S 继续拨打 + + def send_sos_to_app(self,event,msg): + sos_state = EventMesh.publish("get_dev_state") + tmp = 1 << 16 + sos_state = sos_state|tmp #第16位=1 + EventMesh.publish("set_dev_state",sos_state) + EventMesh.publish(constants.EVENT.START_LOCATION,[constants.PROTOCOL.AL_SEND,sos_state]) #开始AL定位 + pass def call_timer_cb(self, *args, **kwargs): - # print("call_timer_cb:{}".format(self.callnumer)) + print("sos call_timer_cb!!!",self.sos_flag) EventMesh.publish("save_phonename",str(self.callnumer)) EventMesh.publish("save_phonenum",str(self.callnumer)) + EventMesh.publish("send_sos_to_app") + print("sos call_timer_cb!!!") EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) - + def close_sos_timer(self,event,msg): self.call_timer.stop() pass + def get_sos_flag(self, event, msg): return self.sos_flag @@ -3020,11 +3489,11 @@ class playPowerAudioManager(Abstract):#播放开关机音频文件 EventMesh.subscribe("play_poewr_off_event", self.play_poewr_off_event) def play_poewr_on_event(self, event, msg): - self.aud.play(1, 1, 'U:/static/R_POWER_1.mp3') #播放播放开机铃声 + self.aud.play(1, 1, 'E:/static/R_POWER_1.mp3') #播放播放开机铃声 def play_poewr_off_event(self, event, msg): self.aud.setVolume(11) - self.aud.play(1, 1, 'U:/static/R_POWER_OFF_1.mp3') #播放关机铃声 + self.aud.play(1, 1, 'E:/static/R_POWER_OFF_1.mp3') #播放关机铃声 class getBootOffManager(Abstract):#开关机时间 def __init__(self): @@ -3048,9 +3517,9 @@ class getBootOffManager(Abstract):#开关机时间 EventMesh.subscribe("get_boot_off_time", self.get_boot_off_time) def set_boot_off_time(self, event, msg): - EventMesh.publish("set_storage_config",["off_on",msg[0]]) - EventMesh.publish("set_storage_config",["off_start",msg[1]]) - EventMesh.publish("set_storage_config",["off_end",msg[2]]) + EventMesh.publish("get_storage_config",["off_on",msg[0]]) + EventMesh.publish("get_storage_config",["off_start",msg[1]]) + EventMesh.publish("get_storage_config",["off_end",msg[2]]) self.off_msg = msg @@ -3068,6 +3537,21 @@ class getBootOffManager(Abstract):#开关机时间 flag = 1 return [self.off_msg,flag] +class setSmsIndexManager(Abstract):# + def __init__(self): + self.index = -1 + + def post_processor_after_instantiation(self): + EventMesh.subscribe("set_sms_index", self.set_sms_index)#设置关机时间 + EventMesh.subscribe("get_sms_index", self.get_sms_index) + + def set_sms_index(self, event, msg): + self.index = msg + + + def get_sms_index(self, event, msg): + + return self.index import protocol class testSmsSetIPManager(Abstract):# def __init__(self): @@ -3204,151 +3688,88 @@ class testSmsSetIPManager(Abstract):# def get_server_state(self, event, msg): return self.server_sate - -class setkeyboardManager(Abstract):#设置键盘开关状态 + +class schoolclassManager(Abstract):# def __init__(self): - self.key_state = 0 - tmp_data = EventMesh.publish("get_storage_config","key_board") + # ['火星情报局', '一年级二班', '柠檬茶'] + self.school_name = '' + self.class_name = '' + self.full_name = '' + tmp_data = EventMesh.publish("get_storage_config","school_name") if tmp_data != None: - self.key_state = tmp_data - - - def post_processor_after_instantiation(self): - EventMesh.subscribe("set_key_board", self.set_key_board)#设置关机时间 - EventMesh.subscribe("get_key_board", self.get_key_board) - - def set_key_board(self, event, msg): - self.key_state = msg - EventMesh.publish("set_storage_config",["key_board",self.key_state]) - + self.school_name = tmp_data + tmp_data = EventMesh.publish("get_storage_config","class_name") + if tmp_data != None: + self.class_name = tmp_data + tmp_data = EventMesh.publish("get_storage_config","full_name") + if tmp_data != None: + self.full_name = tmp_data - def get_key_board(self, event, msg): - return self.key_state - -class vedioInforManager(Abstract):# - def __init__(self): - self.call_id = "" - self.meet_id = ""#会议id - self.call_type = 0 #会议id - self.tokens_data= ""#tokens - pass def post_processor_after_instantiation(self): - EventMesh.subscribe("set_vedio_call_id", self.set_vedio_call_id)# - EventMesh.subscribe("set_vedio_meet_id", self.set_vedio_meet_id)# - EventMesh.subscribe("set_vedio_call_type", self.set_vedio_call_type)# - EventMesh.subscribe("set_vedio_tokens_data", self.set_vedio_tokens_data)# - - EventMesh.subscribe("get_vedio_call_id", self.get_vedio_call_id)# - EventMesh.subscribe("get_vedio_meet_id", self.get_vedio_meet_id)# - EventMesh.subscribe("get_vedio_call_type", self.get_vedio_call_type)# - EventMesh.subscribe("get_vedio_tokens_data", self.get_vedio_tokens_data)# - - def set_vedio_call_id(self, event, msg): - self.call_id = msg + EventMesh.subscribe("set_schoolname", self.set_school_name)# + EventMesh.subscribe("get_schoolname", self.get_school_name) - def set_vedio_meet_id(self, event, msg): - self.meet_id = msg + EventMesh.subscribe("set_classname", self.set_classname)# + EventMesh.subscribe("get_classname", self.get_classname) - def set_vedio_call_type(self, event, msg): - self.call_type = msg + EventMesh.subscribe("set_fullname", self.set_full_name)# + EventMesh.subscribe("get_fullname", self.get_full_name) - def set_vedio_tokens_data(self, event, msg): - self.tokens_data= msg + def set_school_name(self, event, msg): + if msg != None: + if len(msg) != 0: + self.school_name = str(msg) + EventMesh.publish("set_storage_config",["school_name",str(msg)]) - def get_vedio_call_id(self, event, msg): - return self.call_id - - def get_vedio_meet_id(self, event, msg): - return self.meet_id - - def get_vedio_call_type(self, event, msg): - return self.call_type - - def get_vedio_tokens_data(self, event, msg): - return self.tokens_data + def get_school_name(self, event, msg): + if self.school_name: + return self.school_name + else: + return None - - -class simFactoryManager(Abstract):#恢复出厂设置 - def __init__(self): - self.timer= osTimer() - self.new_simiccid = '' - self.new_simiccid = EventMesh.publish("get_storage_config","new_sim_iccid") - pass - - - def post_processor_after_instantiation(self): - EventMesh.subscribe("sim_factory_event", self.sim_factory_event)# - EventMesh.subscribe("get_sim_new_iccid", self.get_sim_new_iccid)# - EventMesh.subscribe("set_sim_new_iccid", self.set_sim_new_iccid)# - - def sim_factory_event(self, event, msg): - + def set_classname(self, event, msg): + if msg != None: + if len(msg) != 0: + self.class_name = str(msg) + EventMesh.publish("set_storage_config",["class_name",str(msg)]) + - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂 - ret = 0 - ret = ql_fs.path_exists("/usr/static/storage_file")#电话本 - if ret == True: - ql_fs.rmdirs("/usr/static/storage_file") - ql_fs.mkdirs("/usr/static/storage_file") - EventMesh.publish(constants.PROTOCOL.DLT_SEND) - self.timer.start(4000,0,self.timer_cb_threescond) - - def timer_cb_threescond(self,e): - - Power.powerRestart() - - def get_sim_new_iccid(self, event, msg): - return self.new_simiccid + def get_classname(self, event, msg): + if self.class_name: + return self.class_name + else: + return None + def set_full_name(self, event, msg): + if msg != None: + if len(msg) != 0: + self.full_name = str(msg) + EventMesh.publish("set_storage_config",["full_name",str(msg)]) - def set_sim_new_iccid(self, event, msg): - EventMesh.publish("set_storage_config",["new_sim_iccid",msg]) - self.new_simiccid = msg + def get_full_name(self, event, msg): + if self.full_name: + return self.full_name + else: + return None -class cameraAlbumManager(Abstract):#保存相册数目 +class setCallStateManager(Abstract):#设置电话通话状态 def __init__(self): - self.album_list = {} - self.album_num = 0 - check_txt = ql_fs.path_exists("/usr/static/storage_file/album_config.json") - if check_txt == True : - with open("/usr/static/storage_file/album_config.json","r") as fd:#音频文件编号 - self.album_list = ujson.load(fd) - if not self.album_list: - self.album_list = {} - self.album_num = 0 - else: - b = str("num") in self.album_list.keys() - if b == True: - self.album_num = self.album_list["num"] - else : - self.album_list = {} - with open("/usr/static/storage_file/album_config.json","w",encoding="utf-8") as fd: - ujson.dump(self.album_list,fd) - - + self.call_state = 0 def post_processor_after_instantiation(self): - EventMesh.subscribe("set_camera_num", self.set_camera_num)# - EventMesh.subscribe("get_camera_num", self.get_camera_num) + EventMesh.subscribe("set_call_state", self.set_call_state)#设置关机时间 + EventMesh.subscribe("get_call_state", self.get_call_state) - - - def set_camera_num(self, event, msg): - self.album_num = msg - # self.album_list = msg - # with open("/usr/static/storage_file/album_config.json","w+",encoding="utf-8") as fd: - # ujson.dump(self.album_list,fd) - # # sorted_keys = sorted(self.album_list.keys()) - # # print("self.album_list",self.album_list,sorted_keys) + def set_call_state(self, event, msg): + self.call_state = msg - def get_camera_num(self, event, msg): + def get_call_state(self, event, msg): - return self.album_num - + return self.call_state + class setclassTimeManager(Abstract):#设置上课禁用时间 def __init__(self): self.class_buf = {} @@ -3383,36 +3804,110 @@ class setclassTimeManager(Abstract):#设置上课禁用时间 hour = data[4]#当前小时 min = data[5]#当前分钟 - cur_week = int(data[3])#星期几 + cur_week = data[3]#星期几 + + + cur_hour = hour cur_min = min - + cur_total_min = cur_hour*60+cur_min #print("cur_total_min",cur_total_min) + start_time1 = 0 + end_time1 = 0 + week1 = [] + enable1 = 0 + + start_time2 = 0 + end_time2 = 0 + week2 = [] + enable2 = 0 + + start_time3 = 0 + end_time3 = 0 + week3 = [] + enable3 = 0 + + start_time4 = 0 + end_time4 = 0 + week4 = [] + enable4 = 0 + self.class_state = 0 - class_info = EventMesh.publish("get_storage_config","class_alarm") - # print("10s class_inf o",class_info) - if class_info != None and class_info != []: - if len(class_info) != 0: - i = 0 - for i in range(len(class_info)): - start_hour = int(class_info[i]["start_hour"]) - start_min = int(class_info[i]["start_min"]) - end_hour = int(class_info[i]["end_hour"]) - end_min = int(class_info[i]["end_min"]) - enable = int(class_info[i]["enable"]) - day = class_info[i]["day"] - - start_total_min = start_hour*60+start_min - end_total_min = end_hour*60+end_min - - cur_total_min = cur_hour*60+cur_min - - if enable != 0 and cur_week in day:#使能并且星期在内 判断时间是否大于开始时间并且小于结束时间 - if cur_total_min >= start_total_min and cur_total_min <= end_total_min:# - self.class_state = 1 - print("enter class") - break + # {'1': {'enabled': 1, 'end_hour': '17:00', 'start_hour': '10:00', 'week': [1, 2, 3, 4, 5]}, + # '0': {'enabled': 1, 'end_hour': '17:00', 'start_hour': '08:00', 'week': [1, 2, 3, 4, 5]}, + # '3': {'enabled': 1, 'end_hour': '17:00', 'start_hour': '08:00', 'week': [1, 2, 3, 4, 5]}, + # '2': {'enabled': 1, 'end_hour': '17:00', 'start_hour': '08:00', 'week': [1, 2, 3, 4, 5]}} + # print("self.class_buf time:",self.class_buf) + if len(self.class_buf) != 0: + #19:56; 9:16 + data1 = self.class_buf["0"] + start_time1 = int(data1["start_time"].split(":")[0])*60+int(data1["start_time"].split(":")[1]) + end_time1 = int(data1["end_time"].split(":")[0])*60 + int(data1["end_time"].split(":")[1]) + + week1 = data1["week"] + enable1 = data1["enable"] + + data2 = self.class_buf["1"] + start_time2 = int(data2["start_time"].split(":")[0])*60 + int(data2["start_time"].split(":")[1]) + end_time2 = int(data2["end_time"].split(":")[0])*60 + int(data2["end_time"].split(":")[1]) + + week2 = data2["week"] + enable2 = data2["enable"] + + data3 = self.class_buf["2"] + start_time3 = int(data3["start_time"].split(":")[0])*60 + int(data3["start_time"].split(":")[1]) + end_time3= int(data3["end_time"].split(":")[0])*60 + int(data3["end_time"].split(":")[1]) + + week3 = data3["week"] + enable3 = data3["enable"] + + data4 = self.class_buf["3"] + start_time4= int(data4["start_time"].split(":")[0])*60 + int(data4["start_time"].split(":")[1]) + end_time4 = int(data4["end_time"].split(":")[0])*60 + int(data4["end_time"].split(":")[1]) + + week4 = data4["week"] + enable4 = data4["enable"] + week1_state = 0 + week2_state = 0 + week3_state = 0 + week4_state = 0 + # print("end_time1 ",start_time1,end_time1,start_time2,end_time2,start_time3,end_time3,start_time4,end_time4) + for i in range(0,7): + if ((cur_week in week1) and enable1 == 1): + week1_state = 1 + if ((cur_week in week2) and enable2 == 1): + week2_state = 1 + + if ((cur_week in week3) and enable3 == 1): + week3_state = 1 + + if ((cur_week in week4) and enable4 == 1): + week4_state = 1 + + if ((cur_week in week1) and enable1 == 1) or ((cur_week in week2) and enable2 == 1) or\ + ((cur_week in week3) and enable3 == 1) or ((cur_week in week4) and enable4 == 1): + if enable1 == 1 or enable2 == 1 or enable3 == 1 or enable4 == 1: + if week1 != [] or week2 != [] or week3 != [] or week4 != []: + if (end_time1 > start_time1 and enable1 == 1 and week1_state == 1) or (end_time2 > start_time2 and enable2 == 1 and week2_state == 1) or\ + (end_time3 > start_time3 and enable3 == 1 and week3_state == 1) or (end_time4 > start_time4 and enable4 == 1 and week4_state == 1): + if (cur_total_min <= end_time1 and cur_total_min >= start_time1 and enable1 == 1) or (cur_total_min <= end_time2 and cur_total_min >= start_time2 and enable2 == 1) or\ + (cur_total_min <= end_time3 and cur_total_min >= start_time3 and enable3 == 1) or (cur_total_min <= end_time4 and cur_total_min >= start_time4 and enable3 == 1): + self.class_state = 1 + print("class_in1") + break + else:#开始时间小于结束时间属于垮天 9:00 -7:00 7*60 6:00 + + # print("end_time1!!!!!!!!!",start_time1,end_time1,start_time2,end_time2,start_time3,end_time3,start_time4,end_time4) + if (((end_time1 >= cur_total_min or cur_total_min >= start_time1) and enable1 == 1 and week1_state == 1)or \ + ((end_time2 >= cur_total_min or cur_total_min >= start_time2) and enable2 == 1 and week2_state == 1) or\ + ((end_time3 >= cur_total_min or cur_total_min >= start_time3) and enable3 == 1 and week3_state == 1) or \ + ((end_time4 >= cur_total_min or cur_total_min >= start_time4) and enable4 == 1 and week4_state == 1)): + self.class_state = 1 + print("class_in2") + break + + return self.class_state def get_class_in_time_page(self, event, msg): @@ -3428,13 +3923,35 @@ class setclassTimeManager(Abstract):#设置上课禁用时间 else: if screen_NAME != None: if screen_NAME == "class_time": - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) + EventMesh.publish("load_screen", {"screen": "main_menu"}) pass + +class getsosInfoManager(Abstract):#平台下发sos内容 + def __init__(self): + self.sos_message = "" + + def post_processor_after_instantiation(self): + EventMesh.subscribe("set_sos_message", self.set_sos_message)#设置关机时间 + EventMesh.subscribe("get_sos_message", self.get_sos_message) + + def set_sos_message(self, event, msg): + if msg != None: + if len(str(msg)) != 0: + self.sos_message = msg + + + def get_sos_message(self, event, msg): + if self.sos_message : + return self.sos_message + else: + return None + + + + + - \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/motor.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/motor.py similarity index 90% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/motor.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/motor.py index cd31639b..7e932af3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/motor.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/motor.py @@ -31,6 +31,8 @@ class motorEventManager(Abstract):#马达事件 self.motor_mode = 0#模式 _thread.start_new_thread(self.motorInfo_queue_thread, ()) EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo) + EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数 + EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器 pass def motorInfo_queue_thread(self): @@ -50,15 +52,14 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0}) def post_processor_after_instantiation(self): - EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数 - EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器 + pass # msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数 def set_motor_time(self,event,msg): - open_power = EventMesh.publish("get_power_on_state")#获取开机标识 - if open_power != None: - if open_power == 0: - return + # open_power = EventMesh.publish("get_power_on_state")#获取开机标识 + # if open_power != None: + # if open_power == 0: + # return if msg != None: self.motor_enable = msg[0] if self.motor_enable == 1: #马达使能 @@ -78,6 +79,7 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("close_motor_infor")#关闭马达和定时器 return if self.motor_mode == 1:# + if self.motor_total_time > 0: self.motor_total_time-=1 if self.motor_total_time > 0: @@ -87,8 +89,10 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("close_motor_infor")#关闭马达和定时器 return elif self.motor_mode == 2:# + # print("motor_fun_cb:{}\r\n".format(self.motor_total_time)) # print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time) if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3 + # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time)) open_motor() else: close_motor() @@ -99,6 +103,8 @@ class motorEventManager(Abstract):#马达事件 def close_motor_infor(self,event,msg): print("close_motor_infor!!!") + if self.motor_enable == 0:#未使能马达定时器 + return close_motor() self.motor_enable = 0#马达使能 self.motor_total_time = 0#总的时间 diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/protocol.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py similarity index 65% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/protocol.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py index 6019a95c..6fdc5cf6 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/protocol.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/protocol.py @@ -17,11 +17,11 @@ import usocket import osTimer import machine -import urandom + import _thread -import request import usys - +import urandom +import request def server_init(server_type = None): #服务器选择1,防走丢,2大锤,3三基同创,4童信 5云米 if server_type == None: @@ -30,7 +30,7 @@ def server_init(server_type = None): d_server_addr = "api.xcloudtech.com" d_server_port = 9000 d_md5_key = "bZld0ALsZTt15tKEZhOlLPgbsO75BLTP" - d_PID = "SZKW" + d_PID = "SZKW" if server_type == 1: pass # server_addr = "api.xcloudtech.com" @@ -57,7 +57,11 @@ def server_init(server_type = None): d_server_port = 8505 d_md5_key = "" d_PID = "3G" - + elif server_type == 6: + d_server_addr = "120.26.104.21" + d_server_port = 9968 + d_md5_key = "bZld0ALsZTt15tKEZhOlLPgbsO75BLTP" + d_PID = "SZKW" return [d_server_addr,d_server_port,d_md5_key,d_PID] from queue import Queue def unicode_to_utf8(src): @@ -165,7 +169,7 @@ class SockManager(Abstract): def connect(self): print("connect1{}:{}".format(self.server_addr, self.server_port)) - if EventMesh.publish("network_state") == 0: #没注网 + if EventMesh.publish("get_sim_Status") != 1: #没sim return try: if(self.sock != None) : @@ -177,8 +181,10 @@ class SockManager(Abstract): #utime.sleep_ms(500) # 发送数据 - self.publish_timer.start(1000, 0, self.publish_timer_cb) + self.publish_timer.start(2000, 1, self.publish_timer_cb) + EventMesh.publish(constants.PROTOCOL.LK_SEND) + print("connect LK_SEND!!!!!!!!!!!!!!") except Exception as e: #usys.print_exception(e) self.run_flag = False @@ -187,11 +193,11 @@ class SockManager(Abstract): print("connect2{}:{}".format(self.server_addr, self.server_port)) self.reconnect_flag = 0 def publish_timer_cb(self, *args): - EventMesh.publish(constants.PROTOCOL.LK_SEND) self.authen_set() def authen_set(self): sever_state = EventMesh.publish("get_server_state")#获取修改服务器状态 + # print("sever_state{}".format(sever_state)) if sever_state != None: if sever_state == 0: imei = EventMesh.publish(constants.EVENT.GET_IMEI) @@ -219,13 +225,15 @@ class SockManager(Abstract): # 转成十六进制表示 sign_data = ubinascii.hexlify(res) sign_data = sign_data.decode('ascii') - print("sign_data:{} sonce_data:{}".format(md5_data,sign_data)) + # print("sign_data:{} sonce_data:{}".format(md5_data,sign_data)) # sign_data = MD5_head # http://8.134.110.49:31379/dev/device/check?imei=&bid=sonce=sign= - ip_addr = "iot.api.thisiot.com" - # url = "http://{}/dev/device/check?imei={}&bid={}&sonce={}&sign={}".format(ip_addr,imei,pid_data,sonce_data,sign_data) + # ip_addr = "test.iot.api.thisiot.com" + # ip_addr = "app.api.thisiot.com" + # http://app.api.thisiot.com/ url = "http://app.api.thisiot.com/dev/device/check?imei={}&bid={}&sonce={}&sign={}".format(imei,pid_data,sonce_data,sign_data) + # print("url:{}".format(url)) response = request.get(url) data_tmp ={} # d_server_addr = "device.miwitracker.com" @@ -241,7 +249,7 @@ class SockManager(Abstract): # "api.xcloudtech.com" # d_server_port = 9000 jsload_data = ujson.loads(c) - # print("jsload_data-{}".format(jsload_data)) + print("jsload_data-{}".format(jsload_data)) # jsload_data = {'data':'111','protocolType':'', 'host':'device.miwitracker.com', 'secretKey': 'bZld0ALsZTt15tKEZhOlLPgbsO75BLTP', 'port':8505, 'bid': '3G', 'extJsonStr': ''} # ujson.loads(c) @@ -257,8 +265,11 @@ class SockManager(Abstract): host = data_tmp["host"]#服务骑地址 secretKey = data_tmp["secretKey"]# pid = data_tmp["bid"]#产品型号 - port = data_tmp["port"]#端口 - if host != '' and port != '' and port != -1: + port = data_tmp["port"]#端口号 + + + + if host != '' and (port != '' and port != -1): if host != '': self.server_addr = host EventMesh.publish("set_ip",str(self.server_addr)) @@ -266,15 +277,16 @@ class SockManager(Abstract): if port != '' and port != -1: self.server_port = port EventMesh.publish("set_com",self.server_port) - EventMesh.publish("set_new_key", str(secretKey))#获取pid和key EventMesh.publish("set_new_pid",str(pid))#获取pid和key + # self.reconnect_timer_cb()#重连设备 + print("self.reconnect_flag",self.reconnect_flag) self.reconnect_flag = 0 self.reconnect()#重连设备 - EventMesh.publish("set_server_state",1)#获取修改服务器状态 - - - + self.publish_timer.stop() + EventMesh.publish("set_server_state",1)#获取修改服务器状态 + else: + self.publish_timer.stop() def check(self, *args): if (not self.run_flag) or (self.connect_tmp == 0) : #7分钟无数据读取,则认为是掉线了 @@ -335,7 +347,7 @@ class SockManager(Abstract): utime.sleep(1) def send(self, topic, msg): - # print("TCP:send data:{}".format(msg)) + #print("TCP:send data:{}".format(msg)) if EventMesh.publish("network_state") == 0: #没注网,则不发送 EventMesh.publish(constants.EVENT.SET_CONNECT, 0)#标记断网 print("dataCall not connect") @@ -402,7 +414,7 @@ class NetManager(Abstract): count = 0 while True: count += 1 - if count > 5 : + if count > 3 : return data = dataCall.getInfo(1, 0) print("data call INFO {}".format(data)) @@ -427,6 +439,7 @@ class NetManager(Abstract): def get_network_state(self, topic, msg): return self.network_state + class ProtoCol(Abstract): TYPE = "" HEADER = "#@{}@#;" @@ -441,6 +454,7 @@ class ProtoCol(Abstract): self.check_sum = None self.password = EventMesh.publish(constants.EVENT.GET_PASSWORD) self.imei = EventMesh.publish(constants.EVENT.GET_IMEI) + #print("ProtoCol:imei:{}".format(self.imei)) self.cid = EventMesh.publish(constants.EVENT.GET_CID) self.imsi = EventMesh.publish(constants.EVENT.GET_IMSI) self.key = EventMesh.publish(constants.EVENT.GET_KEY) @@ -463,8 +477,6 @@ class ProtoCol(Abstract): EventMesh.subscribe(self.TYPE + "_RECV", self.handler) def handler(self, event, msg): - # self.change_key_pid() - self.password = EventMesh.publish(constants.EVENT.GET_PASSWORD) self.imei = EventMesh.publish(constants.EVENT.GET_IMEI)#"867387060319166"#EventMesh.publish(constants.EVENT.GET_IMEI)#"867387060319166" #EventMesh.publish(constants.EVENT.GET_IMEI)#"867387060319166"#EventMesh.publish(constants.EVENT.GET_IMEI) #"867387060319166"#EventMesh.publish(constants.EVENT.GET_IMEI) #"867387060319166"#"867387060319188"#"867387060319177"#"867387060319166"#"860132060004322"#"867387060319166"#"860132060004322"#EventMesh.publish(constants.EVENT.GET_IMEI) self.cid = EventMesh.publish(constants.EVENT.GET_CID) @@ -527,7 +539,7 @@ class LK_ProtoCol(ProtoCol): def send(self, event, msg): #[SZKW*334588000000156*0002*LK] - #print('self.imei:%s'%(self.imei)) + print('lk self.imei:{}'.format(self.imei)) send_data = EventMesh.publish("get_new_pid")+"*%s*0002*LK"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) @@ -543,14 +555,12 @@ class LK_ProtoCol(ProtoCol): @param event: LK成功 @param msg: 接收到的下行数据 """ - print("LK_ProtoCol:recv:%s"%(msg)) EventMesh.publish(constants.PROTOCOL.PING_SEND) EventMesh.publish(constants.PROTOCOL.KA_SEND) EventMesh.publish(constants.PROTOCOL.TIME_SEND) EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始UD定位 EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.WT_SEND) #开始WT定位 - EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_REQ_SEND)#开机获取一次好友列表 EventMesh.publish(constants.PROTOCOL.MEMBERS_SEND) class PING_ProtoCol(ProtoCol): @@ -571,7 +581,7 @@ class PING_ProtoCol(ProtoCol): @param event: PING @param msg: 接收到的下行数据 - """ + """ #print("PING_ProtoCol:recv:%s"%(msg)) data_tmp = msg.decode('ascii') data_tmp = data_tmp.split(']')[0] #去掉] @@ -603,12 +613,17 @@ class KA_ProtoCol(ProtoCol): # print("old_step:send:%d %d"%(old_step,step)) EventMesh.publish("set_storage_config",["old_step_new",step+10]) EventMesh.publish("set_storage_config",["old_step_new",step]) - + else: + step = 0 old_step = step # step = EventMesh.publish(constants.EVENT.GET_STEP)[0] # 电池电量百分比 bat_tmp = EventMesh.publish("screen_get_battery") + if bat_tmp == None: + bat_tmp[1] = 100 + battery_caption = bat_tmp[1] + print("KA,{},{},{},{}".format(date,step,0,battery_caption)) send_data = "KA,%s,%d,%d,%d"%(date,step,0,battery_caption) send_len = len(send_data) @@ -629,7 +644,6 @@ class KA_ProtoCol(ProtoCol): @param event: PING @param msg: 接收到的下行数据 """ - #print("KA_ProtoCol:recv:%s"%(msg)) class UD_ProtoCol(ProtoCol): @@ -647,7 +661,7 @@ class UD_ProtoCol(ProtoCol): if self.UD_count>=6: self.UD_count = 0 EventMesh.publish(constants.PROTOCOL.WT_SEND,msg) - # EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始ud定位 + send_data ="UD,"+msg send_len = len(send_data) #wt_data = "%s"%(send_data) @@ -710,10 +724,9 @@ class FIND_ProtoCol(ProtoCol): @param event: FIND,播放铃声 @param msg: 接收到的下行数据 """ - EventMesh.publish(constants.PROTOCOL.FIND_SEND) # a = audio.Audio(0) - # a.set_pa(Pin.GPIO43) + # a.set_pa(Pin.GPIO29) # a.setVolume(10) # a.play(1, 1, 'E:/audio_audio_haixiu.mp3') #文件名前面要加上路径 @@ -872,7 +885,7 @@ class REMIND_ProtoCol(ProtoCol):#普通闹钟 TYPE = "REMIND" def send(self, event, msg): - send_data = self.PID+"*%s*0006*REMIND"%(self.imei) + send_data = EventMesh.publish("get_new_pid")+"*%s*0006*REMIND"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) @@ -1110,11 +1123,189 @@ class TEMP_ProtoCol(ProtoCol): # print("HRSTART_ProtoCol RECV msg:") #EventMesh.publish(constants.PROTOCOL.TEMP_SEND) +# 设置血压上传频率 +# 平台发送[XT*YYYYYYYYYYYYYYY*LEN*bldstart,x] +# x为上传间隔时间,单位秒,连续上传时最小时间不小于300秒,最大不超过65535. +# 示例[XT*334588000000156*0008*bldstart,300] +# 终端回复: +# [XT*334588000000156*0005*bldstart] +# x为1则代表终端单次上传。 +# x为0则代表终端上传关闭。 +class bldstart_ProtoCol(ProtoCol): + """app下发血压测试频率""" + TYPE = "bldstart" + def send(self, event, msg): + #[XT*334588000000156*len*wdstart,300] + send_data = EventMesh.publish("get_new_pid")+"*%s*0008*bldstart"%(self.imei) + MD5_SIGN = self.pack_MD5_head(send_data) + data = "[%s%s]"%(str(MD5_SIGN),send_data) + # print("temp:data:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + + def recv(self, event, msg): + """ + @param event: 体温下发频率数据 + @param msg: 接收到的下行数据 + """ + # print("WDSTART_ProtoCol RECV msg:") + print("bldstart:{}".format(msg)) + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_tmp = msg_tmp.split(',') + msg_tmp = msg_tmp[1] + + bldstartTotal = int(msg_tmp) + print("bldstartTotal:{}".format(bldstartTotal)) + if bldstartTotal == 1:#单次测量 + get_bp_state = EventMesh.publish("get_bp_state") + get_hr_state = EventMesh.publish("get_hr_state") + get_spo2_state = EventMesh.publish("get_spo2_state") + print("get_bp_state:{}".format(get_bp_state)) + if get_bp_state == 0 and get_hr_state == 0 and get_spo2_state == 0:#只要两个不在测量 单次优先级最低 + EventMesh.publish("set_bp_state",3)#3代表单次测量 + else: + if bldstartTotal > 0 and bldstartTotal <= 300: + bldstartTotal = 300 + elif bldstartTotal >= 65536: + bldstartTotal = 65536 + EventMesh.publish("set_bp_time", bldstartTotal) + + EventMesh.publish(constants.PROTOCOL.BLDSTART_SEND) + + +# 注:回复完后开始测量血压并上传(一般测一次90秒,app端会提醒用户两分钟后刷新页面查看) +# 上传血压数据 +# 终端发送[XT*YYYYYYYYYYYYYYY*LEN*blood,x,y] +# x 是收缩压(高压) +# y 是舒张压(低压) +# 示例[XT*334588000000156*000C*blood,150,70] +# 平台回复: +# [XT*334588000000156*0005*blood] +class blood_ProtoCol(ProtoCol): + """上传血压测试数据""" + TYPE = "blood" + def send(self, event, msg): + len_size = len(str(msg[0]))+len("blood,")+1+len(str(msg[1])) + print("blood:send:{} len:{}".format(msg,len_size)) + # 实例:[XT*334588000000156*0009*blood,36,2] + # 代表终端的 + # 平台回复: + # [XT*334588000000156*0004*blood] + send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*blood"%(self.imei,len_size) + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"blood") + MD5_SIGN = self.pack_MD5_head(MD5_head_data) + data = "[%s%s,%d,%d]"%(str(MD5_SIGN),send_data,msg[0],msg[1]) + print("blood:data:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + + def recv(self, event, msg): + """ + @param event: + @param msg: 接收到的下行数据 + """ + # print("HRSTART_ProtoCol RECV msg:") + #EventMesh.publish(constants.PROTOCOL.TEMP_SEND) + + + +class TEMP_Hour_ProtoCol(ProtoCol): #云米服务独立指令体温 + """上传体温频率 小时单位""" + TYPE = "bodytemp" + def send(self, event, msg): + #[XT*334588000000156*len*wdstart,300] + send_data = EventMesh.publish("get_new_pid")+"*%s*0008*bodytemp"%(self.imei) + MD5_SIGN = self.pack_MD5_head(send_data) + data = "[%s%s]"%(str(MD5_SIGN),send_data) + # print("temp:data:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + + def recv(self, event, msg): + """ + @param event: 体温下发频率数据 + @param msg: 接收到的下行数据 + """ + # print("WDSTART_ProtoCol RECV msg:") + #TCP recv: data:b'[3G*860132060126844*000C*bodytemp,1,2]' + print("bodytemp:{}".format(msg)) + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_tmp = msg_tmp.split('bodytemp,') + msg_tmp = msg_tmp[1] + + body_time = 0 + body_on = 0 + body_on = msg_tmp.split(',')[0]#开关 + body_time = msg_tmp.split(',')[1] + + if int(body_on) == 0: + body_time = 0 + else: + body_time = int(body_time)*3600 + + tempTotal = int(body_time) + + + EventMesh.publish("set_temp_time",tempTotal) + EventMesh.publish(constants.PROTOCOL.BODYTEMP_SEND) + +class bodytemp2_ProtoCol(ProtoCol): + """立即测量""" + TYPE = "bodytemp2" + def send(self, event, msg): + #[XT*334588000000156*len*bodytemp2,300] + send_data = EventMesh.publish("get_new_pid")+"*%s*0009*bodytemp2"%(self.imei) + MD5_SIGN = self.pack_MD5_head(send_data) + data = "[%s%s]"%(str(MD5_SIGN),send_data) + # print("temp:data:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + + def recv(self, event, msg): + """ + @param event: 体温下发频率数据 + @param msg: 接收到的下行数据 + """ + # print("bodytemp2_ProtoCol RECV msg:") + print("bodytemp2:{}".format(msg)) + get_temp_state = EventMesh.publish("get_temp_state") + print("get_temp_state:{}".format(get_temp_state)) + if get_temp_state == 0:#只要两个不在测量 单次优先级最低 + EventMesh.publish("set_temp_state",3)#3代表单次测量 + EventMesh.publish(constants.PROTOCOL.BODYTEMP2_SEND) +class btemp2_ProtoCol(ProtoCol):#上传体温数据 + """立即测量""" + TYPE = "btemp2" + def send(self, event, msg): + # [3G*YYYYYYYYYY*LEN*btemp2,type,temp] Type :测量模式:0:额头模式 1: 手腕模式Temp :体温, + len_size = len(str(msg[0]))+len("btemp2,")+1+len(str(msg[1])) + print("btemp2:send:{} len:{}".format(msg,len_size)) + # 实例:[XT*334588000000156*0009*btemp2,1,36.2] + # 代表终端的温度为:36.2 + # 平台回复: + # [XT*334588000000156*0004*btemp2] + send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*btemp2"%(self.imei,len_size) + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"btemp2") + MD5_SIGN = self.pack_MD5_head(MD5_head_data) + data = "[%s%s,%d,%s]"%(str(MD5_SIGN),send_data,1,msg[1]) + # print("btemp2:data:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + + def recv(self, event, msg): + """ + @param event: 体温下发频率数据 + @param msg: 接收到的下行数据 + """ + # print("btemp2_ProtoCol RECV msg:") + + class WDSTART_ProtoCol(ProtoCol): """上传体温频率""" TYPE = "wdstart" def send(self, event, msg): - #[XT*334588000000156*len*wdstart,300] send_data = EventMesh.publish("get_new_pid")+"*%s*0007*wdstart"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1128,7 +1319,6 @@ class WDSTART_ProtoCol(ProtoCol): @param event: 体温下发频率数据 @param msg: 接收到的下行数据 """ - # print("WDSTART_ProtoCol RECV msg:") print("wdstart:{}".format(msg)) msg = msg[1:-1] @@ -1142,7 +1332,6 @@ class WDSTART_ProtoCol(ProtoCol): get_temp_state = EventMesh.publish("get_temp_state") print("get_temp_state:{}".format(get_temp_state)) if get_temp_state == 0:#只要两个不在测量 单次优先级最低 - EventMesh.publish("set_temp_state",3)#3代表单次测量 else: if tempTotal > 0 and tempTotal <= 300: @@ -1151,9 +1340,6 @@ class WDSTART_ProtoCol(ProtoCol): tempTotal = 65536 EventMesh.publish("set_temp_time",tempTotal) - - - EventMesh.publish(constants.PROTOCOL.WDSTART_SEND) #解绑 # [XT*334588000000156*0003*DLT] @@ -1164,12 +1350,11 @@ class DLT_ProtoCol(ProtoCol): """解绑数据""" TYPE = "DLT" def send(self, event, msg): - - # [XT*334588000000156*0004*temp] + # [XT*334588000000156*0004*DLT] send_data = EventMesh.publish("get_new_pid")+"*%s*0003*DLT"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("temp:data:%s"%(data)) + print("DLT:data:%s"%(data)) # 通过socket发送到服务器端 EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) @@ -1186,8 +1371,7 @@ class UPLOAD_ProtoCol(ProtoCol): """定位频率数据""" TYPE = "UPLOAD" def send(self, event, msg): - - # [XT*334588000000156*0004*temp] + # [XT*334588000000156*0004*UPLOAD] send_data = EventMesh.publish("get_new_pid")+"*%s*0006*UPLOAD"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) @@ -1217,8 +1401,7 @@ class CENTER_ProtoCol(ProtoCol): """设置快捷号码""" TYPE = "CENTER" def send(self, event, msg): - - # [XT*334588000000156*0004*temp] + # [XT*334588000000156*0004*CENTER] send_data = EventMesh.publish("get_new_pid")+"*%s*0006*CENTER"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) @@ -1248,7 +1431,6 @@ class MONITOR_ProtoCol(ProtoCol): """呼叫快捷号码""" TYPE = "MONITOR" def send(self, event, msg): - # [XT*334588000000156*0004*MONITOR] send_data = EventMesh.publish("get_new_pid")+"*%s*0007*MONITOR"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1262,7 +1444,6 @@ class MONITOR_ProtoCol(ProtoCol): @param event: @param msg: 接收到的下行数据 """ - # b'[SZKW*867387060319166*000A*MONITOR]' msg = msg[1:-1] msg_tmp = msg.decode('ascii') msg_tmp = msg_tmp.split('MONITOR') @@ -1292,7 +1473,6 @@ class bootoff_ProtoCol(ProtoCol): """定时开关机""" TYPE = "BOOTOFF" def send(self, event, msg): - # [XT*334588000000156*0004*MONITOR] send_data = EventMesh.publish("get_new_pid")+"*%s*0007*BOOTOFF"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1354,7 +1534,7 @@ class sosHome_dial_ProtoCol(ProtoCol): num = len(msg_tmp)-1 data = [] for i in range(num): - # print("sos:send data :{}".format(msg_tmp[i+1])) + print("sos:send data :{}".format(msg_tmp[i+1])) if len(msg_tmp[i+1]) != 0: EventMesh.publish("set_storage_config",["SOS_NUMBER{}".format(i+1),msg_tmp[i+1]]) data.append(str(msg_tmp[i+1])) @@ -1363,14 +1543,13 @@ class sosHome_dial_ProtoCol(ProtoCol): EventMesh.publish("set_dial_sos_number",data) EventMesh.publish(constants.PROTOCOL.SOS_SEND) - + # 低电提醒 #[XT*334588000000156*0008*LOWBAT,1] class LOWBAT_ProtoCol(ProtoCol): """低电提醒""" TYPE = "LOWBAT" def send(self, event, msg): - # [XT*334588000000156*0006*LOWBAT] send_data = EventMesh.publish("get_new_pid")+"*%s*0006*LOWBAT"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1395,13 +1574,12 @@ class LOWBAT_ProtoCol(ProtoCol): EventMesh.publish("set_low_bat_btn",on_bt) EventMesh.publish(constants.PROTOCOL.LOWBAT_SEND) -# +# 低电提醒 #[XT*334588000000156*0008*LOWBAT,1] class Time_ProtoCol(ProtoCol): """设置系统时间""" TYPE = "Time" def send(self, event, msg): - # [XT*334588000000156*0006*LOWBAT] send_data = EventMesh.publish("get_new_pid")+"*%s*0004*Time"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1429,42 +1607,45 @@ class Time_ProtoCol(ProtoCol): machine.RTC().datetime((next_alarm_time[0],next_alarm_time[1],next_alarm_time[2],next_alarm_time[6],next_alarm_time[3],next_alarm_time[4],next_alarm_time[5],0)) #next_alarm_time = utime.localtime(old_Timesec)#年月日时分秒星期365中的第几天 - + EventMesh.publish("set_rtc_alarm") #EventMesh.publish(constants.PROTOCOL.TIME_SEND) -#拒接模式来电 -class WLKEY_ProtoCol(ProtoCol): - """""" +class WLKEY_ProtoCol(ProtoCol):#白名单开关 + """ + 白名单开关 + [XT*YYYYYYYYYYYYYYY*LEN*WLKEY,ONOFF] ONOFF: 1:开启,0:关闭,2:30秒后自动接听。 + 实例:[XT*334588000000156*0008*WLKEY,1] + 终端回复 + [XT*YYYYYYYYYYYYYYY*LEN*WLKEY] + 实例:[XT*334588000000156*0006*WLKEY] + """ TYPE = "WLKEY" + def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] send_data = EventMesh.publish("get_new_pid")+"*%s*0005*WLKEY"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - # print("WLKEY:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*KEYBRD]' - # print("WLKEY!!!!!!!!!!!!!",msg) - EventMesh.publish(constants.PROTOCOL.WLKEY_SEND) -# [SG*5678901234*0037* SILENCETIMEFS,21:10-7:30@0111110,21:10-7:30@0111110,21:10-7:30@0111110,21:10-7:30@0111110] + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_data = msg_tmp.split(',') + print("WLKEY_ProtoCol".format(msg_data[1])) + EventMesh.publish("set_storage_config",["WLKEY",str(msg_data[1])]) + + + EventMesh.publish(constants.PROTOCOL.WLKEY_SEND) #免打扰 class SILENCETIMEFS_ProtoCol(ProtoCol):#云米 """上课禁用""" TYPE = "SILENCETIMEFS" def send(self, event, msg): - # [XT*334588000000156*0006*SILENCETIME2] a b c d send_data = EventMesh.publish("get_new_pid")+"*%s*000D*SILENCETIMEFS"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1479,66 +1660,84 @@ class SILENCETIMEFS_ProtoCol(ProtoCol):#云米 @param event: @param msg: 接收到的下行数据 """ - # [XT*YYYYYYYYYYYYYYY*LEN*SILENCETIME2,时间段-开关-自定义日期,时间段-开关-自定义日期,时 - # 间段-开关-自定义日期] - class_in_buf = [] - # b'[SZKW*860132060128139*004E*SILENCETIME2,00:00-09:00-1-0111110,15:00-22:00-0-1111111,00:00-23:00-0-0100001]' + class_in_buf = {"1": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []},\ + "0": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}, \ + "3": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}, \ + "2": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}} + # class_in_buf.append({'start_hour': "16:54", 'week': [], 'idx': 0, 'enabled': 0, 'end_hour': "18:39"}) msg = msg[1:-1] msg_tmp = msg.decode('ascii') - msg_tmp_d = str(msg_tmp.split('SILENCETIME2,')[1]) + msg_tmp_d = str(msg_tmp.split('SILENCETIMEFS,')[1]) - count = 0 + count = 1 k = 0 - i = 0 + for i in range(len(str(msg_tmp_d))): if msg_tmp_d[i] == ',': count+=1 - - count+=1 - if count >= 3: - count = 3 - print("class count",count) - for i in range(0,count):#00:00-09:00-1-0111110,15:00-22:00-0-1111111,00:00-23:00-0-0100001默认是三个时间多了也不保存 - alarm_day = [] - alarm_data = str(msg_tmp_d.split(',')[i]) - # print("i",i,sleep_data) - if len(alarm_data) != 0: - b = alarm_data.find('-') - if b != -1: - start_time = alarm_data.split('-')[0]#-作为分隔符 - end_time = alarm_data.split('-')[1]#-作为分隔符 - alarm_enable = int(alarm_data.split('-')[2])#是单次还是每天 还是自定义 - start_hour = int(start_time.split(":")[0])#时间 - start_min = int(start_time.split(":")[1])#冒号分隔时间 时 分 + for x in range(count):#21:10-7:30@0111110,21:10-7:30@0111110,21:10-7:30@0111110,21:10-7:30@0111110 + week = [] + if x >= 4: + break + if count > 1: - end_hour = int(end_time.split(":")[0])#时间 - end_min = int(end_time.split(":")[1])#冒号分隔时间 时 分 - - alarm_day_tmp = alarm_data.split('-')[3]#-作为分隔符 - if len(str(alarm_day_tmp)) != 0: + msg_data = msg_tmp_d.split(',')[x] + print("SILENCETIMEFS count",msg_data) + b = msg_data.find('-') + if b != -1: + data = msg_data.split('-')#-作为分隔符 + time = data[1].split('@')#@作为分隔符 + print("data",data,time,data[0],time[0]) + start_time = data[0]#开始时间 + end_time = time[0]#结束时间 + enable = 1 + week_day = time[1] + for i in range(0,7): + if week_day[i] != '0': + week.append(i) + tmp={} + tmp["start_time"] = start_time + tmp["end_time"] = end_time + tmp["week"] = week + tmp["enable"] = enable + class_in_buf["{}".format(x)] = tmp + else: + if len(msg_tmp_d) != 0: + b = msg_tmp_d.find('-') + if b != -1: + + data = msg_tmp_d.split('-')#-作为分隔符 + time = data[1].split('@')#@作为分隔符 + print("data",data,time,data[0],time[0]) + start_time = data[0]#开始时间 + end_time = time[0]#结束时间 + enable = 1 + week_day = time[1] for i in range(0,7): - if alarm_day_tmp[i] != '0': - alarm_day.append(i) - # if alarm_switch = 0: - class_in_buf.append({"start_hour":start_hour,"start_min":start_min,"end_hour":end_hour,"end_min":end_min,"day":alarm_day,"enable":alarm_enable}) - - EventMesh.publish("set_storage_config",["class_alarm",class_in_buf]) - class_alarm = EventMesh.publish("get_storage_config","class_alarm") - print("class_alarm",class_alarm) + if week_day[i] != '0': + week.append(i) + tmp={} + tmp["start_time"] = start_time + tmp["end_time"] = end_time + tmp["week"] = week + tmp["enable"] = enable + class_in_buf["{}".format(x)] = tmp + + with open("/usr/static/storage_file/class_msg.json", 'w+',encoding='utf-8') as fd: + ujson.dump(class_in_buf,fd) + EventMesh.publish("set_class_time", class_in_buf) - EventMesh.publish(constants.PROTOCOL.SILENCETIME2_SEND) + EventMesh.publish(constants.PROTOCOL.SILENCETIMEFS_SEND) EventMesh.publish("get_class_in_time_page") - #免打扰 class SILENCETIME2_ProtoCol(ProtoCol): """免打扰""" TYPE = "SILENCETIME2" def send(self, event, msg): - # [XT*334588000000156*0006*SILENCETIME2] send_data = EventMesh.publish("get_new_pid")+"*%s*000C*SILENCETIME2"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1553,65 +1752,76 @@ class SILENCETIME2_ProtoCol(ProtoCol): @param event: @param msg: 接收到的下行数据 """ - # [XT*YYYYYYYYYYYYYYY*LEN*SILENCETIME2,时间段-开关-自定义日期,时间段-开关-自定义日期,时 - # 间段-开关-自定义日期] - class_in_buf = [] - # b'[SZKW*860132060128139*004E*SILENCETIME2,00:00-09:00-1-0111110,15:00-22:00-0-1111111,00:00-23:00-0-0100001]' + class_in_buf = {"1": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []},\ + "0": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}, \ + "3": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}, \ + "2": {'enable': 0, 'end_time': '00:00', 'start_time': '00:00', 'week': []}} + # class_in_buf.append({'start_hour': "16:54", 'week': [], 'idx': 0, 'enabled': 0, 'end_hour': "18:39"}) msg = msg[1:-1] msg_tmp = msg.decode('ascii') msg_tmp_d = str(msg_tmp.split('SILENCETIME2,')[1]) - count = 0 + count = 1 k = 0 - i = 0 + for i in range(len(str(msg_tmp_d))): if msg_tmp_d[i] == ',': count+=1 - - count+=1 - if count >= 3: - count = 3 - print("class count",count) - for i in range(0,count):#00:00-09:00-1-0111110,15:00-22:00-0-1111111,00:00-23:00-0-0100001默认是三个时间多了也不保存 - alarm_day = [] - alarm_data = str(msg_tmp_d.split(',')[i]) - # print("i",i,sleep_data) - if len(alarm_data) != 0: - b = alarm_data.find('-') - if b != -1: - start_time = alarm_data.split('-')[0]#-作为分隔符 - end_time = alarm_data.split('-')[1]#-作为分隔符 - alarm_enable = int(alarm_data.split('-')[2])#是单次还是每天 还是自定义 - start_hour = int(start_time.split(":")[0])#时间 - start_min = int(start_time.split(":")[1])#冒号分隔时间 时 分 + for x in range(count):#08:00-17:00-1-0111110,08:00-17:00-1-0111110 + week = [] + if count > 1: + msg_data = msg_tmp_d.split(',')[k] + # print("SILENCETIME count",msg_data) + k+= 1 + b = msg_data.find('-') + if b != -1: + data = msg_data.split('-')#-作为分隔符 + start_time = data[0] + end_time = data[1] + enable = int(data[2]) + week_day = data[3] + for i in range(0,7): + if week_day[i] != '0': + week.append(i) + tmp={} + tmp["start_time"] = start_time + tmp["end_time"] = end_time + tmp["week"] = week + tmp["enable"] = enable + class_in_buf["{}".format(x)] = tmp + else: + b = msg_tmp_d.find('-') + if b != -1: + data = msg_tmp_d.split('-')#-作为分隔符 + start_time = data[0] + end_time = data[1] + enable = int(data[2]) + week_day = data[3] + for i in range(0,7): + if week_day[i] != '0': + week.append(i) + tmp={} + tmp["start_time"] = start_time + tmp["end_time"] = end_time + tmp["week"] = week + tmp["enable"] = enable + class_in_buf["{}".format(x)] = tmp + + with open("/usr/static/storage_file/class_msg.json", 'w+',encoding='utf-8') as fd: + ujson.dump(class_in_buf,fd) - end_hour = int(end_time.split(":")[0])#时间 - end_min = int(end_time.split(":")[1])#冒号分隔时间 时 分 - - alarm_day_tmp = alarm_data.split('-')[3]#-作为分隔符 - if len(str(alarm_day_tmp)) != 0: - for i in range(0,7): - if alarm_day_tmp[i] != '0': - alarm_day.append(i) - # if alarm_switch = 0: - class_in_buf.append({"start_hour":start_hour,"start_min":start_min,"end_hour":end_hour,"end_min":end_min,"day":alarm_day,"enable":alarm_enable}) - - EventMesh.publish("set_storage_config",["class_alarm",class_in_buf]) - class_alarm = EventMesh.publish("get_storage_config","class_alarm") - # print("class_alarm",class_alarm) EventMesh.publish("set_class_time", class_in_buf) EventMesh.publish(constants.PROTOCOL.SILENCETIME2_SEND) EventMesh.publish("get_class_in_time_page") - #键盘开关 + class KEYBRD_ProtoCol(ProtoCol): """键盘开关""" TYPE = "KEYBRD" def send(self, event, msg): - # [XT*334588000000156*0006*SILENCETIME2] send_data = EventMesh.publish("get_new_pid")+"*%s*0006*KEYBRD"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -1628,374 +1838,345 @@ class KEYBRD_ProtoCol(ProtoCol): """ # b'[SZKW*867387060319166*000A*KEYBRD]' # print("KEYBRD!!!!!!!!!!!!!",msg) + msg = msg[1:-1] msg_tmp = msg.decode('ascii') msg_tmp_d = int(str(msg_tmp.split('KEYBRD,')[1])) EventMesh.publish("set_key_board",msg_tmp_d) - + EventMesh.publish(constants.PROTOCOL.KEYBRD_SEND) -# [CS*YYYYYYYYYY*LEN*ppdevvoicemsg,ID,AMR格式音频数据]#设备好友语音发送 -# 服务端回复 -# [CS*YYYYYYYYYY*LEN*ppdevvoicemsg] -#键盘开关 -class ppdevvoicemsg_ProtoCol(ProtoCol): - """设备好友语音发送""" - TYPE = "ppdevvoicemsg" - def send(self, event, msg): - - # [SZKW*YYYYYYYYYYYYYYY*LEN*TK,AMR 格式音频数据] - #[XT*YYYYYYYYYYYYYYY*LEN*TKS,秒数(十进制),AMR 格式音频数据] - arm_data = msg[1] - arm_sec = msg[0] - # print("TK_ProtoCol:msgtype:{} arm_sec:{}".format(len(msg[1]),arm_sec)) - arm = bytearray() - for i in range(len(arm_data)): - if arm_data[i] == 0x7d: - arm.extend(b'\x7d\x01') - elif arm_data[i] == 0x5b : - arm.extend(b'\x7d\x02') - elif arm_data[i] == 0x5d : - arm.extend(b'\x7d\x03') - elif arm_data[i] == 0x2c : - arm.extend(b'\x7d\x04') - elif arm_data[i] == 0x2a : - arm.extend(b'\x7d\x05') - else : - arm.append(arm_data[i]) - - datalen = len(arm) +len(str("ppdevvoicemsg"))+1 - #Wechat_log("len(str(arm_sec)):{}".format(len(str(arm_sec))+1)) - send_data = bytearray(EventMesh.publish("get_new_pid")+"*%s*%04X*ppdevvoicemsg,%s,"%(self.imei,datalen,"860132060129194")) - send_data.extend(arm) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,datalen,"ppdevvoicemsg") - MD5_SIGN = self.pack_MD5_head(MD5_head_data) - data = bytearray('[') - data.extend(MD5_SIGN) - data.extend(send_data) - data.extend(']') - print("TK:send data:%s MD5_head_data:%s"%(data,MD5_head_data)) - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*KEYBRD]' - # print("KEYBRD!!!!!!!!!!!!!",msg) -class ppsrvvoicemsg_ProtoCol(ProtoCol):#服务器发送设备好友语音 [CS*YYYYYYYYYY*LEN*ppsrvvoicemsg,id,接收结果] - """服务器发送好友语音发送""" - TYPE = "ppsrvvoicemsg" +# 平台发送: +# [XT*YYYYYYYYYYYYYYY*LEN*SCREEN_SHOW,参数内容] +# 实例:[XT*334588000000156*0016*SCREEN_SHOW,00000000000] +# 参数内容用 unicode 编码呈现,设备收到后需解码。 +# 解码后的参数内容可能有多个参数,不同参数用逗号分隔,设备自己决定如何在屏幕中显示这些参数。比如 "SCREEN_SHOW,深圳第一中学,三年1班、张三" +# 终端回复: +# [XT*YYYYYYYYYYYYYYY*LEN*SCREEN_SHOW] +# 实例:[XT*334588000000156*000B*SCREEN_SHOW] + +class SCREEN_SHOWProtoCol(ProtoCol): + """开屏显示""" + TYPE = "SCREEN_SHOW" def send(self, event, msg): - - msg_tmp = "ppsrvvoicemsg," +"%s,"%(msg)+ 1 - data_len = len(str(msg_tmp)) - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*ppsrvvoicemsg,%s,%d"%(self.imei,data_len,msg,1) + # [XT*334588000000156*0006*SILENCETIME2] + send_data = EventMesh.publish("get_new_pid")+"*%s*000B*SCREEN_SHOW"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("POWEROFF_ProtoCol:send:%s"%(data)) + # print("KEYBRD:data:%s"%(data)) + # print("KEYBRD!!!!!!!!!!!!!",msg) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) def recv(self, event, msg): """ @param event: @param msg: 接收到的下行数据 """ - EventMesh.publish(constants.PROTOCOL.PPSRVVOICEMSG_SEND,"860132060129194") - # b'[SZKW*867387060319166*000A*ppsrvvoicemsg]' - # print("KEYBRD!!!!!!!!!!!!!",msg) -#碰碰交友 -class ppfriends_ProtoCol(ProtoCol): - """碰碰""" - TYPE = "ppfriends" - def send(self, event, msg): - - # print("ppfriends:send:") - # [SZKW*867387060319491*0008*PP] - if(msg != ""): - time = msg.split(",")[1] - data = machine.RTC().datetime() - hour = "%02d"%(data[4])+"%02d"%(data[5]) - # print("ppfriends:send:{}-{}-{}".format(msg,type(msg),time)) - msg_tmp = "ppfriends," +"%s,"%(time)+ msg - - data_len = len(msg_tmp) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*ppfriends"%(self.imei,data_len) - MD5_SIGN = self.pack_MD5_head(MD5_head_data) - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,data_len,msg_tmp) - data = "[%s%s]"%(str(MD5_SIGN),send_data) - - # print("PP_ProtoCol:msg_tmp:%s"%(data)) - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_tmp = msg_tmp.split(',') + msg_tmp = msg_tmp[1:] + msg_tmp = msg_tmp[0] + print("screen_school_data msg",msg) - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*KEYBRD]' - # print("KEYBRD!!!!!!!!!!!!!",msg) - -class pp_ProtoCol(ProtoCol): - """碰碰交友""" - TYPE = "ppfriends_match" - def send(self, event, msg): - - # print("PP_ProtoCol:send:") - # [SZKW*867387060319491*0008*PP] - if(msg != ""): - time = msg.split(",")[1] - data = machine.RTC().datetime() - hour = "%02d"%(data[4])+"%02d"%(data[5]) - # print("PP_ProtoCol:send:{}-{}-{}".format(msg,type(msg),time)) - msg_tmp = "ppfriends_match," +"%s,"%(time)+ msg - - data_len = len(msg_tmp) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*ppfriends_match"%(self.imei,data_len) - MD5_SIGN = self.pack_MD5_head(MD5_head_data) - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,data_len,msg_tmp) - data = "[%s%s]"%(str(MD5_SIGN),send_data) + j = 0 + i = 0 + videobook_old = {} + videobook_name_tmp = UnicodeHexStr_To_Utf8Str(msg_tmp) + lst = videobook_name_tmp.split(",") + print("lst data",lst) + + # 0 1 2 3 + screen_school_data = ""#学校 + screen_class_data = ""#班级 + screen_fullname_data = ""#姓名 + if len(lst) != 0: + count = len(lst) + if count > 3: + count = 3 + for i in range(count): + if i == 0: + if len(str(lst[0])) != 0: + screen_school_data = lst[0] + EventMesh.publish("set_schoolname", screen_school_data)# + elif i == 1: + if len(str(lst[1])) != 0: + screen_class_data = lst[1] + EventMesh.publish("set_classname", screen_class_data)# + else: + if len(str(lst[2])) != 0: + screen_fullname_data= lst[2] + EventMesh.publish("set_fullname", screen_fullname_data)# + + EventMesh.publish("update_screen_show")#更新开屏显示 - # print("PP_ProtoCol:msg_tmp:%s"%(data)) - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) + print("screen_school_data!!!:",screen_school_data,screen_class_data,screen_fullname_data) + + EventMesh.publish(constants.PROTOCOL.SCREEN_SHOW_SEND) + +class FALLDOWN_ProtoCol(ProtoCol): + """ + 跌倒提醒开关 + 服务器下发跌倒报警设置命令 + [XT*334588000000156*LEN*FALLDOWN,ONOFF] + ONOFF: 1:开启,0:关闭。 + 终端回复 + [XT*334588000000156*LEN*FALLDOWN] + """ + TYPE = "FALLDOWN" + + def send(self, event, msg): + + #[XT*334588000000156*LEN*FALLDOWN] + send_data = EventMesh.publish("get_new_pid")+"*%s*0008*FALLDOWN"%(self.imei) + MD5_SIGN = self.pack_MD5_head(send_data) + data = "[%s%s]"%(str(MD5_SIGN),send_data) + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): """ - @param event: - @param msg: 接收到的下行数据 + [SZKW*860132060341484*000A*FALLDOWN,1] """ - # b'[SZKW*867387060319166*000A*KEYBRD]' - # print("ppfriends_match!!!!!!!!!!!!!",msg) - msg = msg[1:-1] msg_tmp = msg.decode('ascii') - msg_tmp_d = msg_tmp.split(',') - msg_tmp_data = msg_tmp_d[1] - len_data = len(str(msg_tmp_data)) - print(msg_tmp_data,len_data,type(msg_tmp_data)) + msg_data = msg_tmp.split(',') + + Falldowm = str(msg_data[1]) + # EventMesh.debug_log("FALLDOWN:{}".format(Falldowm)) + EventMesh.publish("set_storage_config",["fall_sw",Falldowm]) + + EventMesh.publish(constants.PROTOCOL.FALLDOWN_SEND) +class REMOVE_ProtoCol(ProtoCol): + """ + 取下手环报警开关 + 平台发送: + [XT*YYYYYYYYYYYYYYY*LEN*REMOVE,0或者1] + 实例:[XT*334588000000156*0008*REMOVE,1] + 终端回复: + [XT*YYYYYYYYYYYYYYY*LEN*REMOVE] + """ + TYPE = "REMOVE" - if len_data > 1: - EventMesh.publish("load_screen", {"screen": "addpp_popup","meta":msg_tmp_data}) - pass - elif msg_tmp_data == "1":#对方已加过好友 - screen_NAME = EventMesh.publish("get_screen_NAME") - # if screen_NAME != None: - # if screen_NAME == "pp_popup": - EventMesh.publish("load_screen", {"screen": "addedpp_popup"}) - pass - elif msg_tmp_data == "2":#自己已加过好友 - screen_NAME = EventMesh.publish("get_screen_NAME") - # if screen_NAME != None: - # if screen_NAME == "pp_popup": - EventMesh.publish("load_screen", {"screen": "ownaddedpp_popup"}) - pass - # EventMesh.publish(constants.PROTOCOL.PP_SEND) -#删除碰碰交友 -class delpp_ProtoCol(ProtoCol): - """删除碰碰交友""" - TYPE = "MFCODE_FRIEND_DEL_REQ" def send(self, event, msg): - - # print("MFCODE_FRIEND_DEL_REQ_ProtoCol:send:") - # [SZKW*867387060319491*0008*MFCODE_FRIEND_DEL_REQ] - if(msg != ""): - - msg_tmp = "MFCODE_FRIEND_DEL_REQ,"+ msg - - data_len = len(msg_tmp) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*MFCODE_FRIEND_DEL_REQ"%(self.imei,data_len) - MD5_SIGN = self.pack_MD5_head(MD5_head_data) - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,data_len,msg_tmp) - data = "[%s%s]"%(str(MD5_SIGN),send_data) + send_data = EventMesh.publish("get_new_pid")+"*%s*0006*REMOVE"%(self.imei) + MD5_SIGN = self.pack_MD5_head(send_data) + data = "[%s%s]"%(str(MD5_SIGN),send_data) + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) + # 通过socket发送到服务器端 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) - # print("MFCODE_FRIEND_DEL_REQ_ProtoCol:msg_tmp:%s"%(data)) - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) - EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_REQ_SEND) def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*MFCODE_FRIEND_DEL_REQ]' + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_data = msg_tmp.split(',') + remove_sw = str(msg_data[1]) + # EventMesh.debug_log("REMOVE:{}".format(remove_sw)) + EventMesh.publish("set_storage_config",["remove_sw",remove_sw]) + EventMesh.publish(constants.PROTOCOL.REMOVE_SEND) -# -class reqpp_ProtoCol(ProtoCol): - """同步碰碰交友""" - TYPE = "MFCODE_FRIEND_REQ" +class HELP_ProtoCol(ProtoCol): + """ +一键报警 + [XT*YYYYYYYYYYYYYYY*LEN*HELP,状态] + 状态值为整数:60或不带默认是普通报警,61光电式感烟火灾报警,62检测环境温度(高温报警,温度变化报警), + 63人体活动检测报警,64电池欠压提醒功能,65设备脱落提醒功能,66离线报警,67测试报警,123气感报警, + 124烟感报警,125水浸报警 + 实例: + [XT*334588000000156*0004*HELP,60] + """ + TYPE = "HELP" + def send(self, event, msg): - - send_data = EventMesh.publish("get_new_pid")+"*%s*0011*MFCODE_FRIEND_REQ"%(self.imei) + #[XT*334588000000156*LEN*FALLDOWN] + send_data = EventMesh.publish("get_new_pid")+"*%s*0004*HELP,%d"%(self.imei,msg) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - # print("MFCODE_FRIEND_REQ:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): """ - @param event: - @param msg: 接收到的下行数据 + [XT*334588000000156*0004*HELP,60] """ - # b'[SZKW*867387060319166*000A*MFCODE_FRIEND_DEL_REQ]' -#MFCODE_FRIEND -class revpp_ProtoCol(ProtoCol): - """服务器同步下发碰碰交友""" - TYPE = "MFCODE_FRIEND" + + pass + +class AL_ProtoCol(ProtoCol): + """报警数据上报""" + TYPE = "AL" + timer_repetition_send = None + repetition_queue = None + def send(self, event, msg): + if self.timer_repetition_send == None: + self.timer_repetition_send = osTimer() + if self.repetition_queue == None: + self.repetition_queue = Queue(100) - send_data = EventMesh.publish("get_new_pid")+"*%s*000d*MFCODE_FRIEND"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) + + send_data ="AL,"+msg + send_len = len(send_data) + #wt_data = "%s"%(send_data) + send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,send_len,send_data) + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,send_len,"AL") + + MD5_SIGN = self.pack_MD5_head(MD5_head_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - # print("MFCODE_FRIEND:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + #EventMesh.debug_log("AL_ProtoCol:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) + self.repetition_queue.put(data)#发送入队 + self.timer_repetition_send.start(10000, 1, self.repetition_timer_cb) + EventMesh.publish("set_dev_state",0) def recv(self, event, msg): """ - @param event: + + @param event: PING @param msg: 接收到的下行数据 """ - - msg = msg[1:-1] - # print("MFCODE_FRIEND:msg:%s\r\n"%msg) - msg_tmp = msg.decode('ascii') - msg_tmp = msg_tmp.split(',') - # print("MFCODE_FRIEND recv:len:{}\r\n data:{}".format(len(msg_tmp),msg_tmp)) - - phonebook = {} - msg_tmp = msg_tmp[1:] - # print("msg_tmp:{} len:{}".format(msg_tmp,len(msg_tmp))) - # msg_tmp = ["00310034003500360038","860132060129120",'',"00310034003500360037","860132060129121",'',"00310034003500360036","860132060129122",'',"00310034003500360034","860132060129125",''] - j = 0 - i = 0 - phonebook_oldtmp = {} - # 0 1 2 3 - for phonebook_tmp in msg_tmp: - - # print("phonebook_tmp:{} len:{} j:{}".format(phonebook_tmp,len(phonebook_tmp),j))#名字 号码 PIC 名字 号码 PIC - - if (j%3) == 1:#1 - i+=1 - # print("i:{} j:{} phonebook_tmp:{}".format(i,j,phonebook_tmp)) - if len(phonebook_tmp) != 0: - phonebook_name = UnicodeHexStr_To_Utf8Str(phonebook_oldtmp) - phonebook_name_cont= "{}:{}".format("%02d"%(i),phonebook_tmp) - phonebook[phonebook_name_cont] = phonebook_name - j+=1 - phonebook_oldtmp = phonebook_tmp - # print("pppbook_oldtmp!!!:{}".format(str(phonebook_oldtmp))) - # print("phonebook!!!:{}".format(str(phonebook))) - # with open("/usr/static/storage_file/pplist.json","w",encoding="utf-8") as fd: - # ujson.dump(phonebook,fd) - # print("创建好友列表") - - old_pplist = EventMesh.publish("get_pplist") - EventMesh.publish(constants.PROTOCOL.MFCODE_FRIEND_SEND) - EventMesh.publish("set_pplist",phonebook) - EventMesh.publish("pp_update_data") - # print("old_pplist",old_pplist,phonebook) - # old_pplist = {"01:860132060127124":"哈喽哈喽"} - if old_pplist != None: - if len(phonebook) > 0: - phonebook_keys = sorted(phonebook) - for i in range(len(phonebook)): - value = phonebook_keys[i] - if len(old_pplist) == 0:#如果为空就直接弹窗显示 - msg_tmp_data = value[3:] - state = EventMesh.publish("get_enter_pp_page") - if state != None: - if state == 1: - EventMesh.publish("set_enter_pp_page",0) - EventMesh.publish("load_screen", {"screen": "addpp_popup","meta":msg_tmp_data}) - else:#有好友就遍历不存在好友列表就认为是新得好友 - b = str(value) in old_pplist.keys() - if b == False:#在旧得里面没找到则是新得 - if len(str(value)) > 0: - msg_tmp_data = value[3:] - state = EventMesh.publish("get_enter_pp_page") - if state != None: - if state == 1: - EventMesh.publish("set_enter_pp_page",0) - EventMesh.publish("load_screen", {"screen": "addpp_popup","meta":msg_tmp_data}) - break - - print("MFCODE_FRIEND:{}".format(phonebook)) - -class factory_ProtoCol(ProtoCol): - """恢复出厂设置""" - TYPE = "FACTORY" + #EventMesh.publish(constants.PROTOCOL.CR_SEND) + #EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始ud定位 + print("报警数据上报:recv:%s"%(msg)) + # + if self.repetition_queue.empty() == False: + self.repetition_queue.get()#出队 + else: + self.timer_repetition_send.stop() + + def repetition_timer_cb(self, *args, **kwargs):#每隔10秒发送一次 + if self.repetition_queue.empty() == False: + data = self.repetition_queue.get()#出队 + self.repetition_queue.put(data)#发送入队 + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) + else: + self.timer_repetition_send.stop() + + +# 平台发送: +# [XT*YYYYYYYYYY*LEN*SLEEPTIME,时间段] +# 实例:[XT*5678901234*0014*SLEEPTIME,23:30-7:30] +# 终端回复: +# [XT*YYYYYYYYYY*LEN*SLEEPTIME] +# 实例:[XT*5678901234*0009*SLEEPTIME] +# 说明: 设置翻滚检测的时间段范围.如果时间段为空,即[XT*5678901234*0014*SLEEPTIME,],表示睡眠翻滚监测功能关。 +# 在此时间段内,开启翻滚检查,默认开启时翻滚次数为0,在此时间段内累计翻滚次数,并通过心跳接口上传。翻滚时间段结束,则停止翻滚检查,心跳接口的翻滚次数可置0。 +class SLEEPTIME_ProtoCol(ProtoCol):#睡眠时间 + """ + + 平台发送: + [XT*YYYYYYYYYY*LEN*SLEEPTIME,时间段] + 实例:[XT*5678901234*0014*SLEEPTIME,23:30-7:30] + 终端回复: + [XT*YYYYYYYYYY*LEN*SLEEPTIME] + 实例:[XT*5678901234*0009*SLEEPTIME] + 说明: 设置翻滚检测的时间段范围.如果时间段为空,即[XT*5678901234*0014*SLEEPTIME,],表示睡眠翻滚监测功能关。 + 在此时间段内,开启翻滚检查,默认开启时翻滚次数为0,在此时间段内累计翻滚次数,并通过心跳接口上传。翻滚时间段结束,则停止翻滚检查,心跳接口的翻滚次数可置0。 + """ + TYPE = "SLEEPTIME" + def send(self, event, msg): - send_data = EventMesh.publish("get_new_pid")+"*%s*0007*FACTORY"%(self.imei) + send_data = EventMesh.publish("get_new_pid")+"*%s*00009*SLEEPTIME"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("FACTORY:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + # EventMesh.debug_log("SLEEPTIME:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - EventMesh.publish(constants.PROTOCOL.FACTORY_SEND) - EventMesh.publish("app_factory_cb") + # 实例:[XT*5678901234*0014*SLEEPTIME,23:30-7:30] + # EventMesh.debug_log("SLEEPTIME!!!!!!!!!") + msg = msg[1:-1] + msg_tmp = msg.decode('ascii') + msg_data = msg_tmp.split(',')[1] + data = {} + if len(msg_data) == 0: + EventMesh.publish("set_storage_config",["sleep_time",data]) + pass + else: + sleep_start = msg_data.split("-")[0] + sleep_end = msg_data.split("-")[1] + start_hour = int(sleep_start.split(":")[0]) + start_min = int(sleep_start.split(":")[1]) + + end_hour = int(sleep_end.split(":")[0]) + end_min = int(sleep_end.split(":")[1]) -class restart_ProtoCol(ProtoCol): - """重启""" - TYPE = "RESET" + data = {"start_hour":start_hour,"start_min":start_min,"end_hour":end_hour,"end_min":end_min} + # EventMesh.debug_log("SLEEPTIME".format(data)) + EventMesh.publish("set_storage_config",["sleep_time",data]) + # sleep_time = EventMesh.publish("get_storage_config","sleep_time") + # EventMesh.debug_log("sleep_time:{}".format(sleep_time)) + + EventMesh.publish(constants.PROTOCOL.SLEEPTIME_SEND) + +# 平台发送: +# [XT*YYYYYYYYYYYYYYY*LEN*FACTORY] +# 实例:[XT*334588000000156*0007*FACTORY] +# 终端回复: +# [XT*YYYYYYYYYYYYYYY*LEN*FACTORY] +# 实例:[XT*334588000000156*0007*FACTORY] +# 说明:终端恢复出厂设置,里面设置的号码都将清空 +class FACTORY_ProtoCol(ProtoCol):#睡眠时间 + """ + 实例:[XT*334588000000156*0008*FACTORY] + 终端回复 + [XT*YYYYYYYYYYYYYYY*LEN*WLKEY] + 实例:[XT*334588000000156*0006*FACTORY] + """ + TYPE = "FACTORY" + def send(self, event, msg): - send_data = EventMesh.publish("get_new_pid")+"*%s*0005*RESET"%(self.imei) + send_data = EventMesh.publish("get_new_pid")+"*%s*0007*FACTORY"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("FACTORY:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + # EventMesh.debug_log("FACTORY:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - EventMesh.publish(constants.PROTOCOL.RESET_SEND) - Power.powerRestart() + # EventMesh.debug_log("FACTORY!!!!!!!!!") + # msg = msg[1:-1] + # msg_tmp = msg.decode('ascii') + # msg_data = msg_tmp.split(',') + # EventMesh.debug_log("WLKEY_ProtoCol".format(msg_data[1])) + # EventMesh.publish("set_storage_config",["WLKEY",msg_data[1]]) + EventMesh.publish("app_factory_cb") + EventMesh.publish(constants.PROTOCOL.FACTORY_SEND) + # EventMesh.publish("app_factory",None)#app恢复出厂 -class TK_ProtoCol(ProtoCol): + +class TKS_ProtoCol(ProtoCol): """微聊""" - TYPE = "TK" + TYPE = "TKS" def send(self, event, msg): - # print("TK send:{}".format(msg)) if len(str(msg)) == 1: - - len_size = len(str(msg))+len("TK,") + len_size = len(str(msg))+len("TKS,") # 实例:[XT*334588000000156*0009*TK,1] - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*TK"%(self.imei,len_size) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"TK") + send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*TKS"%(self.imei,len_size) + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"TKS") MD5_SIGN = self.pack_MD5_head(MD5_head_data) data = "[%s%s,%d]"%(str(MD5_SIGN),send_data,msg) - print("TK:data:%s"%(data)) + print("TKS:data:%s"%(data)) # 通过socket发送到服务器端 EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) else: # [SZKW*YYYYYYYYYYYYYYY*LEN*TK,AMR 格式音频数据] #[XT*YYYYYYYYYYYYYYY*LEN*TKS,秒数(十进制),AMR 格式音频数据] - arm_data = msg + arm_data = msg[1] + arm_sec = msg[0] # print("TK_ProtoCol:msgtype:{} arm_sec:{}".format(len(msg[1]),arm_sec)) arm = bytearray() @@ -2013,11 +2194,11 @@ class TK_ProtoCol(ProtoCol): else : arm.append(arm_data[i]) - datalen = len(arm) + len("TK,")+1 + datalen = len(arm) + len(str("TKS,"))+len(str(arm_sec))+1 #Wechat_log("len(str(arm_sec)):{}".format(len(str(arm_sec))+1)) - send_data = bytearray(EventMesh.publish("get_new_pid")+"*%s*%04X*TK,"%(self.imei,datalen)) + send_data = bytearray(EventMesh.publish("get_new_pid")+"*%s*%04X*TKS,%d,"%(self.imei,datalen,arm_sec)) send_data.extend(arm) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,datalen,"TK") + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,datalen,"TKS") MD5_SIGN = self.pack_MD5_head(MD5_head_data) data = bytearray('[') data.extend(MD5_SIGN) @@ -2038,7 +2219,7 @@ class TK_ProtoCol(ProtoCol): #Wechat_log("K_ProtoCol:recv:data:{}".format(msg)) # print("TK recv:{}".format(msg)) msg_tmp = msg.decode('ascii') - str = msg_tmp.split('TK,') + str = msg_tmp.split('TKS,') # Wechat_log("TK_ProtoCol:recv:len:{} {} {}".format(len(msg),len(str),msg_tmp.find("#!AMR"))) if msg_tmp.find("#!AMR") != -1: #是否是服务器下发音频数据 # Wechat_log("TK_ProtoCol:recv:datalen{}".format(len(msg))) @@ -2069,7 +2250,7 @@ class TK_ProtoCol(ProtoCol): EventMesh.publish("load_screen", {"screen": "wechat_popup"}) else: EventMesh.publish("wechat_updata_list_show") - # path = "/ext/static/storage_file/audio_amr/amr/{}.wav".format(wechat_num) + # path = "/usr/static/storage_file/audio_amr/amr/{}.amr".format(wechat_num) path = "/usr/static/storage_file/{}.amr".format(wechat_num) with open(path,"w") as fd: arm = bytearray() @@ -2096,27 +2277,28 @@ class TK_ProtoCol(ProtoCol): if j >= len(arm_data): break fd.write(arm) - EventMesh.publish(constants.PROTOCOL.TK_SEND,1) + EventMesh.publish(constants.PROTOCOL.TKS_SEND,1) - -class TKS_ProtoCol(ProtoCol): + + +class TK_ProtoCol(ProtoCol): """微聊""" - TYPE = "TKS" + TYPE = "TK" def send(self, event, msg): # print("TK send:{}".format(msg)) if len(str(msg)) == 1: - len_size = len(str(msg))+len("TKS,") + len_size = len(str(msg))+len("TK,") # 实例:[XT*334588000000156*0009*TK,1] - send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*TKS"%(self.imei,len_size) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"TKS") + send_data = EventMesh.publish("get_new_pid")+"*%s*%04X*TK"%(self.imei,len_size) + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,len_size,"TK") MD5_SIGN = self.pack_MD5_head(MD5_head_data) data = "[%s%s,%d]"%(str(MD5_SIGN),send_data,msg) - print("TKS:data:%s"%(data)) + print("TK:data:%s"%(data)) # 通过socket发送到服务器端 EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) @@ -2142,11 +2324,11 @@ class TKS_ProtoCol(ProtoCol): else : arm.append(arm_data[i]) - datalen = len(arm) +len("TKS,")+len(str(arm_sec))+1 + datalen = len(arm) +len(str("TK,"))+len(str(arm_sec))+1 #Wechat_log("len(str(arm_sec)):{}".format(len(str(arm_sec))+1)) - send_data = bytearray(EventMesh.publish("get_new_pid")+"*%s*%04X*TKS,%d,"%(self.imei,datalen,arm_sec)) + send_data = bytearray(EventMesh.publish("get_new_pid")+"*%s*%04X*TK,"%(self.imei,datalen)) send_data.extend(arm) - MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,datalen,"TKS") + MD5_head_data = EventMesh.publish("get_new_pid")+"*%s*%04X*%s"%(self.imei,datalen,"TK") MD5_SIGN = self.pack_MD5_head(MD5_head_data) data = bytearray('[') data.extend(MD5_SIGN) @@ -2167,7 +2349,7 @@ class TKS_ProtoCol(ProtoCol): #Wechat_log("K_ProtoCol:recv:data:{}".format(msg)) # print("TK recv:{}".format(msg)) msg_tmp = msg.decode('ascii') - str = msg_tmp.split('TKS,') + str = msg_tmp.split('TK,') # Wechat_log("TK_ProtoCol:recv:len:{} {} {}".format(len(msg),len(str),msg_tmp.find("#!AMR"))) if msg_tmp.find("#!AMR") != -1: #是否是服务器下发音频数据 # Wechat_log("TK_ProtoCol:recv:datalen{}".format(len(msg))) @@ -2198,7 +2380,7 @@ class TKS_ProtoCol(ProtoCol): EventMesh.publish("load_screen", {"screen": "wechat_popup"}) else: EventMesh.publish("wechat_updata_list_show") - # path = "/ext/static/storage_file/audio_amr/amr/{}.wav".format(wechat_num) + # path = "/usr/static/storage_file/audio_amr/amr/{}.amr".format(wechat_num) path = "/usr/static/storage_file/{}.amr".format(wechat_num) with open(path,"w") as fd: arm = bytearray() @@ -2225,10 +2407,11 @@ class TKS_ProtoCol(ProtoCol): if j >= len(arm_data): break fd.write(arm) - EventMesh.publish(constants.PROTOCOL.TKS_SEND,1) + EventMesh.publish(constants.PROTOCOL.TK_SEND,1) - + + class MESSAGE_ProtoCol(ProtoCol): """微聊""" @@ -2236,6 +2419,7 @@ class MESSAGE_ProtoCol(ProtoCol): def send(self, event, msg): + #[XT*334588000000156*0007*MESSAGE] send_data = EventMesh.publish("get_new_pid")+"*%s*0007*MESSAGE"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) @@ -2288,655 +2472,118 @@ class MESSAGE_ProtoCol(ProtoCol): else: EventMesh.publish("wechat_updata_list_show") - - - - -# [3G*860132060128253*14BB*appvoicemsg,1,yx_jh_128237, - -class APPVOICEMSG_ProtoCol(ProtoCol):#群聊语音 - """群聊""" - TYPE = "appvoicemsg" - - - def send(self, event, msg): - send_data = EventMesh.publish("get_new_pid")+"*%s*000b*appvoicemsg,%s,%s,%d"%(self.imei,msg[0],msg[1],1) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("POWEROFF_ProtoCol:send:%s"%(data)) - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) - - def recv(self, event, msg): - """ - - @param event: 微聊文字 - @param msg: 接收到的下行数据 - """ - msg = msg[1:-1] - - msg_s = msg.decode('ascii') - msg_s = msg_s.split(',') - msg_x = msg_s[1] #0是单聊 1是群聊 - msg_id = msg_s[2] #用户ID - - print("msg_x:{},msg_id:{}".format(msg_x,msg_id)) - - - EventMesh.publish(constants.PROTOCOL.APPVOICEMSG_SEND,[msg_x,msg_id]) - -# [CS*YYYYYYYYYY*LEN*srvtextmsg,x,用户id,文本信息] -class srvtextmsg_ProtoCol(ProtoCol):#微聊文字 - """群聊""" - TYPE = "srvtextmsg" +# 平台发送: +# [XT*YYYYYYYYYYYYYYY*LEN*MESSAGE_SOS,短语内容] +# 实例:[XT*334588000000156*0018*MESSAGE_SOS,597D003100320033] +# 终端确认操作回复: +# [XT*YYYYYYYYYYYYYYY*LEN*MESSAGE_SOS] +# 实例:[XT*334588000000156*0007*MESSAGE_SOS] +class MESSAGE_SOS_ProtoCol(ProtoCol): + """SOS下发文字短语""" + TYPE = "MESSAGE_SOS" def send(self, event, msg): - send_data = EventMesh.publish("get_new_pid")+"*%s*000a*srvtextmsg,%s,%s,%d"%(self.imei,msg[0],msg[1],1) + + #[XT*334588000000156*0007*MESSAGE] + send_data = EventMesh.publish("get_new_pid")+"*%s*000b*MESSAGE_SOS"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("POWEROFF_ProtoCol:send:%s"%(data)) + print("MESSAGE_SOS:send:%s"%(data)) # 通过socket发送到服务器端 EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): """ - @param event: 微聊文字 + @param event: @param msg: 接收到的下行数据 """ msg = msg[1:-1] msg_s = msg.decode('ascii') - msg_s = msg_s.split(',') - msg_x = msg_s[1] - msg_id = msg_s[2] - - print("msg_x:{},msg_id:{}".format(msg_x,msg_id)) - - - EventMesh.publish(constants.PROTOCOL.SRVTEXTMSG_SEND,[msg_x,msg_id]) - - - -# #小见平台视频通话 -# # [XT*YYYYYYYYYYYYYYY*LEN*JPREG] -# # 实例: -# # [XT*334588000000156*0004*JPREG] -# # 平台回复: -# # [XT*设备ID*LEN*JPREG,账号(整型)] -# # 实例:[XT*334588000000156*0010*JPREG,1087654321] -class JPREG_ProtoCol(ProtoCol):#登入注册 - """""" - TYPE = "JPREG" - def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0005*JPREG"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s]"%(str(MD5_SIGN),send_data) - # print("WLKEY:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*KEYBRD]' - print("JPREG!!!!!!!!!!!!!",msg,EventMesh.publish("get_new_pid")) - # EventMesh.publish(constants.PROTOCOL.JPREG_SEND) - -# # (声网,佰锐的账号是整型) -# # [XT*YYYYYYYYYYYYYYY*LEN*MEMBERS] -# # 实例:[XT*334588000000156*0007*MEMBERS] -# # 平台回复:[XT*设备ID*LEN*MEMBERS,账号1,昵称1,电话1,账号2,昵称2,电话2.....] -# # 实例: -# # [XT*334588000000156*003F*MEMBERS,d3e2f759f9d5af3858f3530,爸爸,13662313580,妈妈,555] -# # 以上数据部分使用Unicode编码,最终上面示例传到服务端将是: - -class MEMBERS_ProtoCol(ProtoCol):#获取账号列表 - """""" - TYPE = "MEMBERS" - def send(self, event, msg): + msg_s = msg_s.split('MESSAGE_SOS,')[1] + phonebook_name = "" + phonebook_tmp = msg_s + # print("phonebook_tmp!!!!!!!!!!!!",phonebook_tmp) + phonebook_name = UnicodeHexStr_To_Utf8Str(phonebook_tmp) + # print("phonebook_name!!!!!!!!!!!!",phonebook_name) + EventMesh.publish("set_sos_message", phonebook_name)# + EventMesh.publish("load_screen", {"screen": "sos_rev"}) + EventMesh.publish("update_sos_show",phonebook_name) - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0007*MEMBERS"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("MEMBERS SEND:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*876226002021444*0048*MEMBERS,0036003900350031003800330032002C563F563FD83CDF410020D83CDF42002C]' - print("MEMBERS!!!!!!!!!!!!!",msg,EventMesh.publish("get_new_pid")) - msg = msg[1:-1] - msg_tmp = msg.decode('ascii') - msg_tmp = msg_tmp.split(',') - - videobook = {} - msg_tmp = msg_tmp[1:] - msg_tmp = msg_tmp[0] - - j = 0 - i = 0 - videobook_old = {} - videobook_name_tmp = UnicodeHexStr_To_Utf8Str(msg_tmp) - lst = videobook_name_tmp.split(",") - - print("msg_tmp:{} phonebook_oldtmp:{} type:{}".format(msg_tmp,videobook_name_tmp,lst)) - # 0 1 2 3 - for vediobook_tmp in lst: - - if (j % 3) == 0:#账号 - videobook_old = vediobook_tmp - elif (j % 3) == 1:#名称 - i+=1 - videobook_name_cont= "{}:{}".format("%03d"%(i),videobook_old) - videobook[videobook_name_cont] = vediobook_tmp - j+=1 - print("videobook!!!:{}".format(str(videobook))) - # print("phonebook!!!:{}".format(str(phonebook))) - with open("/usr/static/storage_file/videobook.json","w",encoding="utf-8") as fd: - ujson.dump(videobook,fd) - print("创建视频通话账号") - - EventMesh.publish("set_videobook_list",[1,videobook]) - EventMesh.publish("video_updata_list_show") - # EventMesh.publish(constants.PROTOCOL.MEMBERS_SEND) - -# # [X*Y*LEN*CALLING,呼叫者id,会议id,通话类型,Token] - -# # 设备回复 -# # [X*Y*LEN*CALLING,音视频状态] -# # 音视频状态:为0表示正常可通讯状态,否则填上用音视频返回的状态码,比如200,如果未获取到返回状态码,则填1 -class CALLING_ProtoCol(ProtoCol):#app发起视频通话 - """""" - TYPE = "CALLING" - def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0007*CALLING"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s,%d]"%(str(MD5_SIGN),send_data,msg) - print("CALLING:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*CALLING]' - print("CALLING!!!!!!!!!!!!!",msg) - msg = msg[1:-1] - msg_tmp = msg.decode('ascii') - msg_tmp_d = msg_tmp.split(',') - call_id = msg_tmp_d[1]#id - meet_id = msg_tmp_d[2]#会议id - call_type = msg_tmp_d[3]#会议id - tokens_data = msg_tmp_d[4]#tokens - EventMesh.publish("set_vedio_call_id", call_id)# - EventMesh.publish("set_vedio_meet_id", meet_id)# - EventMesh.publish("set_vedio_call_type", int(call_type))# - EventMesh.publish("set_vedio_tokens_data", tokens_data)# - - get_ui = EventMesh.publish("get_UI_high_priority") - if get_ui == None: - get_ui = 0 - - if get_ui == 1:#不能通话 因为在打电话或者禁用时间段 - EventMesh.publish(constants.PROTOCOL.CALLING_SEND,1) - else: - EventMesh.publish(constants.PROTOCOL.CALLING_SEND,0) - if int(call_type) == 1:#视频通话 - EventMesh.publish("load_screen", {"screen": "vedio_incall"}) - # EventMesh.publish("load_screen", {"screen": "vedio_incall","meta":"1"}) - pass - else: - EventMesh.publish("load_screen", {"screen": "voice_incall"}) - # EventMesh.publish("load_screen", {"screen": "vedio_incall","meta":"0"})#语音界面 - pass - - -# # [XT*YYYYYYYYYYYYYYY*LEN*RCALLING,呼叫者id,会议id/声网频道名(没有则留空,但位置保留),音频还是视频(0为音频,1为视频)] -# # 实例: -# # [XT*334588000000156*0007*RCALLING,d3e2f759f9d5af3858f3530b,,0] -# # 终端回复: -# # [XT*设备ID*LEN*RCALLING] -# # 实例:[XT*334588000000156*0009*RCALLING] -# # -class RCALLING_ProtoCol(ProtoCol):#设备拒接接听 - """""" - TYPE = "RCALLING" - def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0008*RCALLING"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s,%s,%s,%d]"%(str(MD5_SIGN),send_data,msg[0],msg[1],msg[2]) - print("RCALLING:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*RCALLING]' - print("RCALLING!!!!!!!!!!!!!") - -class AGTALK_ProtoCol(ProtoCol):#设备发起视频通话与app接听视频通话 - """""" - TYPE = "AGTALK" - def send(self, event, msg): - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0006*AGTALK"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s,%d,%s]"%(str(MD5_SIGN),send_data,msg[0],msg[1]) - print("AGTALK:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*876226002021444*007B*AGTALK,0,01lqlyqzzQHpfwv5g7jFVC2H6Ha2tHFpMlfSm5sd2uo7o55JEcc=OVxewje6MjP0NgEODwsLDwkJCwkLCA0NDQ==,8762260020214441701226895]' - msg = msg[1:-1] - msg_tmp = msg.decode('ascii') - msg_tmp_d = msg_tmp.split(',') - call_state = int(msg_tmp_d[1])#id - - if call_state == 0:#可正常通话 - tokens_data = msg_tmp_d[2]#会议id - meet_id = msg_tmp_d[3]#会议id - EventMesh.publish("set_vedio_meet_id", meet_id)# - EventMesh.publish("set_vedio_tokens_data", tokens_data)# - EventMesh.publish("clear_jrtc_init_state") - EventMesh.publish("open_vedio_infor") - - else: - EventMesh.publish("set_UI_high_priority",0) - EventMesh.publish("clear_jrtc_init_state") - EventMesh.publish("return_prev_screen") - print("AGTALK!!!!!!!!!!!!!") - - -class RTALK_ProtoCol(ProtoCol):#app拒接视频通话 - """""" - TYPE = "RTALK" - def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0005*RTALK"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s,%d,%s]"%(str(MD5_SIGN),send_data,msg[0],msg[1]) - print("RTALK:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) +# 请求[XT*334588000000156*0004*MSGQ] - def recv(self, event, msg): - """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*RTALK]' - print("RTALK!!!!!!!!!!!!!") - # [SZKW*876226002021444*003A*RTALK,3ef20e64f3abb84b27f7d764,8762260020214441701226522,1]' - msg = msg[1:-1] - msg_tmp = msg.decode('ascii') - msg_tmp_d = msg_tmp.split(',') - screen_NAME = EventMesh.publish("get_screen_NAME") - if screen_NAME != None: - if screen_NAME == "vedioing" or screen_NAME == "voiceing" or screen_NAME == "video_outcall" \ - or screen_NAME == "vedio_incall" or screen_NAME == "voice_incall" or screen_NAME == "voice_outcall": - EventMesh.publish("close_jrtc_event",None) - EventMesh.publish("set_UI_high_priority", 0) - EventMesh.publish("return_prev_screen") - +class MSGQ_ProtoCol(ProtoCol): + """离线消息""" + TYPE = "MSGQ" -#云米视频通话 -# [XT*YYYYYYYYYYYYYYY*LEN*JPREG] -# 实例: -# [XT*334588000000156*0004*JPREG] -# 平台回复: -# [XT*设备ID*LEN*JPREG,账号(整型)] -# 实例:[XT*334588000000156*0010*JPREG,1087654321] -# class JPREG_ProtoCol(ProtoCol):#登入注册 -# """""" -# TYPE = "JPREG" -# def send(self, event, msg): - -# # [XT*334588000000156*0005*WLKEY] -# send_data = EventMesh.publish("get_new_pid")+"*%s*0005*JPREG"%(self.imei) -# MD5_SIGN = self.pack_MD5_head(send_data) -# data = "[%s%s]"%(str(MD5_SIGN),send_data) -# # print("WLKEY:data:%s"%(data)) -# # print("WLKEY!!!!!!!!!!!!!") -# # 通过socket发送到服务器端 -# EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - -# def recv(self, event, msg): -# """ -# @param event: -# @param msg: 接收到的下行数据 -# """ -# # b'[SZKW*867387060319166*000A*KEYBRD]' -# print("JPREG!!!!!!!!!!!!!",msg) -# # EventMesh.publish(constants.PROTOCOL.JPREG_SEND) - -# (声网,佰锐的账号是整型) -# [XT*YYYYYYYYYYYYYYY*LEN*MEMBERS] -# 实例:[XT*334588000000156*0007*MEMBERS] -# 平台回复:[XT*设备ID*LEN*MEMBERS,账号1,昵称1,电话1,账号2,昵称2,电话2.....] -# 实例: -# [XT*334588000000156*003F*MEMBERS,d3e2f759f9d5af3858f3530,爸爸,13662313580,妈妈,555] -# 以上数据部分使用Unicode编码,最终上面示例传到服务端将是: - -class JMEMBERS_ProtoCol(ProtoCol):#获取账号列表 - """""" - TYPE = "JMEMBERS" def send(self, event, msg): - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0008*JMEMBERS"%(self.imei) + #[XT*334588000000156*0007*MESSAGE] + send_data = EventMesh.publish("get_new_pid")+"*%s*0004*MSGQ"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - # print("WLKEY:data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): """ - @param event: + + @param event: 微聊文字 @param msg: 接收到的下行数据 """ - # b'[SZKW*876226002021444*0048*MEMBERS,0036003900350031003800330032002C563F563FD83CDF410020D83CDF42002C]' - print("JMEMBERS!!!!!!!!!!!!!",msg) msg = msg[1:-1] - msg_tmp = msg.decode('ascii') - msg_tmp = msg_tmp.split(',') - - videobook = {} - msg_tmp = msg_tmp[1:] - msg_tmp = msg_tmp[0] - j = 0 - i = 0 - videobook_old = {} - videobook_name_tmp = UnicodeHexStr_To_Utf8Str(msg_tmp) - lst = videobook_name_tmp.split(",") - - print("msg_tmp:{} phonebook_oldtmp:{} type:{}".format(msg_tmp,videobook_name_tmp,lst)) - # 0 1 2 3 - for vediobook_tmp in lst: - - if (j % 3) == 0:#账号 - videobook_old = vediobook_tmp - elif (j % 3) == 1:#名称 - i+=1 - videobook_name_cont= "{}:{}".format("%03d"%(i),videobook_old) - videobook[videobook_name_cont] = vediobook_tmp - j+=1 - print("videobook!!!:{}".format(str(videobook))) - # print("phonebook!!!:{}".format(str(phonebook))) - with open("/usr/static/storage_file/videobook.json","w",encoding="utf-8") as fd: - ujson.dump(videobook,fd) - print("创建视频通话账号") - - EventMesh.publish("set_videobook_list",[1,videobook]) - EventMesh.publish("video_updata_list_show") - # EventMesh.publish(constants.PROTOCOL.JMEMBERS_SEND) - -# # [X*Y*LEN*CALLING,呼叫者id,会议id,通话类型,Token] - -# # 设备回复 -# # [X*Y*LEN*CALLING,音视频状态] -# # 音视频状态:为0表示正常可通讯状态,否则填上用音视频返回的状态码,比如200,如果未获取到返回状态码,则填1 -# class CALLING_ProtoCol(ProtoCol):#app发起视频通话 -# """""" -# TYPE = "CALLING" -# def send(self, event, msg): - -# # [XT*334588000000156*0005*WLKEY] -# send_data = EventMesh.publish("get_new_pid")+"*%s*0007*CALLING"%(self.imei) -# MD5_SIGN = self.pack_MD5_head(send_data) -# data = "[%s%s,%d]"%(str(MD5_SIGN),send_data,msg) -# print("CALLING:send data:%s"%(data)) -# # print("WLKEY!!!!!!!!!!!!!") -# # 通过socket发送到服务器端 -# EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - -# def recv(self, event, msg): -# """ -# @param event: -# @param msg: 接收到的下行数据 -# """ -# # b'[SZKW*867387060319166*000A*CALLING]' -# print("CALLING!!!!!!!!!!!!!",msg) -# msg = msg[1:-1] -# msg_tmp = msg.decode('ascii') -# msg_tmp_d = msg_tmp.split(',') -# call_id = msg_tmp_d[2]#id -# meet_id = msg_tmp_d[1]#会议id -# call_type = msg_tmp_d[3]#通话类型id -# tokens_data = "" -# # tokens_data = msg_tmp_d[4]#tokens -# EventMesh.publish("set_vedio_call_id",call_id)# -# EventMesh.publish("set_vedio_meet_id",meet_id)# -# EventMesh.publish("set_vedio_call_type", call_type)# -# EventMesh.publish("set_vedio_tokens_data", tokens_data)# - - -# # EventMesh.publish("set_vedio_infor",[call_id,meet_id,call_type,tokens_data])# -# EventMesh.publish(constants.PROTOCOL.CALLING_SEND,1) -# EventMesh.publish("load_screen", {"screen": "vedio_incall"}) - -# # [XT*YYYYYYYYYYYYYYY*LEN*RCALLING,呼叫者id,会议id/声网频道名(没有则留空,但位置保留),音频还是视频(0为音频,1为视频)] -# # 实例: -# # [XT*334588000000156*0007*RCALLING,d3e2f759f9d5af3858f3530b,,0] -# # 终端回复: -# # [XT*设备ID*LEN*RCALLING] -# # 实例:[XT*334588000000156*0009*RCALLING] -# # -# class RCALLING_ProtoCol(ProtoCol):#设备拒接接听 -# """""" -# TYPE = "RCALLING" -# def send(self, event, msg): - -# # [XT*334588000000156*0005*WLKEY] -# send_data = EventMesh.publish("get_new_pid")+"*%s*0008*RCALLING"%(self.imei) -# MD5_SIGN = self.pack_MD5_head(send_data) -# data = "[%s%s]"%(str(MD5_SIGN),send_data) -# print("RCALLING:send data:%s"%(data)) -# # print("WLKEY!!!!!!!!!!!!!") -# # 通过socket发送到服务器端 -# EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - -# def recv(self, event, msg): -# """ -# @param event: -# @param msg: 接收到的下行数据 -# """ -# # b'[SZKW*867387060319166*000A*RCALLING]' -# print("RCALLING!!!!!!!!!!!!!") -# EventMesh.publish(constants.PROTOCOL.RCALLING_SEND) - -# class AGTALK_ProtoCol(ProtoCol):#设备发起视频通话与app接听视频通话 -# """""" -# TYPE = "RINGING" -# def send(self, event, msg): - -# # [XT*334588000000156*0005*WLKEY] -# send_data = EventMesh.publish("get_new_pid")+"*%s*0007*RINGING"%(self.imei) -# MD5_SIGN = self.pack_MD5_head(send_data) -# data = "[%s%s,%d,%s]"%(str(MD5_SIGN),send_data,msg[0],msg[1]) -# print("AGTALK:send data:%s"%(data)) -# # print("WLKEY!!!!!!!!!!!!!") -# # 通过socket发送到服务器端 -# EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - -# def recv(self, event, msg): -# """ -# @param event: -# @param msg: 接收到的下行数据 -# """ -# # b'[SZKW*876226002021444*007B*AGTALK,0,01lqlyqzzQHpfwv5g7jFVC2H6Ha2tHFpMlfSm5sd2uo7o55JEcc=OVxewje6MjP0NgEODwsLDwkJCwkLCA0NDQ==,8762260020214441701226895]' - -# # msg = msg[1:-1] -# # msg_tmp = msg.decode('ascii') -# # msg_tmp_d = msg_tmp.split(',') -# # call_state = int(msg_tmp_d[1])#id + msg_s = msg.decode('ascii') + print("MSGQ!!!!!!!!!!!!") -# # if call_state == 0:#可正常通话 -# # tokens_data = msg_tmp_d[2]#会议id -# # meet_id = msg_tmp_d[3]#会议id -# # EventMesh.publish("set_vedio_meet_id", meet_id)# -# # EventMesh.publish("set_vedio_tokens_data", tokens_data)# -# # EventMesh.publish("open_vedio_infor") -# # # EventMesh.publish("set_UI_high_priority", 0) -# # # EventMesh.publish("load_screen", {"screen": "vedio_answer"}) -# # # EventMesh.publish("set_vedio_infor",[call_id,meet_id,call_type,tokens_data])# - - - -# print("RINGING!!!!!!!!!!!!!") + +# [XT*YYYYYYYYYYYYYYY*LEN*profile] +class profile_ProtoCol(ProtoCol): + """情景模式""" + TYPE = "profile" -# 注:终端一旦收到该请求,则退出当前通话 -# [DL*YYYYYYYYYYYYYYY*LEN*HANGUP] -# 实 例 : [DL*334588000000156*0006*HANGUP] -# 终端回复: -# [DL*设备 ID*LEN*HANGUP] -class HANGUP_ProtoCol(ProtoCol):#app拒接视频通话 - """""" - TYPE = "HANGUP" def send(self, event, msg): - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*0006*HANGUP"%(self.imei) + #[XT*334588000000156*0007*MESSAGE] + send_data = EventMesh.publish("get_new_pid")+"*%s*0007*profile"%(self.imei) MD5_SIGN = self.pack_MD5_head(send_data) data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("AGTALK:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") + #Wechat_log("POWEROFF_ProtoCol:send:%s"%(data)) # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) + EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND, data) def recv(self, event, msg): """ - @param event: - @param msg: 接收到的下行数据 - """ - # b'[SZKW*867387060319166*000A*RTALK]' - print("HANGUP!!!!!!!!!!!!!") - # [SZKW*876226002021444*003A*RTALK,3ef20e64f3abb84b27f7d764,8762260020214441701226522,1]' - # msg = msg[1:-1] - # msg_tmp = msg.decode('ascii') - # msg_tmp_d = msg_tmp.split(',') - # screen_NAME = EventMesh.publish("get_screen_NAME") - # if screen_NAME != None: - # if screen_NAME == "video_outcall": - # # EventMesh.publish("close_jrtc_event") - # EventMesh.publish("set_UI_high_priority", 0) - # EventMesh.publish("load_screen", {"screen": "videolist"}) - - EventMesh.publish(constants.PROTOCOL.HANGUP_SEND) -# 注:终端一旦收到该请求,则退出当前通话 -# [DL*YYYYYYYYYYYYYYY*LEN*CALLCANCEL] -# 实 例 : [DL*334588000000156*000A*CALLCANCEL] -# 终端回复: -# [DL*设备 ID*LEN*CALLCANCEL] -class CALLCANCEL_ProtoCol(ProtoCol):#app拒接视频通话 - """""" - TYPE = "CALLCANCEL" - def send(self, event, msg): - - # [XT*334588000000156*0005*WLKEY] - send_data = EventMesh.publish("get_new_pid")+"*%s*000A*CALLCANCEL"%(self.imei) - MD5_SIGN = self.pack_MD5_head(send_data) - data = "[%s%s]"%(str(MD5_SIGN),send_data) - print("AGTALK:send data:%s"%(data)) - # print("WLKEY!!!!!!!!!!!!!") - # 通过socket发送到服务器端 - EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - - def recv(self, event, msg): - """ - @param event: + @param event: @param msg: 接收到的下行数据 """ - # b'[SZKW*867387060319166*000A*RTALK]' - print("CALLCANCEL!!!!!!!!!!!!!") - # [SZKW*876226002021444*003A*RTALK,3ef20e64f3abb84b27f7d764,8762260020214441701226522,1]' - # msg = msg[1:-1] - # msg_tmp = msg.decode('ascii') - # msg_tmp_d = msg_tmp.split(',') - # screen_NAME = EventMesh.publish("get_screen_NAME") - # if screen_NAME != None: - # if screen_NAME == "video_outcall": - # # EventMesh.publish("close_jrtc_event") - # EventMesh.publish("set_UI_high_priority", 0) - # EventMesh.publish("load_screen", {"screen": "videolist"}) - - EventMesh.publish(constants.PROTOCOL.CALLCANCEL_SEND) -# class RTALK_ProtoCol(ProtoCol):#app拒接视频通话 -# """""" -# TYPE = "RTALK" -# def send(self, event, msg): - -# # [XT*334588000000156*0005*WLKEY] -# send_data = EventMesh.publish("get_new_pid")+"*%s*0005*RTALK"%(self.imei) -# MD5_SIGN = self.pack_MD5_head(send_data) -# data = "[%s%s,%d,%s]"%(str(MD5_SIGN),send_data,msg[0],msg[1]) -# print("AGTALK:send data:%s"%(data)) -# # print("WLKEY!!!!!!!!!!!!!") -# # 通过socket发送到服务器端 -# EventMesh.publish(constants.EVENT.CHANNEL_SOCKET_SEND,data) - -# def recv(self, event, msg): -# """ -# @param event: -# @param msg: 接收到的下行数据 -# """ -# # b'[SZKW*867387060319166*000A*RTALK]' -# print("RTALK!!!!!!!!!!!!!") -# # [SZKW*876226002021444*003A*RTALK,3ef20e64f3abb84b27f7d764,8762260020214441701226522,1]' -# msg = msg[1:-1] -# msg_tmp = msg.decode('ascii') -# msg_tmp_d = msg_tmp.split(',') -# screen_NAME = EventMesh.publish("get_screen_NAME") -# if screen_NAME != None: -# if screen_NAME == "video_outcall": -# # EventMesh.publish("close_jrtc_event") -# EventMesh.publish("set_UI_high_priority", 0) -# EventMesh.publish("load_screen", {"screen": "videolist"}) + msg = msg[1:-1] + msg_s = msg.decode('ascii') + msg_s = msg_s.split('profile,')[1] + mode = int(msg_s) + if mode == 4: + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME == "sos_rev":#在sos求助界面收到该指令啧退出当前界面 + EventMesh.publish("close_sos_timer") + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("return_prev_screen") + print("profile!!!!!!!!!!!!") + EventMesh.publish(constants.PROTOCOL.PROFILE_SEND) - - + class ProtoColResolver(object): def __init__(self): @@ -2949,7 +2596,7 @@ class ProtoColResolver(object): def handler(self, data): # 这里接收数据 - # print("handler -> {}".format(data)) + #print("handler -> {}".format(data)) # if data.startswith('Init;'): # data = data[5:] # EventMesh.publish(constants.EVENT.SET_KEY, {"value": ujson.loads(data)['KEY']}) diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/sleep_test.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/sleep_test.py new file mode 100644 index 00000000..b2eb1735 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/sleep_test.py @@ -0,0 +1,233 @@ +import uos +import ql_fs +if ql_fs.path_exists("/ext") == False: + ldev = uos.VfsLfs1(32, 32, 32, "ext_fs",0,3) + uos.mount(ldev,'/ext') +res = uos.statvfs("/ext") +res = list(res) +print('总ext空间:{} MB,剩余空间:{} MB'.format((((res[0] * res[2]) / 1024 / 1024)),((res[0] * res[3]) / 1024 / 1024))) +# from lcd import tp_cst816 +# from btn_device_ec800m import BtnDevice + +import lvgl as lv +import utime +import osTimer +import pm +import ql_fs +# from machine import Pin +# from lcd import lcd,lcd_ctrl,tp_cst816,lcd_ctrl +# from misc import PWM +# import uos +# from machine import I2C +# from Hsensor import GH3018 +# from Gsensor import SC7A20 +# btn_device = BtnDevice(tp_cst816) +# btn_device.start() +# i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE) +# WHO_AM_I = bytearray([0x01, 0]) +# I2C_SLAVE_ADDR = 0x49 +# r_data = bytearray(2) +# data = bytearray([0x60A0, 0]) #休眠 +# i2c0.write(I2C_SLAVE_ADDR, WHO_AM_I, 1, data, 2) +# def gsensor_cb(self, para): +# print("gsensor_cb:{}".format(para)) +# gsensor = SC7A20() +# print("DeviceInfoManager:1.0") +# gsensor.activate() +# print("DeviceInfoManager:1.1") +# gsensor.init() +# print("DeviceInfoManager:2") +# gsensor.set_callback(gsensor_cb) +# hsensor = GH3018() +# hsensor.activate() +# hsensor.init() +# hsensor.open_blood_oxygen() +# utime.sleep(5) +# PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1) +# PWM_backlight.open() +# hsensor.close() +# tp_cst816.suspend() +# lcd.lcd_display_off() +# #lcd_ctrl.write(0) +# lv.autoSleep(1) +# pm.autosleep(1) +# print("test end2") + + +import request +import ujson + + +def manual_url_encode(s: str) -> str: + """Encodes a string for use in a URL query string.""" + safe_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.*" + encoded_str = "" + + for char in s: + if char in safe_chars: + encoded_str += char + else: + encoded_str += ''.join(['%' + hex(c)[2:].upper() for c in char.encode('utf-8')]) + return encoded_str + +def generate_url(base_uri: str, params: dict) -> str: + """Generates a full URL given a base URI and a dictionary of query parameters.""" + # Encode each key-value pair in the params dictionary + encoded_params = "&".join([key + "=" + manual_url_encode(str(value)) for key, value in params.items()]) + return base_uri + "?" + encoded_params + +# Test the function with the given example +base_uri = "http://ability.raisound.com:8096/bwtts" +params = { + "text": "这是一个测试用例,一二三四五,上山打老虎", + "voice_name": "xiaomu", + "sample_rate": 44100, + "audio_format": "mp3" +} +import audio +from machine import Pin +record_test = audio.Record() +record_test.gain(4,12) +aud = audio.Audio(0) +aud.set_pa(Pin.GPIO29) +aud.setVolume(11) +tmp = bytearray() +generated_url = generate_url(base_uri, params) +print("url:{}".format(generated_url)) +response = request.get(generated_url) +print("status_code:{}".format(response.status_code)) +play_flag = 1 # = 1流播放 =2保存文件播放 + +size = 10*1024 +ret = 0 +if play_flag == 1: + for i in response.content: + print("len:{}".format(len(i))) + #tmp+= bytearray(i) + ret = aud.playStream(3, bytearray(i)) + print("data len:{}".format(len(tmp))) + #print("data:{}".format(tmp)) + #ret = aud.playStream(3, tmp) + utime.sleep_ms(20) +else: + len_tmp = 0 + with open('/ext/test.mp3', 'w+')as fp: + for i in response.content: + fp.write(i) + len_tmp+=len(i) + print("data len:{}".format(len_tmp)) + #ret = aud.play(1, 1, '/ext/test.mp3') + with open("/usr/test.mp3", "rb")as f: + while 1: + b = f.read(size) # read + if not b: + break + ret =aud.playStream(3, b) + utime.sleep_ms(20) +print("ret:{}".format(ret)) + + + + +# import quecgnss +# import utime + +# import quecgnss +# import utime +# import ure + +# gnss_init_flag = 0 +# ret = -1 +# fix_num = 0 + +# def gnss_nmea_debug(gnss_data): +# global fix_num +# global gnss_init_flag +# try: +# rmc_info = ure.search("GNRMC(.+?)M", gnss_data) +# if rmc_info.group(0).split(",")[2] == 'A': +# if fix_num > 1: +# print("输出有效定位!\r\n") +# else: +# fix_num = fix_num + 1 + +# except: +# pass + + +# def gnss_nmea_get_sat(gnss_data): +# try: +# nema_str_list = gnss_data.split('\r\n') +# for i in range(len(nema_str_list)): +# if(ure.search("GPGSV(.+?)", nema_str_list[i]) != None): +# # print(nema_str_list[i].split(",")[3]) +# try: +# print('GPS SAT NUM:{},SAT1 {} SNR {},SAT2 {} SNR {},SAT3 {} SNR {},SAT4 {} SNR {}\r\n'.format(nema_str_list[i].split(",")[3], \ +# nema_str_list[i].split(",")[4], nema_str_list[i].split(",")[7], nema_str_list[i].split(",")[8], \ +# nema_str_list[i].split(",")[11], nema_str_list[i].split(",")[12], nema_str_list[i].split(",")[15], \ +# nema_str_list[i].split(",")[16], nema_str_list[i].split(",")[19])) + +# except: +# pass + +# elif(ure.search("GBGSV(.+?)", nema_str_list[i]) != None): +# # print(nema_str_list[i].split(",")[3]) +# try: +# print('BDS SAT NUM:{},SAT1 {} SNR {},SAT2 {} SNR {},SAT3 {} SNR {},SAT4 {} SNR {}\r\n'.format(nema_str_list[i].split(",")[3], \ +# nema_str_list[i].split(",")[4], nema_str_list[i].split(",")[7], nema_str_list[i].split(",")[8], \ +# nema_str_list[i].split(",")[11], nema_str_list[i].split(",")[12], nema_str_list[i].split(",")[15], \ +# nema_str_list[i].split(",")[16], nema_str_list[i].split(",")[19])) +# except: +# pass + +# else: +# pass +# except Exception as e: +# print(str(e)) + + +# def main(): +# global fix_num +# global gnss_init_flag +# global ret +# if(gnss_init_flag == 0): +# ret = quecgnss.init() +# if ret == 0: +# print('GNSS init ok.\r\n') +# gnss_init_flag = 1 +# else: +# print('GNSS init failed.\r\n') +# return -1 +# else: +# print('GNSS has been init.\r\n') +# quecgnss.gnssEnable(1) + +# for i in range(60): +# print("==========GNSS READTIME {}==========\r\n".format(i+1)) +# data = quecgnss.read(4096) +# gnss_data = data[1].decode() +# print(gnss_data) +# gnss_nmea_get_sat(gnss_data) +# utime.sleep(1) + +# quecgnss.gnssEnable(0) +# fix_num = 0 +# utime.sleep(5) +# quecgnss.gnssEnable(1) +# print("==========GNSS RESTART==========\r\n") + +# for i in range(60): +# print("==========GNSS READTIME {}==========\r\n".format(i+1)) +# data = quecgnss.read(4096) +# gnss_data = data[1].decode() +# print(gnss_data) +# gnss_nmea_get_sat(gnss_data) +# utime.sleep(1) + +# quecgnss.gnssEnable(0) +# fix_num = 0 + + + +# if __name__ == '__main__': +# main() \ No newline at end of file diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/test.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/test.py similarity index 100% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/test.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/test.py diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py new file mode 100644 index 00000000..4d0ed921 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui.py @@ -0,0 +1,7009 @@ +import utime +import osTimer +import lvgl as lv +import EventMesh +from machine import Timer +import voiceCall +import osTimer +import constants +from misc import Power +import pm +import ujson +import audio +import ql_fs +import audio +import sms +from machine import Pin +from lcd import lcd,lcd_ctrl,tp_cst816 +from misc import PWM +import uos +import gc +import _thread +from queue import Queue +from machine import RTC +import usys +from lcd import LCD_SIZE_W,LCD_SIZE_H + + +def audio_cb(event): + if event == 0: + EventMesh.publish("set_audio_state", 1) + print('audio-play start.') + elif event == 7: + EventMesh.publish("set_audio_state", 0) + print('audio-play finish.') +CALL_LOG_MAX = 50 +aud = audio.Audio(0) +aud.setCallback(audio_cb) +# -----------------------------------------style create-------------------------------------- +style_screen = lv.style_t() +style_screen.init() +style_screen.set_radius(0) +style_screen.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_screen.set_bg_opa(255) +style_screen.set_border_width(0) +style_screen.set_pad_left(0) +style_screen.set_pad_right(0) +style_screen.set_pad_top(0) +style_screen.set_pad_bottom(0) + +style_white_screen = lv.style_t() +style_white_screen.init() +style_white_screen.set_radius(0) +style_white_screen.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +style_white_screen.set_bg_opa(255) +style_white_screen.set_border_width(0) +style_white_screen.set_pad_left(0) +style_white_screen.set_pad_right(0) +style_white_screen.set_pad_top(0) +style_white_screen.set_pad_bottom(0) + +style_gray_bg = lv.style_t() +style_gray_bg.init() +style_gray_bg.set_bg_color(lv.color_make(0x00, 0xff, 0x2a)) +style_gray_bg.set_border_width(0) +style_gray_bg.set_shadow_opa(0) +style_gray_bg.set_pad_left(0) +style_gray_bg.set_pad_right(0) +style_gray_bg.set_pad_top(0) +style_gray_bg.set_pad_bottom(0) + +style_bar = lv.style_t() +style_bar.init() +style_bar.set_radius(10) +style_bar.set_bg_color(lv.color_make(0xA0, 0xA0, 0xA0)) +style_bar.set_bg_grad_color(lv.color_make(0xA0, 0xA0, 0xA0)) +style_bar.set_bg_grad_dir(lv.GRAD_DIR.VER) +style_bar.set_bg_opa(60) +style_bar.set_pad_left(0) +style_bar.set_pad_right(0) +style_bar.set_pad_top(0) +style_bar.set_pad_bottom(0) + + +style_bar_indic = lv.style_t() +style_bar_indic.init() +style_bar_indic.set_radius(10) +style_bar_indic.set_bg_color(lv.color_make(0xff, 0x61, 0x3a)) +style_bar_indic.set_bg_grad_color(lv.color_make(0xff, 0x61, 0x3a)) +style_bar_indic.set_bg_grad_dir(lv.GRAD_DIR.VER) +style_bar_indic.set_bg_opa(255) +# 默认白色 + +style_font_youyuan_20 = lv.style_t() +style_font_youyuan_20.init() +style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) + + +style_font_youyuan_20_gray = lv.style_t() +style_font_youyuan_20_gray.init() +style_font_youyuan_20_gray.set_text_color(lv.color_make(128, 128, 128)) +style_font_youyuan_20_gray.set_text_font(lv.K01_font_16_ALL) + +style_font_youyuan_40 = lv.style_t() +style_font_youyuan_40.init() +style_font_youyuan_40.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_40.set_text_font(lv.K01_font_30_DIAL) +#黑色 +style_font_youyuan_20_black = lv.style_t() +style_font_youyuan_20_black.init() +style_font_youyuan_20_black.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_youyuan_20_black.set_text_font(lv.K01_font_16_ALL) + +#灰色背景黑色字 +style_font_28_black_bg_gray = lv.style_t() +style_font_28_black_bg_gray.init() +style_font_28_black_bg_gray.set_text_color(lv.color_make(0x00, 0x00, 0x00)) +style_font_28_black_bg_gray.set_text_font(lv.K01_font_16_ALL) +style_font_28_black_bg_gray.set_bg_color(lv.color_make(0xe1,0xdb,0xdb)) + +style_font_youyuan_28 = lv.style_t() +style_font_youyuan_28.init() +style_font_youyuan_28.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) +style_font_youyuan_28.set_text_font(lv.K01_font_16_ALL) +#黑色 +style_black = lv.style_t() +style_black.init() +style_black.set_text_color(lv.color_make(0x00, 0x00, 0x00)) + + +style_font_youyuan_20_red = lv.style_t() +style_font_youyuan_20_red.init() +style_font_youyuan_20_red.set_text_color(lv.color_make(0xff, 0x00, 0x00)) +style_font_youyuan_20_red.set_text_font(lv.K01_font_16_ALL) + +style_font_youyuan_20_white = lv.style_t() +style_font_youyuan_20_white.init() +style_font_youyuan_20_white.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20_white.set_text_font(lv.K01_font_16_ALL) + +style_img = lv.style_t() +style_img.init() +style_img.set_img_opa(255) + +style_line = lv.style_t() +style_line.init() +style_line.set_line_width(2) +style_line.set_line_color(lv.color_make(0xff, 0xff, 0xff)) + + +style_list = lv.style_t() +style_list.init() +style_list.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_list.set_radius(0) +style_list.set_bg_opa(255) +style_list.set_border_width(0) +style_list.set_pad_left(0) +style_list.set_pad_right(0) +style_list.set_pad_top(0) + +style_list_scro = lv.style_t() +style_list_scro.init() +style_list_scro.set_bg_opa(0) + +# create style style_btn +style_btn = lv.style_t() +style_btn.init() +style_btn.set_bg_opa(0) +style_btn.set_shadow_opa(0) +style_btn.set_border_width(0) + +style_wechat_btn = lv.style_t() +style_wechat_btn.init() +style_wechat_btn.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_wechat_btn.set_border_width(0) +style_wechat_btn.set_shadow_opa(0) + +style_contact_btn = lv.style_t() +style_contact_btn.init() +style_contact_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +style_contact_btn.set_radius(5) +style_contact_btn.set_border_width(0) +style_contact_btn.set_shadow_opa(0) + +style_common_bg_rect_btn_pressed = lv.style_t() +style_common_bg_rect_btn_pressed.init() +style_common_bg_rect_btn_pressed.set_bg_color(lv.color_make(0x1E, 0x26, 0xff)) +style_common_bg_rect_btn_pressed.set_bg_opa(100) +style_common_bg_rect_btn_pressed.set_border_width(0) +style_common_bg_rect_btn_pressed.set_shadow_opa(0) + +style_contact_btn_pressed = lv.style_t() +style_contact_btn_pressed.init() +style_contact_btn_pressed.set_radius(5) +style_contact_btn_pressed.set_bg_color(lv.color_make(0xff,0xff,0xff)) +style_contact_btn_pressed.set_bg_grad_color(lv.color_make(0x21,0x95,0xf6)) +style_contact_btn_pressed.set_bg_grad_dir(lv.GRAD_DIR.HOR) +style_contact_btn_pressed.set_bg_opa(217) +style_contact_btn_pressed.set_border_color(lv.color_make(0x21,0x95,0xf6)) +style_contact_btn_pressed.set_border_width(0) +style_contact_btn_pressed.set_border_opa(255) +style_contact_btn_pressed.set_text_color(lv.color_make(0x00,0x00,0x00)) + + +style_alipay_btn = lv.style_t() +style_alipay_btn.init() +style_alipay_btn.set_bg_color(lv.color_make(0xFF, 0xFF, 0xff)) +style_alipay_btn.set_bg_opa(20) +style_alipay_btn.set_border_width(0) +style_alipay_btn.set_shadow_opa(0) + + + +style_circle = lv.style_t() +style_circle.init() +style_circle.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +style_circle.set_radius(0x7FFF) + + + +from common import Abstract + +class Screen(Abstract): + meta_type = "UI" + def __init__(self): + self.meta = None + self.meta_info = None + + # self.bg_img = None + + # def set_bg_img(self, _fp): + # print("bg _fp = {} NAME = {} bg_img = {}".format(_fp, self.NAME, self.bg_img)) + # if self.bg_img: + # self.bg_img.set_src(_fp) + + def load_screen(self, e, msg): + print("msg = {}".format(msg)) + EventMesh.publish("load_screen", msg) + + + + def load(self): + pass + + def get_meta(self): + return self.meta + + def Close(self): + + pass + def lcd_on(self): + pass + def lcd_off(self): + pass + def done_left_to_right(self): + pass + + def done_right_to_left(self): + pass + + def done_bottom_to_top(self): + pass + + def done_top_to_bottom(self): + pass + + def done_return(self): + pass + + def done_click(self): + pass + + def done_error(self): + pass + def done_DOWN(self): + pass + def done_UP(self): + pass + def handle_message_event(self,data): + pass + def publish_message_event(self,data): + EventMesh.publish("publish_message_event_ui", data) + +PHONE_CALL_MAX_DATA = 18 + +phone_line_points = [{"x":0,"y":0},{"x":0,"y":40}] +phone_screen = None +phone_line = None +phone_label = None +phone_one = None +phone_two = None +phone_three = None +phone_four = None +phone_five = None +phone_six = None +phone_seven = None +phone_eight = None +phone_nine = None +phone_start = None +phone_zero = None +phone_hash = None +phone_call = None +phone_call_btn = None +phone_contact = None +phone_contact_btn = None +phone_delete = None +phone_delete_btn = None +phone_label_maxnum = None +class PhoneScreen(Screen): + NAME = "Phone" + + def __init__(self): + + super().__init__() + self.meta = None + self.phone_num = '' + self.phone_list = [] + self.button = 0 + self.timer = osTimer() + self.timer_cb = 0 + self.count = 0 + self.zero_button = 0 + self.is_sliding = 0 + + self.max_time = osTimer() + + + def initialization(self): + self.phone_num='' + self.phone_list = [] + global phone_screen ,phone_label_maxnum,phone_line,phone_label,phone_one,phone_two,phone_three,phone_four,phone_five,phone_six,phone_seven,phone_eight,phone_nine,phone_start,\ + phone_zero,phone_hash,phone_call,phone_call_btn,phone_contact,phone_contact_btn,phone_delete,phone_delete_btn + self.is_sliding = 0 + + if phone_screen == None: + phone_screen = lv.obj() + print("phone_screen") + phone_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,0)), lv.EVENT.GESTURE, None) + + phone_line = lv.line(phone_screen) + phone_line.set_points(phone_line_points,2) + phone_line.set_pos(220,20) + phone_line.set_size(2,30) + phone_line.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + phone_line.add_style(style_line,0) + + + phone_label = lv.label(phone_screen) + phone_label.set_pos(0, 24) + phone_label.set_size(0, 48) + phone_label.set_text(" ") + phone_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_label.set_long_mode(lv.label.LONG.CLIP) + phone_label.set_style_text_align(lv.TEXT_ALIGN.RIGHT, 0) + + + + phone_one = lv.img(phone_screen)#1 + phone_one.set_src("U:/static/IMAGE_NUMBER_KEY1_ICON.png") + phone_one.add_flag(lv.obj.FLAG.CLICKABLE) + phone_one.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_one.set_pos(3, 78) + phone_one.set_size(76, 50) + + phone_two = lv.img(phone_screen)#2 + phone_two.set_size(76, 50) + phone_two.set_src("U:/static/IMAGE_NUMBER_KEY2_ICON.png") + phone_two.add_flag(lv.obj.FLAG.CLICKABLE) + phone_two.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_two.set_pos(82, 78) + + phone_three = lv.img(phone_screen)#3 + phone_three.set_size(76, 50) + phone_three.set_src("U:/static/IMAGE_NUMBER_KEY3_ICON.png") + phone_three.add_flag(lv.obj.FLAG.CLICKABLE) + phone_three.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_three.set_pos(161, 78) + + phone_four = lv.img(phone_screen)#4 + phone_four.set_size(76, 50) + phone_four.set_src("U:/static/IMAGE_NUMBER_KEY4_ICON.png") + phone_four.add_flag(lv.obj.FLAG.CLICKABLE) + phone_four.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_four.set_pos(3, 130) + + phone_five = lv.img(phone_screen)#5 + phone_five.set_size(76, 50) + phone_five.set_src("U:/static/IMAGE_NUMBER_KEY5_ICON.png") + phone_five.add_flag(lv.obj.FLAG.CLICKABLE) + phone_five.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_five.set_pos(82, 130) + + phone_six = lv.img(phone_screen)#6 + phone_six.set_size(76, 50) + phone_six.set_src("U:/static/IMAGE_NUMBER_KEY6_ICON.png") + phone_six.add_flag(lv.obj.FLAG.CLICKABLE) + phone_six.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_six.set_pos(161, 130) + + phone_seven = lv.img(phone_screen)#7 + phone_seven.set_size(76, 50) + phone_seven.set_src("U:/static/IMAGE_NUMBER_KEY7_ICON.png") + phone_seven.add_flag(lv.obj.FLAG.CLICKABLE) + phone_seven.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_seven.set_pos(3, 182) + + phone_eight = lv.img(phone_screen)#8 + phone_eight.set_size(76, 50) + phone_eight.set_src("U:/static/IMAGE_NUMBER_KEY8_ICON.png") + phone_eight.add_flag(lv.obj.FLAG.CLICKABLE) + phone_eight.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_eight.set_pos(82, 182) + + phone_nine = lv.img(phone_screen)#9 + phone_nine.set_size(76, 50) + phone_nine.set_src("U:/static/IMAGE_NUMBER_KEY9_ICON.png") + phone_nine.add_flag(lv.obj.FLAG.CLICKABLE) + phone_nine.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_nine.set_pos(161, 182) + + phone_call = lv.img(phone_screen)#拨号 + phone_call.set_size(76, 50) + phone_call.set_src("U:/static/IMAGE_BUTTON_DIAL.png") + phone_call.add_flag(lv.obj.FLAG.CLICKABLE) + phone_call.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_call.set_pos(3, 234) + + phone_zero = lv.img(phone_screen)#0 + phone_zero.set_size(76, 50) + phone_zero.set_src("U:/static/IMAGE_NUMBER_KEY0_ICON.png") + phone_zero.add_flag(lv.obj.FLAG.CLICKABLE) + phone_zero.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_zero.set_pos(82, 234) + + phone_delete = lv.img(phone_screen)#删除 + phone_delete.set_size(76, 50) + phone_delete.set_src("U:/static/IMAGE_BUTTON_DELKEY.png") + phone_delete.add_flag(lv.obj.FLAG.CLICKABLE) + phone_delete.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_delete.set_pos(161, 234) + + # phone_call = lv.img(phone_screen) + # phone_call.set_size(76, 50) + # phone_call.set_src("U:/static/IMAGE_BUTTON_DIAL.png") + # phone_call.add_flag(lv.obj.FLAG.CLICKABLE) + # phone_call.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # phone_call.set_pos(3, 270) + + phone_call_btn = lv.img(phone_screen) + phone_call_btn.set_size(76, 50) + phone_call_btn.add_flag(lv.obj.FLAG.CLICKABLE) + phone_call_btn.set_pos(3, 234) + + # phone_contact = lv.img(phone_screen) + # phone_contact.set_size(64, 50) + # phone_contact.set_src("U:/static/IMAGE_BUTTON_DIAL_CONTACT.png") + # phone_contact.add_flag(lv.obj.FLAG.CLICKABLE) + # phone_contact.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # phone_contact.set_pos(87, 270) + + # phone_contact_btn = lv.img(phone_screen) + # phone_contact_btn.set_size(76, 52) + # phone_contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) + # phone_contact_btn.set_pos(87, 268) + + # phone_delete = lv.img(phone_screen) + # phone_delete.set_size(76, 50) + # phone_delete.set_src("U:/static/IMAGE_BUTTON_DELKEY.png") + # phone_delete.add_flag(lv.obj.FLAG.CLICKABLE) + # phone_delete.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + # phone_delete.set_pos(161, 216) + + phone_delete_btn = lv.img(phone_screen) + phone_delete_btn.set_size(76, 50) + phone_delete_btn.add_flag(lv.obj.FLAG.CLICKABLE) + phone_delete_btn.set_pos(161, 234) + + + phone_label_maxnum = lv.label(phone_screen) + phone_label_maxnum.set_pos(0, 120) + phone_label_maxnum.set_size(240, 48) + phone_label_maxnum.set_text("位数超过最大18个") + phone_label_maxnum.add_style(style_font_youyuan_20_red, lv.PART.MAIN | lv.STATE.DEFAULT) + phone_label_maxnum.set_long_mode(lv.label.LONG.CLIP) + phone_label_maxnum.set_style_text_align(lv.TEXT_ALIGN.RIGHT, 0) + phone_label_maxnum.add_flag(lv.obj.FLAG.HIDDEN) + + self.meta = phone_screen + + phone_one.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + # phone_one.add_event_cb(lambda e: EventMesh.callback_wrapper(self.one(e)), + # lv.EVENT.PRESSING, None) + + phone_two.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), + lv.EVENT.SHORT_CLICKED, None) + # phone_two.add_event_cb(lambda e: EventMesh.callback_wrapper(self.two(e)), + # lv.EVENT.PRESSING, None) + + phone_three.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), + lv.EVENT.SHORT_CLICKED, None) + # phone_three.add_event_cb(lambda e: EventMesh.callback_wrapper(self.three(e)), + # lv.EVENT.PRESSING, None) + + phone_four.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,4)), + lv.EVENT.SHORT_CLICKED, None) + # phone_four.add_event_cb(lambda e: EventMesh.callback_wrapper(self.four(e)), + # lv.EVENT.PRESSING, None) + + phone_five.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,5)), + lv.EVENT.SHORT_CLICKED, None) + # phone_five.add_event_cb(lambda e: EventMesh.callback_wrapper(self.five(e)), + # lv.EVENT.PRESSING, None) + + phone_six.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,6)), + lv.EVENT.SHORT_CLICKED, None) + # phone_six.add_event_cb(lambda e: EventMesh.callback_wrapper(self.six(e)), + # lv.EVENT.PRESSING, None) + + phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,7)), + lv.EVENT.SHORT_CLICKED, None) + phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.LONG_PRESSED, None) + phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.RELEASED, None) + # phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.seven(e)), + # lv.EVENT.PRESSING, None) + + phone_eight.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,8)), + lv.EVENT.SHORT_CLICKED, None) + # phone_eight.add_event_cb(lambda e: EventMesh.callback_wrapper(self.eight(e)), + # lv.EVENT.PRESSING, None) + + phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,9)), + lv.EVENT.SHORT_CLICKED, None) + phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), + lv.EVENT.LONG_PRESSED, None) + phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), + lv.EVENT.RELEASED, None) + # phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.nine(e)), + # lv.EVENT.PRESSING, None) + + phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,10)), + lv.EVENT.SHORT_CLICKED, None) + phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), + lv.EVENT.LONG_PRESSED, None) + phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), + lv.EVENT.RELEASED, None) + # phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero(e)), + # lv.EVENT.PRESSING, None) + + phone_call_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,11)), + lv.EVENT.SHORT_CLICKED, None) + + phone_delete_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,12)), + lv.EVENT.SHORT_CLICKED, None) + + phone_label_maxnum.add_flag(lv.obj.FLAG.HIDDEN) + self.phone_num='' + self.phone_list = [] + self.count = 0 + if phone_label != None: + phone_label.set_pos(0, 20) + phone_label.set_size(0, 0) + phone_label.set_text(" ") + #phone_label.set_text(" ") + # print("self.phone_list :{} self.phone_num:{}".format(self.phone_list,self.phone_num)) + if self.timer_cb == 0: + self.timer_cb = 1 + self.timer.start(1000,1,self.refresh_line) + self.zero_button = 0 + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 1: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("1") + self.phone_num = ''.join(self.phone_list) + self.show_num() + pass + elif msg == 2: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("2") + self.phone_num = ''.join(self.phone_list) + self.show_num() + pass + elif msg == 3: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("3") + self.phone_num = ''.join(self.phone_list) + self.show_num() + pass + elif msg == 4: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("4") + self.phone_num = ''.join(self.phone_list) + self.show_num() + pass + elif msg == 5: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("5") + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 6: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("6") + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 7: + self.zero_button = 0 + elif msg == 8: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("8") + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 9: + self.zero_button = 0 + elif msg == 10: + self.zero_button = 0 + elif msg == 11: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: + self.name = None + self.phonebook = {} + self.number_tmp = {} + if len(self.phone_list) != 0: + data = EventMesh.publish("get_phonebook_list") + if data != None: + check = data[0] + self.phonebook = data[1] + # print("check :{}".format(check)) + if check == 1:#检查通讯录 + phonebook_keys = sorted(self.phonebook.keys()) + b = str(self.phone_num) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + j = 0 + if b == True: + for i in range(len(self.phonebook)): #字典 key value + #'001:张三':15521469561 + name = self.phonebook[phonebook_keys[j]] + name_value = phonebook_keys[j] + number_tmp = str(self.phone_num) + # print("name :{} number_tmp:{}".format(name,number_tmp)) + if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 + number_f= name_value + name_s = number_f.split(':') + name_s = name_s[1] + self.name = name_s + break + j+=1 + else: + self.name = self.phone_num + else: + self.name = self.phone_num + + EventMesh.publish("save_phonenum",self.phone_num) + EventMesh.publish("save_phonename",self.name)# + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + else: + EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"}) + else:#未插卡 + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + elif msg == 12: + if len(self.phone_list) != 0: + self.phone_list.pop() + self.phone_num = ''.join(self.phone_list) + self.show_num() + + elif code == lv.EVENT.LONG_PRESSED: + print("button_cb LONG_PRESSED:{}\r\n".format(msg)) + if msg == 1: + self.zero_button = 1 + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("*") + else: + self.phone_list.append("7") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 2: + self.zero_button = 1 + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("#") + else: + self.phone_list.append("9") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 3: + self.zero_button = 1 + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("+") + else: + self.phone_list.append("0") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + elif code == lv.EVENT.RELEASED: + print("button_cb RELEASED:{} self.zero_button:{} self.phone_list:{}\r\n".format(msg,self.zero_button,self.phone_list)) + if msg == 1: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("*") + else: + self.phone_list.append("7") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 2: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("#") + else: + self.phone_list.append("9") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + elif msg == 3: + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("+") + else: + self.phone_list.append("0") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def refresh_line(self,e): + if self.count > 2 : + self.count = 1 + if self.count%2 == 0: + phone_line.clear_flag(lv.obj.FLAG.HIDDEN) + else: + phone_line.add_flag(lv.obj.FLAG.HIDDEN) + self.count+=1 + + def one(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("1") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def two(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("2") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def three(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("3") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def four(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("4") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def five(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("5") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def six(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("6") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def seven(self,e): + self.zero_button = 0 + + + def seven_longpress(self,e): + self.zero_button = 1 + + def seven_release(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("*") + else: + self.phone_list.append("7") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def eight(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA: + self.show_maxnum_warin() + return + self.phone_list.append("8") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def nine(self,e): + self.zero_button = 0 + + def nine_longpress(self,e): + self.zero_button = 1 + pass + def nine_release(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("#") + else: + self.phone_list.append("9") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def zero(self,e): + self.zero_button = 0 + + def zero_longpress(self,e): + self.zero_button = 1 + pass + + def zero_release(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.zero_button = 0 + self.show_maxnum_warin() + return + if self.zero_button == 1: + self.phone_list.append("+") + else: + self.phone_list.append("0") + self.zero_button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def show_maxnum_warin(self): + phone_label_maxnum.clear_flag(lv.obj.FLAG.HIDDEN) + self.max_time.start(1*1000,0,self.show_maxnum_warin_cb) + + pass + + def show_maxnum_warin_cb(self,*argc): + phone_label_maxnum.add_flag(lv.obj.FLAG.HIDDEN) + pass + + def pressed_start(self,e): + self.button = 1 + + + def Close(self): + self.timer_cb = 0 + self.timer.stop() + + def endpressed_start(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + self.button = 0 + self.show_maxnum_warin() + return + + if self.button == 1:#长按 + self.phone_list.append("+") + else:#短按 + self.phone_list.append("*") + + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def hash(self,e): + if len(self.phone_list) >= PHONE_CALL_MAX_DATA:#限制拨号数量20个数字 + + self.show_maxnum_warin() + return + self.phone_list.append("#") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + + def delete(self,e): + if len(self.phone_list) != 0: + self.phone_list.pop() + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def contact(self,e): + EventMesh.publish("load_screen", {"screen": "contacts"}) + + def call(self,e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1: + self.name = None + self.phonebook = {} + self.number_tmp = {} + if len(self.phone_list) != 0: + data = EventMesh.publish("get_phonebook_list") + if data != None: + check = data[0] + self.phonebook = data[1] + # print("check :{}".format(check)) + if check == 1:#检查通讯录 + phonebook_keys = sorted(self.phonebook.keys()) + b = str(self.phone_num) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + j = 0 + if b == True: + for i in range(len(self.phonebook)): #字典 key value + #'001:张三':15521469561 + name = self.phonebook[phonebook_keys[j]] + name_value = phonebook_keys[j] + number_tmp = str(self.phone_num) + # print("name :{} number_tmp:{}".format(name,number_tmp)) + if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 + number_f= name_value + name_s = number_f.split(':') + name_s = name_s[1] + self.name = name_s + break + j+=1 + else: + self.name = self.phone_num + else: + self.name = self.phone_num + + EventMesh.publish("save_phonenum",self.phone_num) + EventMesh.publish("save_phonename",self.name)# + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + else: + EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"}) + else:#未插卡 + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + self.is_sliding = 0 + + def show_num(self): + #print("self.phone_num ",self.phone_num,self.phone_list) + len_t = len(self.phone_list)*40 + if len_t > 215: + len_t = 215 + phone_label.set_size(len_t,48) + phone_label.set_pos(215-len_t,24) + phone_label.set_text(self.phone_num) + + def lcd_on(self): + if self.timer_cb != 0: + self.timer_cb = 0 + self.timer.start(1000,1,self.refresh_line) + + def lcd_off(self): + self.timer_cb = 1 + self.timer.stop() + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +call_log_screen = None +contacts_cont_list = None +call_log_title = None +none_call_log_title = None +call_log_cont_list_screen = None +CALLLOG_FLAG = 0 +CALL_LOG_LIST_SIZE = 80 +CALL_LOG_LIST_LABEL = 28 +class CallLogScreen(Screen): + NAME = "call_log" + + def __init__(self): + super().__init__() + self.CALL_LOG_MAX = CALL_LOG_MAX + self.meta = None + self.log_list = [] + self.read_call_log = {} + self.check_json = 0 + self.call_log_detail_list = None + self.call_log_detail_list_dict = [] + self.timer = osTimer() + self.is_sliding = 0 + EventMesh.subscribe("call_log_update_show_list", self.call_log_update_show_list) + + def post_processor_before_initialization(self): + read_call_log = EventMesh.publish("get_call_log_list") + if read_call_log != None: + self.check_json = read_call_log[0] + self.read_call_log = read_call_log[1] + + + + def call_log_update_show_list(self, event, msg): + read_call_log = EventMesh.publish("get_call_log_list") + if read_call_log != None: + # print("read_call_log:{}".format(read_call_log)) + self.check_json = read_call_log[0] #文件是否存在 + self.read_call_log = read_call_log[1]#通话记录数据 + self.timer.start(500,0,self.reciving) + + def reciving(self,e): + self.btn_create() + + def initialization(self): + self.is_sliding = 0 + global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title ,call_log_cont_list_screen + if call_log_screen == None: + call_log_screen = lv.obj() + print("call_log_screen") + call_log_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + call_log_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + call_log_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + lv.EVENT.GESTURE, None) + + call_log_cont_list_screen = lv.obj(call_log_screen) + call_log_cont_list_screen.set_pos(0, 50) + call_log_cont_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-50) + call_log_cont_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + call_log_cont_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + call_log_cont_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + lv.EVENT.GESTURE, None) + + call_log_title = lv.label(call_log_screen) + call_log_title.set_pos(0, 10) + call_log_title.set_size(LCD_SIZE_W, 40) + call_log_title.set_long_mode(lv.label.LONG.CLIP) + call_log_title.set_text("通话记录") + call_log_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + call_log_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + none_call_log_title = lv.label(call_log_cont_list_screen) + none_call_log_title.set_pos(0, 120) + none_call_log_title.set_size(LCD_SIZE_W, 40) + none_call_log_title.set_long_mode(lv.label.LONG.WRAP) + none_call_log_title.set_text(" ") + none_call_log_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + none_call_log_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + #self.call_log_detail_list = lv.obj(call_log_screen) + self.call_log_detail_list = lv.obj(call_log_cont_list_screen) + self.call_log_detail_list.set_pos(0, 0) + self.call_log_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-50+1) + self.call_log_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + self.call_log_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + self.call_log_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + lv.EVENT.GESTURE, None) + for i in range(self.CALL_LOG_MAX): + _btn = lv.btn(self.call_log_detail_list) + _btn.add_flag(lv.obj.FLAG.CLICKABLE) + _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + lv.EVENT.SHORT_CLICKED, None) + # _btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + # lv.EVENT.PRESSING, None) + _btn.add_flag(lv.obj.FLAG.HIDDEN) + _btn_label2 = lv.label(_btn) + _btn_label3 = lv.label(_btn) + _btn_label4 = lv.label(_btn) + _btn_label5 = lv.label(_btn) + _btn_label6 = lv.label(_btn) + _btn.add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + _btn_label4.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + _btn_label6.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.call_log_detail_list_dict.append({"_btn":_btn,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3, + "_btn_label4":_btn_label4,"_btn_label5":_btn_label5,"_btn_label6":_btn_label6}) + self.meta = call_log_screen + + + read_call_log = EventMesh.publish("get_call_log_list") + # print("read_call_log:{}".format(read_call_log)) + if read_call_log != None: + self.check_json = read_call_log[0] #文件是否存在 + self.read_call_log = read_call_log[1]#通话记录数据 + if self.check_json == True and self.read_call_log != {}: + none_call_log_title.set_text(" ") + else: + none_call_log_title.set_text("暂无记录") + self.btn_create() + + def btn_create(self): + EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_screen,"data":0}) + + def btn_create_screen(self,data): + global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title ,call_log_cont_list_screen + h = 0 + if call_log_screen != None: + if self.check_json == True and len(self.read_call_log) != 0: + none_call_log_title.set_text(" ") + sort_tmp = self.read_call_log.values() + sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 + # print("self.call_log :{} \r\n sort_new:{}\r\n".format(self.read_call_log,sort_new)) + self.call_log_detail_list.clear_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 + + for sort_new_tmp in sort_new: #字典 key value + + num_count = sort_new_tmp["count"]#获取通话次数 + num_name = sort_new_tmp["name"]#获取名称 + num_phonnum = sort_new_tmp["number"]#获取电话号码 + num_time = sort_new_tmp["time"]#获取电话号码 + + + # print("num_count :{} num_name:{} num_time:{}".format(num_count,num_name,num_time)) + #_btn = lv.btn(self.call_log_detail_list) + self.call_log_detail_list_dict[h]["_btn"].set_size(LCD_SIZE_W-10,CALL_LOG_LIST_SIZE) + self.call_log_detail_list_dict[h]["_btn"].set_pos(5,(CALL_LOG_LIST_SIZE+4)*h) + #self.call_log_detail_list_dict[h]["_btn"].add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + self.call_log_detail_list_dict[h]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + lv.EVENT.SHORT_CLICKED, None) + # self.call_log_detail_list_dict[h]["_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + # lv.EVENT.PRESSING, None) + + + #_btn_label2 = lv.label(_btn) + self.call_log_detail_list_dict[h]["_btn_label2"].set_pos(0, 5) + self.call_log_detail_list_dict[h]["_btn_label2"].set_size(0, CALL_LOG_LIST_LABEL) + self.call_log_detail_list_dict[h]["_btn_label2"].set_text(num_phonnum) + #_btn_label2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + # + #_btn_label3 = lv.label(_btn) + self.call_log_detail_list_dict[h]["_btn_label3"].set_pos(0, 0) + self.call_log_detail_list_dict[h]["_btn_label3"].set_size(0, 0) + self.call_log_detail_list_dict[h]["_btn_label3"].set_text("(" + str(num_count) + ")") + # _btn_label3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + #_btn_label4 = lv.label(_btn) + self.call_log_detail_list_dict[h]["_btn_label4"].set_pos(0, 45) + self.call_log_detail_list_dict[h]["_btn_label4"].set_size(LCD_SIZE_W-10, CALL_LOG_LIST_LABEL) + self.call_log_detail_list_dict[h]["_btn_label4"].set_long_mode(lv.label.LONG.CLIP) + self.call_log_detail_list_dict[h]["_btn_label4"].set_text(num_phonnum) + #self.call_log_detail_list_dict[h]["_btn_label4"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + #_btn_label5 = lv.label(_btn) + self.call_log_detail_list_dict[h]["_btn_label5"].set_pos(0, 5) + self.call_log_detail_list_dict[h]["_btn_label5"].set_size(0, 0) + self.call_log_detail_list_dict[h]["_btn_label5"].set_text(num_name) + # _btn_label5.set_long_mode(lv.obj.LONG.DOT) + # _btn_label5.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + #_btn_label6 = lv.label(_btn) + self.call_log_detail_list_dict[h]["_btn_label6"].set_pos(0, 5) + self.call_log_detail_list_dict[h]["_btn_label6"].set_size(LCD_SIZE_W-10, CALL_LOG_LIST_LABEL) + self.call_log_detail_list_dict[h]["_btn_label6"].set_long_mode(lv.label.LONG.CLIP) + self.call_log_detail_list_dict[h]["_btn_label6"].set_text(num_name) + #self.call_log_detail_list_dict[h]["_btn_label6"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.call_log_detail_list_dict[h]["_btn"].clear_flag(lv.obj.FLAG.HIDDEN) + #self.call_log_detail_list_dict[h]["_btn"].scroll_to_view(lv.ANIM.OFF) + h = h + 1 + for i in range(self.CALL_LOG_MAX): + if i >= h : + self.call_log_detail_list_dict[i]["_btn"].add_flag(lv.obj.FLAG.HIDDEN)#隐藏多余 + else: + if call_log_cont_list_screen != None: + none_call_log_title.set_text("暂无记录") + self.call_log_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 + + def calling(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + elif code == lv.EVENT.SHORT_CLICKED: + global call_log_screen,contacts_cont_list ,call_log_title ,none_call_log_title + # print("e.get_text():{} {}".format(e.get_target().get_child(0).get_text(),e.get_target().get_child(3).get_text())) + phonnum = str(e.get_target().get_child(0).get_text()) + phnoname = e.get_target().get_child(3).get_text() + # print("phonnum :{} _msg:{}".format(phonnum,phnoname)) + + + self.name = None + self.phonebook = {} + + self.call_log = {} + self.call_log_value = {} + self.read_call_log = {} + self.number_tmp = {} + + data = EventMesh.publish("get_phonebook_list") + if data != None: + check = data[0] + self.phonebook = data[1] + # print("check :{}".format(check)) + if check == 1:#检查通讯录 + phonebook_keys = sorted(self.phonebook.keys()) + b = str(phonnum) in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + j = 0 + if b == True: + for i in range(len(self.phonebook)): #字典 key value + #'001:':15521469561 + name = self.phonebook[phonebook_keys[j]] + name_value = phonebook_keys[j] + number_tmp = str(phonnum) + # print("name :{} number_tmp:{}".format(name,number_tmp)) + if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 + number_f= name_value + name_s = number_f.split(':') + name_s = name_s[1] + self.name = name_s + break + j+=1 + else: + self.name = phnoname + else: + self.name = phnoname + + if self.name == None: + self.name = phnoname + if len(phonnum) > 0: + EventMesh.publish("save_phonename",self.name)# + EventMesh.publish("save_phonenum",phonnum)#保存电话号码用于界面显示获取 + #voiceCall.callStart(str(phonnum)) + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + else: + EventMesh.publish("load_screen", {"screen": "no_valied_num_screen"})#无效的号码 请重新输入 + + def done_DOWN(self):#下滑 + if self.call_log_detail_list != None: + scroll_y = self.call_log_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.call_log_detail_list.scroll_to_y(scroll_y-CALL_LOG_LIST_SIZE,lv.ANIM.ON) + + + #setting_cont.scroll_to_view(lv.ANIM.ON) + pass + def done_UP(self):#上滑 + if self.call_log_detail_list != None: + scroll_y = self.call_log_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.call_log_detail_list.scroll_to_y(scroll_y+CALL_LOG_LIST_SIZE,lv.ANIM.ON) + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_left_to_right(self): + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +# ------------------------------拨打电话-------------dialing screen---------------------------------------------------------- + +dialing_screen = None +dialing_img = None +dialing_name = None +dialing_call_label = None +hangup_imgbtn = None +class DialingScreen(Screen): + NAME = "dialing" + + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + self.call_log = {} + self.call_log_value = {} + self.read_call_log = {} + self.number_tmp = {} + self.is_sliding =0 + self.CALL_LOG_MAX = CALL_LOG_MAX + self.meta_type = "popup" + + def initialization(self): + self.is_sliding =0 + EventMesh.publish("set_UI_high_priority", 1) + global dialing_screen,dialing_img,dialing_name ,hangup_imgbtn + if dialing_screen == None: + dialing_screen = lv.obj() + print("dialing_screen") + dialing_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_img = lv.img(dialing_screen) + dialing_img.set_pos(80, 10) + dialing_img.set_size(64, 64) + dialing_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") + dialing_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_name = lv.label(dialing_screen) + dialing_name.set_pos(0, 90) + dialing_name.set_size(LCD_SIZE_W, 50) + dialing_name.set_text(" ") + dialing_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_call_label = lv.label(dialing_screen) + dialing_call_label.set_pos(0, 150) + dialing_call_label.set_size(LCD_SIZE_W, 50) + dialing_call_label.set_text("正在等待对方接\n听电话") + dialing_call_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_call_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + hangup_imgbtn = lv.img(dialing_screen) + hangup_imgbtn.set_size(64, 64) + hangup_imgbtn.set_src("U:/static/hang_up.png") + hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + hangup_imgbtn.set_pos(80, 210) + hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), + lv.EVENT.SHORT_CLICKED, None) + self.meta = dialing_screen + if dialing_name != None: + name = EventMesh.publish("get_phonename")#获取拨打电话名称 + dialing_name.set_text(name)#名称 + def post_processor_after_initialization(self): + # print("创建通话记录 post_processor_before_initialization\n") + utime.sleep_ms(200)#不加延时会切屏 + + + def hangup(self,e): + code = e.get_code() + if code == lv.EVENT.SHORT_CLICKED: + EventMesh.publish("set_UI_high_priority", 0) + EventMesh.publish("close_sos_timer") + EventMesh.publish("set_hangup_mode", 1) + voiceCall.callEnd() + EventMesh.publish("set_interrup_incall",0) + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("return_prev_screen") + + def Close(self): + self.timer.stop() + + def call_end(self,*argc): + call_state = EventMesh.publish("get_call_state")# + if call_state != None: + if call_state == 0:#未打通 + EventMesh.publish("return_prev_screen") + + + def done_return(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn1_release(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + + + +no_sim_popup_screen = None +no_sim_popup_screen_title1 = None +no_sim_popup_screen_title2 = None +#未插卡 +class NoSimScreen(Screen):# + NAME = "no_sim_popup_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global no_sim_popup_screen,no_sim_popup_screen_title1,no_sim_popup_screen_title2 + if no_sim_popup_screen == None : + no_sim_popup_screen = lv.obj() + print("no_sim_popup_screen") + no_sim_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_popup_screen_title1 = lv.label(no_sim_popup_screen) + no_sim_popup_screen_title1.set_pos(0, 100) + no_sim_popup_screen_title1.set_size(LCD_SIZE_W, 40) + no_sim_popup_screen_title1.set_text("无SIM卡或") + no_sim_popup_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_popup_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_popup_screen_title2 = lv.label(no_sim_popup_screen) + no_sim_popup_screen_title2.set_pos(0, 150) + no_sim_popup_screen_title2.set_size(LCD_SIZE_W, 40) + no_sim_popup_screen_title2.set_text("无网络") + no_sim_popup_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_popup_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = no_sim_popup_screen + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + +no_valied_num_screen = None +no_valied_num_screen_title1 = None +no_valied_num_screen_title2 = None +#=无效的号码 请重新输入 +class NovaliedNumScreen(Screen):# + NAME = "no_valied_num_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer_count = 0 + self.timer=osTimer() + + def initialization(self): + global no_valied_num_screen,no_valied_num_screen_title1,no_valied_num_screen_title2 + if no_valied_num_screen == None : + no_valied_num_screen = lv.obj() + print("no_valied_num_screen") + no_valied_num_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_valied_num_screen_title1 = lv.label(no_valied_num_screen) + no_valied_num_screen_title1.set_pos(0, 120) + no_valied_num_screen_title1.set_size(LCD_SIZE_W, 60) + no_valied_num_screen_title1.set_text("无效的号码,请重新输入") + no_valied_num_screen_title1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_valied_num_screen_title1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + # no_valied_num_screen_title2 = lv.label(no_valied_num_screen) + # no_valied_num_screen_title2.set_pos(0, 190) + # no_valied_num_screen_title2.set_size(LCD_SIZE_W, 40) + # no_valied_num_screen_title2.set_text("请重新输入") + # no_valied_num_screen_title2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + # no_valied_num_screen_title2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = no_valied_num_screen + def post_processor_after_initialization(self): + self.timer_count = 0 + self.timer.start(5000,1,self.timeout_exit) + + def timeout_exit(self,e): + self.timer_count+=1 + if self.timer_count >= 2: + self.timer_count = 0 + EventMesh.publish("return_prev_screen") + + def Close(self): + self.timer.stop() + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + + +no_sim_power_screen = None +no_sim_power_screen_title = None +no_sim_power_screen_label =None +no_sim_power_screen_comfirm =None +no_sim_power_screen_cancel = None +no_sim_power_screen_img = None + +#未插卡,长按关机 +class NoSimPowerScreen(Screen):# + NAME = "no_sim_power_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.is_sliding =0 + + def initialization(self): + self.is_sliding =0 + global no_sim_power_screen,no_sim_power_screen_img,no_sim_power_screen_title,no_sim_power_screen_comfirm,no_sim_power_screen_cancel,no_sim_power_screen_label + if no_sim_power_screen == None : + no_sim_power_screen = lv.obj() + print("no_sim_power_screen") + no_sim_power_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_power_screen_title = lv.label(no_sim_power_screen) + no_sim_power_screen_title.set_pos(0, 15) + no_sim_power_screen_title.set_size(LCD_SIZE_W, 40) + no_sim_power_screen_title.set_text("无SIM卡,无法拨打") + no_sim_power_screen_title.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_power_screen_img = lv.img(no_sim_power_screen) + no_sim_power_screen_img.set_pos(89, 55) + no_sim_power_screen_img.set_size(61, 61) + no_sim_power_screen_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sim_power_screen_img.set_src("U:/static/poweroff_icon.png") + + + no_sim_power_screen_label = lv.label(no_sim_power_screen) + no_sim_power_screen_label.set_pos(0, 135) + no_sim_power_screen_label.set_size(LCD_SIZE_W, 40) + no_sim_power_screen_label.set_text("是否关机?") + no_sim_power_screen_label.set_long_mode(lv.label.LONG.WRAP) + no_sim_power_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_power_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + no_sim_power_screen_comfirm = lv.img(no_sim_power_screen) + no_sim_power_screen_comfirm.set_size(176, 46) + no_sim_power_screen_comfirm.set_pos(32, 175) + no_sim_power_screen_comfirm.set_src("U:/static/off_icon.png") + no_sim_power_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_power_screen_comfirm.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + poweroff_confirm_label = lv.label(no_sim_power_screen_comfirm) + poweroff_confirm_label.set_text("确定") + poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 5) + poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_power_screen_cancel = lv.img(no_sim_power_screen) + no_sim_power_screen_cancel.set_size(176, 46) + no_sim_power_screen_cancel.set_pos(32, 235) + no_sim_power_screen_cancel.set_src("U:/static/cancel_icon.png") + no_sim_power_screen_cancel.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_power_screen_cancel.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + poweroff_return_label = lv.label(no_sim_power_screen_cancel) + poweroff_return_label.set_text("取消") + poweroff_return_label.align(lv.ALIGN.CENTER, 0, 5) + poweroff_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sim_power_screen_cancel.set_ext_click_area(20) + + self.meta = no_sim_power_screen + no_sim_power_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,1)), lv.EVENT.GESTURE, None) + no_sim_power_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), + lv.EVENT.SHORT_CLICKED, None) + + no_sim_power_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,3)), + lv.EVENT.SHORT_CLICKED, None) + + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != 1: + if msg == 2: + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + elif msg == 3: + EventMesh.publish("return_prev_screen") + + # def done_right_to_left(self): + # EventMesh.publish("return_prev_screen") + + # def done_bottom_to_top(self): + # EventMesh.publish("return_prev_screen") + def done_return(self): + EventMesh.publish("return_prev_screen") + + # def done_top_to_bottom(self): + # EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + +no_sim_auto_screen = None +no_sim_auto_screen_title = None +no_sim_auto_screen_label =None +no_sim_auto_screen_comfirm =None +no_sim_autor_screen_cancel = None +no_sim_auto_screen_img = None +no_sim_confirm_label = None + +#未插卡,长按关机 +class NoSimAutoScreen(Screen):#无sim卡是否关机 + NAME = "no_sim_auto_screen" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer = osTimer() + self.count = 0 + self.is_sliding = 0 + + def initialization(self): + self.is_sliding = 0 + global no_sim_auto_screen,no_sim_confirm_label,no_sim_cancel_label,no_sim_auto_screen_img,no_sim_auto_screen_title,no_sim_auto_screen_comfirm,no_sim_auto_screen_cancel,no_sim_auto_screen_label + if no_sim_auto_screen == None : + no_sim_auto_screen = lv.obj() + print("no_sim_power_screen") + no_sim_auto_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_auto_screen_title = lv.label(no_sim_auto_screen) + no_sim_auto_screen_title.set_pos(0, 10) + no_sim_auto_screen_title.set_size(LCD_SIZE_W, 50) + no_sim_auto_screen_title.set_text("无SIM卡,无操作30s\n后自动关机") + no_sim_auto_screen_title.set_long_mode(lv.label.LONG.WRAP) + no_sim_auto_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_auto_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_auto_screen_img = lv.img(no_sim_auto_screen) + no_sim_auto_screen_img.set_pos(89, 70) + no_sim_auto_screen_img.set_size(61, 61) + no_sim_auto_screen_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sim_auto_screen_img.set_src("U:/static/poweroff_icon.png") + + + no_sim_auto_screen_label = lv.label(no_sim_auto_screen) + no_sim_auto_screen_label.set_pos(0, 150) + no_sim_auto_screen_label.set_size(LCD_SIZE_W, 40) + no_sim_auto_screen_label.set_text("是否关机?") + no_sim_auto_screen_label.set_long_mode(lv.label.LONG.WRAP) + no_sim_auto_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_sim_auto_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + no_sim_auto_screen_comfirm = lv.img(no_sim_auto_screen) + no_sim_auto_screen_comfirm.set_size(176, 46) + no_sim_auto_screen_comfirm.set_pos(32, 185) + no_sim_auto_screen_comfirm.set_src("U:/static/off_icon.png") + no_sim_auto_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_auto_screen_comfirm.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_confirm_label = lv.label(no_sim_auto_screen_comfirm) + no_sim_confirm_label.set_text("确定") + no_sim_confirm_label.align(lv.ALIGN.CENTER, 0, 5) + no_sim_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_sim_auto_screen_cancel = lv.img(no_sim_auto_screen) + no_sim_auto_screen_cancel.set_size(176, 46) + no_sim_auto_screen_cancel.set_pos(32, 238) + no_sim_auto_screen_cancel.set_src("U:/static/cancel_icon.png") + no_sim_auto_screen_cancel.add_flag(lv.obj.FLAG.CLICKABLE) + no_sim_auto_screen_cancel.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sim_cancel_label = lv.label(no_sim_auto_screen_cancel) + no_sim_cancel_label.set_text("取消") + no_sim_cancel_label.align(lv.ALIGN.CENTER, 0, 5) + no_sim_cancel_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sim_auto_screen_cancel.set_ext_click_area(20) + + self.meta = no_sim_auto_screen + + no_sim_auto_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,0)), lv.EVENT.GESTURE, None) + + no_sim_auto_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), + lv.EVENT.SHORT_CLICKED, None) + + no_sim_auto_screen_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), + lv.EVENT.SHORT_CLICKED, None) + + + self.timer.start(1*1000,1,self.fun) + self.count = 0 + + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != 0: + if msg == 1: + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + else: + EventMesh.publish("return_prev_screen") + + + def fun(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count > 30: + self.count = 0 + self.timer.stop() + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + + + def Close(self): + self.count = 0 + self.timer.stop() + + def confirm(self,e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + print("2self.is_sliding",self.is_sliding) + + self.is_sliding =0 + + + def cancel(self,e): + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + + + +dialing_popup_screen = None +dialing_popup_img = None +dialing_popup_name = None +dialing_popup_hangup_imgbtn = None +class DialingNoPlayPopupScreen(Screen):#正在拨号中...未打出 + NAME = "dialing_noplay_popup" + + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer1 = osTimer() + self.time_count = 0 + self.timer2 = osTimer() + self.call_log = {} + self.call_log_value = {} + self.read_call_log = {} + self.number_tmp = {} + self.CALL_LOG_MAX = CALL_LOG_MAX + self.is_sliding =0 + + def initialization(self): + self.is_sliding =0 + EventMesh.publish("set_UI_high_priority", 1) + global dialing_popup_screen,dialing_popup_img,dialing_popup_name ,dialing_popup_call,dialing_popup_hangup_imgbtn + if dialing_popup_screen == None: + dialing_popup_screen = lv.obj() + print("dialing_popup_screen") + dialing_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_img = lv.img(dialing_popup_screen) + dialing_popup_img.set_pos(80, 20) + dialing_popup_img.set_size(64, 64) + dialing_popup_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") + dialing_popup_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_name = lv.label(dialing_popup_screen) + dialing_popup_name.set_pos(0, 110) + dialing_popup_name.set_size(LCD_SIZE_W, 50) + dialing_popup_name.set_text(" ") + dialing_popup_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_popup_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_call = lv.label(dialing_popup_screen) + dialing_popup_call.set_pos(0, 170) + dialing_popup_call.set_size(LCD_SIZE_W, 50) + dialing_popup_call.set_text("正在拨号中") + dialing_popup_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_popup_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_popup_hangup_imgbtn = lv.img(dialing_popup_screen) + dialing_popup_hangup_imgbtn.set_size(64, 64) + dialing_popup_hangup_imgbtn.set_src("U:/static/hang_up.png") + dialing_popup_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + dialing_popup_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + dialing_popup_hangup_imgbtn.set_pos(80, 210) + dialing_popup_hangup_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), + lv.EVENT.SHORT_CLICKED, None) + self.meta = dialing_popup_screen + if dialing_popup_name != None: + name = EventMesh.publish("get_phonename")#获取拨打电话名称 + dialing_popup_name.set_text(name)#名称 + + def post_processor_after_initialization(self): + self.is_sliding =0 + self.time_count = 0 + #获取字符串 + name = EventMesh.publish("get_phonename")#获取拨打电话名称 + content = EventMesh.publish("get_phonenum")#获取电话号码 + time = EventMesh.publish("screen_get_time")#获取系统时间 + + # ["15692025051","2","12:59","哥gdh符合双方和开发商开发好看的思考"], + # 格式:{"电话号码":{"timesec":'时间戳',"number":'电话号码',"name":'名字',"time":'时间',"count":'通话次数'}} + # dialing_content.set_text(content)#电话号码 + num = 0 + + date_tmp = utime.localtime() + time_tmp = utime.mktime(date_tmp) + # print("time_tmp:{}".format(time_tmp)) + read_call_log_tmp = EventMesh.publish("get_call_log_list") + check_json = read_call_log_tmp[0] + + if check_json == True: + self.read_call_log = read_call_log_tmp[1] + b = content in self.read_call_log.keys()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + if b == True:#查找是否有相同的电话号码 有就直接读出来的次数上加一 没有则从1开始加起 + number_tmp = {} + number_tmp = self.read_call_log[content] #通话次数加一 + num_tmp_t = number_tmp["count"] + # print("number_tmp:{} self.read_call_log.value:{}".format(number_tmp,self.read_call_log.values())) + else : + num_tmp_t = 0 + num = num_tmp_t + else: + num = 0 #通话次数 + + sort_tmp = {} + sort_tmp = self.read_call_log.values() + sort_new = {} + sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 + + i = 0 + # 49 50 + if len(self.read_call_log) >= self.CALL_LOG_MAX: + for sort_new_tmp in sort_new: #字典 key value + i+=1 # 1 + if i >= self.CALL_LOG_MAX:#大于50条把最后一条删除掉只保留前面50调最新的数据 + key_tmp = sort_new_tmp["number"] + del self.read_call_log[key_tmp] + tmp = {} + tmp["count"]= num+1 #通话次数 + tmp["time"]= "{}:{}".format("%02d"%(time[0][0]),"%02d"%(time[0][1]))#通湖时间 + tmp["name"]= name #名称 + tmp["timesec"]= time_tmp #时间戳 + tmp["number"] = content + + self.read_call_log[content] = tmp + with open("/usr/static/storage_file/Call_log.json","w",encoding="utf-8") as fd: + ujson.dump(self.read_call_log,fd) + print("创建通话记录") + EventMesh.publish("set_call_log_list", [1,self.read_call_log]) + EventMesh.publish("call_log_update_show_list") + self.timer1.start(1000, 1, self.timeout_hangup) + self.timer2.start(2000, 0, self.timeout_call) + + def timeout_call(self,e): + phone_num = EventMesh.publish("get_phonenum") + voiceCall.callStart(phone_num) + + def timeout_hangup(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.time_count+=1 + if self.time_count >= 5 :#设置:#5s内没有打通则不在继续拨打关闭 + self.time_count = 0 + voiceCall.callEnd() + EventMesh.publish("set_UI_high_priority", 0) + EventMesh.publish("set_sos_info_call") + # EventMesh.publish("load_screen", {"screen": "dialing"}) + EventMesh.publish("load_screen", {"screen": "dial_no_connect_popup"}) + + def hangup(self,e): + code = e.get_code() + #print("code!!!!!!!!",code,msg) + if code == lv.EVENT.PRESSING: + pass + + elif code == lv.EVENT.SHORT_CLICKED: + EventMesh.publish("set_UI_high_priority", 0) + voiceCall.callEnd() + sos_flag = EventMesh.publish("get_sos_flag") + if sos_flag == 1: + EventMesh.publish("close_sos_timer") + EventMesh.publish("set_sos_flag",0) + EventMesh.publish("set_sos_num",0) + EventMesh.publish("set_hangup_mode",0) + EventMesh.publish("set_interrup_incall",0) + EventMesh.publish("set_UI_high_priority",0) + + EventMesh.publish("return_prev_screen") + + + def Close(self): + self.timer1.stop() + self.timer2.stop() + + def done_return(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn1_release(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + +dial_no_connect_popup = None +dialing_connect_call = None +class DialNoconnectPopupScreen(Screen):#你所拨打的电话暂时无法接通 + NAME = "dial_no_connect_popup" + + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer = osTimer() + self.time_count = 0 + + def initialization(self): + global dial_no_connect_popup,dialing_connect_call + if dial_no_connect_popup == None: + dial_no_connect_popup = lv.obj() + print("dial_no_connect_popup") + dial_no_connect_popup.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + dialing_connect_call = lv.label(dial_no_connect_popup) + dialing_connect_call.set_pos(0, (LCD_SIZE_H//2)-10) + dialing_connect_call.set_size(LCD_SIZE_W, LCD_SIZE_H - ((LCD_SIZE_H//2)-10)) + dialing_connect_call.set_text("你好,你所拨打的\n电话暂时无法接\n通,请稍后再拨") + dialing_connect_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + dialing_connect_call.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.meta = dial_no_connect_popup + + def post_processor_after_initialization(self): + self.time_count = 0 + self.timer.start(1000, 1, self.timeout_hangup) + + def timeout_hangup(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.time_count+=1 + if self.time_count >= 5: + self.time_count = 0 + EventMesh.publish("return_prev_screen") + + def Close(self): + # EventMesh.publish("set_sos_info_call") + self.timer.stop() + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + +charge_full_screen = None +charge_full_screen_title = None +class chargefullScreen(Screen):#充电已满弹窗提示 + NAME = "charge_full" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer = osTimer() + self.count = 0 + def initialization(self): + global charge_full_screen,charge_full_screen_title + if charge_full_screen == None : + charge_full_screen = lv.obj() + print("charge_full_screen") + charge_full_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + + charge_full_screen_title = lv.label(charge_full_screen) + charge_full_screen_title.set_pos(0, (LCD_SIZE_H//2)-10) + charge_full_screen_title.set_size(LCD_SIZE_W, 40) + charge_full_screen_title.set_text("充电已满") + charge_full_screen_title.set_long_mode(lv.label.LONG.WRAP) + charge_full_screen_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + charge_full_screen_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = charge_full_screen + self.count = 0 + self.timer.start(1*1000,1,self.fun) + + def Close(self): + self.count = 0 + self.timer.stop() + pass + + def fun(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count > 2*60: + self.count = 0 + self.timer.stop() + #EventMesh.publish("return_prev_screen") + + def done_click(self): + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("return_prev_screen") + + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + + + + +message_popup_screen = None +message_popup_title = None +#信息弹窗 +class NewMessageScreen(Screen): + NAME = "message_popup" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global message_popup_screen,message_popup_title + if message_popup_screen == None : + message_popup_screen = lv.obj() + print("message_popup_screen") + message_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + message_popup_title = lv.label(message_popup_screen) + message_popup_title.set_pos(0, (LCD_SIZE_H//2)-10) + message_popup_title.set_size(LCD_SIZE_W, 40) + message_popup_title.set_text("你有新的信息") + message_popup_title.set_long_mode(lv.label.LONG.WRAP) + message_popup_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + message_popup_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = message_popup_screen + EventMesh.publish("set_sms_clear_all_data",10) + + + + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +remove_message_popup_screen = None +remove_message_popup_title = None +#信息弹窗 +class RemoveMessageScreen(Screen):#删除短信弹窗框 + NAME = "remove_message_popup" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer = osTimer() + + def initialization(self): + global remove_message_popup_screen,remove_message_popup_title + if remove_message_popup_screen == None : + remove_message_popup_screen = lv.obj() + print("message_popup_screen") + remove_message_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + message_popup_title = lv.label(remove_message_popup_screen) + message_popup_title.set_pos(0, (LCD_SIZE_W//2)-10) + message_popup_title.set_size(LCD_SIZE_W, 50) + message_popup_title.set_text("正在删除中...\n请稍候") + message_popup_title.set_long_mode(lv.label.LONG.WRAP) + message_popup_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + message_popup_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = remove_message_popup_screen + self.timer.start(1000,1,self.timer_cb) + def timer_cb(self,*argc): + msg_nums = sms.getMsgNums() + # print("timer_cb remove!!!!!!!!!",msg_nums) + if msg_nums == 0: + self.timer.stop() + EventMesh.publish("load_screen", {"screen": "popup"}) + + def Close(self): + self.timer.stop() + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) +message_full_screen = None +message_full_label = None +message_full_confirm = None +message_full_cancel = None +#信息弹窗 +class MessageFullScreen(Screen): + NAME = "message_full" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + EventMesh.subscribe("remove_all_sms_cb",self.remove_all_sms_cb) + self.is_sliding = 0 + + def initialization(self): + self.is_sliding = 0 + global message_full_screen,message_full_label,message_full_confirm,message_full_cancel + if message_full_screen == None : + message_full_screen = lv.obj() + print("message_full_screen") + message_full_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + message_full_label = lv.label(message_full_screen) + message_full_label.set_pos(0, 100) + message_full_label.set_size(LCD_SIZE_W, 50) + message_full_label.set_text("信息已满,是否清除所有?") + message_full_label.set_long_mode(lv.label.LONG.WRAP) + message_full_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + message_full_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + message_full_confirm = lv.label(message_full_screen) + message_full_confirm.set_text("确认") + message_full_confirm.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + message_full_confirm.set_size(120, 60) + message_full_confirm.set_pos(0,180) + message_full_confirm.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + message_full_confirm.add_flag(lv.obj.FLAG.CLICKABLE) + message_full_confirm.set_ext_click_area(20) + + message_full_cancel = lv.label(message_full_screen) + message_full_cancel.set_text("取消") + message_full_cancel.set_size(120, 60) + message_full_cancel.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + message_full_cancel.set_pos(120,180) + message_full_cancel.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + message_full_cancel.add_flag(lv.obj.FLAG.CLICKABLE) + message_full_cancel.set_ext_click_area(20) + self.meta = message_full_screen + message_full_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,0)), lv.EVENT.GESTURE, None) + + message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)),lv.EVENT.SHORT_CLICKED, None) + message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)),lv.EVENT.SHORT_CLICKED, None) + + # message_full_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.PRESSING, None) + # message_full_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.PRESSING, None) + + + def remove_all_sms_cb(self, event, msg): + sms.deleteMsg(1,4) + + def button_cb(self, e, msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg != 0: + if msg == 1: + EventMesh.publish("load_screen", {"screen": "remove_message_popup"}) + EventMesh.publish_async("remove_all_sms_cb","",1*1024) + elif msg == 2: + EventMesh.publish("return_prev_screen") + + def confirm(self, e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + print("sms confirm!!!!!!!!") + # self.timer.start(2*1000,0,self.clear_data) + EventMesh.publish("load_screen", {"screen": "remove_message_popup"}) + EventMesh.publish_async("remove_all_sms_cb","",1*1024) + + self.is_sliding =0 + + + + def concel(self, e): + EventMesh.publish("return_prev_screen") + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) +############短信############################### +MSG_FLAG = 0 +MSG_MAX = 5 #最大显示短信内容条数 +def msg_cb(args): + index = args[1] + storage = args[2] + print("index:{}".format(index)) + sms_data = sms.getSaveLoc() + if sms_data == -1: + return + sms_max = sms_data[0][2] + if index != -1: + tmp = sms.searchTextMsg(index) + detail = tmp[1]#内容 + print("msg_cb:detail {}".format,detail) + if detail.find("SETIP:") != -1:#寻找是否有这个字符串 + tmp_test = detail.split("SETIP:")[1] + if tmp_test.find(":") != -1: + new_ip = tmp_test.split(':')[0] + # print("tmp_test:{} new_ip:{}".format(tmp_test,new_ip)) + new_com = tmp_test.split(':')[1] + # new_md5 = detail.split(':')[3] + if len(new_ip) > 0 and len(new_com) > 0: + EventMesh.publish("set_new_ip", [new_ip,new_com,tmp[0]])#设置关机时间 + # EventMesh.publish("set_new_ip", [new_ip,new_com,new_md5])#设置关机时间 + + if index >= sms_max-1: + EventMesh.publish("load_screen", {"screen": "message_full"}) + else: + EventMesh.publish("load_screen", {"screen": "message_popup"}) + +sms.setCallback(msg_cb) +style_sms_bg_btn = lv.style_t() +style_sms_bg_btn.init() +style_sms_bg_btn.set_radius(5) +style_sms_bg_btn.set_bg_color(lv.color_make(0xff, 0xff, 0xff)) +style_sms_bg_btn.set_bg_grad_color(lv.color_make(0xff, 0xff, 0xff)) +style_sms_bg_btn.set_bg_opa(255) +style_sms_bg_btn.set_border_color(lv.color_make(0xff, 0xff, 0xff)) +style_sms_bg_btn.set_border_opa(255) +style_sms_bg_btn.set_border_width(0) +style_sms_bg_btn.set_pad_left(0) +style_sms_bg_btn.set_pad_right(0) +style_sms_bg_btn.set_pad_top(0) +style_sms_bg_btn.set_pad_bottom(0) + + +msg_list_screen = None +msg_top_title = None +msg_cont_detail = None +msg_list_t = None +msg_list_t_done_img = None +no_msg_text = None +msg_cont_list_screen = None +SMS_LIST_ONE_ICON = 70#短信每一项的列表高度 +SMS_LIST_ONE_LABEL_SIZE = 28#文本大小 +class PopupScreen(Screen): + NAME = "popup" + + def __init__(self): + super().__init__() + # -------------------------------------------popup_menu screen---------------------------------------------------------- + self.meta = None + self.msg_detail = {} + self.msg_nums = 0 + self.msg_nums_old = 0 + self.sms_detail_list = None + self.sms_detail_list_dict = [] + self.sms_data = [] #最新短信内容 + self.is_sliding = 0 + def post_processor_before_initialization(self): + pass + # self.msg_nums = sms.getMsgNums() #获取短信条数 + # if self.msg_nums_old != self.msg_nums: + # self.sms_data = [] + # self.msg_nums_old = self.msg_nums + + def initialization(self): + self.is_sliding = 0 + global msg_list_screen,msg_top_title,msg_cont_detail,msg_list_t,msg_list_t_done_img,no_msg_text,msg_cont_list_screen + print("PopupScreen:initialization1") + if msg_list_screen == None : + msg_list_screen = lv.obj() + print("msg_list_screen") + msg_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + msg_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + msg_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), + lv.EVENT.GESTURE, None) + + + msg_top_title = lv.label(msg_list_screen) + msg_top_title.set_pos(0, 10) + msg_top_title.set_size(LCD_SIZE_W, 40) + msg_top_title.set_text("信息") + msg_top_title.set_long_mode(lv.label.LONG.WRAP) + msg_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + msg_top_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + msg_cont_list_screen = lv.obj(msg_list_screen) + msg_cont_list_screen.set_pos(0, 50) + msg_cont_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-50) + msg_cont_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + msg_cont_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + + msg_list_t_done_img = lv.img(msg_cont_list_screen) + msg_list_t_done_img.set_pos(53, 20) + msg_list_t_done_img.set_size(134, 117) + msg_list_t_done_img.set_src("U:/static/IMAGE_NOTICE_NONE.png") + msg_list_t_done_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_msg_text = lv.label(msg_cont_list_screen) + no_msg_text.set_pos(0, 180) + no_msg_text.set_size(LCD_SIZE_W, 40) + no_msg_text.set_text("暂无信息") + no_msg_text.set_long_mode(lv.label.LONG.WRAP) + no_msg_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_msg_text.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.sms_detail_list = lv.obj(msg_cont_list_screen) + self.sms_detail_list.set_pos(0, 0) + self.sms_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-50+1) + self.sms_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + self.sms_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + self.sms_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), + lv.EVENT.GESTURE, None) + for i in range(MSG_MAX): + msg_btn = lv.btn(self.sms_detail_list) + msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + # msg_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), + # lv.EVENT.PRESSING, None) + msg_btn.add_flag(lv.obj.FLAG.HIDDEN) + _btn_label2 = lv.label(msg_btn) + _btn_label3 = lv.label(msg_btn) + _btn_label4 = lv.label(msg_btn) + _btn_label5 = lv.label(msg_btn) + msg_btn.add_style(style_sms_bg_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + msg_btn.add_style(style_sms_bg_btn, lv.PART.MAIN|lv.STATE.PRESSED) + _btn_label4.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + _btn_label5.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.sms_detail_list_dict.append({"msg_btn":msg_btn,"_btn_label2":_btn_label2,"_btn_label3":_btn_label3, + "_btn_label4":_btn_label4,"_btn_label5":_btn_label5}) + self.meta = msg_list_screen + + + self.msg_nums = sms.getMsgNums() + if self.msg_nums_old != self.msg_nums: + self.sms_data = [] + self.msg_nums_old = self.msg_nums + + self.btn_create(1) + print("PopupScreen:initialization2") + + # def sms_create_list(self,event,msg): + # self.msg_nums = sms.getMsgNums() + # self.btn_create(1) + + def sms_deal_phone_number(self,args): + data=enumerate(args) + data_str1="" + data_str2="" + data_str3="" + for index,value in data: + if index % 2 == 0: + data_str1=data_str1+value + else: + data_str2=data_str2+value + for i in range(0,len(data_str1)): + data_str3=data_str3+data_str2[i] + data_str3=data_str3+data_str1[i] + return data_str3 + def sms_get_message_info(self,index): + """ + :param index :短信索引值 + :tyoe index :整形 + + :return :元组类型 + 元组内容: + (message_ref,message_total_num,message_seq,sub_message_data,pdu_tye,sub_message_len) + + :message_ref :短信参考标识,同一个标识表明为同一条短信 + :message_total_num :此条长短信总条数 + :message_seq :此条短信在长短信中的序号 + :sub_message_data :词条短信的内容 + :pdu_tye :PDU类型,bit 6标记是否包含用户报文头,长短信需要 + :sub_message_len :此条短信内容长度 + + """ + message0=sms.searchPduMsg(index) + #print("sms_get_message_info:message0:{}".format(message0)) + if message0 == -1: + return -1 + + sca_num = int(message0[0:2],16) - 1 + data_len = 2 + addr_type= message0[data_len:data_len+1*2] + data_len = data_len+1*2 + + sca = message0[data_len:data_len+sca_num*2] + # 电话号码高低位需要转换 + sca = self.sms_deal_phone_number(sca) + + # if sca_num % 2 == 1: + # print("Get SCA phone {}".format(sca[:-1])) + # else: + # print("Get SCA phone {}".format(sca)) + + data_len = data_len+sca_num*2 + + pdu_tye = int(message0[data_len:data_len+1*2],16) + data_len = data_len+1*2 + + oa_num = int(message0[data_len:data_len+1*2],16) + data_len = data_len+1*2 + oa_addr_type = message0[data_len:data_len+1*2] + data_len = data_len+1*2 + + if oa_num % 2 == 1: + oa_num_t = int((oa_num + 1)/2) + else: + oa_num_t = int((oa_num )/2) + + oa = message0[data_len:data_len+oa_num_t*2] + # 电话号码高低位需要转换 + oa = self.sms_deal_phone_number(oa) + + # if oa_num % 2 == 1: + # print("Get OA phone {}".format(oa[:-1])) + # else: + # print("get OA phone {}".format(oa)) + + data_len = data_len+oa_num_t*2 + pid = message0[data_len:data_len+1*2] + + data_len = data_len+1*2 + dcs = message0[data_len:data_len+1*2] + data_len = data_len+1*2 + scts = message0[data_len:data_len+7*2] + data_len = data_len+7*2 + sub_message_len = int(message0[data_len:data_len+1*2],16) + data_len = data_len+1*2 + sub_message_head = message0[data_len:data_len+6*2] + data_len = data_len+6*2 + + # 或短信用户数据 + sub_message_data = message0[data_len:data_len+sub_message_len*2] + + #长短信 + if ((pdu_tye & 0x40 ) >> 6) == 1: + #长短信,处理长短信用户报文头 + message_ref = int(sub_message_head[6:8],16) + message_total_num = int(sub_message_head[8:10],16) + message_seq = int(sub_message_head[10:12],16) + return [message_ref,message_total_num,message_seq,pdu_tye,sub_message_len,message0] + else: + # 短短信 + return [0,1,1,pdu_tye,sub_message_len,message0] + + def btn_create(self,msg): + EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_screen,"data":msg}) + + def btn_create_screen(self,msg): + global msg_list_screen,msg_top_title,msg_cont_detail,msg_list_t,msg_list_t_done_img,no_msg_text,msg_cont_list_screen + count = 0 + j = 0 + print("self.msg_nums:{}".format(self.msg_nums)) + if self.msg_nums > 0 : + + + #隐藏短信控件,加提示信息 + if msg_cont_list_screen != None: + msg_list_t_done_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_msg_text.clear_flag(lv.obj.FLAG.HIDDEN) + no_msg_text.set_text("正在加载···") + if self.sms_detail_list != None: + self.sms_detail_list.add_flag(lv.obj.FLAG.HIDDEN) + SMS_lis={} + SMS_lis_count = 0 + #self.sms_data = [] #短信数组 + if self.sms_data == [] : + for i in range(self.msg_nums): + EventMesh.publish("system_sleep_rest")#防止黑屏 + message=self.sms_get_message_info(self.msg_nums-i-1) + if message == -1: + break + #print("self.msg_nums:{} message:{} {} {}".format(self.msg_nums-i-1,message[0],message[1],message[2])) + #message:[253, 3, 1, 100, 140, '751F4EA776EE524D6D4'] + if message[1]>1 :#长短信 + if message[0] in SMS_lis:#存在列表 + SMS_lis[message[0]].append(message) + + else :#列表是新的 + SMS_lis[message[0]] = [message]#新增列表 + #print("SMS_lis:{}".format(SMS_lis)) + #SMS_lis[message[0]].append(message)#新增列表数据 + if len(SMS_lis[message[0]]) == message[1]:#存满一条 + SMS_lis_tmp = SMS_lis[message[0]] + data = "" + message_pdu = [] + for k in range(len(SMS_lis_tmp)): + for j in range(len(SMS_lis_tmp)): #排序 + if SMS_lis_tmp[j][2] == k+1: + message_pdu = sms.decodePdu(SMS_lis_tmp[j][5],20) + if(message_pdu!=-1): + data += message_pdu[1] + break + #print("data:{}".format(data)) + data_tmp = [] + data_tmp.append(message_pdu[0]) + data_tmp.append(data) + self.sms_data.append(data_tmp) + SMS_lis_count += 1 + if(SMS_lis_count >= MSG_MAX): + break + else : + SMS_lis_count += 1 + message_pdu = sms.decodePdu(message[5],20) + data = message_pdu[1] + data_tmp = [] + data_tmp.append(message_pdu[0]) + data_tmp.append(data) + self.sms_data.append(data_tmp) + print("data:{}".format(data)) + if(SMS_lis_count >= MSG_MAX): + break + + + MSG_nums = len (self.sms_data) + for i in range(MSG_MAX): + if i >= MSG_nums : + self.sms_detail_list_dict[i]["msg_btn"].add_flag(lv.obj.FLAG.HIDDEN) + continue + tmp = self.sms_data[i] + if tmp != -1: + #msg_btn = lv.btn(self.sms_detail_list) + self.sms_detail_list_dict[i]["msg_btn"].set_size(LCD_SIZE_W-10,SMS_LIST_ONE_ICON) + self.sms_detail_list_dict[i]["msg_btn"].set_pos(5,(SMS_LIST_ONE_ICON+4)*count) + #self.sms_detail_list_dict[i]["msg_btn"].add_style(style_sms_bg_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + # self.sms_detail_list_dict[i]["msg_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.sms_cb(e)), + # lv.EVENT.CLICKED, None) + + title = tmp[0] + # print("title:{}".format(title)) + #_btn_label2 = lv.label(msg_btn) + self.sms_detail_list_dict[i]["_btn_label2"].set_pos(0, 0) + self.sms_detail_list_dict[i]["_btn_label2"].set_size(0, 0) + self.sms_detail_list_dict[i]["_btn_label2"].set_text(title) + # _btn_label2.set_long_mode(lv.label.LONG.DOT) + # _btn_label2.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + # + detail = tmp[1] + #_btn_label3 = lv.label(msg_btn) + self.sms_detail_list_dict[i]["_btn_label3"].set_pos(0, 0) + self.sms_detail_list_dict[i]["_btn_label3"].set_size(0, 0) + self.sms_detail_list_dict[i]["_btn_label3"].set_text(detail) + # _btn_label3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + detail1 = tmp[1] + #_btn_label4 = lv.label(msg_btn) + self.sms_detail_list_dict[i]["_btn_label4"].set_pos(0, 40) + self.sms_detail_list_dict[i]["_btn_label4"].set_size(LCD_SIZE_W-10, SMS_LIST_ONE_LABEL_SIZE) + self.sms_detail_list_dict[i]["_btn_label4"].set_text(detail1) + self.sms_detail_list_dict[i]["_btn_label4"].set_long_mode(lv.label.LONG.DOT) + #self.sms_detail_list_dict[i]["_btn_label4"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + title1 = tmp[0] + #_btn_label5 = lv.label(msg_btn) + self.sms_detail_list_dict[i]["_btn_label5"].set_pos(0, 10) + self.sms_detail_list_dict[i]["_btn_label5"].set_size(LCD_SIZE_W-10, SMS_LIST_ONE_LABEL_SIZE) + self.sms_detail_list_dict[i]["_btn_label5"].set_text(title1) + self.sms_detail_list_dict[i]["_btn_label5"].set_long_mode(lv.label.LONG.DOT) + #self.sms_detail_list_dict[i]["_btn_label5"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.sms_detail_list_dict[i]["msg_btn"].clear_flag(lv.obj.FLAG.HIDDEN) + #if msg == 1: + #self.sms_detail_list_dict[i]["msg_btn"].scroll_to_view(lv.ANIM.OFF) + + count = count + 1 + else : + self.sms_detail_list_dict[i]["msg_btn"].add_flag(lv.obj.FLAG.HIDDEN) + #显示控件 + if msg_list_t_done_img != None: + msg_list_t_done_img.add_flag(lv.obj.FLAG.HIDDEN) + no_msg_text.add_flag(lv.obj.FLAG.HIDDEN) + self.sms_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) + else: + if msg_cont_list_screen != None: + msg_list_t_done_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_msg_text.clear_flag(lv.obj.FLAG.HIDDEN) + no_msg_text.set_text("暂无信息") + if self.sms_detail_list != None: + self.sms_detail_list.add_flag(lv.obj.FLAG.HIDDEN) + + def sms_cb(self, e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + # EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + elif code == lv.EVENT.SHORT_CLICKED: + _name = e.get_target().get_child(0).get_text() + EventMesh.publish("save_msg_name", _name) + content = e.get_target().get_child(1).get_text() + EventMesh.publish("save_msg_content", content) + EventMesh.publish("load_screen", {"screen": "msg_detail"}) + + + def done_DOWN(self):#下滑 + if self.sms_detail_list != None: + scroll_y = self.sms_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.sms_detail_list.scroll_to_y(scroll_y-SMS_LIST_ONE_ICON,lv.ANIM.ON) + + + #setting_cont.scroll_to_view(lv.ANIM.ON) + pass + def done_UP(self):#上滑 + if self.sms_detail_list != None: + scroll_y = self.sms_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.sms_detail_list.scroll_to_y(scroll_y+SMS_LIST_ONE_ICON,lv.ANIM.ON) + pass + + def done_right_to_left(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_left_to_right(self): + # EventMesh.subscribe("watch_top_show", self.watch_top_show) + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + +msg_detail_screen = None +msg_detail_title = None +msg_detail_cont = None +msg_detail_cont_obj = None +class MsgDetailScreen(Screen): + NAME = "msg_detail" + + def __init__(self): + super().__init__() + self.meta = None + + self.name = "" + self.contetn = "" + + + def initialization(self): + global msg_detail_screen,msg_detail_title,msg_detail_cont,msg_detail_cont_obj + if msg_detail_screen == None: + msg_detail_screen = lv.obj() + print("msg_detail_screen") + msg_detail_screen.add_style(style_white_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + msg_detail_title = lv.label(msg_detail_screen) + msg_detail_title.set_pos(0, 20) + msg_detail_title.set_size(LCD_SIZE_W, 35) + msg_detail_title.set_long_mode(lv.label.LONG.DOT) + msg_detail_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + msg_detail_title.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + + msg_detail_cont_obj = lv.obj(msg_detail_screen) + msg_detail_cont_obj.set_pos(0, 55) + msg_detail_cont_obj.set_size(LCD_SIZE_W, LCD_SIZE_H-55) + msg_detail_cont_obj.add_style(style_white_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + msg_detail_cont = lv.label(msg_detail_cont_obj) + msg_detail_cont.set_pos(0, 5) + msg_detail_cont.set_size(LCD_SIZE_W, lv.SIZE.CONTENT) + msg_detail_cont.set_long_mode(lv.label.LONG.WRAP) + msg_detail_cont.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + msg_detail_cont.add_style(style_font_28_black_bg_gray, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = msg_detail_screen + #获取字符串 + + + msg_detail_cont_obj.scroll_to(0, 0, lv.ANIM.OFF) + + self.name = EventMesh.publish("get_msg_name") + self.content = EventMesh.publish("get_msg_content") + msg_detail_title.set_text(self.name) + # tmp_y=(len(self.content)//15+1)*28 + # msg_detail_cont.set_size(LCD_SIZE_W, tmp_y) + msg_detail_cont.set_text(self.content) + + + def post_processor_after_initialization(self): + pass + + + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "popup"}) + + + + +# -------------------------------------------toolbox screen---------------------------------------------------------- + +toolbox_screen = None +toolbox_text_img = None +toolbox_cont = None +toolbox_step_img = None +toolbox_weather_img = None +toolbox_alarm_img = None +# toolbox_sms_img = None +toolbox_countdown_img = None +toolbox_stopwatch_img = None + +toolbox_cont_style = lv.style_t() +toolbox_cont_style.init() +toolbox_cont_style.set_radius(0) +toolbox_cont_style.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +toolbox_cont_style.set_bg_grad_color(lv.color_make(0x00, 0x00, 0x00)) +toolbox_cont_style.set_bg_grad_dir(lv.GRAD_DIR.VER) +toolbox_cont_style.set_bg_opa(255) +toolbox_cont_style.set_border_width(0) +toolbox_cont_style.set_pad_left(0) +toolbox_cont_style.set_pad_right(0) +toolbox_cont_style.set_pad_top(0) +toolbox_cont_style.set_pad_bottom(0) + +TOOL_ICON_OFFSET_SIZE = 84 +TOOL_ICON_W_SIZE = 220 +TOOL_ICON_H_SIZE = 65 +TOOL_BG_ICON_W_SIZE = 230 +TOOL_BG_ICON_H_SIZE = 78 +class ToolboxScreen(Screen): + NAME = "toolbox" + + def __init__(self): + super().__init__() + self.meta = None + self.is_sliding =0 + + def initialization(self): + self.is_sliding =0 + global toolbox_screen,toolbox_text_img,toolbox_cont,toolbox_step_img,toolbox_weather_img ,toolbox_alarm_img ,\ + toolbox_countdown_img,toolbox_stopwatch_img + if toolbox_screen == None: + tool_set_y = 0 + toolbox_screen = lv.obj() + print("toolbox_screen") + toolbox_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + toolbox_screen.set_scrollbar_mode(0) + + toolbox_text_img = lv.img(toolbox_screen) + toolbox_text_img.set_pos(0, 10) + toolbox_text_img.set_size(232, 34) + toolbox_text_img.set_src("U:/static/tool/tool_text.png") + toolbox_text_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_cont = lv.obj(toolbox_screen) + toolbox_cont.set_pos(0, 50) + toolbox_cont.set_size(LCD_SIZE_W, LCD_SIZE_H-50) + toolbox_cont.add_style(toolbox_cont_style,lv.PART.MAIN | lv.STATE.DEFAULT) + + + toolbox_step_bg_img = lv.img(toolbox_cont) + toolbox_step_bg_img.set_pos(0, tool_set_y) + toolbox_step_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) + toolbox_step_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_step_bg_img.set_src("U:/static/list_bg.png") + toolbox_step_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + + toolbox_step_img = lv.img(toolbox_cont) + toolbox_step_img.set_pos(8, tool_set_y+6) + toolbox_step_img.set_size(TOOL_ICON_W_SIZE, TOOL_ICON_H_SIZE) + # toolbox_step_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_step_img.set_src("U:/static/tool/IMAGE_SECMENU_STEP.png") + toolbox_step_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + tool_set_y+=TOOL_ICON_OFFSET_SIZE + + toolbox_weather_bg_img = lv.img(toolbox_cont) + toolbox_weather_bg_img.set_pos(0, tool_set_y) + toolbox_weather_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) + toolbox_weather_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_weather_bg_img.set_src("U:/static/list_bg.png") + toolbox_weather_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_weather_img = lv.img(toolbox_cont) + toolbox_weather_img.set_pos(8, tool_set_y+6) + toolbox_weather_img.set_size(TOOL_ICON_W_SIZE, TOOL_ICON_H_SIZE) + # toolbox_weather_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_weather_img.set_src("U:/static/tool/IMAGE_SECMENU_WEATHER.png") + toolbox_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + tool_set_y+=TOOL_ICON_OFFSET_SIZE + + + toolbox_alarm_bg_img = lv.img(toolbox_cont) + toolbox_alarm_bg_img.set_pos(0, tool_set_y) + toolbox_alarm_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) + toolbox_alarm_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_alarm_bg_img.set_src("U:/static/list_bg.png") + toolbox_alarm_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_alarm_img = lv.img(toolbox_cont) + toolbox_alarm_img.set_pos(8, tool_set_y+6) + toolbox_alarm_img.set_size(TOOL_ICON_W_SIZE, TOOL_ICON_H_SIZE) + # toolbox_alarm_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_alarm_img.set_src("U:/static/tool/IMAGE_SECMENU_ALARM.png") + toolbox_alarm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + + # tool_set_y+=90 + # toolbox_sms_img = lv.img(toolbox_cont) + # toolbox_sms_img.set_pos(4, tool_set_y) + # toolbox_sms_img.set_size(232, 80) + # toolbox_sms_img.add_flag(lv.obj.FLAG.CLICKABLE) + # toolbox_sms_img.set_src("U:/static/tool/sms_setting.png") + # toolbox_sms_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + tool_set_y+=TOOL_ICON_OFFSET_SIZE + toolbox_countdown_bg_img = lv.img(toolbox_cont) + toolbox_countdown_bg_img.set_pos(0, tool_set_y) + toolbox_countdown_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) + toolbox_countdown_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_countdown_bg_img.set_src("U:/static/list_bg.png") + toolbox_countdown_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_countdown_img = lv.img(toolbox_cont) + toolbox_countdown_img.set_pos(8, tool_set_y+6) + toolbox_countdown_img.set_size(TOOL_ICON_W_SIZE, TOOL_ICON_H_SIZE) + # toolbox_countdown_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_countdown_img.set_src("U:/static/tool/IMAGE_SECMENU_COUNTDOWN.png") + toolbox_countdown_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + tool_set_y+=TOOL_ICON_OFFSET_SIZE + + toolbox_stopwatch_bg_img = lv.img(toolbox_cont) + toolbox_stopwatch_bg_img.set_pos(0, tool_set_y) + toolbox_stopwatch_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) + toolbox_stopwatch_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_stopwatch_bg_img.set_src("U:/static/list_bg.png") + toolbox_stopwatch_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_stopwatch_img = lv.img(toolbox_cont) + toolbox_stopwatch_img.set_pos(8, tool_set_y+6) + toolbox_stopwatch_img.set_size(TOOL_ICON_W_SIZE, TOOL_ICON_H_SIZE) + # toolbox_stopwatch_img.add_flag(lv.obj.FLAG.CLICKABLE) + toolbox_stopwatch_img.set_src("U:/static/tool/IMAGE_SECMENU_STOPWATCH.png") + toolbox_stopwatch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + toolbox_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "void")), lv.EVENT.GESTURE, None) + + toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.SHORT_CLICKED, None) + toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.SHORT_CLICKED, None) + toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) + # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.CLICKED, None) + toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) + toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) + + # toolbox_step_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "step")), lv.EVENT.PRESSING, None) + # toolbox_weather_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "weather")), lv.EVENT.PRESSING, None) + # toolbox_alarm_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "clk_list")), lv.EVENT.PRESSING, None) + # # toolbox_sms_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.load_screen(e, {"screen": "popup"})), lv.EVENT.CLICKED, None) + # toolbox_countdown_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "countdown")), lv.EVENT.PRESSING, None) + # toolbox_stopwatch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.tool_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) + self.meta = toolbox_screen + + def tool_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != "void": + EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) + + def done_DOWN(self):#下滑 + scroll_y = toolbox_cont.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + toolbox_cont.scroll_to_y(scroll_y-TOOL_ICON_OFFSET_SIZE,lv.ANIM.ON) + + + #setting_cont.scroll_to_view(lv.ANIM.ON) + pass + def done_UP(self):#上滑 + scroll_y = toolbox_cont.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + toolbox_cont.scroll_to_y(scroll_y+TOOL_ICON_OFFSET_SIZE,lv.ANIM.ON) + pass + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +incoming_call_screen = None +incoming_call_img = None +incoming_call_name_label = None +incoming_call_answer = None +incoming_call_hangup = None +# CALL_LOG_MAX = 50 +class IncomingCallScreen(Screen): + NAME = "incoming_call" + + def __init__(self): + super().__init__() + self.CALL_LOG_MAX = CALL_LOG_MAX + + self.aud = audio.Audio(0) + + self.call_timer = osTimer() + self.name = None + self.phonebook = {} + self.pro_state = 0 + self.meta = None + + self.is_sliding =0 + self.call_log = {} + self.call_log_value = {} + self.read_call_log = {} + self.number_tmp = {} + self.meta_type = "popup" + self.time_count = 0 + EventMesh.subscribe("answer_auto_event",self.answer_auto_event) + + def initialization(self): + self.is_sliding =0 + self.time_count = 0 + global incoming_call_screen,incoming_call_img,incoming_call_name_label,incoming_call_answer ,incoming_call_hangup + if incoming_call_screen == None : + # -------------------------------------------incoming_call screen---------------------------------------------------------- + incoming_call_screen = lv.obj() + print("incoming_call_screen") + incoming_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + incoming_call_img = lv.img(incoming_call_screen) + incoming_call_img.set_pos(80, 20) + incoming_call_img.set_size(64, 64) + incoming_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") + incoming_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + incoming_call_name_label = lv.label(incoming_call_screen) + incoming_call_name_label.set_pos(0, 140) + incoming_call_name_label.set_text(" ") + incoming_call_name_label.set_size(LCD_SIZE_W, 50) + incoming_call_name_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + incoming_call_name_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + incoming_call_answer = lv.img(incoming_call_screen) + incoming_call_answer.set_size(64, 64) + incoming_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) + incoming_call_answer.set_pos(150, 210) + incoming_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + incoming_call_answer.set_src("U:/static/answer.png") + + incoming_call_hangup = lv.img(incoming_call_screen) + incoming_call_hangup.set_size(64, 64) + incoming_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) + incoming_call_hangup.set_pos(30, 210) + incoming_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + incoming_call_hangup.set_src("U:/static/hang_up.png") + + incoming_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + incoming_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + self.meta = incoming_call_screen + EventMesh.publish("set_UI_high_priority", 1) + + + def post_processor_after_initialization(self): + self.is_sliding =0 + global incoming_call_screen,incoming_call_img,incoming_call_name_label,incoming_call_answer ,incoming_call_hangup + utime.sleep_ms(200)#不加延时会切屏 + data = EventMesh.publish("get_phonebook_list") + if data != None: + check = data[0] + self.phonebook = data[1] + if check == 1:#先检查通讯录 + phonebook_keys = sorted(self.phonebook.keys()) + b = self.meta_info in self.phonebook.values()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + j = 0 + if b == True: + for i in range(len(self.phonebook)): #字典 key value + #'001:邓雪英':15521469561 + name = self.phonebook[phonebook_keys[j]] + name_value = phonebook_keys[j] + number_tmp = str(self.meta_info) + # print("name :{} number_tmp:{}".format(name,number_tmp)) + if name.find(number_tmp) != -1:#查找电话号码是否在通讯录里面 + number_f= name_value + name_s = number_f.split(':') + name_s = name_s[1] + self.name = name_s + self.pro_state = 1 + break + j+=1 + else: + self.name = str(self.meta_info) + self.pro_state = 0 + else: + self.name = str(self.meta_info) + self.pro_state = 0 + + read_call_log = EventMesh.publish("get_call_log_list") + check_call_log_json = read_call_log[0] + self.read_call_log = read_call_log[1] + if self.pro_state == 0 and check_call_log_json == 1:#电话本没有就在通话记录查找电话号码并且文件存在是查找 + + sort_tmp = self.read_call_log.values() + for sort_new_tmp in sort_tmp: #字典 key value + number = sort_new_tmp["number"] + find_ok = self.meta_info in number + # print("find_ok:{} sort_tmp :{} self.meta_info:{}\r\n".format(find_ok,number,self.meta_info)) + if find_ok == True: + name_value = sort_new_tmp["name"]#查找到相同的电话号码就退出break + self.name = name_value + break + + if self.name == None: + self.name = str(self.meta_info) + + # incoming_call_label.set_text(str(self.meta_info)) + incoming_call_name_label.set_text(self.name) + EventMesh.publish("save_phonename",self.name) + time = EventMesh.publish("screen_get_time")#获取系统时间 + + # ["15692025051","2","12:59","哥gdh符合双方和开发商开发好看的思考"], + # 格式:{"电话号码":{"timesec":'时间戳',"number":'电话号码',"name":'名字',"time":'时间',"count":'通话次数'}} + self.num = 0 + + date_tmp = utime.localtime() + time_tmp = utime.mktime(date_tmp) + # print("time_tmp:{}".format(time_tmp)) + read_call_log = EventMesh.publish("get_call_log_list") + check_json = read_call_log[0] + + if check_json == True: + self.read_call_log = read_call_log[1] + print("读取通话记录") + b = str(self.meta_info) in self.read_call_log.keys()#查找key中是否包含content电话号码 True 包含在里面 False不包含在里面 + + if b == True:#查找是否有相同的电话号码 有就直接读出来的次数上加一 没有则从1开始加起 + number_tmp = {} + number_tmp = self.read_call_log[str(self.meta_info)] #通话次数加一 + num_tmp_t = number_tmp["count"]#读取本地保存的通话次数 + else : + num_tmp_t = 0 + self.num = num_tmp_t + else: + self.num = 0 #通话次数 + + sort_tmp = {} + sort_tmp = self.read_call_log.values() + sort_new = {} + sort_new = sorted(sort_tmp, key = lambda i: i['timesec'],reverse = True)#按照时间戳进行排序 去掉最旧的一次数据如果满了五十条 + i = 0 + if len(self.read_call_log) >= self.CALL_LOG_MAX: + for sort_new_tmp in sort_new: #字典 key value + i+=1 # 1 + if i >= self.CALL_LOG_MAX:#大于50条把最后一条删除掉只保留前面50调最新的数据 + key_tmp = sort_new_tmp["number"] + del self.read_call_log[key_tmp] + + tmp = {} + self.num = self.num +1 + if self.num > 99: + self.num = 99 + tmp["count"]= self.num #通话次数 + tmp["time"]= "{}:{}".format("%02d"%(time[0][0]),"%02d"%(time[0][1]))#通话时间 + tmp["name"]= self.name #名称 + tmp["timesec"]= time_tmp #时间戳 + tmp["number"] = self.meta_info + + self.read_call_log[self.meta_info] = tmp + with open("/usr/static/storage_file/Call_log.json","w",encoding="utf-8") as fd: + ujson.dump(self.read_call_log,fd) + print("创建通话记录") + EventMesh.publish("set_call_log_list", [1,self.read_call_log]) + EventMesh.publish("call_log_update_show_list") + self.time_count = 0 + self.call_timer.start(1000, 1, self.call_timer_cb) + self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 + EventMesh.publish("set_motor_time",[1,2,8*20,8,4])#设置马达参数 + + def call_timer_cb(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.time_count+=1 + if self.time_count % 6 == 0: + self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 + + def answer_cb(self,e): + code = e.get_code() + if code == lv.EVENT.SHORT_CLICKED: + self.call_timer.stop() + self.aud.stop() + EventMesh.publish("set_UI_high_priority", 0) + voiceCall.callAnswer() + name = EventMesh.publish("get_phonename") + EventMesh.publish("load_screen", {"screen": "on_call","meta":str(name)}) + + def answer_auto_event(self,event,msg): + self.call_timer.stop() + self.aud.stop() + EventMesh.publish("set_UI_high_priority", 0) + voiceCall.callAnswer() + name = EventMesh.publish("get_phonename") + EventMesh.publish("load_screen", {"screen": "on_call","meta":str(name)}) + + + def Close(self): + self.call_timer.stop() + self.aud.stop() + EventMesh.publish("close_motor_infor")#设置马达参数 + + def hangup_cb(self,e): + code = e.get_code() + if code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + EventMesh.publish("set_UI_high_priority", 0) + self.aud.stop() + self.call_timer.stop() + voiceCall.callEnd() + EventMesh.publish("set_interrup_incall",0) + EventMesh.publish("set_UI_high_priority",0) + + + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "dialing_noplay_popup": + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + pass + + def btn8_press(self): + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + pass + + def done_left_to_right(self): + pass + + def done_right_to_left(self): + pass + + def done_bottom_to_top(self): + pass + + def done_top_to_bottom(self): + pass + + def done_return(self): + pass + + +on_call_screen = None +on_call_obj =None +on_call_label_name = None +on_call_second_label = None +on_call_volum_label = None +on_call_tab_label = None +on_call_hangup = None +on_call_bar = None +on_call_volum_reduce = None +on_call_volum_add = None +on_call_phone_one = None +on_call_phone_two = None +on_call_phone_three = None +on_call_phone_four = None +on_call_phone_five = None +on_call_phone_six = None +on_call_phone_seven = None +on_call_phone_eight = None +on_call_phone_nine = None +on_call_phone_start = None +on_call_phone_zero = None +on_call_screen_tab = None +on_call_phone_hash = None +on_call_phone_return =None +on_call_screen_tab_label =None +on_call_phone_return_btn = None +ON_CALL_MAX_DATA = 9 +class OnCallScreen(Screen): + NAME = "on_call" + + def __init__(self): + super().__init__() + self.meta = None + self.count_sec = 0 + self.timer = osTimer() + self.aud = audio.Audio(0) + self.volum_size = 8 + self.open_volum = 0 + self.phone_num = '' + self.phone_list = [] + self.button = 0 + self.mute_btn = 0 + self.is_sliding = 0 + self.meta_type = "popup" + + + def initialization(self): + self.is_sliding = 0 + EventMesh.publish("set_UI_high_priority", 1) + global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup ,on_call_volum_label,on_call_tab_label,on_call_bar,on_call_obj,\ + on_call_volum_reduce,on_call_volum_add,on_call_phone_one ,on_call_phone_two ,on_call_phone_three,on_call_phone_four,on_call_phone_five,\ + on_call_phone_six,on_call_phone_seven,on_call_screen_tab_label ,on_call_phone_return,on_call_phone_eight ,on_call_phone_nine ,on_call_phone_start ,\ + on_call_phone_zero ,on_call_phone_hash,on_call_phone_return_btn,\ + on_call_screen_tab + if on_call_screen ==None : + on_call_screen = lv.obj() + on_call_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_obj = lv.obj(on_call_screen) + on_call_obj.set_size(LCD_SIZE_W,LCD_SIZE_H) + on_call_obj.set_pos(0,0) + on_call_obj.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + print("on_call_screen") + + on_call_label_name = lv.label(on_call_obj) + on_call_label_name.set_pos(0, 70) + on_call_label_name.set_size(LCD_SIZE_W, 50) + on_call_label_name.set_text(" ") + on_call_label_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + on_call_label_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + on_call_second_label = lv.label(on_call_obj) + on_call_second_label.set_pos(0, 130) + on_call_second_label.set_size(LCD_SIZE_W, 30) + on_call_second_label.set_text("00:00") + on_call_second_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + on_call_second_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + on_call_bar = lv.bar(on_call_obj) + on_call_bar.set_pos(49, 173) + on_call_bar.set_size(140, 25) + on_call_bar.set_style_anim_time(1000, lv.PART.INDICATOR | lv.STATE.DEFAULT) + on_call_bar.set_mode(lv.bar.MODE.NORMAL) + on_call_bar.set_value(50, lv.ANIM.OFF) + on_call_bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_bar.add_style(style_bar_indic, lv.PART.INDICATOR | lv.STATE.DEFAULT) + + on_call_volum_reduce = lv.img(on_call_obj) + on_call_volum_reduce.set_size(36, 36) + on_call_volum_reduce.set_pos(4, 168) + on_call_volum_reduce.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_volum_reduce.set_src("U:/static/REDUCE_VOLUM_ICON.png") + + + on_call_volum_reduce_btn = lv.label(on_call_obj) + on_call_volum_reduce_btn.set_pos(0, 160) + on_call_volum_reduce_btn.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_volum_reduce_btn.set_size(60, 50) + on_call_volum_reduce_btn.set_text(" ") + on_call_volum_reduce_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_volum_reduce_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), + lv.EVENT.PRESSING, None) + + on_call_volum_add = lv.img(on_call_obj) + on_call_volum_add.set_size(36, 36) + on_call_volum_add.set_pos(194, 168) + on_call_volum_add.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_volum_add.set_src("U:/static/VOLUM_ADD_ICON.png") + + + on_call_volum_add_btn = lv.label(on_call_obj) + on_call_volum_add_btn.set_pos(180, 160) + on_call_volum_add_btn.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_volum_add_btn.set_size(60, 50) + on_call_volum_add_btn.set_text(" ") + on_call_volum_add_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_volum_add_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)), + lv.EVENT.PRESSING, None) + + + on_call_volum_label = lv.label(on_call_obj) + on_call_volum_label.set_pos(0, 240) + on_call_volum_label.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_volum_label.set_size(85, 34) + on_call_volum_label.set_text("静音") + on_call_volum_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) + on_call_volum_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_volum_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.open_volum_show(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_volum_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.open_volum_show(e)), + lv.EVENT.PRESSING, None) + + on_call_hangup = lv.img(on_call_obj) + on_call_hangup.set_size(64, 64) + on_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_hangup.set_pos(85, 215) + on_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_hangup.set_src("U:/static/hang_up.png") + on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_hangup.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), + lv.EVENT.PRESSING, None) + + on_call_tab_label = lv.label(on_call_obj) + on_call_tab_label.set_pos(150, 240) + on_call_tab_label.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_tab_label.set_size(90, 34) + on_call_tab_label.set_text("键盘") + on_call_tab_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) + on_call_tab_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_tab_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_call_tab_show(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_tab_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_call_tab_show(e)), + lv.EVENT.PRESSING, None) + + on_call_screen_tab = lv.obj(on_call_screen) + on_call_screen_tab.set_size(LCD_SIZE_W,LCD_SIZE_H) + on_call_screen_tab.set_pos(0,0) + on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) + on_call_screen_tab.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + on_call_screen_tab_label = lv.label(on_call_screen_tab) + on_call_screen_tab_label.set_pos(40, 25) + on_call_screen_tab_label.set_size(0, 30) + on_call_screen_tab_label.set_text(" ") + on_call_screen_tab_label.set_long_mode(lv.label.LONG.CLIP) + on_call_screen_tab_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_screen_tab_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + on_call_phone_return = lv.img(on_call_screen_tab) + on_call_phone_return.set_src("U:/static/RED_RETURN_PNG.png") + on_call_phone_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_return.set_pos(0, 15) + on_call_phone_return.set_size(36, 36) + + on_call_phone_return_btn = lv.img(on_call_screen_tab) + on_call_phone_return_btn.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_return_btn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_return_btn.set_pos(0, 0) + on_call_phone_return_btn.set_size(50, 100) + on_call_phone_return_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.on_return_show(e)), + lv.EVENT.SHORT_CLICKED, None) + + + on_call_phone_one = lv.img(on_call_screen_tab) + on_call_phone_one.set_src("U:/static/IMAGE_NUMBER_KEY1_ICON.png") + on_call_phone_one.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_one.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_one.set_pos(3, 60) + on_call_phone_one.set_size(76, 50) + + on_call_phone_two = lv.img(on_call_screen_tab) + on_call_phone_two.set_size(76, 50) + on_call_phone_two.set_src("U:/static/IMAGE_NUMBER_KEY2_ICON.png") + on_call_phone_two.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_two.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_two.set_pos(82, 60) + + on_call_phone_three = lv.img(on_call_screen_tab) + on_call_phone_three.set_size(76, 50) + on_call_phone_three.set_src("U:/static/IMAGE_NUMBER_KEY3_ICON.png") + on_call_phone_three.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_three.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_three.set_pos(161, 60)#1 + + on_call_phone_four = lv.img(on_call_screen_tab) + on_call_phone_four.set_size(76, 50) + on_call_phone_four.set_src("U:/static/IMAGE_NUMBER_KEY4_ICON.png") + on_call_phone_four.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_four.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_four.set_pos(3, 112) + + on_call_phone_five = lv.img(on_call_screen_tab) + on_call_phone_five.set_size(76, 50) + on_call_phone_five.set_src("U:/static/IMAGE_NUMBER_KEY5_ICON.png") + on_call_phone_five.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_five.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_five.set_pos(82, 112) + + on_call_phone_six = lv.img(on_call_screen_tab) + on_call_phone_six.set_size(76, 50) + on_call_phone_six.set_src("U:/static/IMAGE_NUMBER_KEY6_ICON.png") + on_call_phone_six.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_six.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_six.set_pos(161, 112)#2 + + on_call_phone_seven = lv.img(on_call_screen_tab) + on_call_phone_seven.set_size(76, 50) + on_call_phone_seven.set_src("U:/static/IMAGE_NUMBER_KEY07_ICON.png") + on_call_phone_seven.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_seven.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_seven.set_pos(3, 164) + + on_call_phone_eight = lv.img(on_call_screen_tab) + on_call_phone_eight.set_size(76, 50) + on_call_phone_eight.set_src("U:/static/IMAGE_NUMBER_KEY8_ICON.png") + on_call_phone_eight.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_eight.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_eight.set_pos(82, 164) + + on_call_phone_nine = lv.img(on_call_screen_tab) + on_call_phone_nine.set_size(76, 50) + on_call_phone_nine.set_src("U:/static/IMAGE_NUMBER_KEY09_ICON.png") + on_call_phone_nine.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_nine.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_nine.set_pos(161, 164) + + on_call_phone_start = lv.img(on_call_screen_tab) + on_call_phone_start.set_size(76, 50) + on_call_phone_start.set_src("U:/static/IMAGE_NUMBER_KEYSTAR00_ICON.png") + on_call_phone_start.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_start.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_start.set_pos(3, 216) + + on_call_phone_zero = lv.img(on_call_screen_tab) + on_call_phone_zero.set_size(76, 50) + on_call_phone_zero.set_src("U:/static/IMAGE_NUMBER_KEY00_ICON.png") + on_call_phone_zero.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_zero.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_zero.set_pos(82, 216) + + on_call_phone_hash = lv.img(on_call_screen_tab) + on_call_phone_hash.set_size(76, 50) + on_call_phone_hash.set_src("U:/static/IMAGE_NUMBER_KEYHASH00_ICON.png") + on_call_phone_hash.add_flag(lv.obj.FLAG.CLICKABLE) + on_call_phone_hash.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + on_call_phone_hash.set_pos(161, 216) + + self.meta = on_call_screen + + + on_call_phone_one.add_event_cb(lambda e: EventMesh.callback_wrapper(self.one(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_two.add_event_cb(lambda e: EventMesh.callback_wrapper(self.two(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_three.add_event_cb(lambda e: EventMesh.callback_wrapper(self.three(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_four.add_event_cb(lambda e: EventMesh.callback_wrapper(self.four(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_five.add_event_cb(lambda e: EventMesh.callback_wrapper(self.five(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_six.add_event_cb(lambda e: EventMesh.callback_wrapper(self.six(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_seven.add_event_cb(lambda e: EventMesh.callback_wrapper(self.seven(e)), + lv.EVENT.SHORT_CLICKED, None) + + on_call_phone_eight.add_event_cb(lambda e: EventMesh.callback_wrapper(self.eight(e)), + lv.EVENT.SHORT_CLICKED, None) + on_call_phone_nine.add_event_cb(lambda e: EventMesh.callback_wrapper(self.nine(e)), + lv.EVENT.SHORT_CLICKED, None) + + + on_call_phone_zero.add_event_cb(lambda e: EventMesh.callback_wrapper(self.zero(e)), + lv.EVENT.SHORT_CLICKED, None) + + on_call_phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.start(e)), + lv.EVENT.SHORT_CLICKED, None)#短按显示* + + on_call_phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.pressed_start(e)), + lv.EVENT.LONG_PRESSED, None)#长按显示+ + + on_call_phone_start.add_event_cb(lambda e: EventMesh.callback_wrapper(self.endpressed_start(e)), + lv.EVENT.RELEASED, None)#释放按键 + + on_call_phone_hash.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hash(e)), + lv.EVENT.SHORT_CLICKED, None) + name = EventMesh.publish("get_phonename") + on_call_label_name.set_text(name) + # on_call_label.set_text(str(self.meta_info)) + on_call_second_label.set_text("00:00") + on_call_volum_label.set_style_text_color(lv.color_make(255,255,255), lv.STATE.DEFAULT) + self.phone_num = '' + self.phone_list = [] + self.button = 0 + self.mute_btn = 0 + self.is_sliding = 0 + voiceCall.mute(2,0,0) + + def show_num(self): + global on_call_screen_tab_label + print("phone self.phone_num ",self.phone_num,self.phone_list) + on_call_screen_tab_label.set_size(200, 30) + on_call_screen_tab_label.set_text(self.phone_num) + def one(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + + voiceCall.startDtmf("1",100) + self.phone_list.append("1") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def two(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("2",100) + self.phone_list.append("2") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def three(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + voiceCall.startDtmf("3",100) + self.phone_list.append("3") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def four(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + voiceCall.startDtmf("4",100) + self.phone_list.append("4") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def five(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("5",100) + self.phone_list.append("5") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def six(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("6",100) + self.phone_list.append("6") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def seven(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("7",100) + self.phone_list.append("7") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def eight(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("8",100) + self.phone_list.append("8") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def nine(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA: + self.phone_list.pop(0) + #return + voiceCall.startDtmf("9",100) + self.phone_list.append("9") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def zero(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 + self.phone_list.pop(0) + #return + voiceCall.startDtmf("0",100) + self.phone_list.append("0") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def start(self,e): + self.button = 0 + + def pressed_start(self,e): + self.button = 1 + def Close(self): + self.timer_cb = 0 + self.timer.stop() + + def endpressed_start(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 + self.phone_list.pop(0) + #return + if self.button == 1:#长按 + voiceCall.startDtmf("+",100) + self.phone_list.append("+") + else:#短按 + voiceCall.startDtmf("*",100) + self.phone_list.append("*") + self.button = 0 + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def hash(self,e): + if len(self.phone_list) >= ON_CALL_MAX_DATA:#限制拨号数量20个数字 + self.phone_list.pop(0) + #return + voiceCall.startDtmf("#",100) + self.phone_list.append("#") + self.phone_num = ''.join(self.phone_list) + self.show_num() + + def add_show_hidden(self): + on_call_volum_add.add_flag(lv.obj.FLAG.HIDDEN) + on_call_volum_reduce.add_flag(lv.obj.FLAG.HIDDEN) + on_call_bar.add_flag(lv.obj.FLAG.HIDDEN) + + def clear_show_hidden(self): + on_call_volum_add.clear_flag(lv.obj.FLAG.HIDDEN) + on_call_volum_reduce.clear_flag(lv.obj.FLAG.HIDDEN) + on_call_bar.clear_flag(lv.obj.FLAG.HIDDEN) + + def open_volum_show(self, e): + global on_call_screen_tab,on_call_screen,on_call_obj + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + if self.mute_btn == 0:#默认是开启 + self.mute_btn = 1 + voiceCall.mute(2,1,0) + on_call_volum_label.set_style_text_color(lv.color_make(0, 169, 242), lv.STATE.DEFAULT) + else: + + on_call_volum_label.set_style_text_color(lv.color_make(255, 255, 255), lv.STATE.DEFAULT) + self.mute_btn = 0 + voiceCall.mute(2,0,0) + + self.is_sliding =0 + + def on_call_tab_show(self, e): + global on_call_screen_tab,on_call_screen,on_call_obj + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + if on_call_screen_tab != None: + self.phone_num = '' + self.phone_list = [] + self.show_num() + on_call_screen_tab.clear_flag(lv.obj.FLAG.HIDDEN) + on_call_obj.add_flag(lv.obj.FLAG.HIDDEN) + + self.is_sliding =0 + + + + def on_return_show(self, e): + global on_call_screen_tab,on_call_screen,on_call_obj + if on_call_screen_tab != None: + on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) + on_call_obj.clear_flag(lv.obj.FLAG.HIDDEN) + + def add_volum_size(self, e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + self.volum_size+=2 + if self.volum_size >= 11: + self.volum_size = 11 + self.show_bar(1) + + self.is_sliding =0 + + + def reduce_volum_size(self, e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + self.volum_size -= 2 + if self.volum_size < 0: + self.volum_size = 0 + self.show_bar(1) + + self.is_sliding =0 + + + def show_bar(self,msg): + on_call_bar.set_value((100 // 11) * self.volum_size, lv.ANIM.OFF) + if msg == 1: + self.aud.setVolume(self.volum_size) + EventMesh.publish("set_volum_size",self.volum_size) + + + def post_processor_after_initialization(self): + global on_call_screen_tab,on_call_obj + self.count_sec = 0 + self.timer.start(1000,1,self.refresh) + + num = EventMesh.publish("get_volum_size") + if num == None: + self.volum_size = 8 + else: + self.volum_size = num + self.show_bar(0) + self.open_volum = 0 + self.phone_num = '' + self.phone_list = [] + self.button = 0 + if on_call_obj != None: + on_call_obj.clear_flag(lv.obj.FLAG.HIDDEN) + if on_call_screen_tab != None: + on_call_screen_tab.add_flag(lv.obj.FLAG.HIDDEN) + self.show_num() + def refresh(self,e): + EventMesh.publish("publish_message_event_ui",{"func":self.refresh_do,"data":0}) + + def refresh_do(self,data): + # print("call_in") + global on_call_screen,on_call_label_name,on_call_second_label ,on_call_hangup + min = self.count_sec/60 + sec = self.count_sec%60 + if min > 99: + total = "%03d:%02d"%(min,sec) + else: + total = "%02d:%02d"%(min,sec) + on_call_second_label.set_text(str(total)) + self.count_sec+=1 + + def hangup(self,e): + code = e.get_code() + if code == lv.EVENT.SHORT_CLICKED: + EventMesh.publish("set_UI_high_priority", 0) + self.timer.stop() + voiceCall.callEnd() + EventMesh.publish("set_interrup_incall",0) + EventMesh.publish("set_UI_high_priority",0) + + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "dialing_noplay_popup": + EventMesh.publish("return_prev_screen") + + + + def Close(self): + self.timer.stop() + + def btn1_release(self): + pass + #EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + #EventMesh.publish("load_screen", {"screen": "main_menu"}) +# -------------------------------------------step screen----------------------------------------------------------# + +step_screen = None +step_label = None +step_label_01 = None +step_img = None +class StepScreen(Screen): + NAME = "step" + + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + + def initialization(self): + global step_screen,step_label ,step_label_01 ,step_img + if step_screen == None: + step_screen = lv.obj() + print("step_screen") + step_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + step_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) + + step_label = lv.label(step_screen) + step_label.set_pos(10, 30) + step_label.set_size(230, 50) + step_label.set_text("今日步数") + step_label.set_long_mode(lv.label.LONG.WRAP) + step_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + step_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + step_label_01 = lv.label(step_screen) + step_label_01.set_pos(0, 100) + step_label_01.set_size(LCD_SIZE_W, 50) + step_label_01.set_text("0步") + step_label_01.set_long_mode(lv.label.LONG.WRAP) + step_label_01.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + step_label_01.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + step_img = lv.img(step_screen) + step_img.set_pos(100, 150) + step_img.set_size(40, 65) + step_img.set_src("U:/static/IMAGE_STEP.png") + step_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = step_screen + + step = EventMesh.publish("get_old_step_value") + if step == None: + step = 0 + step_label_01.set_text("{} 步".format(step)) + self.timer.start(1000, 1, self.revcing) + + def revcing(self, *args, **kwargs): + global step_screen,step_label ,step_label_01 ,step_img + step = EventMesh.publish("get_old_step_value") + if step == None: + step = 0 + step_label_01.set_text("{} 步".format(step)) + + def Close(self): + self.timer.stop() + + def fun(self, e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + # EventMesh.publish("load_screen", {"screen": "toolbox"}) + + # def done_return(self): + # EventMesh.publish("load_screen", {"screen": "toolbox"}) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +# -------------------------------------------weather screen---------------------------------------------------------- + +weather_screen = None +weather_img = None +no_weather_img = None +weather_tem_label = None +no_weather_degree = None +weather_detail_label = None +weather_location_label = None +no_connect_label = None +no_connect_label1 = None +class WeatherScreen(Screen): + NAME = "weather" + + def __init__(self): + super().__init__() + self.meta = None + self.weather_data = {} + EventMesh.subscribe("updata_weather_show", self.update_weather_data) + + def initialization(self): + global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,\ + weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 + if weather_screen == None : + weather_screen = lv.obj() + print("weather_screen") + weather_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + weather_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) + + weather_img = lv.img(weather_screen) + weather_img.set_pos(10, 10) + weather_img.set_size(135, 120) + + weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_weather_img = lv.img(weather_screen) + no_weather_img.set_pos(10, 10) + no_weather_img.set_size(135, 120) + no_weather_img.set_src("U:/static/update.png") + no_weather_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + weather_tem_label = lv.label(weather_screen) + weather_tem_label.set_pos(145, 44) + weather_tem_label.set_size(240-145, 50) + weather_tem_label.set_text("_ _℃") + weather_tem_label.set_long_mode(lv.label.LONG.WRAP) + weather_tem_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + weather_tem_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_weather_degree = lv.img(weather_screen) + no_weather_degree.set_pos(205, 40) + no_weather_degree.set_size(22, 22) + # no_weather_degree.set_src("U:/static/degree.png") + no_weather_degree.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + weather_detail_label = lv.label(weather_screen) + weather_detail_label.set_pos(145, 80) + weather_detail_label.set_size(85, 50) + weather_detail_label.set_text("-/-") + weather_detail_label.set_long_mode(lv.label.LONG.WRAP) + weather_detail_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + weather_detail_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + weather_location_label = lv.label(weather_screen) + weather_location_label.set_pos(0, 180) + weather_location_label.set_size(LCD_SIZE_W, 50) + weather_location_label.set_text("--") + weather_location_label.set_long_mode(lv.label.LONG.WRAP) + weather_location_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + weather_location_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_connect_label = lv.label(weather_screen) + no_connect_label.set_pos(0, 180) + no_connect_label.set_size(LCD_SIZE_W, 40) + no_connect_label.set_text("找不到服务器") + no_connect_label.set_long_mode(lv.label.LONG.WRAP) + no_connect_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_connect_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + no_connect_label1 = lv.label(weather_screen) + no_connect_label1.set_pos(0, 230) + no_connect_label1.set_size(LCD_SIZE_W, 54) + no_connect_label1.set_text("请联网后重试") + no_connect_label1.set_long_mode(lv.label.LONG.WRAP) + no_connect_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + no_connect_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + self.meta = weather_screen + + #EventMesh.publish(constants.PROTOCOL.WT_SEND) + EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.WT_SEND) #开始WT定位 + def post_processor_after_initialization(self): + EventMesh.publish("updata_weather_show") + + + def update_weather_data(self, event, msg): + global weather_screen,weather_img,no_weather_img,weather_tem_label,no_weather_degree,\ + weather_detail_label,weather_location_label,no_connect_label ,no_connect_label1 + connect = EventMesh.publish(constants.EVENT.GET_CONNECT) #获取网络状态 + self.weather_data = EventMesh.publish("get_weather_data") + if weather_screen != None: + if connect != 0 and self.weather_data != None: + no_data = self.weather_data[8] + if no_data != 0 : + no_weather_img.add_flag(lv.obj.FLAG.HIDDEN) + weather_img.clear_flag(lv.obj.FLAG.HIDDEN) + no_connect_label.set_text(" ") + no_connect_label1.set_text(" ") + # print("self.weather_data:{}".format(self.weather_data)) + type = self.weather_data[3] + if type == None: + weather_img.set_src("U:/static/update.png")#天气类型 + else: + weather_img.set_src("U:/static/{}_weather.png".format(type))#天气类型 + + temp = self.weather_data[4] + if temp == None: + weather_tem_label.set_text("_ _℃") + else: + weather_tem_label.set_text("{}℃".format(temp)) + + date = self.weather_data[0] + if date != {}: + date_month = date.split('-')[1] + date_day = date.split('-')[2] + weather_detail_label.set_text("{}/{}".format(date_month,date_day))#天气更新时间 + else: + weather_detail_label.set_text("-/-") + + city = self.weather_data[7] + if city != {}: + weather_location_label.set_text("{}".format(city))#城市 + else: + weather_location_label.set_text("--") + else:#已联网未获取到天气数据 + weather_location_label.set_text(" ") + weather_detail_label.set_text("-/-") + weather_tem_label.set_text("_ _℃") + + no_connect_label.set_text("未获取网络数据") + no_connect_label1.set_text("请稍候重试") + + else: + weather_location_label.set_text(" ") + weather_detail_label.set_text("-/-") + weather_tem_label.set_text("_ _℃") + + no_weather_img.clear_flag(lv.obj.FLAG.HIDDEN) + weather_img.add_flag(lv.obj.FLAG.HIDDEN) + no_connect_label.set_text("找不到服务器") + no_connect_label1.set_text("请联网后重试") + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + def fun(self, e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +import audio +from machine import Pin + + + + +# -----------------------------联系人--------------contacts screen---------------------------------------------------------- + +CONTACT_FLAG = 0 +contacts_screen = None +contacts_cont = None +contacts_top_title = None +contact_none_label = None +contacts_screen_list_screen = None +CONTACTS_LIST_SIZE = 80 +CONTACTS_LIST_LABEL = 28 #文本控件的高度大小 +class ContactsScreen(Screen): + NAME = "contacts" + + def __init__(self): + super().__init__() + # -------------------------------------------popup_menu screen---------------------------------------------------------- + self.meta = None + self.phonebook = {} + self.count = 0 + self.phone_num_count = 0 + self.phone_num = {} + self.name = [] + self.check_json = 0 + self.timer = osTimer() + self.contact_detail_list = None + EventMesh.subscribe("contact_updata_list_show", self.btn_create_list) + self.MXA_phone_num = 50 #最大显示号码个数 + self.contact_detail_listt_dict = [] + self.calling_btn = [] + self.is_sliding = 0 + + def post_processor_before_initialization(self): + data = EventMesh.publish("get_phonebook_list") + if data != None: + self.check_json = data[0] + self.phonebook = data[1] + self.count = 0 + + def initialization(self): + self.is_sliding = 0 + global contacts_screen,contacts_cont,contacts_top_title,contact_none_label,contacts_screen_list_screen + if contacts_screen == None: + contacts_screen = lv.obj() + print("contacts_screen") + contacts_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + contacts_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + contacts_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), + lv.EVENT.GESTURE, None) + + contacts_screen_list_screen = lv.obj(contacts_screen) + contacts_screen_list_screen.set_pos(0, 50) + contacts_screen_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-50) + contacts_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + contacts_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + contacts_top_title = lv.label(contacts_screen) + contacts_top_title.set_pos(0, 10) + contacts_top_title.set_size(LCD_SIZE_W, 40) + contacts_top_title.set_text("联系人") + contacts_top_title.set_long_mode(lv.label.LONG.WRAP) + contacts_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + contacts_top_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + contact_none_label = lv.label(contacts_screen_list_screen) + contact_none_label.set_pos(0, 80) + contact_none_label.set_size(LCD_SIZE_W, 50) + contact_none_label.set_text("无联系人,请在手机\nAPP上添加") + contact_none_label.set_long_mode(lv.label.LONG.WRAP) + contact_none_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + contact_none_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.contact_detail_list = lv.obj(contacts_screen_list_screen) + self.contact_detail_list.set_pos(0, 0) + self.contact_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-50+1) + self.contact_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + self.contact_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + self.contact_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), + lv.EVENT.GESTURE, None) + for i in range(self.MXA_phone_num): + contact_btn = lv.btn(self.contact_detail_list) + contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) + contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + # contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), + # lv.EVENT.PRESSING, None) + contact_btn.add_flag(lv.obj.FLAG.HIDDEN) + + contact_btn_label_1 = lv.label(contact_btn) + contact_btn_label_2 = lv.label(contact_btn) + contact_btn_label_3 = lv.label(contact_btn) + contact_btn.add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + contact_btn_label_1.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + contact_btn_label_3.add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + self.contact_detail_listt_dict.append({"contact_btn":contact_btn,"contact_btn_label_1":contact_btn_label_1,"contact_btn_label_2":contact_btn_label_2,"contact_btn_label_3":contact_btn_label_3}) + self.meta = contacts_screen + self.count = 0 + self.btn_create_list_show(0) + + def btn_create_list(self,event,msg): + self.post_processor_before_initialization() + self.timer.start(1 * 1000, 0, self.OutTime_s) + + def OutTime_s(self,e): + self.btn_create_list_show(1) + + def btn_create_list_show(self,state): + EventMesh.publish("publish_message_event_ui",{"func":self.btn_create_list_show_screen,"data":state}) + + def btn_create_list_show_screen(self,state): + global contacts_screen,contacts_cont,contacts_top_title,contact_none_label,contacts_screen_list_screen + print("btn_create_list_show_screen!!!!!!!!!!!") + if contacts_screen == None: + return + #读取json文件中的键作为label文本; + self.check_json = True + + if self.check_json == True and len(self.phonebook) != 0: + + self.contact_detail_list.clear_flag(lv.obj.FLAG.HIDDEN) + contact_none_label.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 + j =0 + print("self.phonebook sorted :{} len(self.phonebook) :{}".format(sorted(self.phonebook.keys()),len(self.phonebook))) + phonebook_keys = sorted(self.phonebook.keys()) + if len(self.phonebook) > self.MXA_phone_num: + j = len(self.phonebook) - self.MXA_phone_num + for i in range(self.MXA_phone_num): #字典 key value + if(j >= len(self.phonebook)): + self.contact_detail_listt_dict[i]["contact_btn"].add_flag(lv.obj.FLAG.HIDDEN) + continue + name = self.phonebook[phonebook_keys[j]] + key_tmp =phonebook_keys[j] + + + # print("name :{} key_tmp:{}".format(name,key_tmp)) + + #contact_btn = lv.btn(self.contact_detail_list) + self.contact_detail_listt_dict[i]["contact_btn"].set_size(LCD_SIZE_W-10,CONTACTS_LIST_SIZE) + self.contact_detail_listt_dict[i]["contact_btn"].set_pos(5,(CONTACTS_LIST_SIZE+6)*i ) + #self.contact_detail_listt_dict[i]["contact_btn"].add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.DEFAULT) + # contact_btn.add_style(style_contact_btn_pressed, lv.PART.MAIN | lv.STATE.PRESSED) + # self.contact_detail_listt_dict[i]["contact_btn"].add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling(e)), + # lv.EVENT.CLICKED, None) + + #contact_btn_label_1 = lv.label(contact_btn) + self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_pos(0, 8) + self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_SIZE_W-20, CONTACTS_LIST_LABEL) + self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_text(key_tmp[4:]) + self.contact_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.CLIP) + #self.contact_detail_listt_dict[i]["contact_btn_label_1"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + #contact_btn_label_2 = lv.label(contact_btn) + self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_pos(0, 5) + self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_size(0, 0) + self.contact_detail_listt_dict[i]["contact_btn_label_2"].set_text(key_tmp) + + + #contact_btn_label_3 = lv.label(contact_btn) + self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 45) + self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_SIZE_W-20, CONTACTS_LIST_LABEL) + self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_text(name) + self.contact_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.CLIP) + #self.contact_detail_listt_dict[i]["contact_btn_label_3"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) + + + self.contact_detail_listt_dict[i]["contact_btn"].clear_flag(lv.obj.FLAG.HIDDEN) + #self.contact_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) + j+=1 + + if state == 1: + self.contact_detail_listt_dict[i]["contact_btn"].scroll_to_view(lv.ANIM.OFF) + + else: + if contacts_screen_list_screen != None: + contact_none_label.clear_flag(lv.obj.FLAG.HIDDEN) #显示空文本 + if self.contact_detail_list != None: + self.contact_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 + + def calling_cb(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + elif code == lv.EVENT.SHORT_CLICKED: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + msg_text = e.get_target().get_child(1).get_text() + EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + else: + EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + + + def calling(self,msg_text): + _msg = msg_text + print("contacts:calling_cb1:{}".format(_msg)) + # print("_msg:{}".format(_msg)) + msg_tmp = _msg.split(':') + msg_tmp = msg_tmp[1] + EventMesh.publish("save_phonename", msg_tmp) + + phone_num = self.phonebook[_msg] + EventMesh.publish("save_phonenum", phone_num) + + EventMesh.publish("load_screen", {"screen": "dialing_noplay_popup"}) + + def done_DOWN(self):#下滑 + if self.contact_detail_list != None: + scroll_y = self.contact_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.contact_detail_list.scroll_to_y(scroll_y-CONTACTS_LIST_SIZE,lv.ANIM.ON) + + + #setting_cont.scroll_to_view(lv.ANIM.ON) + pass + def done_UP(self):#上滑 + if self.contact_detail_list != None: + scroll_y = self.contact_detail_list.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + self.contact_detail_list.scroll_to_y(scroll_y+CONTACTS_LIST_SIZE,lv.ANIM.ON) + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn1_release(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_left_to_right(self): + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + +# -------------------------------------------countdown screen---------------------------------------------------------- +countdown_screen = None +countdown_title = None +countdown_hour = None +countdown_mao = None +countdown_mao = None +countdown_mao1 = None +countdown_sec = None +countdown_hour_up = None +countdown_hour_up_btn = None +countdown_hour_down = None +countdown_hour_down_btn = None +countdown_min_up = None +countdown_min_up_btn = None +countdown_min_down = None +countdown_min_down_btn = None +countdown_sec_up = None +countdown_sec_up_btn = None +countdown_sec_down = None +countdown_sec_down_btn = None +countdown_reset_img = None +countdown_reset_imgbtn = None +countdown_start_img = None +countdown_start_imgbtn = None +countdown_stop_img = None +countdown_min = None +class CountdownScreen(Screen): + NAME = "countdown" + + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + self.sec = 0 + self.min = 0 + self.hour = 0 + self.total = 0 + self.flag = 1 + self.g_state = 0 + self.g_end = 0 + self.total = 0 + self.time_tmp = 0 + self.timer_cb = 0 + self.is_sliding =0 + EventMesh.subscribe("close_count_show_info", self.close_count_show_info) + + def initialization(self): + self.is_sliding=0 + global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ + countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ + countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ + countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ + countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min + if countdown_screen == None : + countdown_screen = lv.obj() + print("countdown_screen") + countdown_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,1)), + lv.EVENT.GESTURE, None) + + countdown_title = lv.label(countdown_screen) + countdown_title.set_pos(0, 20) + countdown_title.set_size(LCD_SIZE_W, 20) + countdown_title.set_text("倒计时") + countdown_title.set_long_mode(lv.label.LONG.WRAP) + countdown_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + countdown_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_hour = lv.label(countdown_screen) + countdown_hour.set_pos(30, 130) + countdown_hour.set_size(60, 30) + countdown_hour.set_text("00") + countdown_hour.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_hour.set_long_mode(lv.label.LONG.WRAP) + countdown_hour.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + countdown_mao = lv.label(countdown_screen) + countdown_mao.set_pos(82, 128) + countdown_mao.set_size(30, 30) + countdown_mao.set_text(":") + countdown_mao.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_mao.set_long_mode(lv.label.LONG.WRAP) + countdown_mao.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + + countdown_min = lv.label(countdown_screen) + countdown_min.set_pos(95, 130) + countdown_min.set_size(60, 30) + countdown_min.set_text("00") + countdown_min.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_min.set_long_mode(lv.label.LONG.WRAP) + countdown_min.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + countdown_mao1 = lv.label(countdown_screen) + countdown_mao1.set_pos(146, 128) + countdown_mao1.set_size(30, 30) + countdown_mao1.set_text(":") + countdown_mao1.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_mao1.set_long_mode(lv.label.LONG.WRAP) + countdown_mao1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + + countdown_sec = lv.label(countdown_screen) + countdown_sec.set_pos(160, 130) + countdown_sec.set_size(60, 30) + countdown_sec.set_text("00") + countdown_sec.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_sec.set_long_mode(lv.label.LONG.WRAP) + countdown_sec.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + countdown_hour_up = lv.img(countdown_screen) + countdown_hour_up.set_size(34, 30) + countdown_hour_up.set_pos(36, 90) + countdown_hour_up.set_src("U:/static/time_up.png") + countdown_hour_up.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_hour_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_hour_up_btn= lv.img(countdown_screen) + countdown_hour_up_btn.set_size(62, 65) + countdown_hour_up_btn.set_pos(20, 80) + countdown_hour_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + + countdown_hour_down = lv.img(countdown_screen) + countdown_hour_down.set_size(34, 30) + countdown_hour_down.set_pos(36, 170) + countdown_hour_down.set_src("U:/static/time_down.png") + countdown_hour_down.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_hour_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_hour_down_btn= lv.img(countdown_screen) + countdown_hour_down_btn.set_size(62, 70) + countdown_hour_down_btn.set_pos(20, 145) + countdown_hour_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + + countdown_min_up = lv.img(countdown_screen) + countdown_min_up.set_size(34, 30) + countdown_min_up.set_pos(99, 90) + countdown_min_up.set_src("U:/static/time_up.png") + countdown_min_up.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_min_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_min_up_btn= lv.img(countdown_screen) + countdown_min_up_btn.set_size(64, 65) + countdown_min_up_btn.set_pos(82, 80) + countdown_min_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + + + countdown_min_down = lv.img(countdown_screen) + countdown_min_down.set_size(34, 30) + countdown_min_down.set_pos(99, 170) + countdown_min_down.set_src("U:/static/time_down.png") + countdown_min_down.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_min_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_min_down_btn= lv.img(countdown_screen) + countdown_min_down_btn.set_size(64, 70) + countdown_min_down_btn.set_pos(82, 145) + countdown_min_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + + countdown_sec_up = lv.img(countdown_screen) + countdown_sec_up.set_size(34, 30) + countdown_sec_up.set_pos(165, 90) + countdown_sec_up.set_src("U:/static/time_up.png") + countdown_sec_up.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_sec_up.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_sec_up_btn = lv.img(countdown_screen) + countdown_sec_up_btn.set_size(64, 65) + countdown_sec_up_btn.set_pos(146, 80) + countdown_sec_up_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + countdown_sec_down = lv.img(countdown_screen) + countdown_sec_down.set_size(34, 30) + countdown_sec_down.set_pos(165, 170) + countdown_sec_down.set_src("U:/static/time_down.png") + countdown_sec_down.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_sec_down.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_sec_down_btn = lv.img(countdown_screen) + countdown_sec_down_btn.set_size(64, 70) + countdown_sec_down_btn.set_pos(146, 145) + countdown_sec_down_btn.add_flag(lv.obj.FLAG.CLICKABLE) + + + countdown_reset_img = lv.img(countdown_screen) + countdown_reset_img.set_size(99, 36) + countdown_reset_img.set_src("U:/static/stopwatch_reset.png") + countdown_reset_img.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_reset_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_reset_img.set_pos(10, 230) + + countdown_reset_imgbtn = lv.img(countdown_screen) + countdown_reset_imgbtn.set_size(99, 54) + countdown_reset_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_reset_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_reset_imgbtn.set_pos(10, 220) + + + + countdown_start_img = lv.img(countdown_screen) + countdown_start_img.set_size(99, 36) + countdown_start_img.set_src("U:/static/stopwatch_play.png") + countdown_start_img.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_start_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_start_img.set_pos(120, 230) + + countdown_start_imgbtn = lv.img(countdown_screen) + countdown_start_imgbtn.set_size(99, 54) + countdown_start_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + countdown_start_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_start_imgbtn.set_pos(120, 220) + + + + countdown_stop_img = lv.img(countdown_screen) + countdown_stop_img.set_size(99, 36) + countdown_stop_img.set_src("U:/static/stopwatch_stop.png") + countdown_stop_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_stop_img.set_pos(120, 230) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + + self.meta = countdown_screen + + countdown_sec_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,2)), + lv.EVENT.SHORT_CLICKED, None) + countdown_sec_up.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,2)), + lv.EVENT.SHORT_CLICKED, None) + countdown_sec_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,3)), + lv.EVENT.SHORT_CLICKED, None) + countdown_sec_down.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,3)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_min_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,4)), + lv.EVENT.SHORT_CLICKED, None) + countdown_min_up.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,4)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_min_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,5)), + lv.EVENT.SHORT_CLICKED, None) + countdown_min_down.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,5)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_hour_up_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,6)), + lv.EVENT.SHORT_CLICKED, None) + countdown_hour_up.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,6)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_hour_down_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,7)), + lv.EVENT.SHORT_CLICKED, None) + countdown_hour_down.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,7)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,8)), + lv.EVENT.SHORT_CLICKED, None) + countdown_start_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,8)), + lv.EVENT.SHORT_CLICKED, None) + + countdown_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,9)), + lv.EVENT.SHORT_CLICKED, None) + countdown_reset_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_bt(e,9)), + lv.EVENT.SHORT_CLICKED, None) + self.show_value() + + + + def fun_bt(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + if self.sec < 59: + self.sec = self.sec + 1 + print("sec_up:",self.sec) + self.show_value() + pass + elif msg == 3: + if self.sec > 0: + self.sec = self.sec - 1 + print("sec_down:",self.sec) + self.show_value() + pass + elif msg == 4: + if self.min < 59: + self.min = self.min + 1 + print("min_up:",self.min) + self.show_value() + pass + elif msg == 5: + if self.min > 0: + self.min = self.min - 1 + print("min_down:",self.min) + self.show_value() + pass + elif msg == 6: + if self.hour < 99: + self.hour = self.hour + 1 + + print("hour_up:",self.hour) + self.show_value() + pass + elif msg == 7: + if self.hour > 0: + self.hour = self.hour - 1 + print("hour_down:",self.hour) + self.show_value() + elif msg == 8: + self.total = self.hour*60*60 + self.min*60 + self.sec + print("--00:",self.total,self.hour,self.min,self.sec,self.g_state) + if self.g_state == 1: + self.g_state = 2 + self.stop() + elif self.g_state == 2: + self.g_state = 1 + if self.total > 0: + date_tmp = utime.localtime() + timeSecond = utime.mktime(date_tmp) + print("start self.timeSecond:{}".format(timeSecond)) + EventMesh.publish("set_countdown_all_time", [self.total,timeSecond]) + if self.g_state != 2: + self.g_state = 1 + self.g_end = 0 + date_tmp = utime.localtime() + self.timeSecond = utime.mktime(date_tmp) + self.show_value() + self.timer.start(1000,1,self.fun) + #countdown_hour_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + + EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + pass + elif msg == 9: + self.timer.stop() + self.hour = 0 + self.min = 0 + self.sec = 0 + self.g_state = 0 + self.g_end = 0 + self.total = 0 + EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + EventMesh.publish("reset_time_countdown") + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + + countdown_hour_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) + self.show_value() + pass + + def stop(self): + global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ + countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ + countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ + countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ + countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min + print("in stop") + countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + + self.g_end = 0 + self.timer.stop() + + def fun(self,e): + if self.g_state == 1: + date_tmp = utime.localtime() + self.time_tmp = utime.mktime(date_tmp) + total_sec = self.time_tmp - self.timeSecond + print("total_sec:{} self.time_tmp:{} self.timeSecond:{} self.total:{}".format(total_sec,self.time_tmp,self.timeSecond,self.total)) + if self.total > 0: + self.total = self.total - total_sec + self.timeSecond = self.time_tmp + + + self.hour = self.total//3600 + self.min = self.total%3600//60 + self.sec = self.total%60 + + + # print("self.total:{} self.time_tmp:{} self.timeSecond:{} test_hour:{} test_min:{} test_sec:{}".format(self.total,self.time_tmp,self.timeSecond,test_hour,test_min,test_sec)) + + # print("Close self.timeSecond:22") + #EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) + if self.total <= 0: + self.timer.stop() + EventMesh.publish("load_screen", {"screen": "countdown_end"}) + self.g_state = 0 + self.g_end = 1 + self.hour = 0 + self.min = 0 + self.sec = 0 + else: + + self.show_value() + + # self.total = self.total - 1 + + # self.sec = self.sec - 1 + # if self.sec < 0: + # self.sec = 59 + + def Close(self): + pass + # time = EventMesh.publish("get_countdown_all_time") + # if time > 0 and self.g_state == 1: + # self.timer_cb = 1 + # date_tmp = utime.localtime() + # self.timeSecond = utime.mktime(date_tmp) + # EventMesh.publish("set_countdown_off_state", [1,self.g_state]) + # # print("Close self.timeSecond:{}".format(self.timeSecond)) + # EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) + # self.timer.stop() + # else: + # msg_tmp = EventMesh.publish("get_countdown_off_state") + # self.g_state = msg_tmp[1] + # EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + def close_count_show_info(self, event, msg): + self.reset() + + def reset(self): + global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ + countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ + countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ + countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ + countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min + # print("in reset") + self.timer.stop() + self.hour = 0 + self.min = 0 + self.sec = 0 + self.g_state = 0 + self.g_end = 0 + self.total = 0 + EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + EventMesh.publish("reset_time_countdown") + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + + countdown_hour_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) + self.show_value() + + + + + + + def show_value(self): + global countdown_screen ,countdown_title,countdown_hour ,countdown_mao ,countdown_mao ,countdown_mao1 ,\ + countdown_sec ,countdown_hour_up ,countdown_hour_up_btn ,countdown_hour_down ,countdown_hour_down_btn ,\ + countdown_min_up,countdown_min_up_btn ,countdown_min_down,countdown_min_down_btn,countdown_sec_up ,\ + countdown_sec_up_btn,countdown_sec_down ,countdown_sec_down_btn ,countdown_reset_img ,countdown_reset_imgbtn ,\ + countdown_start_img,countdown_start_imgbtn,countdown_stop_img ,countdown_min + if self.g_state == 0:#没点开始 + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up_btn.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down_btn.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up_btn.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down_btn.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up_btn.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_min.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_hour.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_title.clear_flag(lv.obj.FLAG.HIDDEN) + + elif self.g_state == 1:#计时 + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_start_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + elif self.g_state == 2:#暂停 + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_hour_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_min_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_up_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_sec_down_btn.add_flag(lv.obj.FLAG.HIDDEN) + countdown_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + countdown_reset_img.clear_flag(lv.obj.FLAG.HIDDEN) + countdown_sec.set_text(str("%02d"%(self.sec))) + countdown_min.set_text(str("%02d"%(self.min))) + countdown_hour.set_text(str("%02d"%(self.hour))) + + def lcd_on(self): + print("lcd_on self.timer_cb:{}".format(self.timer_cb)) + # time = EventMesh.publish("get_countdown_all_time") + + # if time > 0 and self.g_state != 0: + # if self.g_state == 1: + # if self.timer_cb != 0: + # self.timer_cb = 0 + # EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + # date_tmp = utime.localtime() + # time_tmp = utime.mktime(date_tmp) + # total_sec = time_tmp - self.timeSecond + # # print("total_sec:{} self.time_tmp:{} self.timeSecond:{} self.total:{}".format(total_sec,self.time_tmp,self.timeSecond,self.total)) + # if self.total > 0: + # self.total = self.total - total_sec + # self.timeSecond = self.time_tmp + # self.hour = self.total//3600 + # self.min = self.total%3600//60 + # self.sec = self.total%60 + # self.show_value() + # self.timer.start(1000,1,self.fun) + # else: + # msg_tmp = EventMesh.publish("get_countdown_off_state") + # self.g_state = msg_tmp[1] + # EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + + # else: + # self.reset(0) + # msg_tmp = EventMesh.publish("get_countdown_off_state") + # self.g_state = msg_tmp[1] + # EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + + def lcd_off(self): + pass + # time = EventMesh.publish("get_countdown_all_time") + # if time > 0 and self.g_state == 1: + # self.timer_cb = 1 + # date_tmp = utime.localtime() + # self.timeSecond = utime.mktime(date_tmp) + # EventMesh.publish("set_countdown_off_state", [1,self.g_state]) + # EventMesh.publish("set_countdown_all_time", [self.total,self.timeSecond]) + # self.timer.stop() + # else: + # EventMesh.publish("set_countdown_off_state", [0,self.g_state]) + + def stop_count_down(self,*argc,a): + if self.g_state == 0: + self.timer.stop() + + def done_return(self): + if self.g_state == 0: + self.timer.stop() + if self.g_end == 1: + EventMesh.publish("load_screen", {"screen": "countdown"}) + else: + EventMesh.publish("return_prev_screen") + + + + def btn1_release(self): + if self.g_state == 0: + self.timer.stop() + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + # def done_left_to_right(self): + # EventMesh.publish("return_prev_screen") + + def btn8_press(self): + if self.g_state == 0: + self.timer.stop() + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +#结束倒计时显示图标 +countdown_end_screen = None +countdown_end_img = None +countdown_end_label = None +class CountdownEndScreen(Screen): + NAME = "countdown_end" + + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.FIND_timer=osTimer() + self.aud = audio.Audio(0) + self.FIND_timer_count = 0 + + def initialization(self): + global countdown_end_screen ,countdown_end_img ,countdown_end_label + if countdown_end_screen == None: + countdown_end_screen = lv.obj() + print("countdown_end_screen") + countdown_end_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_end_img = lv.img(countdown_end_screen) + countdown_end_img.set_size(140, 140) + countdown_end_img.set_pos(50, 60) + countdown_end_img.set_src("U:/static/time_finish.png") + countdown_end_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + countdown_end_label = lv.label(countdown_end_screen) + countdown_end_label.set_pos(0, 240) + countdown_end_label.set_size(LCD_SIZE_W, 40) + countdown_end_label.set_text("时间到") + countdown_end_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + countdown_end_label.set_long_mode(lv.label.LONG.WRAP) + countdown_end_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + self.meta = countdown_end_screen + self.FIND_timer_count = 0 + self.FIND_timer.start(1000, 1, self.FIND_timer_cb) + EventMesh.publish("close_count_show_info") + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') #播放声音 + + def FIND_timer_cb(self, *args): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.FIND_timer_count += 1 + if self.FIND_timer_count >= 30: #120秒 + self.stop_FIND() + EventMesh.publish("return_prev_screen") + return + if self.FIND_timer_count % 4 == 0: + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') + + def stop_FIND(self) : + + self.FIND_timer.stop() + self.aud.stopAll() + + def Close(self): + self.stop_FIND() + + + + def done_return(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def done_click(self): + print("count down !!!!!!!!!!") + self.stop_FIND() + EventMesh.publish("load_screen", {"screen": "countdown"}) + + def done_left_to_right(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + self.stop_FIND() + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + self.stop_FIND() + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +# -------------------------------------------stopwatch screen---------------------------------------------------------- + + +stopwatch_screen = None +stopwatch_title = None +stopwatch_label_min = None +stopwatch_mao = None +stopwatch_label_sec = None +stopwatch_mao1 = None +stopwatch_label_ms = None +stopwatch_reset_img = None +stopwatch_reset_imgbtn = None +stopwatch_start_img = None +stopwatch_start_imgbtn = None +stopwatch_stop_img = None +class StopwatchScreen(Screen): + NAME = "stopwatch" + + def __init__(self): + super().__init__() + self.meta = None + self.ms_value = 0 + self.sec_value = 0 + self.min_value = 0 + self.s_state = 0 + self.total_time = 0 + self.TimeSecond = 0 + self.timer = osTimer() + + def initialization(self): + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + if stopwatch_screen == None : + stopwatch_screen = lv.obj() + print("stopwatch_screen") + stopwatch_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun_btn(e,1)), lv.EVENT.GESTURE, None) + + stopwatch_title = lv.label(stopwatch_screen) + stopwatch_title.set_pos(0, 20) + stopwatch_title.set_size(LCD_SIZE_W, 20) + stopwatch_title.set_text("秒表") + stopwatch_title.set_long_mode(lv.label.LONG.WRAP) + stopwatch_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + stopwatch_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + stopwatch_label_min = lv.label(stopwatch_screen) + stopwatch_label_min.set_pos(40, 140) + stopwatch_label_min.set_size(60, 30) + stopwatch_label_min.set_text("00") + stopwatch_label_min.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_label_min.set_long_mode(lv.label.LONG.WRAP) + stopwatch_label_min.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + stopwatch_mao = lv.label(stopwatch_screen) + stopwatch_mao.set_pos(92, 138) + stopwatch_mao.set_size(30, 30) + stopwatch_mao.set_text(":") + stopwatch_mao.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_mao.set_long_mode(lv.label.LONG.WRAP) + stopwatch_mao.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + + stopwatch_label_sec = lv.label(stopwatch_screen) + stopwatch_label_sec.set_pos(105, 140) + stopwatch_label_sec.set_size(60, 30) + stopwatch_label_sec.set_text("00") + stopwatch_label_sec.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_label_sec.set_long_mode(lv.label.LONG.WRAP) + stopwatch_label_sec.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + stopwatch_mao1 = lv.label(stopwatch_screen) + stopwatch_mao1.set_pos(156, 138) + stopwatch_mao1.set_size(30, 30) + stopwatch_mao1.set_text(".") + stopwatch_mao1.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_mao1.set_long_mode(lv.label.LONG.WRAP) + stopwatch_mao1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + + stopwatch_label_ms = lv.label(stopwatch_screen) + stopwatch_label_ms.set_pos(170, 140) + stopwatch_label_ms.set_size(60, 30) + stopwatch_label_ms.set_text("0") + stopwatch_label_ms.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_label_ms.set_long_mode(lv.label.LONG.WRAP) + stopwatch_label_ms.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) + + + + + stopwatch_reset_img = lv.img(stopwatch_screen) + stopwatch_reset_img.set_size(99, 36) + stopwatch_reset_img.set_src("U:/static/stopwatch_reset.png") + stopwatch_reset_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_reset_img.set_pos(15, 210) + + stopwatch_reset_imgbtn = lv.img(stopwatch_screen) + stopwatch_reset_imgbtn.set_size(99, 76) + stopwatch_reset_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + stopwatch_reset_imgbtn.set_pos(15, 190) + + + stopwatch_start_img = lv.img(stopwatch_screen) + stopwatch_start_img.set_size(99, 36) + stopwatch_start_img.set_src("U:/static/stopwatch_play.png") + stopwatch_start_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_start_img.set_pos(120, 210) + + + stopwatch_start_imgbtn = lv.img(stopwatch_screen) + stopwatch_start_imgbtn.set_size(99, 76) + stopwatch_start_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) + stopwatch_start_imgbtn.set_pos(120, 190) + + + stopwatch_stop_img = lv.img(stopwatch_screen) + stopwatch_stop_img.set_size(99, 36) + stopwatch_stop_img.set_src("U:/static/stopwatch_stop.png") + stopwatch_stop_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + stopwatch_stop_img.set_pos(120, 210) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + stopwatch_start_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_btn(e,2)), + lv.EVENT.SHORT_CLICKED, None) + + stopwatch_reset_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun_btn(e,3)), + lv.EVENT.SHORT_CLICKED, None) + self.meta = stopwatch_screen + + if self.s_state == 0: + self.reset(0) + if self.s_state == 1: + date_tmp = utime.localtime() + timeSecond = utime.mktime(date_tmp) + reduce = timeSecond - self.TimeSecond + self.total_time = self.total_time+reduce + if self.total_time >= 99*60: + self.total_time = 99*60 + self.ms_value = 0 + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + self.show_value() + else: + self.timer.start(100,1,self._fun) + + + def paused(self): + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + print("stopwatch pause") + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + self.timer.stop() + self.show_value() + + def reset(self,e): + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + print("stopwatch reset") + + self.sec_value = 0 + self.min_value = 0 + self.ms_value = 0 + self.s_state = 0 + self.total_time = 0 + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + self.timer.stop() + self.show_value() + + def fun_btn(self, e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + if self.s_state == 0: + self.timer.stop() + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + print("stopwatch start:{}".format(self.s_state)) + #self.timer.start(100, 1, self._fun) + + if self.s_state == 1: + self.s_state = 2 + self.paused() + elif self.s_state == 2: + self.s_state = 1 + if self.s_state != 2: + self.s_state = 1 + if self.total_time >= 99*60: + self.ms_value = 0 + self.sec_value = 0 + self.min_value = 0 + self.total_time = 0 + self.show_value() + self.timer.start(100,1,self._fun) + stopwatch_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_start_img.add_flag(lv.obj.FLAG.HIDDEN) + # print("ms_value start:{} {} {}".format(self.ms_value,self.sec_value,self.min_value)) + pass + elif msg == 3: + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + print("stopwatch reset") + self.timer.stop() + self.sec_value = 0 + self.min_value = 0 + self.ms_value = 0 + self.s_state = 0 + self.total_time = 0 + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + + self.show_value() + pass + + + def _fun(self,e): + if self.s_state != 0: + self.ms_value += 1 + if self.ms_value > 9: + self.ms_value = 0 + self.sec_value += 1 + self.total_time+=1 + if self.sec_value > 59: + self.sec_value = 0 + if self.total_time > 99*60: + self.total_time = 99*60 + self.timer.stop() + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + + self.show_value() + + def show_value(self): + global stopwatch_screen,stopwatch_title,stopwatch_label_min,stopwatch_mao,stopwatch_label_sec ,\ + stopwatch_mao1 ,stopwatch_label_ms,stopwatch_reset_img ,stopwatch_reset_imgbtn ,stopwatch_start_img ,\ + stopwatch_start_imgbtn, stopwatch_stop_img + if self.total_time >= 99*60: + self.total_time = 99*60 + test_s = self.total_time % 60 + test_m = self.total_time//60 + # print("test_s:{} test_m:{} self.total_time:{}".format(test_s,test_m,self.total_time)) + + stopwatch_label_ms.set_text(str("%d"%(self.ms_value))) + stopwatch_label_sec.set_text(str("%02d"%(test_s))) + stopwatch_label_min.set_text(str("%02d"%(test_m))) + + def Close(self): + if self.s_state == 1: + self.timer.stop() + date_tmp = utime.localtime() + self.TimeSecond = utime.mktime(date_tmp) + + def lcd_on(self): + if self.s_state == 1: + date_tmp = utime.localtime() + timeSecond = utime.mktime(date_tmp) + reduce = timeSecond - self.TimeSecond + self.total_time = self.total_time+reduce + total = self.total_time // 60 + if total >= 99: + self.total_time = 99*60 + self.timer.stop() + self.s_state = 0 + self.ms_value = 0 + stopwatch_start_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_stop_img.add_flag(lv.obj.FLAG.HIDDEN) + self.show_value() + else: + + print("stopwatch reset start:{}".format(self.s_state)) + #self.timer.start(100, 1, self._fun) + self.show_value() + self.timer.start(100,1,self._fun) + stopwatch_stop_img.clear_flag(lv.obj.FLAG.HIDDEN) + stopwatch_start_img.add_flag(lv.obj.FLAG.HIDDEN) + # print("ms_value start:{} {} {}".format(self.ms_value,self.sec_value,self.min_value)) + + pass + + def lcd_off(self): + if self.s_state == 1: + date_tmp = utime.localtime() + timeSecond = utime.mktime(date_tmp) + self.TimeSecond = timeSecond + self.timer.stop() + pass + + def done_return(self): + if self.s_state == 0: + self.timer.stop() + EventMesh.publish("return_prev_screen") + + + + def btn1_release(self): + if self.s_state == 0: + self.timer.stop() + EventMesh.publish("load_screen", {"screen": "toolbox"}) + + # def done_left_to_right(self): + # if self.s_state == 0: + # self.timer.stop() + + # EventMesh.publish("return_prev_screen") + + def btn8_press(self): + if self.s_state == 0: + self.timer.stop() + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +FIND_screen = None +watchface_mpsignal_img = None +class UIFINDScreen(Screen): + NAME = "FIND" + def __init__(self): + super().__init__() + self.aud = audio.Audio(0) + # self.aud.setVolume(self.volum_size) + self.FIND_timer = osTimer() + self.FIND_timer_count = 0 + + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global FIND_screen ,watchface_mpsignal_img + + if FIND_screen == None: + FIND_screen = lv.obj() + print("FIND_screen") + FIND_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + FIND_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + watchface_mpsignal_img = lv.img(FIND_screen) + watchface_mpsignal_img.set_pos(int(40),int(27)) + watchface_mpsignal_img.set_size(160,230) + watchface_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + watchface_mpsignal_img.add_flag(lv.obj.FLAG.CLICKABLE) + watchface_mpsignal_img.set_src("U:/static/find_phone.png") + watchface_mpsignal_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + self.meta = FIND_screen + + + def post_processor_after_initialization(self): + utime.sleep_ms(200)#不加延时会切屏 + self.FIND_timer_count = 0 + print("self.FIND_timer_count:{}".format(self.FIND_timer_count)) + EventMesh.publish("set_motor_time",[1,2,8*10,8,4])#设置马达参数 + self.FIND_timer.start(3000, 1, self.FIND_timer_cb) + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') #播放声音 + + def FIND_timer_cb(self, *args): + EventMesh.publish("system_sleep_rest") + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') + self.FIND_timer_count += 1 + if self.FIND_timer_count > 20: #120秒 + self.stop_FIND() + + def stop_FIND(self) : + self.FIND_timer.stop() + self.aud.stop() #播放声音 + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + EventMesh.publish("return_prev_screen") + + def Close(self): + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + self.FIND_timer.stop() + self.aud.stop() #播放声音 + + + + def done_return(self): + self.stop_FIND() + + def done_click(self): + self.stop_FIND() + + + def btn1_release(self): + self.stop_FIND() + + def done_left_to_right(self): + self.stop_FIND() + + def done_right_to_left(self): + self.stop_FIND() + def done_bottom_to_top(self): + self.stop_FIND() + + def done_top_to_bottom(self): + self.stop_FIND() + + def btn8_press(self): + self.stop_FIND() + +Lowpower_screen = None +Lowpower_screen_img = None +class LowPowerScreen(Screen): + NAME = "LOW_POWER" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + + def initialization(self): + global Lowpower_screen ,Lowpower_screen_img + if Lowpower_screen == None : + Lowpower_screen = lv.obj() + print("Lowpower_screen") + Lowpower_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + Lowpower_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + Lowpower_screen_img = lv.img(Lowpower_screen) + Lowpower_screen_img.set_pos(int(40),int(27)) + Lowpower_screen_img.set_size(160,230) + Lowpower_screen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + Lowpower_screen_img.add_flag(lv.obj.FLAG.CLICKABLE) + Lowpower_screen_img.set_src("U:/static/low_power.png") + Lowpower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + self.meta = Lowpower_screen + + + def done_return(self): + EventMesh.publish("return_prev_screen") + def done_click(self): + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +LowOnePower_screen = None +LowOnePower_screen_img = None +LowOnePower_screen_label2 = None +LowOnePower_screen_label1 = None +class LowOnePowerScreen(Screen): #0%的电池电量 + NAME = "LOW_ONE_POWER" + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + self.meta_type = "popup" + + def initialization(self): + global LowOnePower_screen ,LowOnePower_screen_img ,LowOnePower_screen_label2,LowOnePower_screen_label1 + if LowOnePower_screen == None : + LowOnePower_screen = lv.obj() + print("LowOnePower_screen") + LowOnePower_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + LowOnePower_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + LowOnePower_screen_img = lv.img(LowOnePower_screen) + LowOnePower_screen_img.set_pos(int(86),int(20)) + LowOnePower_screen_img.set_size(68,110) + LowOnePower_screen_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + LowOnePower_screen_img.add_flag(lv.obj.FLAG.CLICKABLE) + LowOnePower_screen_img.set_src("U:/static/0_BAT.png") + LowOnePower_screen_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + + LowOnePower_screen_label1 = lv.label(LowOnePower_screen) + LowOnePower_screen_label1.set_pos(0, 150) + LowOnePower_screen_label1.set_size(LCD_SIZE_W, 60) + LowOnePower_screen_label1.set_text("电池电量过低,请及时充电") + LowOnePower_screen_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + LowOnePower_screen_label1.set_long_mode(lv.label.LONG.WRAP) + LowOnePower_screen_label1.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + LowOnePower_screen_label2 = lv.label(LowOnePower_screen) + LowOnePower_screen_label2.set_pos(0, 220) + LowOnePower_screen_label2.set_size(LCD_SIZE_W, 60) + LowOnePower_screen_label2.set_text("继续使用,5s过后强制关机") + LowOnePower_screen_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + LowOnePower_screen_label2.set_long_mode(lv.label.LONG.WRAP) + LowOnePower_screen_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + self.meta = LowOnePower_screen + + def post_processor_after_initialization(self): + self.timer.start(5000,0,self.fun) + + def fun(self,e): + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + + def done_click(self): + EventMesh.publish("return_prev_screen") + def btn1_release(self): + EventMesh.publish("return_prev_screen") + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + +sos_screen = None +sos_screen_label = None +sos_screen_label_p = None + +#sos求组提示界面 +class sosScreen(Screen): + NAME = "SOS_POPUP" + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + self.meta_type = "popup" + self.count = 0 + self.is_sliding =0 + + def initialization(self): + global sos_screen ,sos_screen_label + self.is_sliding =0 + if sos_screen == None : + sos_screen = lv.obj() + print("SOS_POPUP") + sos_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + sos_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + + sos_screen_label = lv.label(sos_screen) + sos_screen_label.set_pos(0, 20) + sos_screen_label.set_size(LCD_SIZE_W, 30) + sos_screen_label.set_text("SOS") + sos_screen_label.add_style(style_font_youyuan_20_red, lv.PART.MAIN | lv.STATE.DEFAULT) + sos_screen_label.set_long_mode(lv.label.LONG.WRAP) + sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + + sos_screen_label = lv.label(sos_screen) + sos_screen_label.set_text("是否拨打求助电话?") + sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + sos_screen_label.set_size(LCD_SIZE_W, 50) + sos_screen_label.set_pos(0,65) + sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + sos_screen_label = lv.label(sos_screen) + sos_screen_label.set_text("无操作10s后\n自动拨打") + sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + sos_screen_label.set_size(LCD_SIZE_W, 50) + sos_screen_label.set_pos(0,100) + sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + sos_screen_confirm_img = lv.img(sos_screen) + sos_screen_confirm_img.set_size(176, 46) + sos_screen_confirm_img.set_pos(32, 170) + sos_screen_confirm_img.set_src("U:/static/off_icon.png") + sos_screen_confirm_img.add_flag(lv.obj.FLAG.CLICKABLE) + sos_screen_confirm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + sos_screen_confirm_label = lv.label(sos_screen_confirm_img) + sos_screen_confirm_label.set_text("确定") + sos_screen_confirm_label.align(lv.ALIGN.CENTER, 0, 5) + sos_screen_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + sos_screen_return = lv.img(sos_screen) + sos_screen_return.set_size(176, 46) + sos_screen_return.set_pos(32, 230) + sos_screen_return.set_src("U:/static/cancel_icon.png") + sos_screen_return.add_flag(lv.obj.FLAG.CLICKABLE) + sos_screen_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + sos_screen_return_label = lv.label(sos_screen_return) + sos_screen_return_label.set_text("取消") + sos_screen_return_label.align(lv.ALIGN.CENTER, 0, 5) + sos_screen_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + sos_screen_return_label.set_ext_click_area(20) + + self.meta = sos_screen + sos_screen_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_comfirm_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + + sos_screen_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_cancel_cb(e)), + lv.EVENT.SHORT_CLICKED, None) + sos_screen_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_comfirm_cb(e)), + lv.EVENT.PRESSING, None) + + sos_screen_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.timer_cancel_cb(e)), + lv.EVENT.PRESSING, None) + + def timer_comfirm_cb(self,e): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding =0 + EventMesh.publish("set_sos_flag", 1) + print("2self.is_sliding",self.is_sliding) + + self.is_sliding =0 + + + def timer_cancel_cb(self,e): + EventMesh.publish("return_prev_screen") + + def post_processor_before_initialization(self): + self.count = 0 + self.timer.start(1000,1,self.timer_cb_onescond) + + def timer_cb_onescond(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count >= 10: + self.count = 0 + self.timer.stop() + EventMesh.publish("set_sos_flag", 1) + + def Close(self): + self.timer.stop() + + + def done_return(self): + EventMesh.publish("return_prev_screen") + pass + def done_click(self): + #EventMesh.publish("return_prev_screen") + pass + + def btn8_press(self): + + pass + def btn1_press(self): + EventMesh.publish("return_prev_screen") + pass + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + pass + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + pass + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + pass + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + pass + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + pass + + +no_sos_screen = None +no_sos_screen_label = None + +#没有设置紧急联系人的号码 +class noSosDataScreen(Screen): + NAME = "NO_SOS_POPUP" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.count = 0 + self.timer = osTimer() + + def initialization(self): + global no_sos_screen ,no_sos_screen_label + if no_sos_screen == None : + no_sos_screen = lv.obj() + print("NO_SOS_POPUP") + no_sos_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + no_sos_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + + no_sos_screen_label = lv.label(no_sos_screen) + no_sos_screen_label.set_pos(0, 110) + no_sos_screen_label.set_size(LCD_SIZE_W, 80) + no_sos_screen_label.set_text("请在手机app上设置\n紧急联系人号码") + no_sos_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + no_sos_screen_label.set_long_mode(lv.label.LONG.WRAP) + no_sos_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + + self.meta = no_sos_screen + def post_processor_before_initialization(self): + self.count = 0 + self.timer.start(1000,1,self.timer_cb_onescond) + + def Close(self): + self.timer.stop() + + def timer_cb_onescond(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count >= 10: + self.count = 0 + EventMesh.publish("return_prev_screen") + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + pass + def done_click(self): + EventMesh.publish("return_prev_screen") + pass + + def btn8_press(self): + + pass + def btn1_press(self): + EventMesh.publish("return_prev_screen") + pass + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + pass + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + pass + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + pass + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + pass + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + pass + + + + +system_init_screen = None +system_init_label = None +class SystemInitScreen(Screen): + #系统初始化中... + NAME = "system_init" + + def __init__(self): + super().__init__() + self.meta = None + self.system_init_timer=osTimer() + self.system_init_timer_count = 0 + + def initialization(self): + global system_init_screen ,system_init_label + if system_init_screen == None: + system_init_screen = lv.obj() + print("Lowpower_screen") + system_init_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + system_init_label = lv.label(system_init_screen) + system_init_label.set_pos(0, (LCD_SIZE_H//2)-10) + system_init_label.set_size(LCD_SIZE_W, 40) + system_init_label.set_text("系统初始化中") + system_init_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + system_init_label.set_long_mode(lv.label.LONG.WRAP) + system_init_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + self.meta = system_init_screen + self.system_init_timer_count = 0 + self.system_init_timer.start(1000, 1, self.system_init_timer_cb) + + def system_init_timer_cb(self, *args): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.system_init_timer_count += 1 + if self.system_init_timer_count > 4: + self.system_init_timer_count = 1 + if system_init_screen != None: + + system_init_label_str = "系统初始化中" + if self.system_init_timer_count == 1: + system_init_label.set_text("系统初始化中.") + elif self.system_init_timer_count == 2: + system_init_label.set_text("系统初始化中..") + elif self.system_init_timer_count == 3: + system_init_label.set_text("系统初始化中...") + else: + system_init_label.set_text("系统初始化中....") + + def Close(self): + self.system_init_timer.stop() + +charge_in_screen = None +charge_in_screen_label = None + +#正在充电 +class chargeInScreen(Screen): + NAME = "charge_in" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.count = 0 + self.timer = osTimer() + + def initialization(self): + global charge_in_screen ,charge_in_screen_label + if charge_in_screen == None : + charge_in_screen = lv.obj() + print("charge_in_screen") + charge_in_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + charge_in_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + + charge_in_screen_label = lv.label(charge_in_screen) + charge_in_screen_label.set_pos(0, (LCD_SIZE_H//2)-10) + charge_in_screen_label.set_size(LCD_SIZE_W, 20) + charge_in_screen_label.set_text(" ") + charge_in_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + charge_in_screen_label.set_long_mode(lv.label.LONG.WRAP) + charge_in_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + + self.meta = charge_in_screen + + + def post_processor_after_initialization(self): + global charge_in_screen_label + self.count = 0 + self.timer.start(1000,1,self.timer_cb_onescond) + charge_in_screen_label.set_text("正在充电") + + def Close(self): + self.timer.stop() + + def timer_cb_onescond(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count >= 5: + self.count = 0 + EventMesh.publish("return_prev_screen") + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + pass + def done_click(self): + EventMesh.publish("return_prev_screen") + pass + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + pass + def btn1_press(self): + EventMesh.publish("return_prev_screen") + pass + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + pass + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + pass + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + pass + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + pass + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + pass + + +charge_out_screen = None +charge_out_screen_label = None + +#充电已移出 +class chargeOutScreen(Screen): + NAME = "charge_out" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.count = 0 + self.timer = osTimer() + + + def initialization(self): + global charge_out_screen ,charge_out_screen_label + if charge_out_screen == None : + charge_out_screen = lv.obj() + print("charge_out_screen") + charge_out_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + charge_out_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + + charge_out_screen_label = lv.label(charge_out_screen) + charge_out_screen_label.set_pos(0, (LCD_SIZE_H//2)-10) + charge_out_screen_label.set_size(LCD_SIZE_W, 20) + charge_out_screen_label.set_text(" ") + charge_out_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + charge_out_screen_label.set_long_mode(lv.label.LONG.WRAP) + charge_out_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + self.meta = charge_out_screen + + + + def post_processor_after_initialization(self): + global charge_out_screen_label + self.count = 0 + self.timer.start(1000,1,self.timer_cb_onescond) + charge_out_screen_label.set_text("充电已移出") + + def Close(self): + self.timer.stop() + + def timer_cb_onescond(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.count+=1 + if self.count >= 5: + self.count = 0 + EventMesh.publish("return_prev_screen") + + + + def done_return(self): + EventMesh.publish("return_prev_screen") + pass + def done_click(self): + EventMesh.publish("return_prev_screen") + pass + + def btn8_press(self): + EventMesh.publish("return_prev_screen") + pass + def btn1_press(self): + EventMesh.publish("return_prev_screen") + pass + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + pass + def done_right_to_left(self): + EventMesh.publish("return_prev_screen") + pass + def done_bottom_to_top(self): + EventMesh.publish("return_prev_screen") + pass + def done_top_to_bottom(self): + EventMesh.publish("return_prev_screen") + pass + + def btn1_release(self): + EventMesh.publish("return_prev_screen") + pass +rrestor_confirm_n_screen = None +rrestor_confirm_n_screen_label = None + +#正在充电 +class restore_confirmScreen(Screen): + NAME = "restore_confirm" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.count = 0 + self.timer1 = osTimer() + self.timer2 = osTimer() + self.timer3 = osTimer() + + EventMesh.subscribe("app_factory_cb",self.app_factory_cb) + + def initialization(self): + global rrestor_confirm_n_screen ,rrestor_confirm_n_screen_label + if rrestor_confirm_n_screen == None : + rrestor_confirm_n_screen = lv.obj() + print("rrestor_confirm_n_screen") + rrestor_confirm_n_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + rrestor_confirm_n_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + #进入图片 + + rrestor_confirm_n_screen_label = lv.label(rrestor_confirm_n_screen) + rrestor_confirm_n_screen_label.set_pos(0, (LCD_SIZE_H//2)-10) + rrestor_confirm_n_screen_label.set_size(LCD_SIZE_W, 60) + rrestor_confirm_n_screen_label.set_text("正在恢复出厂中\n请稍等...") + rrestor_confirm_n_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + rrestor_confirm_n_screen_label.set_long_mode(lv.label.LONG.WRAP) + rrestor_confirm_n_screen_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + + + self.meta = rrestor_confirm_n_screen + self.timer1.start(1000,1,self.timer_cb_onescond) + + ret = 0 + ret = ql_fs.path_exists("/usr/static/storage_file")#电话本 + if ret == True: + ql_fs.rmdirs("/usr/static/storage_file") + ql_fs.mkdirs("/usr/static/storage_file") + EventMesh.publish("alipay_unbind") + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂 + EventMesh.publish(constants.PROTOCOL.DLT_SEND) + self.timer2.start(4000,0,self.timer_cb_threescond) + + def app_factory_cb(self,event,msg): + ret = 0 + ret = ql_fs.path_exists("/usr/static/storage_file")#电话本 + if ret == True: + ql_fs.rmdirs("/usr/static/storage_file") + ql_fs.mkdirs("/usr/static/storage_file") + EventMesh.publish("alipay_unbind") + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#已连接服务器发指令恢复出厂 + EventMesh.publish(constants.PROTOCOL.DLT_SEND) + self.timer3.start(4000,0,self.timer_cb_threescond) + pass + + def Close(self): + self.timer1.stop() + self.timer2.stop() + + def timer_cb_threescond(self,e): + + Power.powerRestart() + + def timer_cb_onescond(self,e): + EventMesh.publish("system_sleep_rest")#防止黑屏 + + + def done_left_to_right(self): + pass + def done_right_to_left(self): + pass + def done_bottom_to_top(self): + pass + def done_top_to_bottom(self): + pass + def done_return(self): + pass + def done_click(self): + pass + + def btn8_press(self): + pass + def btn1_press(self): + pass + def btn1_release(self): + pass + +style_font_youyuan_70_red = lv.style_t() +style_font_youyuan_70_red.init() +style_font_youyuan_70_red.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_70_red.set_text_font(lv.K01_font_30_DIAL) + +class_mgr_popup_screen = None +class_mgr_popup_label = None +class_mgr_popup_time1_text = None +class classMgrPopupScreen(Screen):#上课禁用时间界面 + #上课禁用 + NAME = "class_time" + + def __init__(self): + super().__init__() + self.meta = None + self.timer = osTimer() + def initialization(self): + global class_mgr_popup_screen ,class_mgr_popup_label ,class_mgr_popup_time1_text + if class_mgr_popup_screen == None: + class_mgr_popup_screen = lv.obj() + print("Lowpower_screen") + class_mgr_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + + class_mgr_popup_time1_text = lv.label(class_mgr_popup_screen) + class_mgr_popup_time1_text.set_pos(0, 10) + class_mgr_popup_time1_text.set_size(LCD_SIZE_W, 80) + class_mgr_popup_time1_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + class_mgr_popup_time1_text.set_text(" ") + class_mgr_popup_time1_text.add_style(style_font_youyuan_70_red, lv.PART.MAIN|lv.STATE.DEFAULT) + + class_mgr_popup_label = lv.label(class_mgr_popup_screen) + class_mgr_popup_label.set_pos(0, 120) + class_mgr_popup_label.set_size(LCD_SIZE_W, 50) + class_mgr_popup_label.set_text("现在是上课时间点,禁用手表功能") + class_mgr_popup_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + class_mgr_popup_label.set_long_mode(lv.label.LONG.WRAP) + class_mgr_popup_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) + self.meta = class_mgr_popup_screen + + sos_flag = EventMesh.publish("get_sos_flag") + if sos_flag == 1: + EventMesh.publish("set_sos_flag",0) + EventMesh.publish("set_sos_num",0) + EventMesh.publish("close_sos_timer") + EventMesh.publish("set_hangup_mode",0) + data = RTC().datetime() + hour = data[4] + min = data[5] + class_mgr_popup_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) + self.timer.start(1*1000,1,self.fun) + + def lcd_on(self): + self.timer.start(1*1000,1,self.fun) + + def lcd_off(self): + self.timer.stop() + + def fun(self,*argc): + global class_mgr_popup_time1_text + data = RTC().datetime() + hour = data[4] + min = data[5] + class_mgr_popup_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) + + + def btn1_release(self): + state = EventMesh.publish("get_cur_class_time_state") + print("state:{}".format(state)) + if state != None: + if state == 0: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + return + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + + def btn8_press(self): + state = EventMesh.publish("get_cur_class_time_state") + print("state:{}".format(state)) + if state != None: + if state == 0: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + return + flag = EventMesh.publish("get_lcd_state") + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + + +sos_recv_screen = None +sos_recv_screen_label = None +sos_recv_screen_comfirm =None +sos_recv_screen_label2 = None +sos_recv_screen_label2_btn =None +sos_recv_new_screen = None + +style_cont_sos = lv.style_t() +style_cont_sos.init() +style_cont_sos.set_bg_color(lv.color_make(0x23, 0xc1,0xbb)) +style_cont_sos.set_radius(20) +style_cont_sos.set_pad_left(0) +style_cont_sos.set_pad_right(0) +style_cont_sos.set_pad_top(0) +style_cont_sos.set_pad_bottom(0) + +class sosrecvScreen(Screen):#设备接收平台发送的 + NAME = "sos_rev" + def __init__(self): + super().__init__() + self.meta = None + self.meta_type = "popup" + self.timer = osTimer() + self.timer1 = osTimer() + self.count = 0 + self.sos_state = 0 + self.aud = audio.Audio(0) + EventMesh.subscribe("close_sos_timer",self.close_sos_timer) + + EventMesh.subscribe("update_sos_show",self.update_sos_show) + + def initialization(self): + self.aud.setVolume(11)#设置最大声录音 + self.count = 0 + self.sos_state = 1 + EventMesh.publish("set_UI_high_priority",1) + global sos_recv_screen,sos_recv_screen_label,sos_recv_new_screen,sos_recv_screen_label2,sos_recv_screen_comfirm,sos_recv_screen_label2_btn + if sos_recv_screen == None : + sos_recv_screen = lv.obj() + print("sos_recv_screen") + sos_recv_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + sos_recv_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + + sos_recv_new_screen = lv.obj(sos_recv_screen) + sos_recv_new_screen.set_size(240,200) + sos_recv_new_screen.set_pos(0,10) + print("sos_recv_new_screen") + sos_recv_new_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + sos_recv_new_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + + sos_recv_new_btn_screen = lv.obj(sos_recv_screen) + sos_recv_new_btn_screen.set_size(240,62) + sos_recv_new_btn_screen.set_pos(0,220) + print("sos_recv_new_screen") + sos_recv_new_btn_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + # add style for watchface + sos_recv_new_btn_screen.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + # + sos_recv_screen_label = lv.label(sos_recv_new_screen) + sos_recv_screen_label.set_size(235,lv.SIZE.CONTENT) + sos_recv_screen_label.set_pos(5,10) + sos_recv_screen_label.set_text(" ") + sos_recv_screen_label.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + + sos_recv_screen_comfirm = lv.btn(sos_recv_new_btn_screen) + sos_recv_screen_comfirm.set_size(200,46) + sos_recv_screen_comfirm.set_pos(20,0) + sos_recv_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) + sos_recv_screen_comfirm.add_style(style_cont_sos, lv.PART.MAIN | lv.STATE.DEFAULT) + + + # sos_recv_screen_comfirm = lv.img(sos_recv_new_btn_screen) + # sos_recv_screen_comfirm.set_size(176, 46) + # sos_recv_screen_comfirm.set_pos(32, 0) + # sos_recv_screen_comfirm.set_src("U:/static/off_icon.png") + # sos_recv_screen_comfirm.add_flag(lv.obj.FLAG.CLICKABLE) + # sos_recv_screen_comfirm.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + sos_recv_screen_label2 = lv.label(sos_recv_screen_comfirm) + sos_recv_screen_label2.set_text("确定") + sos_recv_screen_label2.align(lv.ALIGN.CENTER, 0, 5) + sos_recv_screen_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + sos_recv_screen_label2_btn = lv.label(sos_recv_new_btn_screen) + sos_recv_screen_label2_btn.set_text(" ") + sos_recv_screen_label2_btn.set_size(240, 62) + sos_recv_screen_label2_btn.set_pos(0, 0) + sos_recv_screen_label2_btn.add_flag(lv.obj.FLAG.CLICKABLE) + # sos_recv_screen_label2_btn.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + + self.meta = sos_recv_screen + sos_recv_screen_label2_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), + lv.EVENT.SHORT_CLICKED, None) + sos_recv_screen_comfirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)), + lv.EVENT.SHORT_CLICKED, None) + # print("sos recv self.meta_info",self.meta_info) + # self.meta_info = "需要你的帮助,是好滴还是我hi海带丝电池给谁是是是hi都会死好滴你的还是1hi的hi收到hi都会死hi换货地址好ID号i海底火山hi大海hi属地化似乎机顶盒试试几点合适试试是是是" + + sos_message = EventMesh.publish("get_sos_message") + if sos_message != None: + if len(str(sos_message)) != 0: + sos_recv_screen_label.set_text("{}".format(sos_message)) + else: + sos_recv_screen_label.set_text(" ") + else: + sos_recv_screen_label.set_text(" ") + + EventMesh.publish("set_motor_time",[1,2,10*10,10,5])#设置马达参数 + self.aud.stop()# + self.aud.play(1, 1, '/ext/static/SOS_PLAY.mp3') #文件名前面要加上路径 + self.timer.start(1*1000,1,self.motor_cb) + + def close_sos_timer(self,event,msg): + self.aud.stop()# + self.timer.stop() + + + def confirm(self,e): + self.sos_state = 0 + self.timer.stop() + + EventMesh.publish(constants.PROTOCOL.MESSAGE_SOS_SEND) + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("return_prev_screen") + + + def motor_cb(self,*argc): + EventMesh.publish("system_sleep_rest")#防止黑屏 + if EventMesh.publish("get_audio_state") == 0: + self.aud.stop()# + self.aud.play(1, 1, '/ext/static/SOS_PLAY.mp3') + + self.count+=1 + if self.count >= 7: + self.count = 0 + EventMesh.publish("set_motor_time",[1,2,10*10,10,5])#设置马达参数 + + def update_sos_show(self,event,msg): + global sos_recv_screen_label,sos_recv_new_screen + if sos_recv_screen_label == None: + return + if len(str(msg)) != 0: + sos_recv_new_screen.scroll_to(0, 0, lv.ANIM.OFF)#每次更新的时候就从头显示 + sos_recv_screen_label.set_text("{}".format(msg)) + else: + sos_recv_new_screen.scroll_to(0, 0, lv.ANIM.OFF) + sos_recv_screen_label.set_text(" ") + pass + + def Close(self): + + self.aud.stop()# + num = EventMesh.publish("get_volum_size") + if num == None: + num = 8 + self.aud.setVolume(num)#恢复原始音量 + EventMesh.publish("set_UI_high_priority",0) + self.timer.stop() + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + + def done_return(self): + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("return_prev_screen") + + def btn1_release(self): + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("return_prev_screen") + + def btn8_press(self): + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + +#from usr.ui_WatchFaceScreen import WatchFaceScreen +class UI(object): + def __init__(self): + #self.screen = WatchFaceScreen() + #self.screen_old = self.screen + self.ui_queue = Queue() + _thread.stack_size(13*1024) + _thread.start_new_thread(self.ui_queue_thread, ()) + _thread.stack_size(8*1024) + self.screen = None + self.screen_old = None + self.screen_prev = None + self.screen_prev_new = None + self.screen_last = None + self.screen_list = [] + self.lv = lv + self.system_sleep_timer = osTimer() + self.system_ui_timer = osTimer() + self.system_sleep_timer_count = 0 + self.sleep_flag = 1 + self.level = 6 + self.aud = audio.Audio(0) + self.system_ui_state = 0 + self.main_flag = 0 + self.main_id = 0 + self.set_interrup_flag = 0 + self.UI_high_priority_flag = 0 #如果=1,则当前ui不被打断 + self.page_id = ["main_menu"] + self.page_count = 0 + self.level = EventMesh.publish("get_storage_config","brightness_level") + + + if self.level == None: + self.level = 6 + self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, self.level*100, 1000) + self.PWM_backlight.open() + self.sleep_lock = 0 + + def post_processor_after_instantiation(self): + EventMesh.subscribe("load_screen", self.load_screen_cb) + + EventMesh.subscribe("btn1_press", self.btn_press) + EventMesh.subscribe("btn8_press", self.btn_press) + EventMesh.subscribe("btn8_long_press", self.btn_press) + + EventMesh.subscribe("btn1_release", self.btn_release) + EventMesh.subscribe("btn8_release", self.btn_release) + + EventMesh.subscribe("done_left_to_right", self.ui_press) + EventMesh.subscribe("done_right_to_left", self.ui_press) + EventMesh.subscribe("done_bottom_to_top", self.ui_press) + EventMesh.subscribe("done_top_to_bottom", self.ui_press) + EventMesh.subscribe("done_return", self.ui_press) + EventMesh.subscribe("done_click", self.ui_press) + EventMesh.subscribe("done_error", self.ui_press) + EventMesh.subscribe("done_press", self.ui_press) + EventMesh.subscribe("done_DOWN", self.ui_press) + EventMesh.subscribe("done_UP", self.ui_press) + EventMesh.subscribe("call_in", self.publish_call_in) + + EventMesh.subscribe("get_lcd_state", self.get_lcd_state) + EventMesh.subscribe("set_lcd_state", self.set_lcd_state) + + #EventMesh.subscribe("call_in", self.publish_call_in) + #EventMesh.subscribe("set_bg_img", self.set_bg_img) + + EventMesh.subscribe(constants.EVENT.SYSTEM_SLEEP, self.system_sleep) + EventMesh.subscribe(constants.EVENT.SYSTEM_UP, self.system_up) + EventMesh.subscribe("system_sleep_rest", self.system_sleep_rest) + EventMesh.subscribe("set_UI_high_priority", self.set_UI_high_priority) + EventMesh.subscribe("get_UI_high_priority", self.get_UI_high_priority) + + EventMesh.subscribe("set_interrup_incall", self.set_interrup_incall) + EventMesh.subscribe("get_interrup_incall", self.get_interrup_incall) + EventMesh.subscribe("get_screen_NAME",self.get_screen_NAME) + EventMesh.subscribe("publish_message_event_ui",self.publish_message_event_ui) + EventMesh.subscribe("return_prev_screen",self.return_prev_screen) + + EventMesh.subscribe("del_prev_screen",self.del_prev_screen)#退出当前界面就删除当前界面 进去需要保存当前界面 + EventMesh.subscribe("add_new_screen",self.add_new_screen)#保存新的界面用作返回上一级 + + + self.system_sleep_timer.start(1000, 1, self.system_sleep_timer_cb) + + def publish_message_event_ui(self,event,msg): + self.ui_queue.put(msg) + + #ui的消息队列处理,防止内存越界 格式:{函数名,数据} + def ui_queue_thread(self): + while True: + data = self.ui_queue.get() + #print("ui_queue_thread:data = {}".format(data)) + if data != None: + try: + data["func"](data["data"]) + except Exception as e: + usys.print_exception(e) + print("ui_queue_thread:ERROR:{}".format(e)) + # for scr in self.screen_list: + # if scr.handle_message_event(data) == 1 : + # break + + def add_new_screen(self, event, msg): + if msg == "main_menu": + if self.page_count > 0: + self.page_id.clear()#清空所有 + self.page_count = 0 + self.page_id = ["main_menu"] + print("add_new_screen ",self.page_id,self.page_count) + else: + if self.page_count == None: + self.page_count = 0 + self.page_id.clear()#清空所有 + self.page_id = ["main_menu"] + last_screen = self.page_id[int(self.page_count)] + print("self.page_id",last_screen,msg,self.page_id,self.page_count) + if last_screen != msg and (msg in last_screen) == False: + self.page_count+=1 + page_pre = "{}".format(msg) + self.page_id.append(page_pre) + + def del_prev_screen(self, event, msg): + if self.page_count > 0: + # print("del_prev_screen self.page_id",self.page_id,self.page_count) + if self.screen.meta_type != "popup": + del self.page_id[int(self.page_count)] + self.page_count-=1 + + if self.page_count == 0: + self.page_id.clear()#清空所有 + self.page_id = ["main_menu"] + + if self.page_count == None: + self.page_count = 0 + self.page_id.clear()#清空所有 + self.page_id = ["main_menu"] + + def return_prev_screen(self, event, msg): + EventMesh.publish("del_prev_screen")#退出当前界面就删除当前界面 进去需要保存当前界面 + + pre_page = self.page_id[int(self.page_count)] + # print("pre_page:data = {} self.page_count:{}".format(pre_page,self.page_count)) + if len(pre_page) == 0:#预防是空的界面 + self.page_count = 0 + pre_page = "main_menu" + + if self.page_count == None: + self.page_count = 0 + + if self.page_count == 0: + pre_page = "main_menu" + if pre_page != None: + EventMesh.publish("load_screen", {"screen": pre_page}) + # if self.screen_prev.NAME != None: + # print("self.screen_prev.NAME:data = {} ".format(self.screen_prev.NAME)) + # EventMesh.publish("load_screen", {"screen": self.screen_prev.NAME}) + + def set_interrup_incall(self, event, msg): + self.set_interrup_flag = msg + + def get_interrup_incall(self, event, msg): + return self.set_interrup_flag + + def set_UI_high_priority(self, event, msg): + self.UI_high_priority_flag = msg + + def get_UI_high_priority(self, event, msg): + return self.UI_high_priority_flag + + def get_lcd_state(self, event, key): + return self.sleep_flag + + def set_lcd_state(self, event, key): + print("key_:{}".format(key)) + self.sleep_flag = key + + def system_sleep_rest(self, event, key): + #print("system_sleep_rest!!!!!") + self.system_sleep_timeout_rest() + + def ui_press(self, event, key): + EventMesh.publish("publish_message_event_ui",{"func":self.ui_press_do,"data":event}) + def ui_press_do(self, event): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME == "poweron" or screen_NAME == "system_init": + return + self.system_sleep_timeout_rest() + # print("ui press {} self.screen_old:{}".format(self.screen_prev,self.screen_old)) + # print("ui_press_do") + + if self.system_ui_state == 0: + if event == "done_left_to_right": + self.screen.done_left_to_right() + if event == "done_right_to_left": + self.screen.done_right_to_left() + if event == "done_bottom_to_top": + self.screen.done_bottom_to_top() + if event == "done_top_to_bottom": + self.screen.done_top_to_bottom() + if event == "done_return": + self.screen.done_return() + if event == "done_click": + self.screen.done_click() + if event == "done_DOWN": + self.screen.done_DOWN() + if event == "done_UP": + self.screen.done_UP() + # if event == "done_press": + # self.system_sleep_timeout_rest() + + def btn_press(self, event, key): + EventMesh.publish("publish_message_event_ui",{"func":self.btn_press_do,"data":event}) + def btn_press_do(self, event): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME == "poweron" or screen_NAME == "system_init": + return + print("btn_press: {}".format(event)) + #主表盘按电源键,息屏 + + #息屏状态按按钮都亮屏 + if self.main_flag != 1 and self.sleep_flag == 0: + if event == "btn8_long_press": + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + sos_number = EventMesh.publish("get_dial_sos_number") + if sos_number != None: + if len(sos_number) != 0: + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "SOS_POPUP": + EventMesh.publish("load_screen", {"screen": "SOS_POPUP"}) + else: + EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) + else: + EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) + else: + self.__lcd_on() + return + # if event == "btn1_press": + # self.screen.btn1_press() + # self.__lcd_on() + if event == "btn8_press": + self.screen.btn8_press() + if event == "btn8_long_press": + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + sos_number = EventMesh.publish("get_dial_sos_number") + if sos_number != None: + if len(sos_number) != 0: + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME != "SOS_POPUP": + EventMesh.publish("load_screen", {"screen": "SOS_POPUP"}) + else: + EventMesh.publish("load_screen", {"screen": "NO_SOS_POPUP"}) + else: + EventMesh.publish("load_screen", {"screen": "no_sim_power_screen"}) + + if event == "btn1_press": + self.screen.btn1_release() + + + def btn_release(self, event, msg): + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME == "poweron" or screen_NAME == "system_init": + return + print("btn_release: {}".format(event)) + # if self.main_flag != 1 and self.sleep_flag == 0: + # self.__lcd_on() + # return + # if event == "btn1_release": + + # self.screen.btn1_release() + + def __lcd_on(self): + self.system_sleep_timeout_rest() + if self.sleep_flag == 0 : + print("__lcd_on") + if self.sleep_lock == 1: + print("__lcd_on:sleep_lock:error!") + utime.sleep_ms(200) + self.sleep_lock = 1 + self.sleep_flag = 1 + + + #lcd_ctrl.write(1) + #utime.sleep(10) + self.screen.lcd_on() + self.system_sleep_timer.start(1000, 1, self.system_sleep_timer_cb) + EventMesh.publish("set_lcd_state",self.sleep_flag) + tp_cst816.resume() + lcd.lcd_display_on() + utime.sleep_ms(2) + lv.autoSleep(0) + pm.autosleep(0) + pm.sclkEx_set(0, 1, 5) + utime.sleep_ms(60) + self.level = EventMesh.publish("get_brightness_level") + if self.level == None: + self.level = 6 + elif self.level > 10: + self.level = 10 + elif self.level <= 0: + self.level = 1 + self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, self.level*100, 1000) + self.PWM_backlight.open() + self.sleep_lock = 0 + + + def publish_call_in(self, event, msg): + + EventMesh.publish("load_screen", {"screen": "dialing", "meta": msg}) + + def __lcd_off(self): + + if self.sleep_flag == 1 : + print("__lcd_off") + if self.sleep_lock == 1: + print("__lcd_on:sleep_lock:error!") + utime.sleep_ms(200) + self.sleep_lock = 1 + self.sleep_flag = 0 + self.PWM_backlight = PWM(PWM.PWM0, PWM.ABOVE_10US, 0, 1000) + self.PWM_backlight.open() + #lcd_ctrl.write(0) + # + lv.autoSleep(1) + pm.autosleep(1) + pm.sclkEx_set(1, 1, 5) + utime.sleep_ms(2) + tp_cst816.suspend() + lcd.lcd_display_off() + #utime.sleep_ms(80) + EventMesh.publish("set_lcd_state",self.sleep_flag) + self.sleep_lock = 0 + self.screen.lcd_off() + self.system_sleep_timer.stop() + EventMesh.publish("Hsensor_set_sleep") #让系统更快休眠 + + def system_sleep(self, event, msg) : + self.__lcd_off() + + def system_up(self, event, msg): + self.__lcd_on() + + def system_sleep_timer_cb(self, *args): + #print("system_sleep_timer_count:{}".format(self.system_sleep_timer_count)) + time = EventMesh.publish("get_brightness_time") + if time == None: + time = 10 + self.system_sleep_timer_count += 1 + if self.system_sleep_timer_count >= time : + self.system_sleep_timer_count = 0 + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if screen_NAME == "poweron": + return + self.__lcd_off() + + def system_ui_flag(self, *args): + # print("system_ui_flag") + self.system_ui_state = 0 + + + def system_sleep_timeout_rest(self) : + #print("system_sleep_timeout_rest") + self.system_sleep_timer_count = 0 + + def start(self): + #self.post_processor_after_instantiation() + pass + + def add_screen(self, screen): + try: + self.screen_list.append(screen) + except Exception as e: + usys.print_exception(e) + return self + + def get_screen_NAME(self, event, msg): + return self.screen.NAME + + def load_screen_cb(self, topic, msg): + EventMesh.publish("publish_message_event_ui",{"func":self.load_screen,"data":msg}) + + def load_screen(self, msg): + + print("msg1={} self.UI_high_priority_flag:{}".format(msg,self.UI_high_priority_flag)) + if self.UI_high_priority_flag == 1:#电话界面屏蔽其他界面 + return + state = EventMesh.publish("get_cur_class_time_state") + print("state:{}".format(state)) + if state != None: + if state == 1: + screen_NAME = EventMesh.publish("get_screen_NAME") + if screen_NAME != None: + if msg["screen"] == "charge_out" or msg["screen"] == "charge_in": + pass + else: + if screen_NAME == "class_time" :#在上课禁用界面打断其他操作界面 + print("class_time UI") + if msg["screen"] == "countdown_end": + # print("countdown_end UI") + EventMesh.publish("close_count_show_info") + return + else: + if screen_NAME != "dialing_noplay_popup" or screen_NAME != "dial_no_connect_popup" or \ + screen_NAME != "on_call" or screen_NAME != "dialing" or screen_NAME != "incoming_call" or \ + screen_NAME != "charge_in" or screen_NAME != "charge_out": + EventMesh.publish("load_screen", {"screen": "class_time"}) + if self.screen : + if self.screen.NAME == msg["screen"]: + return + for scr in self.screen_list: + if scr.NAME == msg["screen"]: + # 每次屏幕切换开始息屏倒计时 + + if scr.NAME == 'main_menu': + self.main_flag = 1 + else : + self.main_flag = 0 + mem = gc.mem_free() + print('1剩余内存RAM:{} KB'.format(mem / 1024)) + + self.screen = scr + play_state = EventMesh.publish("get_audio_state")#音频播放状态 + if play_state != None: + if play_state != 0:#在上一个界面在播放音频时切换界面则关闭 以免一直播放 + self.aud.stop() + + if self.screen_old != None : + if scr.NAME != "poweron": + EventMesh.publish("close_motor_infor")#设置参数切换界面时关闭马达振动 + self.screen_old.Close() #先关闭上一次界面 + self.lv.img.cache_invalidate_src(None) #清img cache + self.lv.img.cache_set_size(16) #开img cache + if self.screen.meta_type != "popup": #只要当前界面不是弹窗界面都要保存当前界面 + if self.screen_old.meta_type != "popup":#上个界面也不为弹窗界面 + self.screen_prev = self.screen_old #第二种方式 + screen_new = msg["screen"] + # print('self.screen_prev.NAME:{} self.screen_old:{}'.format(self.screen_prev.NAME,self.screen.NAME)) + if self.screen_prev.NAME != self.screen.NAME: + EventMesh.publish("add_new_screen",screen_new)#保存新的界面用作返回上一级 + + if msg.get("meta"): + self.screen.meta_info = msg.get("meta") + print("load_screen:post_processor_before_initialization") + self.screen.post_processor_before_initialization() + print("load_screen:initialization") + self.screen.initialization() + + print("load_screen.load()") + self.screen.load() + self.lv.scr_load(self.screen.get_meta()) + + self.screen.post_processor_after_initialization() + self.__lcd_on() + mem = gc.mem_free() + print('2剩余内存RAM:{} KB'.format(mem / 1024)) + if self.screen_prev == None: + if self.screen.meta_type != "popup": + self.screen_prev = self.screen + self.screen_old = self.screen + # print('self.screen:{} self.screen_old:{}'.format(self.screen,self.screen_old)) + self.system_ui_state = 1 + self.system_ui_timer.stop() + self.system_ui_timer.start(200, 0, self.system_ui_flag) + + + + diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py new file mode 100644 index 00000000..b5f061e6 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_WatchFaceScreen.py @@ -0,0 +1,995 @@ +#表盘 +import osTimer +import lvgl as lv +import EventMesh +import osTimer +import constants +from ui import Screen,style_screen,style_font_youyuan_28,style_font_youyuan_20_white +import ql_fs +import ujson +import sim +from machine import RTC +from lcd import LCD_SIZE_W,LCD_SIZE_H + + + + +watchface_style_default = lv.style_t() +watchface_style_default.init() +watchface_style_default.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +watchface_style_default.set_text_font(lv.K01_font_16_ALL) + + + + +power_line_points = [{"x":0,"y":0},{"x":0,"y":16}] +power_line_red = lv.style_t() +power_line_red.init() +power_line_red.set_line_width(0)#23 宽度 +power_line_red.set_line_rounded(False) #没有圆角 +power_line_red.set_line_color(lv.color_make(0xff, 0xff, 0xff)) + +Watchface = lv.obj() +print("Watchface") +Watchface1 = lv.obj(Watchface) + +Watchface1.set_size(LCD_SIZE_W,LCD_SIZE_H) +#Watchface1.set_pos(0,0) +Watchface1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +Watchface1.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + +# create style style_watchface_img_default +style_watchface_img_default = lv.style_t() +style_watchface_img_default.init() +style_watchface_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) +style_watchface_img_default.set_img_recolor_opa(0) +style_watchface_img_default.set_img_opa(255) + + +#表盘 + +#状态栏 + +watchface1_mpsignal_img = lv.img(Watchface1) +watchface1_mpsignal_img.set_pos(int(20),int(15)) +watchface1_mpsignal_img.set_size(30,22) +watchface1_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface1_mpsignal_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface1_mpsignal_img.set_src("U:/static/mpsignal0.png") +watchface1_mpsignal_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface1_res_stat_battery_img = lv.img(Watchface1) +watchface1_res_stat_battery_img.set_pos(int(185),int(15)) +watchface1_res_stat_battery_img.set_size(40,22) +watchface1_res_stat_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface1_res_stat_battery_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface1_res_stat_battery_img.set_src("U:/static/vbat_0.png") +watchface1_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + + + +watchface1_res_stat_battery_line = lv.line(Watchface1) +watchface1_res_stat_battery_line.set_points(power_line_points,2) +watchface1_res_stat_battery_line.set_pos(int(192),int(20)) +watchface1_res_stat_battery_line.set_size(0,6)#高度12 +watchface1_res_stat_battery_line.add_style(power_line_red,0) + + +watchface1_res_stat_charge_in_img = lv.img(Watchface1) +watchface1_res_stat_charge_in_img.set_pos(int(180),int(10)) +watchface1_res_stat_charge_in_img.set_size(10,18) +watchface1_res_stat_charge_in_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface1_res_stat_charge_in_img.add_flag(lv.obj.FLAG.CLICKABLE) +# watchface1_res_stat_charge_in_img.set_src("U:/static/charge_in.png") +# add style for watchface1_res_stat_charge_in_img +watchface1_res_stat_charge_in_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +#主图片 +watchface1_bg_img = lv.img(Watchface1) +watchface1_bg_img.set_pos(int(9),int(60)) +watchface1_bg_img.set_size(222,222) +watchface1_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface1_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface1_bg_img.set_src("U:/static/bg.png") +watchface1_bg_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) +#时间 + +style_font_youyuan_70_white = lv.style_t() +style_font_youyuan_70_white.init() +style_font_youyuan_70_white.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_70_white.set_text_font(lv.K01_font_16_ALL) + +style_font_youyuan_70_black = lv.style_t() +style_font_youyuan_70_black.init() +style_font_youyuan_70_black.set_text_color(lv.color_make(0x32, 0xc8, 0xdb)) +style_font_youyuan_70_black.set_text_font(lv.K01_font_16_ALL) +#init3:(2106, 2, 7, 6, 29, 38, 6, 38) +data = RTC().datetime() +hour = data[4] +min = data[5] + +week = data[3] + +date1 = data[1] +date2 = data[2] +print("hour:{} min:{} week:{} date1:{} date2:{} data:{}".format(hour,min,week,date1,date2,data)) + +def get_week(msg): + if msg == 1: + return '一' + elif msg == 2: + return '二' + elif msg == 3: + return '三' + elif msg == 4: + return '四' + elif msg == 5: + return '五' + elif msg == 6: + return '六' + elif msg == 7 or msg == 0: + return '日' + + +watchface1_time1_text = lv.label(Watchface1) +watchface1_time1_text.set_pos(20, 55) +watchface1_time1_text.set_size(190, 71) +watchface1_time1_text.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) +# watchface1_time1_text.set_text("%02d:%02d"%(hour,min)) +watchface1_time1_text.add_style(style_font_youyuan_70_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +#日期 +watchface1_date_span = lv.label(Watchface1) +watchface1_date_span.set_pos(8, 127) +watchface1_date_span.set_size(140, 30) +watchface1_date_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_date_span.set_text("%d月%d日"%(date1,date2)) +watchface1_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) +#星期 +watchface1_week_span = lv.label(Watchface1) +watchface1_week_span.set_pos(8, 165) +watchface1_week_span.set_size(100, 30) +watchface1_week_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_week_span.set_text("星期%s"%(get_week(week))) +watchface1_week_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +watchface1_step_span = lv.label(Watchface1) +watchface1_step_span.set_pos(142, 155) +watchface1_step_span.set_size(240-142, 30) +watchface1_step_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface1_step_span.set_text("0") +watchface1_step_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +# watchface1_HB_span = lv.label(Watchface1) +# watchface1_HB_span.set_pos(52, 235) +# watchface1_HB_span.set_size(80, 30) +# watchface1_HB_span.set_align(lv.TEXT_ALIGN.LEFT) +# watchface1_HB_span.set_text("0") +# watchface1_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface1_HB_span = lv.label(Watchface1) +watchface1_HB_span.set_pos(5, 235) +watchface1_HB_span.set_size(115, 30) +watchface1_HB_span.set_text("0") +watchface1_HB_span.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +watchface1_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN | lv.STATE.DEFAULT) + + +watchface1_SPO2_span = lv.label(Watchface1) +watchface1_SPO2_span.set_pos(110, 235) +watchface1_SPO2_span.set_size(120, 30) +watchface1_SPO2_span.set_text("0") +watchface1_SPO2_span.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +watchface1_SPO2_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + + +class WatchFace1(): + NAME = "Watchface1" + # # #表盘1 + def __init__(self): + print("Watchface1:__init__") + self.meta = Watchface1 + def set_parent(self,main_menu): + Watchface1.set_parent(main_menu)#设置父控件 + + def initialization(self): + print("Watchface1:initialization") + #Watchface1.set_parent(main_menu)#设置父控件 + #获取信号 + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + hrValue = EventMesh.publish("get_old_hr_data") + if hrValue: + self.__oldHrValue(None, hrValue) + + spo2Value = EventMesh.publish("get_old_spo2_data") + if spo2Value : + self.__oldSpo2Value(None, spo2Value) + # print("main get_step msg:{}".format(msg)) + + # step = EventMesh.publish(constants.EVENT.GET_STEP) + step = EventMesh.publish("get_old_step_value") + self.__stepValue(None, step) + + + def timerout_update(self): + #获取信号 + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + + hrValue = EventMesh.publish("get_old_hr_data") + if hrValue: + self.__oldHrValue(None, hrValue) + + spo2Value = EventMesh.publish("get_old_spo2_data") + if spo2Value : + self.__oldSpo2Value(None, spo2Value) + # print("main get_step msg:{}".format(msg)) + # step = EventMesh.publish(constants.EVENT.GET_STEP) + step = EventMesh.publish("get_old_step_value") + self.__stepValue(None, step) + + def __time(self, event, msg): + #时间 + watchface1_time1_text.set_text("{}:{}".format("%02d"%(msg[0][0]),"%02d"%(msg[0][1]))) + + watchface1_date_span.set_text(msg[2])#日期 + watchface1_week_span.set_text(msg[3]) #星期 + + def __signal(self, event, msg): + print("111111111__signal_cb:",str(msg)) + # 信号强度值范围0 ~ 31,值越大表示信号强度越好 + #print("__signal_cb:{}".format(msg//8)) + sim_state = sim.getStatus() + if sim_state != 1:#没有卡 + watchface1_mpsignal_img.set_src("U:/static/mpsignal5.png") + else: + if msg == -1: + watchface1_mpsignal_img.set_src("U:/static/mpsignal0.png") + else: + if msg: + if msg >= 0 and msg<=31 : + watchface1_mpsignal_img.set_src("U:/static/mpsignal{}.png".format(msg//8+1)) + else : + watchface1_mpsignal_img.set_src("U:/static/mpsignal0.png") + + def __battery(self, event, msg): + #print("__battery_cb:",str(msg)) + #print(msg) + if msg[0] == '1': + + watchface1_res_stat_battery_line.set_pos(int(0),int(8)) + watchface1_res_stat_battery_line.set_size(0,0) + watchface1_res_stat_battery_line.set_style_line_width(0,lv.PART.MAIN) + watchface1_res_stat_battery_img.set_src("U:/static/charge_ing.png") + else: + watchface1_res_stat_battery_img.set_src("U:/static/vbat_0.png") + level = msg[1] + if level >= 99: + level = 100 + line_len = int(level*(30/100)) + print("__battery_cb111:",level,line_len,30/100) + if line_len >= 30: + line_len = 30 + if line_len <= 6: + line_len = 6 + set_x = int(188+line_len//2) + + line_points = [ + {"x":0, "y":5}, + {"x":line_len, "y":5}, + ] + watchface1_res_stat_battery_line.set_size(int(line_len),int(6)) + watchface1_res_stat_battery_line.set_pos(int(188),int(21)) + watchface1_res_stat_battery_line.set_points(line_points, 2) + watchface1_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) + + if line_len <= 6: + watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) + else: + watchface1_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) + pass + + def __oldHrValue(self, event, msg): + watchface1_HB_span.set_text(str(msg)) + + def __oldSpo2Value(self, event, msg): + watchface1_SPO2_span.set_text(str(msg)) + + def __stepValue(self, event, msg): + if msg == None: + watchface1_step_span.set_text("0") + else: + watchface1_step_span.set_text(str(msg)) + + def Close(self): + pass + + def done_left_to_right(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_right_to_left(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_top_to_bottom(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def done_bottom_to_top(self): + EventMesh.publish("load_screen", {"screen": "call_log"}) + +# create style style_watchface_img_default +style_watchface_img_default = lv.style_t() +style_watchface_img_default.init() +style_watchface_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) +style_watchface_img_default.set_img_recolor_opa(0) +style_watchface_img_default.set_img_opa(255) + +Watchface2 = lv.obj(Watchface) +Watchface2.set_size(LCD_SIZE_W,LCD_SIZE_H) +#Watchface2.set_pos(0,0) +Watchface2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +Watchface2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + +#表盘 +Watchface2_bg_img = lv.img(Watchface2) +Watchface2_bg_img.set_pos(int(0),int(0)) +Watchface2_bg_img.set_size(240,282) +Watchface2_bg_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +Watchface2_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +Watchface2_bg_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) +#状态栏 + +watchface2_mpsignal_img = lv.img(Watchface2) +watchface2_mpsignal_img.set_pos(int(20),int(15)) +watchface2_mpsignal_img.set_size(30,22) +watchface2_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface2_mpsignal_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface2_mpsignal_img.set_src("U:/static/mpsignal0.png") +watchface2_mpsignal_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface2_res_stat_battery_img = lv.img(Watchface2) +watchface2_res_stat_battery_img.set_pos(int(185),int(15)) +watchface2_res_stat_battery_img.set_size(40,22) +watchface2_res_stat_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface2_res_stat_battery_img.set_src("U:/static/vbat_0.png") +watchface2_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + +watchface2_res_stat_battery_line = lv.line(Watchface2) +watchface2_res_stat_battery_line.set_points(power_line_points,2) +watchface2_res_stat_battery_line.set_pos(int(192),int(20)) +watchface2_res_stat_battery_line.set_size(0,6)#高度12 +watchface2_res_stat_battery_line.add_style(power_line_red,0) + + +# watchface2_res_stat_charge_in_img = lv.img(Watchface2) +# watchface2_res_stat_charge_in_img.set_pos(int(180),int(0)) +# watchface2_res_stat_charge_in_img.set_size(10,18) +# watchface2_res_stat_charge_in_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# watchface2_res_stat_charge_in_img.add_flag(lv.obj.FLAG.CLICKABLE) +# watchface2_res_stat_charge_in_img.set_src("U:/static/charge_ing.png") +# # add style for watchface_res_stat_charge_in_img +# watchface2_res_stat_charge_in_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +style_font_youyuan_70_red = lv.style_t() +style_font_youyuan_70_red.init() +style_font_youyuan_70_red.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_70_red.set_text_font(lv.K01_font_16_ALL) +#时间 +x = 30 +y = 80 +watchface2_time1_hour_text = lv.label(Watchface2) +watchface2_time1_hour_text.set_pos(20, 80) +watchface2_time1_hour_text.set_size(88, 70) +watchface2_time1_hour_text.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_time1_hour_text.set_text("{}".format("%02d"%(hour))) +watchface2_time1_hour_text.add_style(style_font_youyuan_70_red, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface2_time1_mao_text = lv.label(Watchface2) +watchface2_time1_mao_text.set_pos(108, 76) +watchface2_time1_mao_text.set_size(44, 70) +watchface2_time1_mao_text.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_time1_mao_text.set_text(":") +watchface2_time1_mao_text.add_style(style_font_youyuan_70_red, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface2_time1_hour1_text = lv.label(Watchface2) +watchface2_time1_hour1_text.set_pos(152, 80) +watchface2_time1_hour1_text.set_size(88, 70) +watchface2_time1_hour1_text.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_time1_hour1_text.set_text("{}".format("%02d"%(min))) +watchface2_time1_hour1_text.add_style(style_font_youyuan_70_red, lv.PART.MAIN|lv.STATE.DEFAULT) + + + + +#日期 +watchface2_date_span = lv.label(Watchface2) +watchface2_date_span.set_pos(18, 170) +watchface2_date_span.set_size(120, 35) +watchface2_date_span.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_date_span.set_text("%d月%d日"%(date1,date2)) +watchface2_date_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + +#日期 +watchface2_week = lv.label(Watchface2) +watchface2_week.set_pos(146, 170) +watchface2_week.set_size(110, 35) +watchface2_week.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_week.set_text("星期%s"%(get_week(week))) +watchface2_week.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) +#星期 + + +# watchface2_week = lv.img(Watchface2) +# watchface2_week.set_pos(int(30+56+20+25),int(y+56+30)) +# watchface2_week.set_size(90,30) +# watchface2_week.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# watchface2_week.set_src("U:/static/watch_plate/style_2/week/0_week.png") +# watchface2_week.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +watchface2_step_img = lv.img(Watchface2) +watchface2_step_img.set_pos(int(95),int(250)) +watchface2_step_img.set_size(26,21) +watchface2_step_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface2_step_img.set_src("U:/static/step.png") +watchface2_step_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface2_step_txt = lv.label(Watchface2) +watchface2_step_txt.set_pos(125, 250) +watchface2_step_txt.set_size(80, 30) +watchface2_step_txt.set_align(lv.TEXT_ALIGN.LEFT) +watchface2_step_txt.set_text("0") +watchface2_step_txt.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + +Watchface2_label_edit = lv.label(Watchface2) +Watchface2_label_edit.set_pos(0, 0) +Watchface2_label_edit.set_size(240, 282) +Watchface2_label_edit.set_text(" ") +Watchface2_label_edit.add_flag(lv.obj.FLAG.CLICKABLE) + +class WatchFace2(): + NAME = "Watchface2" + # # #表盘2 + def __init__(self): + print("Watchface2:__init__") + self.meta = Watchface2 + EventMesh.subscribe("update_dial_file", self.update_dial_file) + # Watchface2_label_edit. + def set_parent(self,main_menu): + Watchface1.set_parent(main_menu)#设置父控件 + + def update_dial_file(self, event, msg): #更新表盘文件 + check_txt = ql_fs.path_exists("/usr/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True : + Watchface2_bg_img.set_src("U:/static/storage_file/aigc_dial.jpg") + pass + + def initialization(self): + check_txt = ql_fs.path_exists("/usr/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True: + Watchface2_bg_img.clear_flag(lv.obj.FLAG.HIDDEN) + Watchface2_bg_img.set_src("U:/static/storage_file/aigc_dial.jpg") + else: + Watchface2_bg_img.add_flag(lv.obj.FLAG.HIDDEN) + print("Watchface2:initialization") + #Watchface2.set_parent(main_menu)#设置父控件 + #获取信号 + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + + step = EventMesh.publish("get_old_step_value") + self.__stepValue(None, step) + + + def timerout_update(self): + #获取信号 + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + + step = EventMesh.publish("get_old_step_value") + self.__stepValue(None, step) + + def __time(self, event, msg): + #时间 + hour1_chose = (msg[0][0])//10%10 + hour2_chose = (msg[0][0])%10 + min1_chose = (msg[0][1])//10%10 + min2_chose = (msg[0][1])%10 + watchface2_time1_hour_text.set_text("{}".format("%02d"%(msg[0][0]))) + watchface2_time1_hour1_text.set_text("{}".format("%02d"%(msg[0][1]))) + # watchface2_time1_hour_text.set_text("{}".format("%d"%(hour1_chose))) + # watchface2_time1_hour2_text.set_text("{}".format("%d"%(hour2_chose))) + # watchface2_time2_min1_text.set_text("{}".format("%d"%(min1_chose))) + # watchface2_time2_min2_text.set_text("{}".format("%d"%(min2_chose))) + watchface2_date_span.set_text(msg[2])#日期 + watchface2_week.set_text(msg[3])#星期 + # watchface2_week.set_src("U:/static/watch_plate/style_2/week/%d_week.png"%(msg[5])) #星期 + + def __signal(self, event, msg): + print("Watchface2 __signal_cb:",str(msg)) + # 信号强度值范围0 ~ 31,值越大表示信号强度越好 + #print("__signal_cb:{}".format(msg//8)) + sim_state = sim.getStatus() + if sim_state != 1:#没有卡 + watchface2_mpsignal_img.set_src("U:/static/mpsignal5.png") + else: + if msg == -1: + watchface2_mpsignal_img.set_src("U:/static/mpsignal0.png") + else: + if msg: + if msg >= 0 and msg<=31 : + watchface2_mpsignal_img.set_src("U:/static/mpsignal{}.png".format(msg//8+1)) + else : + watchface2_mpsignal_img.set_src("U:/static/mpsignal0.png") + + def __battery(self, event, msg): + #print("__battery_cb:",str(msg)) + #print(msg) + if msg[0] == '1': + + watchface2_res_stat_battery_line.set_pos(int(0),int(15)) + watchface2_res_stat_battery_line.set_size(0,0) + watchface2_res_stat_battery_line.set_style_line_width(0,lv.PART.MAIN) + watchface2_res_stat_battery_img.set_src("U:/static/charge_ing.png") + else: + watchface2_res_stat_battery_img.set_src("U:/static/vbat_0.png") + level = msg[1] + if level >= 99: + level = 100 + line_len = int(level*(30/100)) + print("__battery_cb:222",level,line_len,30/100) + if line_len >= 30: + line_len = 30 + if line_len <= 6: + line_len = 6 + set_x = int(188+line_len//2) + + line_points = [ + {"x":0, "y":5}, + {"x":line_len, "y":5}, + ] + watchface2_res_stat_battery_line.set_size(int(line_len),int(6)) + watchface2_res_stat_battery_line.set_pos(int(188),int(21)) + watchface2_res_stat_battery_line.set_points(line_points, 2) + watchface2_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) + + if line_len <= 6: + watchface2_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) + else: + watchface2_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) + + # watchface2_res_stat_battery_img.set_src("U:/static/vbat_%d.png"%(msg[1]))#"U:/vbat_60.png" + pass + def __stepValue(self, event, msg): + if msg == None: + watchface2_step_txt.set_text("0") + else: + watchface2_step_txt.set_text(str(msg)) + + + # def __weather_type(self, event, msg): + # if msg == None: + # watchface2_temp_img.add_flag(lv.obj.FLAG.HIDDEN) + # watchface2_no_temp_txt.clear_flag(lv.obj.FLAG.HIDDEN) + # else: + # type = int(msg) + # watchface2_no_temp_txt.add_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_img.clear_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_img.set_src("U:/static/watch_plate/style_2/%d_main2_weather.png"%(type)) + + # def __weather_value(self, event, msg): + # if msg == None: + # watchface2_temp_degree.add_flag(lv.obj.FLAG.HIDDEN) + # watchface2_no_temp_txt.clear_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_txt.add_flag(lv.obj.FLAG.HIDDEN) + # else: + # watchface2_no_temp_txt.add_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_txt.clear_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_degree.clear_flag(lv.obj.FLAG.HIDDEN) + # watchface2_temp_txt.set_text(str(msg)) + + def Close(self): + pass + + def done_left_to_right(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_right_to_left(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def done_top_to_bottom(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def done_bottom_to_top(self): + EventMesh.publish("load_screen", {"screen": "call_log"}) + + +Watchface3 = lv.obj(Watchface) + +Watchface3.set_size(LCD_SIZE_W,LCD_SIZE_H) +#Watchface1.set_pos(0,0) +Watchface3.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +Watchface3.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface3_mpsignal_img = lv.img(Watchface3) +watchface3_mpsignal_img.set_pos(int(20),int(15)) +watchface3_mpsignal_img.set_size(30,22) +watchface3_mpsignal_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface3_mpsignal_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface3_mpsignal_img.set_src("U:/static/mpsignal0.png") +watchface3_mpsignal_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface3_res_stat_battery_img = lv.img(Watchface3) +watchface3_res_stat_battery_img.set_pos(int(185),int(15)) +watchface3_res_stat_battery_img.set_size(40,22) +watchface3_res_stat_battery_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +watchface3_res_stat_battery_img.add_flag(lv.obj.FLAG.CLICKABLE) +watchface3_res_stat_battery_img.set_src("U:/static/vbat_0.png") +watchface3_res_stat_battery_img.add_style(style_watchface_img_default, lv.PART.MAIN|lv.STATE.DEFAULT) + + +watchface3_res_stat_battery_line = lv.line(Watchface3) +watchface3_res_stat_battery_line.set_points(power_line_points,2) +watchface3_res_stat_battery_line.set_pos(int(188),int(20)) +watchface3_res_stat_battery_line.set_size(0,12)#高度12 +watchface3_res_stat_battery_line.add_style(power_line_red,0) +#时间 + + +watchface3_time1_text = lv.label(Watchface3) +watchface3_time1_text.set_pos(20, 55) +watchface3_time1_text.set_size(190, 71) +watchface3_time1_text.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) +watchface3_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) +# watchface3_time1_text.set_text("%02d:%02d"%(hour,min)) +watchface3_time1_text.add_style(style_font_youyuan_70_white, lv.PART.MAIN|lv.STATE.DEFAULT) + +#日期 +watchface3_week_span = lv.label(Watchface3) +watchface3_week_span.set_pos(0, 125) +watchface3_week_span.set_size(240, 20) +watchface3_week_span.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) +watchface3_week_span.set_text("%02d/%02d 周%s"%(date1,date2,get_week(week))) +watchface3_week_span.add_style(style_font_youyuan_20_white, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +watchface3_school_label = lv.label(Watchface3) +watchface3_school_label.set_pos(0, 165) +watchface3_school_label.set_size(240, 20) +watchface3_school_label.set_style_text_align(lv.TEXT_ALIGN.CENTER,0) +watchface3_school_label.set_text(" ") +watchface3_school_label.add_style(style_font_youyuan_20_white, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +# watchface3_HB_span = lv.label(Watchface1) +# watchface3_HB_span.set_pos(52, 235) +# watchface3_HB_span.set_size(80, 30) +# watchface3_HB_span.set_align(lv.TEXT_ALIGN.LEFT) +# watchface3_HB_span.set_text("0") +# watchface3_HB_span.add_style(style_font_youyuan_28, lv.PART.MAIN|lv.STATE.DEFAULT) + +watchface3_class_label = lv.label(Watchface3) +watchface3_class_label.set_pos(0, 200) +watchface3_class_label.set_size(240, 20) +watchface3_class_label.set_text(" ") +watchface3_class_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +watchface3_class_label.add_style(style_font_youyuan_20_white, lv.PART.MAIN | lv.STATE.DEFAULT) + + +watchface3_fullname_label = lv.label(Watchface3) +watchface3_fullname_label.set_pos(0, 235) +watchface3_fullname_label.set_size(240, 20) +watchface3_fullname_label.set_text(" ") +watchface3_fullname_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +watchface3_fullname_label.add_style(style_font_youyuan_20_white, lv.PART.MAIN|lv.STATE.DEFAULT) + + +class WatchFace3(): + NAME = "Watchface3" + # # #表盘1 + def __init__(self): + print("Watchface3:__init__") + self.meta = Watchface3 + EventMesh.subscribe("update_screen_show",self.update_screen_show)#更新开屏显示 + def set_parent(self,main_menu): + Watchface3.set_parent(main_menu)#设置父控件 + + def initialization(self): + print("Watchface3:initialization") + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + + self.update_screen_show(None, None) + + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + + + def timerout_update(self): + time = EventMesh.publish("screen_get_time") + #print("publish_time:"+time) + if time: + self.__time(None, time) + + self.update_screen_show(None, None) + + signal = EventMesh.publish("screen_get_sig") + if signal: + self.__signal(None, signal) + # 获取电池电量 + battery = EventMesh.publish("screen_get_battery") + if battery: + self.__battery(None, battery) + + def __signal(self, event, msg): + + # 信号强度值范围0 ~ 31,值越大表示信号强度越好 + #print("__signal_cb:{}".format(msg//8)) + sim_state = sim.getStatus() + print("__signal_cb:",str(msg),sim_state) + if sim_state != 1:#没有卡 + watchface3_mpsignal_img.set_src("U:/static/mpsignal5.png") + else: + if msg == -1: + watchface3_mpsignal_img.set_src("U:/static/mpsignal0.png") + else: + if msg: + if msg >= 0 and msg<=31 : + print("111__signal_cb:",str(msg)) + watchface3_mpsignal_img.set_src("U:/static/mpsignal{}.png".format(msg//8+1)) + else : + print("222__signal_cb:",str(msg)) + watchface3_mpsignal_img.set_src("U:/static/mpsignal0.png") + + def __battery(self, event, msg): + #print("__battery_cb:",str(msg)) + #print(msg) + if msg[0] == '1': + + watchface3_res_stat_battery_line.set_pos(int(0),int(15)) + watchface3_res_stat_battery_line.set_size(0,0) + watchface3_res_stat_battery_line.set_style_line_width(0,lv.PART.MAIN) + watchface3_res_stat_battery_img.set_src("U:/static/charge_ing.png") + else: + watchface3_res_stat_battery_img.set_src("U:/static/vbat_0.png") + level = msg[1] + if level >= 99: + level = 100 + line_len = int(level*(30/100)) + print("__battery_cb:222",level,line_len,30/100) + if line_len >= 30: + line_len = 30 + if line_len <= 6: + line_len = 6 + set_x = int(188+line_len//2) + + line_points = [ + {"x":0, "y":5}, + {"x":line_len, "y":5}, + ] + watchface3_res_stat_battery_line.set_size(int(line_len),int(6)) + watchface3_res_stat_battery_line.set_pos(int(188),int(21)) + watchface3_res_stat_battery_line.set_points(line_points, 2) + watchface3_res_stat_battery_line.set_style_line_width(16,lv.PART.MAIN) + + if line_len <= 6: + watchface3_res_stat_battery_line.set_style_line_color(lv.color_make(0xff,0x00,0x00),0) + else: + watchface3_res_stat_battery_line.set_style_line_color(lv.color_make(0x00,0xff,0x00),0) + + + def __time(self, event, msg): + data = RTC().datetime() + hour = int(data[4]) + min = int(data[5]) + + week = int(data[3]) + + date1 = int(data[1]) + date2 = int(data[2]) + + watchface3_time1_text.set_text("{}:{}".format("%02d"%(hour),"%02d"%(min))) + watchface3_week_span.set_text("%02d/%02d 周%s"%(date1,date2,get_week(week))) + + def update_screen_show(self, event, msg): + pass + school=EventMesh.publish("get_schoolname") + if school != None: + if len(str(school)) != 0: + watchface3_school_label.set_text(str(school)) + else: + watchface3_school_label.set_text(' ') + else: + watchface3_school_label.set_text(' ') + class_name = EventMesh.publish("get_classname") + if class_name != None: + if len(str(class_name)) != 0: + watchface3_class_label.set_text(str(class_name)) + else: + watchface3_class_label.set_text(' ') + else: + watchface3_class_label.set_text(' ') + + fullname = EventMesh.publish("get_fullname") + if fullname != None: + if len(str(fullname)) != 0: + watchface3_fullname_label.set_text(str(fullname)) + else: + watchface3_fullname_label.set_text(' ') + else: + watchface3_fullname_label.set_text(' ') + + def Close(self): + pass + + def done_left_to_right(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_right_to_left(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def done_top_to_bottom(self): + EventMesh.publish("load_screen", {"screen": "popup"}) + + def done_bottom_to_top(self): + EventMesh.publish("load_screen", {"screen": "call_log"}) + + + +class WatchFace(): + #NAME = "Watchface" + + def __init__(self,main_menu): + #表盘 + self.meta = None + self.watchface_style_num = "Watchface2" + self.watchface_list = [] + self.watchface_style = None + self.timer_update = osTimer() + EventMesh.subscribe("set_change_face", self.change_face) + self.PWM_backlight = None + read_data = EventMesh.publish("get_storage_config","watchface") + if read_data != None: + self.watchface_style_num = read_data + if self.watchface_list == [] : #第一次初始化 + self.watchface_list.append( WatchFace1()) + self.watchface_list.append( WatchFace2()) + self.set_parent( main_menu) + + for wat in self.watchface_list: + if wat.NAME == self.watchface_style_num : + self.watchface_style = wat + wat.meta.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + self.watchface_style.initialization() + self.meta = self.watchface_style.meta + self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 + EventMesh.subscribe("update_dial_file", self.update_dial_file) + + def update_dial_file(self, event, msg): #更新表盘文件 + for wat in self.watchface_list: + if wat.NAME == self.watchface_style_num : + self.watchface_style = wat + wat.meta.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + self.watchface_style.initialization() + self.meta = self.watchface_style.meta + self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 + check_txt = ql_fs.path_exists("/usr/static/storage_file/aigc_dial.jpg") + print("update_dial_file!!!!! {}\r\n".format(check_txt)) + if check_txt == True : + if Watchface2_bg_img != None: + Watchface2_bg_img.set_src("U:/static/storage_file/aigc_dial.jpg") + + + pass + + def initialization(self): + + self.watchface_style.timerout_update() + print("watchface INIT !!!!!!!!:",self.watchface_style_num) + + self.timer_update.start(10000, 1, self.timerout_update) + + def set_parent(self,main_menu): + Watchface1.set_parent(main_menu)#设置父控件 + Watchface2.set_parent(main_menu)#设置父控件 + + def timerout_update(self, *args, **kwargs): + self.watchface_style.timerout_update() + + def change_face(self, event=None, msg=None): + print("change_face :",msg) + self.watchface_style_num = str(msg) + for wat in self.watchface_list: + if wat.NAME == self.watchface_style_num : + self.watchface_style = wat + wat.meta.add_flag(lv.obj.FLAG.HIDDEN) #隐藏 + self.watchface_style.initialization() + self.meta = self.watchface_style.meta + self.watchface_style.meta.clear_flag(lv.obj.FLAG.HIDDEN)#显示 + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + + # def done_left_to_right(self): + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # def done_right_to_left(self): + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + # def done_top_to_bottom(self): + # EventMesh.publish("load_screen", {"screen": "popup"}) + + # def done_bottom_to_top(self): + # EventMesh.publish("load_screen", {"screen": "call_log"}) + # def done_return(self): + # EventMesh.publish("load_screen", {"screen": "Watchface"}) + + # def btn1_release(self): + # EventMesh.publish("load_screen", {"screen": "Watchface"}) + + # def btn8_press(self): + # EventMesh.publish("load_screen", {"screen": "Watchface"}) + + def Close(self): + print("watchface Close !!!!!!!!") + self.timer_update.stop() + self.watchface_style.Close() + return + + + + diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_health.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_health.py similarity index 92% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_health.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_health.py index 1eca55e3..788971f3 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_health.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_health.py @@ -55,7 +55,7 @@ health_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) health_title_img = lv.img(health_screen) health_title_img.set_pos(4, 10) health_title_img.set_size(232, 34) -health_title_img.set_src("E:/static/health/health_text.png") +health_title_img.set_src("U:/static/health/health_text.png") health_title_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -89,14 +89,14 @@ health_hr_bg_img = lv.img(healt_cont) health_hr_bg_img.set_pos(5, health_cont_y) health_hr_bg_img.set_size(HEALTH_BG_ICON_W_SIZE, HEALTH_BG_ICON_H_SIZE) health_hr_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_hr_bg_img.set_src("E:/static/list_bg.png") +health_hr_bg_img.set_src("U:/static/list_bg.png") health_hr_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_hr_img = lv.img(healt_cont) health_hr_img.set_pos(13, health_cont_y+6) health_hr_img.set_size(HEALTH_ICON_W_SIZE, HEALTH_ICON_H_SIZE) # health_hr_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_hr_img.set_src("E:/static/health/health_hr.png") +health_hr_img.set_src("U:/static/health/health_hr.png") health_hr_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_cont_y+=HEALTH_ICON_OFFSET_SIZE @@ -105,14 +105,14 @@ hhealth_spo2_bg_img = lv.img(healt_cont) hhealth_spo2_bg_img.set_pos(5, health_cont_y) hhealth_spo2_bg_img.set_size(HEALTH_BG_ICON_W_SIZE, HEALTH_BG_ICON_H_SIZE) hhealth_spo2_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) -hhealth_spo2_bg_img.set_src("E:/static/list_bg.png") +hhealth_spo2_bg_img.set_src("U:/static/list_bg.png") hhealth_spo2_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_spo2_img = lv.img(healt_cont) health_spo2_img.set_pos(13, health_cont_y+6) health_spo2_img.set_size(HEALTH_ICON_W_SIZE, HEALTH_ICON_H_SIZE) # health_spo2_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_spo2_img.set_src("E:/static/health/health_spo2.png") +health_spo2_img.set_src("U:/static/health/health_spo2.png") health_spo2_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_cont_y+=HEALTH_ICON_OFFSET_SIZE @@ -120,14 +120,14 @@ health_temp_bg_img = lv.img(healt_cont) health_temp_bg_img.set_pos(5, health_cont_y) health_temp_bg_img.set_size(HEALTH_BG_ICON_W_SIZE, HEALTH_BG_ICON_H_SIZE) health_temp_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_temp_bg_img.set_src("E:/static/list_bg.png") +health_temp_bg_img.set_src("U:/static/list_bg.png") health_temp_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_temp_img = lv.img(healt_cont) health_temp_img.set_pos(13, health_cont_y+6) health_temp_img.set_size(HEALTH_ICON_W_SIZE, HEALTH_ICON_H_SIZE) # health_temp_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_temp_img.set_src("E:/static/health/health_temp.png") +health_temp_img.set_src("U:/static/health/health_temp.png") health_temp_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_cont_y+=HEALTH_ICON_OFFSET_SIZE @@ -137,14 +137,14 @@ health_blood_bg_img = lv.img(healt_cont) health_blood_bg_img.set_pos(5, health_cont_y) health_blood_bg_img.set_size(HEALTH_BG_ICON_W_SIZE, HEALTH_BG_ICON_H_SIZE) health_blood_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_blood_bg_img.set_src("E:/static/list_bg.png") +health_blood_bg_img.set_src("U:/static/list_bg.png") health_blood_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_blood_img = lv.img(healt_cont) health_blood_img.set_pos(13, health_cont_y+6) health_blood_img.set_size(HEALTH_ICON_W_SIZE, HEALTH_ICON_H_SIZE) # health_blood_img.add_flag(lv.obj.FLAG.CLICKABLE) -health_blood_img.set_src("E:/static/health/health_blood.png") +health_blood_img.set_src("U:/static/health/health_blood.png") health_blood_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) health_cont_y+=HEALTH_ICON_OFFSET_SIZE @@ -182,6 +182,8 @@ class HealthScreen(Screen):#健康测量 elif code == lv.EVENT.SHORT_CLICKED: EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -244,7 +246,9 @@ class TemperatureScreen(Screen): temperature_screen = lv.obj() print("temp_screen") temperature_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - + temperature_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,1)), + lv.EVENT.GESTURE, None) + temperature_label = lv.label(temperature_screen) temperature_label.set_pos(0, 10) temperature_label.set_size(LCD_SIZE_W, 40) @@ -256,16 +260,16 @@ class TemperatureScreen(Screen): temperature_line_bg_img = lv.img(temperature_screen) temperature_line_bg_img.set_pos(5, 45) temperature_line_bg_img.set_size(230, 120) - temperature_line_bg_img.set_src("E:/static/temp_line_bg.png") + temperature_line_bg_img.set_src("U:/static/temp_line_bg.png") temperature_done_img = lv.img(temperature_screen) temperature_done_img.set_pos(30, 218) - temperature_done_img.set_src("E:/static/temp_gif03.png") + temperature_done_img.set_src("U:/static/temp_gif03.png") temp_reset_btn_img = lv.img(temperature_screen) temp_reset_btn_img.set_pos(0, 177) - temp_reset_btn_img.set_src("E:/static/reset_hr_btn.png") + temp_reset_btn_img.set_src("U:/static/reset_hr_btn.png") temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) temp_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) @@ -346,10 +350,8 @@ class TemperatureScreen(Screen): self.meta = temperature_screen - temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), + temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,2)), lv.EVENT.SHORT_CLICKED, None) - temp_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.PRESSING, None) temperature_bpm_label.set_text("- -℃") temperature_start_label.set_text("正在测量中.") @@ -358,42 +360,50 @@ class TemperatureScreen(Screen): self.is_sliding =0 self.start_init() - def restart_up(self,e): + def restart_up(self,e,msg): global temperature_done_label,temperature_keep_label,temperature_bpm_label,temperature_start_label,temp_reset_btn_img code = e.get_code() - - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + self.timer.stop() + EventMesh.publish("set_temp_state",0) + EventMesh.publish(constants.EVENT.STOP_TEMP) + EventMesh.publish("return_prev_screen") elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 - temperature_bpm_label.set_text("- -℃") + if msg == 2: + if temperature_bpm_label != None: + temperature_bpm_label.set_text("- -℃") # temperature_keep_label.set_text("未出值") - temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) + if temp_reset_btn_img != None: + temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) self.point = 0 - temperature_bpm_label.set_text("- -℃") - temperature_start_label.set_text("正在测量中.") + if temperature_bpm_label != None: + temperature_bpm_label.set_text("- -℃") + if temperature_start_label != None: + temperature_start_label.set_text("正在测量中.") EventMesh.publish("set_temp_state",1) EventMesh.publish(constants.EVENT.START_TEMP) EventMesh.publish("show_history_temp_data") self.temp_data_old = 0 self.timer.start(1*500, 1, self.start_measure) - - self.is_sliding =0 def start_init(self): - temperature_bpm_label.set_text("- -℃") + if temperature_bpm_label != None: + temperature_bpm_label.set_text("- -℃") # temperature_keep_label.set_text("未出值") - temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) + if temp_reset_btn_img != None: + temp_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) self.point = 0 - temperature_bpm_label.set_text("- -℃") - temperature_start_label.set_text("正在测量中.") + if temperature_bpm_label != None: + temperature_bpm_label.set_text("- -℃") + if temperature_start_label != None: + temperature_start_label.set_text("正在测量中.") EventMesh.publish("set_temp_state",1) EventMesh.publish(constants.EVENT.START_TEMP) EventMesh.publish("show_history_temp_data") @@ -587,17 +597,17 @@ class TemperatureScreen(Screen): if self.point%4 == 0 : temperature_start_label.set_text("正在测量中..") - temperature_done_img.set_src("E:/static/temp_gif02.png") + temperature_done_img.set_src("U:/static/temp_gif02.png") if self.point%4 == 1 : temperature_start_label.set_text("正在测量中...") - temperature_done_img.set_src("E:/static/temp_gif01.png") + temperature_done_img.set_src("U:/static/temp_gif01.png") if self.point%4 == 2 : temperature_start_label.set_text("正在测量中.") - temperature_done_img.set_src("E:/static/temp_gif02.png") + temperature_done_img.set_src("U:/static/temp_gif02.png") if self.point%4 == 3 : temperature_start_label.set_text("正在测量中.") - temperature_done_img.set_src("E:/static/temp_gif03.png") + temperature_done_img.set_src("U:/static/temp_gif03.png") tmp_f_tmp = 0 tmp_d_tmp = 0 @@ -634,9 +644,9 @@ class TemperatureScreen(Screen): temperature_bpm_label.set_text("{} ℃".format(data)) temperature_start_label.set_text("测量结束,点击重测") if temp >= 37.3: - temperature_done_img.set_src("E:/static/temp_high.png") + temperature_done_img.set_src("U:/static/temp_high.png") else: - temperature_done_img.set_src("E:/static/temp_gif03.png") + temperature_done_img.set_src("U:/static/temp_gif03.png") temp_reset_btn_img.clear_flag(lv.obj.FLAG.HIDDEN) if temp > 0: EventMesh.publish("set_history_temp_value",temp) @@ -665,12 +675,8 @@ class TemperatureScreen(Screen): self.timer.stop() EventMesh.publish("set_temp_state",0) EventMesh.publish(constants.EVENT.STOP_TEMP) - - def done_left_to_right(self): - self.timer.stop() - EventMesh.publish("set_temp_state",0) - EventMesh.publish(constants.EVENT.STOP_TEMP) - EventMesh.publish("return_prev_screen") + def done_return(self): + EventMesh.publish("load_screen", {"screen": "health"}) def btn8_press(self): EventMesh.publish("watch_top_show") @@ -731,7 +737,9 @@ class Spo2Screen(Screen): spo2_screen = lv.obj() print("spo2_screen") spo2_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - + spo2_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,1)), + lv.EVENT.GESTURE, None) + spo2_label = lv.label(spo2_screen) spo2_label.set_pos(0, 10) spo2_label.set_size(LCD_SIZE_W, 40) @@ -743,16 +751,16 @@ class Spo2Screen(Screen): spo2_line_bg_img = lv.img(spo2_screen) spo2_line_bg_img.set_pos(5, 45) spo2_line_bg_img.set_size(230, 120) - spo2_line_bg_img.set_src("E:/static/spo2_line_bg.png") + spo2_line_bg_img.set_src("U:/static/spo2_line_bg.png") spo2_done_img = lv.img(spo2_screen) spo2_done_img.set_pos(30, 220) - spo2_done_img.set_src("E:/static/spo2_gif04.png") + spo2_done_img.set_src("U:/static/spo2_gif04.png") spo2_reset_btn_img = lv.img(spo2_screen) spo2_reset_btn_img.set_pos(0, 177) - spo2_reset_btn_img.set_src("E:/static/reset_hr_btn.png") + spo2_reset_btn_img.set_src("U:/static/reset_hr_btn.png") spo2_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) spo2_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) @@ -816,10 +824,8 @@ class Spo2Screen(Screen): self.meta = spo2_screen - spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), + spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,2)), lv.EVENT.SHORT_CLICKED, None) - spo2_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.PRESSING, None) def post_processor_after_initialization(self): self.point = 0 @@ -828,32 +834,31 @@ class Spo2Screen(Screen): EventMesh.publish("show_history_spo2_data") self.start_init() - def restart_up(self,e): + def restart_up(self,e,msg): global spo2_value_label,heartrate_bpm_label,spo2_start_label,spo2_reset_btn_img - code = e.get_code() - #print("code!!!!!!!!",code,msg) - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "health"}) elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 + if msg == 2: self.point = 0 self.timer.start(1*500, 1, self.start_measure) if spo2_reset_btn_img != None: spo2_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - - spo2_value_label.set_text("- -%") - spo2_start_label.set_text("正在测量中.") + if spo2_value_label != None: + spo2_value_label.set_text("- -%") + if spo2_start_label != None: + spo2_start_label.set_text("正在测量中.") EventMesh.publish("set_spo2_state",1)#2代表后台进入血氧测试 EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN) - self.is_sliding =0 def start_init(self): self.point = 0 @@ -963,25 +968,25 @@ class Spo2Screen(Screen): if self.point%4 == 0 : spo2_start_label.set_text("正在测量中..") - spo2_done_img.set_src("E:/static/spo2_gif03.png") + spo2_done_img.set_src("U:/static/spo2_gif03.png") if self.point%4 == 1 : spo2_start_label.set_text("正在测量中...") - spo2_done_img.set_src("E:/static/spo2_gif02.png") + spo2_done_img.set_src("U:/static/spo2_gif02.png") if self.point%4 == 2 : spo2_start_label.set_text("正在测量中.") - spo2_done_img.set_src("E:/static/spo2_gif01.png") + spo2_done_img.set_src("U:/static/spo2_gif01.png") if self.point%4 == 3 : spo2_start_label.set_text("正在测量中.") - spo2_done_img.set_src("E:/static/spo2_gif04.png") + spo2_done_img.set_src("U:/static/spo2_gif04.png") if self.point > 120 or (WEAR == 0 and self.point > 10): #测60s self.timer.stop() - spo2_done_img.set_src("E:/static/spo2_gif04.png") + spo2_done_img.set_src("U:/static/spo2_gif04.png") self.spo2_value = EventMesh.publish(constants.EVENT.GET_BLOOD_OXYGEN) if WEAR == 0: self.spo2_value = 0 @@ -1023,9 +1028,6 @@ class Spo2Screen(Screen): def btn1_release(self): EventMesh.publish("load_screen", {"screen": "health"}) - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") def btn8_press(self): EventMesh.publish("watch_top_show") @@ -1086,7 +1088,9 @@ class HeartrateScreen(Screen): heartrate_screen = lv.obj() print("heartrate_screen") heartrate_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - + heartrate_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,1)), + lv.EVENT.GESTURE, None) + heartrate_label = lv.label(heartrate_screen) heartrate_label.set_pos(0, 10) heartrate_label.set_size(LCD_SIZE_W, 40) @@ -1098,16 +1102,16 @@ class HeartrateScreen(Screen): heartrate_line_bg_img = lv.img(heartrate_screen) heartrate_line_bg_img.set_pos(5, 45) heartrate_line_bg_img.set_size(230, 120) - heartrate_line_bg_img.set_src("E:/static/hr_line_bg.png") + heartrate_line_bg_img.set_src("U:/static/hr_line_bg.png") heartrate_done_img = lv.img(heartrate_screen) heartrate_done_img.set_pos(20, 229) - heartrate_done_img.set_src("E:/static/hr_gif_03.png") + heartrate_done_img.set_src("U:/static/hr_gif_03.png") heartrate_reset_btn_img = lv.img(heartrate_screen) heartrate_reset_btn_img.set_pos(0, 172) - heartrate_reset_btn_img.set_src("E:/static/reset_hr_btn.png") + heartrate_reset_btn_img.set_src("U:/static/reset_hr_btn.png") heartrate_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) heartrate_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) @@ -1177,10 +1181,8 @@ class HeartrateScreen(Screen): heartrate_done_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) self.meta = heartrate_screen - heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), + heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,2)), lv.EVENT.SHORT_CLICKED, None) - heartrate_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.PRESSING, None) heartrate_done_label.set_text(" ") heartrate_bpm_label.set_text("-- bpm") @@ -1197,35 +1199,36 @@ class HeartrateScreen(Screen): # self.show_history_data() self.start_init() - def restart_up(self,e): + def restart_up(self,e,msg): global heartrate_done_label,heartrate_bpm_label,heartrate_start_label,heartrate_reset_btn_img - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "health"}) elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 + if msg == 2: self.point = 0 + self.heart_value = 0 self.timer.start(1*500, 1, self.start_measure) - heartrate_bpm_label.set_text("-- bpm") + if heartrate_bpm_label != None: + heartrate_bpm_label.set_text("-- bpm") if heartrate_reset_btn_img != None: heartrate_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) - - self.heart_value = 0 - - heartrate_done_label.set_text(" ") - heartrate_bpm_label.set_text("-- bpm") - heartrate_start_label.set_text("正在测量中.") + + if heartrate_done_label != None: + heartrate_done_label.set_text(" ") + if heartrate_bpm_label != None: + heartrate_bpm_label.set_text("-- bpm") + if heartrate_start_label != None: + heartrate_start_label.set_text("正在测量中.") EventMesh.publish("set_hr_state",1)#1代表手动进入测试界面 EventMesh.publish(constants.EVENT.START_HEART) - - self.is_sliding =0 + def start_init(self): self.point = 0 self.timer.start(1*500, 1, self.start_measure) @@ -1262,19 +1265,19 @@ class HeartrateScreen(Screen): if value <= 60:#18 36.6 -18 = 18 line_value = int((value-30)*0.6)# elif value <= 90: - line_value = int((value-60)*0.6)+18#127+15+1 + line_value = int((value-60)*0.6)+18*1#127+15+1 elif value < 120: - line_value = int((value-90)*0.55)+18+18 + line_value = int((value-90)*0.55)+18*2 elif value == 120: - line_value = int((value-90)*0.6)+18+18 + line_value = int((value-90)*0.6)+18*2 elif value < 150: - line_value = int((value-120)*0.55)+18+18+18 + line_value = int((value-120)*0.55)+18*3 elif value == 150: - line_value = int((value-120)*0.6)+18+18+18 + line_value = int((value-120)*0.6)+18*3 elif value < 180: - line_value = int((value-150)*0.56)+18+18+18+18 + line_value = int((value-150)*0.56)+18*4 elif value == 180: - line_value = int((value-150)*0.6)+18+18+18+18 + line_value = int((value-150)*0.6)+18*4 #print("hr hist",line_value) hr_line_points = [{"x":0,"y":0},{"x":0,"y":line_value}] if i == 0: @@ -1330,23 +1333,23 @@ class HeartrateScreen(Screen): if self.point%4 == 0 : heartrate_start_label.set_text("正在测量中..") - heartrate_done_img.set_src("E:/static/hr_gif_02.png") + heartrate_done_img.set_src("U:/static/hr_gif_02.png") if self.point%4 == 1 : heartrate_start_label.set_text("正在测量中...") - heartrate_done_img.set_src("E:/static/hr_gif_01.png") + heartrate_done_img.set_src("U:/static/hr_gif_01.png") if self.point%4 == 2 : heartrate_start_label.set_text("正在测量中.") - heartrate_done_img.set_src("E:/static/hr_gif_02.png") + heartrate_done_img.set_src("U:/static/hr_gif_02.png") if self.point%4 == 3 : heartrate_start_label.set_text("正在测量中.") - heartrate_done_img.set_src("E:/static/hr_gif_03.png") + heartrate_done_img.set_src("U:/static/hr_gif_03.png") if self.point > 120 or (WEAR == 0 and self.point > 10): #测60s或没佩戴 self.timer.stop() - heartrate_done_img.set_src("E:/static/hr_gif_03.png") + heartrate_done_img.set_src("U:/static/hr_gif_03.png") self.heart_value = EventMesh.publish(constants.EVENT.GET_HEART) if WEAR == 0: @@ -1378,9 +1381,10 @@ class HeartrateScreen(Screen): EventMesh.publish("set_hr_state",0)#0代表关闭测试 print("stop debug10") EventMesh.publish(constants.EVENT.STOP_HEART) - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") + def done_return(self): + EventMesh.publish("load_screen", {"screen": "health"}) + # def done_left_to_right(self): + # EventMesh.publish("return_prev_screen") def btn8_press(self): EventMesh.publish("watch_top_show") @@ -1459,7 +1463,9 @@ class bloodpressureScreen(Screen): blood_pressure_screen = lv.obj() print("blood_pressure_screen") blood_pressure_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - + blood_pressure_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,1)), + lv.EVENT.GESTURE, None) + blood_pressure_label = lv.label(blood_pressure_screen) blood_pressure_label.set_pos(0, 10) blood_pressure_label.set_size(LCD_SIZE_W, 40) @@ -1471,16 +1477,16 @@ class bloodpressureScreen(Screen): blood_pressure_line_bg_img = lv.img(blood_pressure_screen) blood_pressure_line_bg_img.set_pos(5, 45) blood_pressure_line_bg_img.set_size(230, 120) - blood_pressure_line_bg_img.set_src("E:/static/hr_line_bg.png") + blood_pressure_line_bg_img.set_src("U:/static/hr_line_bg.png") blood_pressure_done_img = lv.img(blood_pressure_screen) blood_pressure_done_img.set_pos(20, 224) - blood_pressure_done_img.set_src("E:/static/blood_gif03.png") + blood_pressure_done_img.set_src("U:/static/blood_gif03.png") blood_pressure_reset_btn_img = lv.img(blood_pressure_screen) blood_pressure_reset_btn_img.set_pos(0, 172) - blood_pressure_reset_btn_img.set_src("E:/static/reset_hr_btn.png") + blood_pressure_reset_btn_img.set_src("U:/static/reset_hr_btn.png") blood_pressure_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) blood_pressure_reset_btn_img.add_flag(lv.obj.FLAG.CLICKABLE) @@ -1608,10 +1614,8 @@ class bloodpressureScreen(Screen): blood_pressure_done_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) self.meta = blood_pressure_screen - blood_pressure_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), + blood_pressure_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e,2)), lv.EVENT.SHORT_CLICKED, None) - blood_pressure_reset_btn_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.restart_up(e)), - lv.EVENT.PRESSING, None) blood_pressure_done_label.set_text(" ") blood_pressure_bpm_label.set_text("--/--") @@ -2125,19 +2129,18 @@ class bloodpressureScreen(Screen): - def restart_up(self,e): + def restart_up(self,e,msg): global blood_pressure_done_label,blood_pressure_bpm_label,blood_pressure_start_label,blood_pressure_reset_btn_img - code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "health"}) elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 + if msg == 2: self.point = 0 self.blood_Maxvalue = 0 self.blood_Minvalue = 0 @@ -2149,14 +2152,16 @@ class bloodpressureScreen(Screen): self.heart_value = 0 - blood_pressure_done_label.set_text(" ") - blood_pressure_bpm_label.set_text("--/--") - blood_pressure_start_label.set_text("正在测量中.") + if blood_pressure_done_label != None: + blood_pressure_done_label.set_text(" ") + if blood_pressure_bpm_label != None: + blood_pressure_bpm_label.set_text("--/--") + if blood_pressure_start_label != None: + blood_pressure_start_label.set_text("正在测量中.") EventMesh.publish("set_bp_state",1)#3代表单次测量 EventMesh.publish(constants.EVENT.START_HEART) - - self.is_sliding =0 + def start_init(self): self.point = 0 self.blood_Maxvalue = 0 @@ -2164,13 +2169,17 @@ class bloodpressureScreen(Screen): self.count_blood = 0 self.count_blood = 0 self.timer.start(1*500, 1, self.start_measure) - blood_pressure_bpm_label.set_text("--/--") + if blood_pressure_bpm_label != None: + blood_pressure_bpm_label.set_text("--/--") if blood_pressure_reset_btn_img != None: blood_pressure_reset_btn_img.add_flag(lv.obj.FLAG.HIDDEN) self.heart_value = 0 - blood_pressure_done_label.set_text(" ") - blood_pressure_bpm_label.set_text("--/--") - blood_pressure_start_label.set_text("正在测量中.") + if blood_pressure_done_label != None: + blood_pressure_done_label.set_text(" ") + if blood_pressure_bpm_label != None: + blood_pressure_bpm_label.set_text("--/--") + if blood_pressure_start_label != None: + blood_pressure_start_label.set_text("正在测量中.") EventMesh.publish("set_bp_state",1)#3代表单次测量 EventMesh.publish(constants.EVENT.START_HEART) @@ -2210,19 +2219,19 @@ class bloodpressureScreen(Screen): if valueMax <= 60:#18 36.6 -18 = 18 line_Maxvalue = int((valueMax-30)*0.6)# elif valueMax <= 90: - line_Maxvalue = int((valueMax-60)*0.6)+18#127+15+1 + line_Maxvalue = int((valueMax-60)*0.6)+18*1#127+15+1 elif valueMax < 120: - line_Maxvalue = int((valueMax-90)*0.55)+18+18 + line_Maxvalue = int((valueMax-90)*0.55)+18*2 elif valueMax == 120: - line_Maxvalue = int((valueMax-90)*0.6)+18+18 + line_Maxvalue = int((valueMax-90)*0.6)+18*2 elif valueMax < 150: - line_Maxvalue = int((valueMax-120)*0.55)+18+18+18 + line_Maxvalue = int((valueMax-120)*0.55)+18*3 elif valueMax == 150: - line_Maxvalue = int((valueMax-120)*0.6)+18+18+18 + line_Maxvalue = int((valueMax-120)*0.6)+18*3 elif valueMax < 180: - line_Maxvalue = int((valueMax-150)*0.56)+18+18+18+18 + line_Maxvalue = int((valueMax-150)*0.56)+18*4 elif valueMax == 180: - line_Maxvalue = int((valueMax-150)*0.6)+18+18+18+18 + line_Maxvalue = int((valueMax-150)*0.6)+18*4 if line_Maxvalue >= 100: line_Maxvalue = 100 @@ -2239,19 +2248,19 @@ class bloodpressureScreen(Screen): if valueMin <= 60:#18 36.6 -18 = 18 line_Minvalue = int((valueMin-30)*0.6)# elif valueMin <= 90: - line_Minvalue = int((valueMin-60)*0.6)+18#127+15+1 + line_Minvalue = int((valueMin-60)*0.6)+18*1#127+15+1 elif valueMin < 120: - line_Minvalue = int((valueMin-90)*0.55)+18+18 + line_Minvalue = int((valueMin-90)*0.55)+18*2 elif valueMin == 120: - line_Minvalue = int((valueMin-90)*0.6)+18+18 + line_Minvalue = int((valueMin-90)*0.6)+18*2 elif valueMin < 150: - line_Minvalue = int((valueMin-120)*0.55)+18+18+18 + line_Minvalue = int((valueMin-120)*0.55)+18*3 elif valueMin == 150: - line_Minvalue = int((valueMin-120)*0.6)+18+18+18 + line_Minvalue = int((valueMin-120)*0.6)+18*3 elif valueMin < 180: - line_Minvalue = int((valueMin-150)*0.56)+18+18+18+18 + line_Minvalue = int((valueMin-150)*0.56)+18*4 elif valueMin == 180: - line_Minvalue = int((valueMin-150)*0.6)+18+18+18+18 + line_Minvalue = int((valueMin-150)*0.6)+18*4 #print("hr hist",line_value) blood_pressure_lineh_points = [{"x":0,"y":0},{"x":0,"y":line_Maxvalue}] blood_pressure_linel_points = [{"x":0,"y":0},{"x":0,"y":line_Minvalue}] @@ -2332,18 +2341,18 @@ class bloodpressureScreen(Screen): if self.point%3 == 0 : blood_pressure_start_label.set_text("正在测量中..") - blood_pressure_done_img.set_src("E:/static/blood_gif01.png") + blood_pressure_done_img.set_src("U:/static/blood_gif01.png") if self.point%3 == 1 : blood_pressure_start_label.set_text("正在测量中...") - blood_pressure_done_img.set_src("E:/static/blood_gif02.png") + blood_pressure_done_img.set_src("U:/static/blood_gif02.png") if self.point%3 == 2 : blood_pressure_start_label.set_text("正在测量中.") - blood_pressure_done_img.set_src("E:/static/blood_gif03.png") + blood_pressure_done_img.set_src("U:/static/blood_gif03.png") if self.point > 120 or (WEAR == 0 and self.point > 10): #90S self.timer.stop() - blood_pressure_done_img.set_src("E:/static/blood_gif03.png") + blood_pressure_done_img.set_src("U:/static/blood_gif03.png") if WEAR == 0: blood_pressure_start_label.set_text("佩戴异常,点击重测") else : @@ -2382,9 +2391,9 @@ class bloodpressureScreen(Screen): def btn1_release(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) - - def done_left_to_right(self): - EventMesh.publish("return_prev_screen") + def done_return(self): + EventMesh.publish("load_screen", {"screen": "health"}) + def btn8_press(self): EventMesh.publish("watch_top_show") diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py new file mode 100644 index 00000000..d87f8cc6 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_main_menu.py @@ -0,0 +1,1086 @@ +#主菜单 +import utime +import osTimer +import lvgl as lv +import EventMesh +from machine import Timer +import voiceCall +import osTimer +import constants +from misc import Power +import pm +from ui import Screen,style_screen,style_font_youyuan_20,style_font_youyuan_20_black +from ui_WatchFaceScreen import WatchFace +from lcd import LCD_SIZE_W,LCD_SIZE_H +MAIN_ICON_SZIE = 120 #菜单界面图片的大小 +MAIN_ICON_X = 60#菜单界面的x坐标 +MAIN_ICON_Y = 30#菜单界面的y坐标 +MAIN_LABEL_Y = 200#菜单界面的文本的y坐标 +style_MainMenu_screen_default = lv.style_t() +style_MainMenu_screen_default.init() +style_MainMenu_screen_default.set_radius(0) +style_MainMenu_screen_default.set_bg_color(lv.color_make(0x00, 0x00, 0x00)) +style_MainMenu_screen_default.set_bg_opa(255) +style_MainMenu_screen_default.set_border_width(0) +style_MainMenu_screen_default.set_pad_left(0) +style_MainMenu_screen_default.set_pad_right(0) +style_MainMenu_screen_default.set_pad_top(0) +style_MainMenu_screen_default.set_pad_bottom(0) + +style_MainMenu_img_default = lv.style_t() +style_MainMenu_img_default.init() +style_MainMenu_img_default.set_img_recolor(lv.color_make(0xff,0xff,0xff)) +style_MainMenu_img_default.set_img_recolor_opa(0) +style_MainMenu_img_default.set_img_opa(255) + +style_font_youyuan_20 = lv.style_t() +style_font_youyuan_20.init() +style_font_youyuan_20.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_20.set_text_font(lv.K01_font_16_ALL) + +style_font_youyuan_25 = lv.style_t() +style_font_youyuan_25.init() +style_font_youyuan_25.set_text_color(lv.color_make(0xff, 0xff, 0xff)) +style_font_youyuan_25.set_text_font(lv.K01_font_16_ALL) + +style_btn = lv.style_t() +style_btn.init() +style_btn.set_bg_opa(lv.OPA.TRANSP) +style_btn.set_shadow_opa(0) +style_btn.set_border_width(0) + + +MainMenu = lv.obj() + +style_font_youyuan_font_60 = lv.style_t() +style_font_youyuan_font_60.init() +style_font_youyuan_font_60.set_text_color(lv.color_make(0xFF, 0xFF, 0xFF)) +style_font_youyuan_font_60.set_text_font(lv.K01_font_16_ALL) +MainMenu2x = 0 +MainMenu2_num = 0 +MainMenu2 = lv.obj(MainMenu) +MainMenu2.set_size(LCD_SIZE_W,LCD_SIZE_H) +#MainMenu1.set_pos(0,0) +MainMenu2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +MainMenu2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) +print("MainMenu2") +MainMenu2_til = lv.tileview(MainMenu2) +MainMenu2_til.set_scrollbar_mode(0) +MainMenu2_til.set_size(240,284) +MainMenu2_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) +#MainMenu2_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) +#LV_OBJ_FLAG_SCROLL_MOMENTUM +#表盘 +MainMenu2_Watchface = MainMenu2_til.add_tile(0, 1, lv.DIR.LEFT | lv.DIR.RIGHT) + +label_text = lv.label(MainMenu2_Watchface) +label_text.set_pos(0, LCD_SIZE_W) +label_text.set_size(0, 0) +label_text.set_text("0") + +# MainMenu2_num+=1 +# # # #支付宝 +# # MainMenu2_alipay = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# # #MainMenu2_alipay.set_tile_act(7,0,lv.ANIM.ON)#设置拼接 +# # label_text = lv.label(MainMenu2_alipay) +# # label_text.set_pos(0, LCD_SIZE_H) +# # label_text.set_size(0, 0) +# # label_text.set_text("{}".format(MainMenu2_num)) +# # MainMenu2_img_alipay = lv.img(MainMenu2_alipay) +# # MainMenu2_img_alipay.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# # MainMenu2_img_alipay.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# # MainMenu2_img_alipay.set_src("U:/static/alipay_.png") +# # MainMenu2_img_alipay.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_alipay.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# # MainMenu2_img_alipay_text = lv.label(MainMenu2_alipay) +# # MainMenu2_img_alipay_text.set_pos(int(0),int(MAIN_LABEL_Y)) +# # MainMenu2_img_alipay_text.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# # MainMenu2_img_alipay_text.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_alipay_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# # MainMenu2_img_alipay_text.set_text("支付宝") +# # MainMenu2_img_alipay_text.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# # MainMenu2_num+=1 +# # MainMenu2x+=1 + +# #视频通话 +# MainMenu2_heartrate = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) +# label_text = lv.label(MainMenu2_heartrate) +# label_text.set_pos(0, 0) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_camera_video = lv.img(MainMenu2_heartrate) +# MainMenu2_img_camera_video.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_camera_video.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_camera_video.set_src("U:/static/IMAGE_ONE_PAGE_VIDEOCALL.png") +# MainMenu2_img_camera_video.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera_video.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_camera_video_txt = lv.label(MainMenu2_heartrate) +# MainMenu2_img_camera_video_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_camera_video_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_camera_video_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera_video_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_camera_video_txt.set_text("视频通话") +# MainMenu2_img_camera_video_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 +# # label_alipay.set_long_mode(lv.label.LONG.WRAP) +# # label_alipay.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# # label_alipay.add_style(style_font_youyuan_25, lv.PART.MAIN | lv.STATE.DEFAULT) + +# #相机 +# MainMenu2_camera = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) +# label_text = lv.label(MainMenu2_camera) +# label_text.set_pos(0, 0) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_camera = lv.img(MainMenu2_camera) +# MainMenu2_img_camera.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_camera.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_camera.set_src("U:/static/IMAGE_ONE_PAGE_CAMERA.png") +# MainMenu2_img_camera.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_camera_txt = lv.label(MainMenu2_camera) +# MainMenu2_img_camera_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_camera_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_camera_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_camera_txt.set_text("相机") +# MainMenu2_img_camera_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + + +# #相册 +# MainMenu2_camera_album = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.ALL) +# label_text = lv.label(MainMenu2_camera_album) +# label_text.set_pos(0, 0) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_camera_album = lv.img(MainMenu2_camera_album) +# MainMenu2_img_camera_album.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_camera_album.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_camera_album.set_src("U:/static/IMAGE_ONE_PAGE_ALBUM.png") +# MainMenu2_img_camera_album.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera_album.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_camera_album_txt = lv.label(MainMenu2_camera_album) +# MainMenu2_img_camera_album_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_camera_album_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_camera_album_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_camera_album_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_camera_album_txt.set_text("相册") +# MainMenu2_img_camera_album_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 +# #拨号盘 +# MainMenu2_phone = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_phone) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_phone = lv.img(MainMenu2_phone) +# MainMenu2_img_phone.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_phone.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_phone.set_src("U:/static/IMAGE_ONE_PAGE_CALL.png") +# MainMenu2_img_phone.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_phone.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_phone_text = lv.label(MainMenu2_phone) +# MainMenu2_img_phone_text.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_phone_text.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_phone_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_phone_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_phone_text.set_text("拨号盘") +# MainMenu2_img_phone_text.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# #通讯录 +# MainMenu2_contacts = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_contacts) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_contacts = lv.img(MainMenu2_contacts) +# MainMenu2_img_contacts.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_contacts.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_contacts.set_src("U:/static/IMAGE_ONE_PAGE_CONTACTS.png") +# MainMenu2_img_contacts.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_contacts.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_contacts_txt = lv.label(MainMenu2_contacts) +# MainMenu2_img_contacts_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_contacts_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_contacts_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_contacts_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_contacts_txt.set_text("联系人") +# MainMenu2_img_contacts_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# #短信 +# MainMenu2_SMS = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_SMS) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_sms = lv.img(MainMenu2_SMS) +# MainMenu2_img_sms.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_sms.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_sms.set_src("U:/static/IMAGE_ONE_PAGE_SMS.png") +# MainMenu2_img_sms.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_sms.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_sms_txt = lv.label(MainMenu2_SMS) +# MainMenu2_img_sms_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_sms_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_sms_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_sms_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_sms_txt.set_text("短信") +# MainMenu2_img_sms_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# #AI助手 +# MainMenu2_ai = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_ai) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_ai = lv.img(MainMenu2_ai) +# MainMenu2_img_ai.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_ai.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_ai.set_src("U:/static/IMAGE_ONE_PAGE_AI.png") +# MainMenu2_img_ai.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_ai.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_ai_txt = lv.label(MainMenu2_ai) +# MainMenu2_img_ai_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_ai_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_ai_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_ai_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_ai_txt.set_text("AI助手") +# MainMenu2_img_ai_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# #微聊 +# MainMenu2_wechat = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_wechat) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_wechat = lv.img(MainMenu2_wechat) +# MainMenu2_img_wechat.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_wechat.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_wechat.set_src("U:/static/IMAGE_ONE_PAGE_WECHAT.png") +# MainMenu2_img_wechat.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_wechat.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_wechat_txt = lv.label(MainMenu2_wechat) +# MainMenu2_img_wechat_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_wechat_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_wechat_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_wechat_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_wechat_txt.set_text("微聊") +# MainMenu2_img_wechat_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# # #健康测量 +# # MainMenu2_heartrate = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# # label_text = lv.label(MainMenu2_heartrate) +# # label_text.set_pos(0, LCD_SIZE_H) +# # label_text.set_size(0, 0) +# # label_text.set_text("{}".format(MainMenu2_num)) +# # MainMenu2_img_health = lv.img(MainMenu2_heartrate) +# # MainMenu2_img_health.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# # MainMenu2_img_health.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# # MainMenu2_img_health.set_src("U:/static/IMAGE_ONE_PAGE_HEALTH.png") +# # MainMenu2_img_health.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_health.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# # MainMenu2_img_health_txt = lv.label(MainMenu2_heartrate) +# # MainMenu2_img_health_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# # MainMenu2_img_health_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# # MainMenu2_img_health_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_health_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# # MainMenu2_img_health_txt.set_text("健康测量") +# # MainMenu2_img_health_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# # MainMenu2_num+=1 +# # MainMenu2x+=1 + + +# #血样检测 +# # MainMenu2_spo2 = MainMenu2_til.add_tile(4, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# # label_text = lv.label(MainMenu2_spo2) +# # label_text.set_pos(0, 240) +# # label_text.set_size(0, 0) +# # label_text.set_text("5") +# # MainMenu2_img_spo2 = lv.img(MainMenu2_spo2) +# # MainMenu2_img_spo2.set_size(160,160) +# # MainMenu2_img_spo2.set_pos(40,20) +# # MainMenu2_img_spo2.set_src("U:/static/IMAGE_ONE_PAGE_SPO2_DETECT.png") +# # MainMenu2_img_spo2.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_spo2.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# # MainMenu2_img_spo2_txt = lv.label(MainMenu2_spo2) +# # MainMenu2_img_spo2_txt.set_pos(int(0),int(220)) +# # MainMenu2_img_spo2_txt.set_size(240,100) +# # MainMenu2_img_spo2_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu2_img_spo2_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# # MainMenu2_img_spo2_txt.set_text("血氧检测") +# # MainMenu2_img_spo2_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# #MainMenu2_num+=1 +# #MainMenu2x+=1 + +# #工具箱 +# MainMenu2_toolbox = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu2_toolbox) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_toolbox = lv.img(MainMenu2_toolbox) +# MainMenu2_img_toolbox.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_toolbox.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_toolbox.set_src("U:/static/IMAGE_ONE_PAGE_TOOLS.png") +# MainMenu2_img_toolbox.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_toolbox.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_toolbox_txt = lv.label(MainMenu2_toolbox) +# MainMenu2_img_toolbox_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_toolbox_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_toolbox_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_toolbox_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_toolbox_txt.set_text("工具箱") +# MainMenu2_img_toolbox_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + +# #设置 +# MainMenu2_setting = MainMenu2_til.add_tile(MainMenu2x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# #MainMenu2_setting.set_tile_act(0,0,lv.ANIM.ON) +# label_text = lv.label(MainMenu2_setting) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu2_num)) +# MainMenu2_img_setting = lv.img(MainMenu2_setting) +# MainMenu2_img_setting.set_size(MAIN_ICON_SZIE,MAIN_ICON_SZIE) +# MainMenu2_img_setting.set_pos(MAIN_ICON_X,MAIN_ICON_Y) +# MainMenu2_img_setting.set_src("U:/static/IMAGE_ONE_PAGE_SETTINGS.png") +# MainMenu2_img_setting.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_setting.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu2_img_setting_txt = lv.label(MainMenu2_setting) +# MainMenu2_img_setting_txt.set_pos(int(0),int(MAIN_LABEL_Y)) +# MainMenu2_img_setting_txt.set_size(LCD_SIZE_W,LCD_SIZE_H-MAIN_LABEL_Y) +# MainMenu2_img_setting_txt.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu2_img_setting_txt.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu2_img_setting_txt.set_text("设置") +# MainMenu2_img_setting_txt.add_style(style_font_youyuan_font_60, lv.PART.MAIN|lv.STATE.DEFAULT) +# MainMenu2_num+=1 +# MainMenu2x+=1 + + + +################################################################################################################ +THEME1_ICON_X = 80 +THEME1_ICON_Y = 80 + +MAIN1_ICON_X = 26 +MAIN1_ICON_Y = 12 +MainMenu1x = 0 +MainMenu1_num = 0 +MainMenu1 = lv.obj(MainMenu) +MainMenu1.set_size(LCD_SIZE_W,LCD_SIZE_H) +#MainMenu1.set_pos(0,0) +MainMenu1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +MainMenu1.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) +print("MainMenu1") +MainMenu1_til = lv.tileview(MainMenu1) +MainMenu1_til.set_scrollbar_mode(0) +MainMenu1_til.set_size(240,284) +MainMenu1_til.add_style(style_MainMenu_screen_default, lv.PART.MAIN | lv.STATE.DEFAULT) +#MainMenu1_til.add_flag(lv.obj.FLAG.SCROLL_ELASTIC) +#LV_OBJ_FLAG_SCROLL_MOMENTUM +#表盘 +MainMenu1_Watchface = MainMenu1_til.add_tile(0, 1, lv.DIR.LEFT | lv.DIR.RIGHT) + +label_text = lv.label(MainMenu1_Watchface) +label_text.set_pos(0, LCD_SIZE_W) +label_text.set_size(0, 0) +label_text.set_text("0") + + +MainMenu1_num+=1 + +#拨号盘 +MainMenu1_one = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +label_text = lv.label(MainMenu1_one) +label_text.set_pos(0, LCD_SIZE_H) +label_text.set_size(0, 0) +label_text.set_text("{}".format(MainMenu1_num)) +MainMenu1_img_contacts = lv.img(MainMenu1_one) +# MainMenu1_img_contacts.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_contacts.set_size(240,282) +MainMenu1_img_contacts.set_pos(0,0) +MainMenu1_img_contacts.set_src("U:/static/theme1/THEME1_CONTACTS.png") +# MainMenu1_img_contacts.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_contacts.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +MainMenu1_img_contacts_text = lv.label(MainMenu1_one) +MainMenu1_img_contacts_text.set_pos(int(MAIN1_ICON_X),int(MAIN1_ICON_Y+5)) +MainMenu1_img_contacts_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_contacts_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_contacts_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_contacts_text.set_text(" ") +MainMenu1_img_contacts_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_sms= lv.img(MainMenu1_one) +# MainMenu1_img_sms.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_sms.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +# # MainMenu1_img_sms.set_src("U:/static/theme1/THEME1_SMS.png") +# MainMenu1_img_sms.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_sms.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +MainMenu1_img_sms_text = lv.label(MainMenu1_one) +MainMenu1_img_sms_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) +MainMenu1_img_sms_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_sms_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_sms_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_sms_text.set_text(" ") +MainMenu1_img_sms_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_phone = lv.img(MainMenu1_one) +# MainMenu1_img_phone.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_phone.set_pos(MAIN1_ICON_X,140+5) +# # MainMenu1_img_phone.set_src("U:/static/theme1/THEME1_PHONE.png") +# MainMenu1_img_phone.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_phone.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +MainMenu1_img_phone_text = lv.label(MainMenu1_one) +MainMenu1_img_phone_text.set_pos(int(MAIN1_ICON_X),int(140+5)) +MainMenu1_img_phone_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_phone_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_phone_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_phone_text.set_text(" ") +MainMenu1_img_phone_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_calllog = lv.img(MainMenu1_one) +# MainMenu1_img_calllog.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_calllog.set_pos(MAIN1_ICON_X*2+85,140+5) +# # MainMenu1_img_calllog.set_src("U:/static/theme1/THEME1_CALLLOG.png") +# MainMenu1_img_calllog.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_calllog.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +MainMenu1_img_calllog_text = lv.label(MainMenu1_one) +MainMenu1_img_calllog_text.set_pos(int(MAIN1_ICON_X*2+85),int(140+5)) +MainMenu1_img_calllog_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_calllog_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_calllog_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_calllog_text.set_text(" ") +MainMenu1_img_calllog_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_num+=1 +# MainMenu1x+=1 +# #健康测试 +# MainMenu1_two = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +# label_text = lv.label(MainMenu1_two) +# label_text.set_pos(0, LCD_SIZE_H) +# label_text.set_size(0, 0) +# label_text.set_text("{}".format(MainMenu1_num)) + + +# MainMenu1_img_hr = lv.img(MainMenu1_two) +# MainMenu1_img_hr.set_size(240,282) +# MainMenu1_img_hr.set_pos(0,0) +# MainMenu1_img_hr.set_src("U:/static/theme1/THEME1_HEART.png") +# # MainMenu1_img_hr.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_hr.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_hr_text = lv.label(MainMenu1_two) +# MainMenu1_img_hr_text.set_pos(int(MAIN1_ICON_X),int(MAIN1_ICON_Y+5)) +# MainMenu1_img_hr_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_hr_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_hr_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_hr_text.set_text(" ") +# MainMenu1_img_hr_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# # MainMenu1_img_spo2 = lv.img(MainMenu1_two) +# # MainMenu1_img_spo2.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# # MainMenu1_img_spo2.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +# # MainMenu1_img_spo2.set_src("U:/static/theme1/THEME1_SPO2.png") +# # MainMenu1_img_spo2.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu1_img_spo2.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_spo2_text = lv.label(MainMenu1_two) +# MainMenu1_img_spo2_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) +# MainMenu1_img_spo2_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_spo2_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_spo2_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_spo2_text.set_text(" ") +# MainMenu1_img_spo2_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +# # MainMenu1_img_blood = lv.img(MainMenu1_two) +# # MainMenu1_img_blood.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# # MainMenu1_img_blood.set_pos(MAIN1_ICON_X,140+5) +# # MainMenu1_img_blood.set_src("U:/static/theme1/THEME1_BLOOD_PRESSURE.png") +# # MainMenu1_img_blood.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu1_img_blood.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_blood_text = lv.label(MainMenu1_two) +# MainMenu1_img_blood_text.set_pos(int(MAIN1_ICON_X),int(140+5)) +# MainMenu1_img_blood_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_blood_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_blood_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_blood_text.set_text(" ") +# MainMenu1_img_blood_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# # MainMenu1_img_temp = lv.img(MainMenu1_two) +# # MainMenu1_img_temp.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# # MainMenu1_img_temp.set_pos(MAIN1_ICON_X*2+85,140+5) +# # MainMenu1_img_temp.set_src("U:/static/theme1/THEME1_TEMP.png") +# # MainMenu1_img_temp.add_flag(lv.obj.FLAG.CLICKABLE) +# # MainMenu1_img_temp.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_temp_text = lv.label(MainMenu1_two) +# MainMenu1_img_temp_text.set_pos(int(MAIN1_ICON_X*2+85),int(140+5)) +# MainMenu1_img_temp_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_temp_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_temp_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_temp_text.set_text(" ") +# MainMenu1_img_temp_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + +MainMenu1_num+=1 +MainMenu1x+=1 +#短信 +MainMenu1_three = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +label_text = lv.label(MainMenu1_three) +label_text.set_pos(0, LCD_SIZE_H) +label_text.set_size(0, 0) +label_text.set_text("{}".format(MainMenu1_num)) + +MainMenu1_img_wechat = lv.img(MainMenu1_three) +MainMenu1_img_wechat.set_size(240,282) +MainMenu1_img_wechat.set_pos(0,0) +MainMenu1_img_wechat.set_src("U:/static/theme1/THEME1_WECHAT.png") +# MainMenu1_img_wechat.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_wechat.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_health_text = lv.label(MainMenu1_three) +# MainMenu1_img_health_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_health_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_health_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_health_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_health_text.set_text(" ") +# MainMenu1_img_health_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + +MainMenu1_img_ai_text = lv.label(MainMenu1_three) +MainMenu1_img_ai_text.set_pos(MAIN1_ICON_X*2,MAIN1_ICON_Y+5) +MainMenu1_img_ai_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_ai_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_ai_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_ai_text.set_text(" ") +MainMenu1_img_ai_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + +MainMenu1_img_wechat_text = lv.label(MainMenu1_three) +MainMenu1_img_wechat_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +MainMenu1_img_wechat_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_wechat_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_wechat_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_wechat_text.set_text(" ") +MainMenu1_img_wechat_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +# MainMenu1_img_alarm= lv.img(MainMenu1_three) +# MainMenu1_img_alarm.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_alarm.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +# MainMenu1_img_alarm.set_src("U:/static/theme1/THEME1_ALARM.png") +# MainMenu1_img_alarm.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_alarm.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +MainMenu1_img_alarm_text = lv.label(MainMenu1_three) +MainMenu1_img_alarm_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_alarm_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_alarm_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_alarm_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_alarm_text.set_text(" ") +MainMenu1_img_alarm_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_camera_text = lv.label(MainMenu1_three) +MainMenu1_img_camera_text.set_pos(MAIN1_ICON_X*2+85,140+5) +MainMenu1_img_camera_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_camera_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_camera_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_camera_text.set_text(" ") +MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_num+=1 +MainMenu1x+=1 +#相机,相册,视频通话,支付宝 +MainMenu1_four = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +label_text = lv.label(MainMenu1_four) +label_text.set_pos(0, LCD_SIZE_H) +label_text.set_size(0, 0) +label_text.set_text("{}".format(MainMenu1_num)) + +MainMenu1_img_toolbox = lv.img(MainMenu1_four) +MainMenu1_img_toolbox.set_size(240,282) +MainMenu1_img_toolbox.set_pos(0,0) +MainMenu1_img_toolbox.set_src("U:/static/theme1/THEME1_CAMERA.png") +# MainMenu1_img_toolbox.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_toolbox.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_camera_text = lv.label(MainMenu1_four) +# MainMenu1_img_camera_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_camera_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +# MainMenu1_img_camera_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_camera_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_camera_text.set_text(" ") +# MainMenu1_img_camera_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_picture_text = lv.label(MainMenu1_four) +MainMenu1_img_picture_text.set_pos(int(MAIN1_ICON_X),int(MAIN1_ICON_Y+5)) +MainMenu1_img_picture_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_picture_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_picture_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_picture_text.set_text(" ") +MainMenu1_img_picture_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_video_text = lv.label(MainMenu1_four) +MainMenu1_img_video_text.set_pos(MAIN1_ICON_X*2+85,MAIN1_ICON_Y+5) +MainMenu1_img_video_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_video_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_video_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_video_text.set_text(" ") +MainMenu1_img_video_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_alipay_text = lv.label(MainMenu1_four) +MainMenu1_img_alipay_text.set_pos(MAIN1_ICON_X,140+5) +MainMenu1_img_alipay_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_alipay_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_alipay_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_alipay_text.set_text(" ") +MainMenu1_img_alipay_text.add_style(style_font_youyuan_20, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_stopwatch_text = lv.label(MainMenu1_four) +MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X*2+85,140+5) +MainMenu1_img_stopwatch_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +MainMenu1_img_stopwatch_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_stopwatch_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_stopwatch_text.set_text(" ") +MainMenu1_img_stopwatch_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_num+=1 +MainMenu1x+=1 +#工具箱 设置 +MainMenu1_setting = MainMenu1_til.add_tile(MainMenu1x, 0, lv.DIR.LEFT | lv.DIR.RIGHT) +label_text = lv.label(MainMenu1_setting) +label_text.set_pos(0, LCD_SIZE_H) +label_text.set_size(0, 0) +label_text.set_text("{}".format(MainMenu1_num)) + +MainMenu1_img_setting = lv.img(MainMenu1_setting) +MainMenu1_img_setting.set_size(240,282) +MainMenu1_img_setting.set_pos(0,0) +MainMenu1_img_setting.set_src("U:/static/theme1/THEME1_SETING.png") +# MainMenu1_img_setting.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_setting.add_style(style_MainMenu_img_default, lv.PART.MAIN | lv.STATE.DEFAULT) + +# MainMenu1_img_stopwatch_text = lv.label(MainMenu1_setting) +# MainMenu1_img_stopwatch_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +# MainMenu1_img_stopwatch_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +# MainMenu1_img_stopwatch_text.add_flag(lv.obj.FLAG.CLICKABLE) +# MainMenu1_img_stopwatch_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# MainMenu1_img_stopwatch_text.set_text(" ") +# MainMenu1_img_stopwatch_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + +MainMenu1_img_countdown_text = lv.label(MainMenu1_setting) +MainMenu1_img_countdown_text.set_pos(MAIN1_ICON_X,MAIN1_ICON_Y+5) +MainMenu1_img_countdown_text.set_size(THEME1_ICON_X,THEME1_ICON_Y) +MainMenu1_img_countdown_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_countdown_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_countdown_text.set_text(" ") +MainMenu1_img_countdown_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_toolbox_text = lv.label(MainMenu1_setting) +MainMenu1_img_toolbox_text.set_pos(int(MAIN1_ICON_X*2+85),int(MAIN1_ICON_Y+5)) +MainMenu1_img_toolbox_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_toolbox_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_toolbox_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_toolbox_text.set_text(" ") +MainMenu1_img_toolbox_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + +MainMenu1_img_setting_text = lv.label(MainMenu1_setting) +MainMenu1_img_setting_text.set_pos(int(MAIN1_ICON_X),int(140+5)) +MainMenu1_img_setting_text.set_size(THEME1_ICON_X,THEME1_ICON_X) +MainMenu1_img_setting_text.add_flag(lv.obj.FLAG.CLICKABLE) +MainMenu1_img_setting_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +MainMenu1_img_setting_text.set_text(" ") +MainMenu1_img_setting_text.add_style(style_font_youyuan_20_black, lv.PART.MAIN|lv.STATE.DEFAULT) + + + +MainMenu1_num+=1 +MainMenu1x+=1 + +#主菜单风格2,单页 +class MainMenuScreen(Screen): + NAME = "main_menu" + def __init__(self): + self.meta = MainMenu + self.MainMenu_Watchface = None + self.MainMenu_til = None + self.MainMenu_num = None + self.watchface = None + read_data = EventMesh.publish("get_storage_config","MainMenu") + print("set_mainmenu:MainMenu:{}".format(read_data)) + if read_data != None: + self.set_mainmenu(msg = [read_data,0]) + else: + self.set_mainmenu(msg = ["1",0]) + self.watchface = WatchFace(self.MainMenu_Watchface ) + + + EventMesh.subscribe("set_mainmenu", self.set_mainmenu) + + self.menu_id = "0" + self.menu_new_id = "255" + self.menu_old_id = "255" + self.is_sliding = 0 + self.scroll_begin_event_count = 0 + self.menu_action = 0 # =1左滑 =2右划 + ###1 + MainMenu1_til.add_event_cb(lambda e: EventMesh.callback_wrapper(self.scroll_begin_event_cb(e)),lv.EVENT.SCROLL_END,None) + + + MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_contacts_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) + + MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_calllog_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "call_log")), lv.EVENT.PRESSING, None) + + MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_sms_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.PRESSING, None) + + MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_phone_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "Phone")), lv.EVENT.PRESSING, None) + + + # MainMenu1_img_health_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_health_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.PRESSING, None) + + MainMenu1_img_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_ai_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.PRESSING, None) + + + MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_wechat_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) + + MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_alarm_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "clk_list")), lv.EVENT.PRESSING, None) + + MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_stopwatch_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "stopwatch")), lv.EVENT.PRESSING, None) + + MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_countdown_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "countdown")), lv.EVENT.PRESSING, None) + + MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_camera_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.PRESSING, None) + MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_picture_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.PRESSING, None) + MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_video_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.PRESSING, None) + # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) + MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_alipay_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) + + MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_toolbox_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) + MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) + MainMenu1_img_setting_text.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) + + + + + ##2 + # print("MainMenu1:__init__") + # MainMenu2_til.add_event_cb(lambda e: EventMesh.callback_wrapper(self.scroll_begin_event_cb(e)),lv.EVENT.SCROLL_END,None) + # #lv_obj_add_event_cb(lv_tabview_get_content(tabview), scroll_begin_event, LV_EVENT_SCROLL_END, NULL); + # MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "aigc_mainlist")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.SHORT_CLICKED, None) + # # MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.SHORT_CLICKED, None) + + # MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.SHORT_CLICKED, None) + # # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.SHORT_CLICKED, None) + # #MainMenu2_img_alipay.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_alipay.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_camera_video.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_camera.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.SHORT_CLICKED, None) + # MainMenu2_img_camera_album.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.SHORT_CLICKED, None) + + # MainMenu2_img_phone.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "aigc_mainlist")), lv.EVENT.PRESSING, None) + # MainMenu2_img_toolbox.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "toolbox")), lv.EVENT.PRESSING, None) + # MainMenu2_img_setting.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "setting")), lv.EVENT.PRESSING, None) + # # MainMenu2_img_health.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "health")), lv.EVENT.PRESSING, None) + # MainMenu2_img_contacts.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "contacts")), lv.EVENT.PRESSING, None) + # MainMenu2_img_ai.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "AI_success")), lv.EVENT.PRESSING, None) + # MainMenu2_img_wechat.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "wechat")), lv.EVENT.PRESSING, None) + # # MainMenu2_img_spo2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "spo2")), lv.EVENT.CLICKED, None) + # MainMenu2_img_sms.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "popup")), lv.EVENT.PRESSING, None) + # #MainMenu2_img_alipay.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) + # #MainMenu2_img_alipay.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "alipay_open")), lv.EVENT.PRESSING, None) + + # MainMenu2_img_camera_video.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "videolist")), lv.EVENT.PRESSING, None) + # MainMenu2_img_camera.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera")), lv.EVENT.PRESSING, None) + # MainMenu2_img_camera_album.add_event_cb(lambda e: EventMesh.callback_wrapper(self.img_cb(e, "camera_album")), lv.EVENT.PRESSING, None) + + EventMesh.subscribe("watch_top_show", self.watch_top_show) + EventMesh.subscribe("return_alipay", self.return_alipay) + EventMesh.subscribe("return_setiing", self.return_setiing) + #MainMenu2_img_alipay.add_event_cb(lambda e: img_cb(e, "Watchface_set"), lv.EVENT.CLICKED, None) + + def initialization(self): + + self.watchface.initialization() + self.is_sliding = 0 + if self.menu_id =="0": + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + # if self.meta_info in globals() : + # self.MainMenu_til.set_tile_id(self.meta_info[0],self.meta_info[1],lv.ANIM.OFF) + pass# + + #切换菜单风格 + def set_mainmenu(self, event=None, msg=None): + if self.watchface != None: + self.watchface.Close() + MainMenu2.add_flag(lv.obj.FLAG.HIDDEN)#隐藏菜单 + MainMenu1.add_flag(lv.obj.FLAG.HIDDEN) + if msg[0] == "2": + MainMenu2.clear_flag(lv.obj.FLAG.HIDDEN)#显示菜单 + self.MainMenu_Watchface = MainMenu2_Watchface + self.MainMenu_til = MainMenu2_til + self.MainMenu_num = MainMenu2_num + # self.watchface = MainMenu2_watchface + print("set_mainmenu2") + elif msg[0] == "1": + MainMenu1.clear_flag(lv.obj.FLAG.HIDDEN) + self.MainMenu_Watchface = MainMenu1_Watchface + self.MainMenu_til = MainMenu1_til + self.MainMenu_num = MainMenu1_num + #self.watchface = MainMenu1_watchface + print("set_mainmenu1") + else : + MainMenu1.clear_flag(lv.obj.FLAG.HIDDEN) + self.MainMenu_Watchface = MainMenu1_Watchface + self.MainMenu_til = MainMenu1_til + self.MainMenu_num = MainMenu1_num + #self.watchface = MainMenu1_watchface + msg[0] = "1" + + EventMesh.publish("set_storage_config",["MainMenu",msg[0]]) + print("set_mainmenu:MainMenu:{}".format(msg[0])) + if self.watchface != None: + self.watchface.set_parent(self.MainMenu_Watchface)#切换父对象,比较危险 + self.watchface.initialization() + self.menu_id = "0" + if len (msg ) >= 2: + if msg[1] != 0 : + #EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + #self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + #self.initialization() + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + def scroll_begin_event_cb(self, e): + pass + # EventMesh.publish("publish_message_event_ui",{"func":self.scroll_begin_event,"data":0}) + # def scroll_begin_event(self, data): + #处理轻微滑动不跳页面问题 + # self.scroll_begin_event_count+=1 + + # if self.scroll_begin_event_count == 1: + # self.menu_new_id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + # #print("scroll_begin_event scroll_begin_event {} old_id {} new_id{}".format(self.scroll_begin_event_count,self.menu_old_id,self.menu_new_id)) + # elif self.scroll_begin_event_count == 2: + # self.menu_old_id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + # print("scroll_begin_event menu_action {} old_id {} new_id {}".format(self.menu_action,self.menu_old_id,self.menu_new_id)) + # self.scroll_begin_event_count = 0 + # if self.menu_old_id == self.menu_new_id and self.menu_action == 1: + # self.MainMenu_til.set_tile_id(int(self.menu_old_id)-2,0,lv.ANIM.ON) + # print("scroll_begin_event menu_action == 1") + # elif self.menu_old_id == self.menu_new_id and self.menu_action == 2: + # print("scroll_begin_event menu_action == 2") + # self.MainMenu_til.set_tile_id(int(self.menu_old_id),0,lv.ANIM.ON) + # self.menu_action = 0 + # else : + # self.scroll_begin_event_count = 0 + + # MainMenu = e.get_target() + # code = e.get_code() + # print("MainMenu2:scroll_begin_event code {}!!!!!".format(code)) + # if code == lv.EVENT.SCROLL_END: + # pass + def watch_top_show(self, event, msg): # + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + + def img_cb(self,e,msg): + code = e.get_code() + if code == lv.EVENT.PRESSING: + #print("PRESSING") + self.is_sliding += 1 + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + print("1self.is_sliding",self.is_sliding) + if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + self.is_sliding = 0 + print("img_cb:{}".format(msg)) + EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) + else: + self.is_sliding = 0 + + def lcd_on(self): + print("main Close lcd_on !!!!!!!!") + self.is_sliding = 0 + self.watchface.watchface_style.timerout_update() + self.watchface.timer_update.start(10000, 1, self.watchface.timerout_update) + + def lcd_off(self): + self.is_sliding = 0 + self.watchface.timer_update.stop() + + def done_return(self): + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + + def btn1_release(self): + flag = EventMesh.publish("get_lcd_state") + if flag == 0: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + else: + if self.MainMenu_til.get_tile_act() != None: + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id != "0": + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + else: + EventMesh.publish("load_screen", {"screen": "alipay_open"}) + + def return_alipay(self, event, msg): + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + + def return_setiing(self, event, msg): + self.MainMenu_til.set_tile_id(7,0,lv.ANIM.OFF) + + + + def btn8_press(self): + self.is_sliding = 0 + flag = EventMesh.publish("get_lcd_state") + if self.MainMenu_til.get_tile_act() != None: + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id == "0": + if flag == 1: + EventMesh.publish(constants.EVENT.SYSTEM_SLEEP) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + else: + if flag == 1: + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + else: + if flag == 1: + self.MainMenu_til.set_tile_id(0,1,lv.ANIM.OFF) + else: + EventMesh.publish(constants.EVENT.SYSTEM_UP) + + def done_bottom_to_top(self): + + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id == "0": + EventMesh.publish("load_screen", {"screen": "call_log"}) + self.menu_id = id + self.is_sliding = 0 + + def done_top_to_bottom(self): + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + if id == "0": + EventMesh.publish("load_screen", {"screen": "popup"}) + self.menu_id = id + self.is_sliding = 0 + + def done_left_to_right(self): + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + print("done_left_to_right:ID{} menu_id{}".format(id,self.menu_id)) + if id == "0": + self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + elif self.menu_id != '2' and id == '1': + self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + elif self.menu_id == id : + self.menu_action = 1 + self.menu_id = id + self.is_sliding = 0 + + def done_right_to_left(self): + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + print("done_right_to_left:ID{} menu_id{}".format(id,self.menu_id)) + if id == "0": + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + elif (self.menu_id != str(self.MainMenu_num-2) ) and id == str(self.MainMenu_num-1) : + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + else : + self.menu_action = 2 + self.menu_id = id + self.is_sliding = 0 + + def done_DOWN(self):#下滑 + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + print("done_right_to_left: {} {} {}".format(id,self.menu_id,self.MainMenu_num)) + if id == "0": + self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + elif self.menu_id != '2' and id == '1': + self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + else : + if id == "1": + self.MainMenu_til.set_tile_id(self.MainMenu_num-2,0,lv.ANIM.OFF) + else : + self.MainMenu_til.set_tile_id(int(id)-2,0,lv.ANIM.OFF) + self.menu_id = id + self.is_sliding = 0 + + def done_UP(self):#上滑 + id = self.MainMenu_til.get_tile_act().get_child(0).get_text() + print("done_right_to_left: {} {} {}".format(id,self.menu_id,self.MainMenu_num)) + if id == "0": + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + elif (self.menu_id != str(self.MainMenu_num-2) ) and id == str(self.MainMenu_num-1) : + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + else : + if int(id) == self.MainMenu_num-1 : + self.MainMenu_til.set_tile_id(0,0,lv.ANIM.OFF) + else : + self.MainMenu_til.set_tile_id(int(id),0,lv.ANIM.OFF) + + self.menu_id = id + self.is_sliding = 0 + + def Close(self): + self.watchface.Close() + print("main_menu Close !!!!!!!!") + self.menu_id = '1' + return + +print("ui_main_menu end") diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_setting.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py similarity index 50% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_setting.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py index c8b6dc2f..6640cfa2 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_setting.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_setting.py @@ -3,18 +3,21 @@ import lvgl as lv import ql_fs import EventMesh from misc import Power -from ui import style_screen,style_font_youyuan_20_default,style_font_youyuan_20_black,style_font_youyuan_20_gray,style_screen_btn_1_main_main_default,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn,style_bar,style_bar_indic +from ui import style_screen,style_font_youyuan_20_gray,style_font_youyuan_20,style_btn,style_img,Screen,style_contact_btn,style_bar,style_bar_indic import constants import osTimer import audio from machine import Pin import ujson - +from lcd import style_font_youyuan_40,LCD_SIZE_W,LCD_SIZE_H # -------------------------------------------setting screen---------------------------------------------------------- +SETTING_ICON_W_SIZE = 220 +SETTING_ICON_H_SIZE = 65 +SETTING_ICON_OFFSET_SIZE = 84 +TOOL_BG_ICON_W_SIZE = 230 +TOOL_BG_ICON_H_SIZE = 78 -set_icon_x = 25 -set_icon_y = 25 style_volume_btn = lv.style_t() style_volume_btn.init() @@ -23,25 +26,25 @@ style_volume_btn.set_border_width(0) style_volume_btn.set_bg_color(lv.color_make(0x80, 0x80, 0x80)) -setting_cont_y = 5 -setting_cont_offset = 40 + +setting_cont_y = 0 setting_screen = lv.obj() print("setting_screen") setting_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -# setting_imei_img = lv.img(setting_screen) -# setting_imei_img.set_pos(75, 10) -# setting_imei_img.set_size(90, 30) -# setting_imei_img.set_src("U:/static/setting/setting_text.png") -# setting_imei_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -# setting_title = lv.label(setting_screen) -# setting_title.set_pos(0, 5) -# setting_title.set_size(128, 20) + +setting_imei_img = lv.img(setting_screen) +setting_imei_img.set_pos(4, 10) +setting_imei_img.set_size(232, 34) +setting_imei_img.set_src("U:/static/setting/setting_text.png") +setting_imei_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_title = lv.label(setting) +# setting_title.set_pos(0, 10) +# setting_title.set_size(240, 40) # setting_title.set_text("设置") # setting_title.set_long_mode(lv.label.LONG.WRAP) # setting_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) # setting_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - setting_cont_style = lv.style_t() setting_cont_style.init() setting_cont_style.set_radius(0) @@ -57,389 +60,266 @@ setting_cont_style.set_pad_bottom(0) setting_cont = lv.obj(setting_screen) -setting_cont.set_pos(0, 5) -setting_cont.set_size(128, 123) +setting_cont.set_pos(0, 50) +setting_cont.set_size(LCD_SIZE_W, LCD_SIZE_H-50) setting_cont.add_style(setting_cont_style,lv.PART.MAIN | lv.STATE.DEFAULT) - -# setting_dialswitch_img_btn_1 = lv.btn(setting_cont) -# setting_dialswitch_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -# setting_dialswitch_img_btn_1.set_size(120,35) -# setting_dialswitch_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# setting_dialswitch_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) -# setting_dialswitch_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# setting_dialswitch_label = lv.label(setting_cont) -# setting_dialswitch_label.set_text("表盘切换") -# setting_dialswitch_label.set_pos(34, setting_cont_y+5) -# setting_dialswitch_label.set_size(128-34, 35) -# # setting_dialswitch_label.add_flag(lv.obj.FLAG.CLICKABLE) -# # setting_dialswitch_label.set_text_align(lv.ALIGN.LEFT_MID, 30, setting_cont_y) -# setting_dialswitch_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -# setting_dialswitch_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# setting_dialswitch_img = lv.img(setting_cont) -# setting_dialswitch_img.set_pos(4, setting_cont_y) -# setting_dialswitch_img.set_size(set_icon_x, set_icon_y) -# # setting_dialswitch_img.add_flag(lv.obj.FLAG.CLICKABLE) -# setting_dialswitch_img.set_src("U:/static/menu_watch_switch.png") -# setting_dialswitch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - - -# setting_cont_y+=setting_cont_offset - - -setting_imei_img_btn_1 = lv.btn(setting_cont) -setting_imei_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_imei_img_btn_1.set_size(120,35) -setting_imei_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_imei_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_imei_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_imei_label = lv.label(setting_cont) -setting_imei_label.set_text("设备IMEI号") -setting_imei_label.set_pos(34, setting_cont_y+5) -setting_imei_label.set_size(128-34, 35) -# setting_imei_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_imei_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_imei_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_language = lv.btn(setting_cont) +# setting_language.set_pos(0, setting_cont_y) +# setting_language.set_size(240, 54) +# setting_language_label = lv.label(setting_language) +# setting_language_label.set_text("语言设置") +# setting_language.set_style_pad_all(0, lv.STATE.DEFAULT) +# setting_language_label.align(lv.ALIGN.LEFT_MID, 70, 0) +# setting_language_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# setting_language_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_language.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_language_img = lv.img(setting_cont) +# setting_language_img.set_pos(10, setting_cont_y)set_size(47, 47) +# setting_language_img.set_size(232, 80) +# setting_language_img.add_flag(lv.obj.FLAG.CLICKABLE) +# setting_language_img.set_src("U:/static/menu_language.png") +# setting_language_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +#setting_cont_y += 60 + +setting_dialswitch_bg_img = lv.img(setting_cont) +setting_dialswitch_bg_img.set_pos(0, setting_cont_y) +setting_dialswitch_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_dialswitch_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_dialswitch_bg_img.set_src("U:/static/list_bg.png") +setting_dialswitch_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +setting_dialswitch_img = lv.img(setting_cont) +setting_dialswitch_img.set_pos(8, setting_cont_y+6) +setting_dialswitch_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) +# setting_dialswitch_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_dialswitch_img.set_src("U:/static/setting/menu_watch_switch.png") +setting_dialswitch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE + + +setting_themeswitch_bg_img = lv.img(setting_cont) +setting_themeswitch_bg_img.set_pos(0, setting_cont_y) +setting_themeswitch_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_themeswitch_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_themeswitch_bg_img.set_src("U:/static/list_bg.png") +setting_themeswitch_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +setting_themeswitch_img = lv.img(setting_cont) +setting_themeswitch_img.set_pos(8, setting_cont_y+6) +setting_themeswitch_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) +# setting_themeswitch_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_themeswitch_img.set_src("U:/static/setting/menu_theme_menustyle.png") +setting_themeswitch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE + +# setting_themeswitch = lv.btn(setting_cont) +# setting_themeswitch.set_pos(0, 120) +# setting_themeswitch.set_size(240, 54) +# setting_themeswitch_label = lv.label(setting_themeswitch) +# setting_themeswitch_label.set_text("主题切换") +# setting_themeswitch.set_style_pad_all(0, lv.STATE.DEFAULT) +# setting_themeswitch_label.align(lv.ALIGN.LEFT_MID, 70, 0) +# setting_themeswitch_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) +# setting_themeswitch_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_themeswitch.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_themeswitch_img = lv.img(setting_cont) +# setting_themeswitch_img.set_pos(10, 120) +# setting_themeswitch_img.set_size(232, 80) +# setting_themeswitch_img.add_flag(lv.obj.FLAG.CLICKABLE) +# setting_themeswitch_img.set_src("U:/static/menu_theme_switch.png") +# setting_themeswitch_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +#setting_cont_y+=60 +setting_imei_bg_img = lv.img(setting_cont) +setting_imei_bg_img.set_pos(0, setting_cont_y) +setting_imei_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_imei_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_imei_bg_img.set_src("U:/static/list_bg.png") +setting_imei_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_imei_img = lv.img(setting_cont) -setting_imei_img.set_pos(4, setting_cont_y) -setting_imei_img.set_size(set_icon_x, set_icon_y) +setting_imei_img.set_pos(8, setting_cont_y+6) +setting_imei_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_imei_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_imei_img.set_src("U:/static/menu_imei_qrcode.png") +setting_imei_img.set_src("U:/static/setting/menu_imei_qrcode.png") setting_imei_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE - -setting_cont_y+=setting_cont_offset - -setting_app_img_btn_1 = lv.btn(setting_cont) -setting_app_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_app_img_btn_1.set_size(120,35) -setting_app_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_app_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_app_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_app_label = lv.label(setting_cont) -setting_app_label.set_text("手机APP") -setting_app_label.set_pos(34, setting_cont_y+5) -setting_app_label.set_size(128-34, 35) -# setting_app_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_app_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_app_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_app_bg_img = lv.img(setting_cont) +setting_app_bg_img.set_pos(0, setting_cont_y) +setting_app_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_app_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_app_bg_img.set_src("U:/static/list_bg.png") +setting_app_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_app_img = lv.img(setting_cont) -setting_app_img.set_pos(4, setting_cont_y) -setting_app_img.set_size(set_icon_x, set_icon_y) +setting_app_img.set_pos(8, setting_cont_y+6) +setting_app_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_app_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_app_img.set_src("U:/static/menu_app_qrcode.png") +setting_app_img.set_src("U:/static/setting/menu_app_qrcode.png") setting_app_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE - -setting_cont_y+=setting_cont_offset - -setting_bright_img_btn_1 = lv.btn(setting_cont) -setting_bright_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_bright_img_btn_1.set_size(120,35) -setting_bright_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_bright_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_bright_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_bright_label = lv.label(setting_cont) -setting_bright_label.set_text("屏幕调节") -# setting_bright_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_bright_label.set_size(128-34, 35) -setting_bright_label.set_pos(34, setting_cont_y+5) -setting_bright_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_bright_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_bright_bg_img = lv.img(setting_cont) +setting_bright_bg_img.set_pos(0, setting_cont_y) +setting_bright_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_bright_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_bright_bg_img.set_src("U:/static/list_bg.png") +setting_bright_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_bright_img = lv.img(setting_cont) -setting_bright_img.set_pos(4, setting_cont_y) -setting_bright_img.set_size(set_icon_x, set_icon_y) +setting_bright_img.set_pos(8, setting_cont_y+6) +setting_bright_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_bright_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_bright_img.set_src("U:/static/menu_bright.png") +setting_bright_img.set_src("U:/static/setting/menu_bright.png") setting_bright_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE -setting_cont_y+=setting_cont_offset - -setting_volume_img_btn_1 = lv.btn(setting_cont) -setting_volume_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_volume_img_btn_1.set_size(120,35) -setting_volume_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_volume_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_volume_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_volume_label = lv.label(setting_cont) -setting_volume_label.set_text("铃声") -# setting_volume_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_volume_label.set_size(128-34, 35) -setting_volume_label.set_pos(34, setting_cont_y+5) -setting_volume_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_volume_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_volume_bg_img = lv.img(setting_cont) +setting_volume_bg_img.set_pos(0, setting_cont_y) +setting_volume_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_volume_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_volume_bg_img.set_src("U:/static/list_bg.png") +setting_volume_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_volume_img = lv.img(setting_cont) -setting_volume_img.set_pos(4, setting_cont_y) -setting_volume_img.set_size(set_icon_x, set_icon_y) +setting_volume_img.set_pos(8, setting_cont_y+6) +setting_volume_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_volume_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_volume_img.set_src("U:/static/menu_volume.png") +setting_volume_img.set_src("U:/static/setting/menu_volume.png") setting_volume_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE - -setting_cont_y+=setting_cont_offset - -setting_restore_img_btn_1 = lv.btn(setting_cont) -setting_restore_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_restore_img_btn_1.set_size(120,35) -setting_restore_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_restore_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_restore_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_restore_label = lv.label(setting_cont) -setting_restore_label.set_text("恢复出厂") -# setting_restore_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_restore_label.set_size(128-34, 35) -setting_restore_label.set_pos(34, setting_cont_y+5) -setting_restore_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_restore_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_restore_bg_img = lv.img(setting_cont) +setting_restore_bg_img.set_pos(0, setting_cont_y) +setting_restore_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_restore_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_restore_bg_img.set_src("U:/static/list_bg.png") +setting_restore_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_restore_img = lv.img(setting_cont) -setting_restore_img.set_pos(4, setting_cont_y) -setting_restore_img.set_size(set_icon_x, set_icon_y) +setting_restore_img.set_pos(8, setting_cont_y+6) +setting_restore_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_restore_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_restore_img.set_src("U:/static/menu_restore.png") +setting_restore_img.set_src("U:/static/setting/menu_restore.png") setting_restore_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE - -setting_cont_y+=setting_cont_offset - -setting_poweroff_img_btn_1 = lv.btn(setting_cont) -setting_poweroff_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_poweroff_img_btn_1.set_size(120,35) -setting_poweroff_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_poweroff_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_poweroff_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - - -setting_poweroff_label = lv.label(setting_cont) -setting_poweroff_label.set_text("关机") -# setting_poweroff_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_poweroff_label.set_size(128-34, 35) -setting_poweroff_label.set_pos(34, setting_cont_y+5) -setting_poweroff_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_poweroff_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_poweroff_bg_img = lv.img(setting_cont) +setting_poweroff_bg_img.set_pos(0, setting_cont_y) +setting_poweroff_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_poweroff_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_poweroff_bg_img.set_src("U:/static/list_bg.png") +setting_poweroff_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_poweroff_img = lv.img(setting_cont) -setting_poweroff_img.set_pos(4, setting_cont_y) -setting_poweroff_img.set_size(set_icon_x, set_icon_y) +setting_poweroff_img.set_pos(8, setting_cont_y+6) +setting_poweroff_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_poweroff_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_poweroff_img.set_src("U:/static/menu_poweroff.png") +setting_poweroff_img.set_src("U:/static/setting/menu_poweroff.png") setting_poweroff_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE - -setting_cont_y+=setting_cont_offset - - -#重启setting_restart_img_btn_1 -setting_restart_img_btn_1 = lv.btn(setting_cont) -setting_restart_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_restart_img_btn_1.set_size(120,35) -setting_restart_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_restart_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_restart_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - - -setting_restart_label = lv.label(setting_cont) -setting_restart_label.set_text("重启") -# setting_poweroff_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_restart_label.set_size(128-34, 35) -setting_restart_label.set_pos(34, setting_cont_y+5) -setting_restart_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_restart_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -setting_restart_img = lv.img(setting_cont) -setting_restart_img.set_pos(4, setting_cont_y) -setting_restart_img.set_size(set_icon_x, set_icon_y) -# setting_poweroff_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_restart_img.set_src("U:/static/menu_restart.png") -setting_restart_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - -setting_cont_y+=setting_cont_offset - -setting_version_img_btn_1 = lv.btn(setting_cont) -setting_version_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -setting_version_img_btn_1.set_size(120,34) -setting_version_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -setting_version_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -setting_version_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -setting_version_label = lv.label(setting_cont) -setting_version_label.set_text("关于设备") -# setting_version_label.add_flag(lv.obj.FLAG.CLICKABLE) -setting_version_label.set_size(128-34, 35) -setting_version_label.set_pos(34, setting_cont_y+5) -setting_version_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -setting_version_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_version_bg_img = lv.img(setting_cont) +setting_version_bg_img.set_pos(0, setting_cont_y) +setting_version_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +setting_version_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +setting_version_bg_img.set_src("U:/static/list_bg.png") +setting_version_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) setting_version_img = lv.img(setting_cont) -setting_version_img.set_pos(4, setting_cont_y) -setting_version_img.set_size(set_icon_x, set_icon_y) +setting_version_img.set_pos(8, setting_cont_y+6) +setting_version_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # setting_version_img.add_flag(lv.obj.FLAG.CLICKABLE) -setting_version_img.set_src("U:/static/menu_version.png") +setting_version_img.set_src("U:/static/setting/menu_version.png") setting_version_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +setting_cont_y+=SETTING_ICON_OFFSET_SIZE -setting_cont_y+=setting_cont_offset - -# setting_update_img_btn_1 = lv.btn(setting_cont) -# setting_update_img_btn_1.set_pos(int(0),int(setting_cont_y-5)) -# setting_update_img_btn_1.set_size(120,35) -# setting_update_img_btn_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) -# setting_update_img_btn_1.add_style(style_screen_btn_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) -# setting_update_img_btn_1.add_flag(lv.obj.FLAG.CLICKABLE) - -# setting_update_label = lv.label(setting_cont) -# setting_update_label.set_text("系统升级") -# # setting_update_label.add_flag(lv.obj.FLAG.CLICKABLE) -# setting_update_label.set_size(128-34, 35) -# setting_update_label.set_pos(34, setting_cont_y+5) -# setting_update_label.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -# setting_update_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# setting_update_label_btn = lv.label(setting_cont) -# setting_update_label_btn.set_text(" ") -# # setting_update_label_btn.add_flag(lv.obj.FLAG.CLICKABLE) -# setting_update_label_btn.set_size(128, 45) -# setting_update_label_btn.set_pos(0, setting_cont_y) -# setting_update_label_btn.set_style_text_color(lv.color_make(0xff, 0xff, 0xff), lv.STATE.DEFAULT) -# setting_update_label_btn.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# setting_update_bg_img = lv.img(setting_cont) +# setting_update_bg_img.set_pos(0, setting_cont_y) +# setting_update_bg_img.set_size(TOOL_BG_ICON_W_SIZE, TOOL_BG_ICON_H_SIZE) +# setting_update_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +# setting_update_bg_img.set_src("U:/static/list_bg.png") +# setting_update_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) # setting_update_img = lv.img(setting_cont) -# setting_update_img.set_pos(4, setting_cont_y) -# setting_update_img.set_size(set_icon_x, set_icon_y) +# setting_update_img.set_pos(8, setting_cont_y+6) +# setting_update_img.set_size(SETTING_ICON_W_SIZE, SETTING_ICON_H_SIZE) # # setting_update_img.add_flag(lv.obj.FLAG.CLICKABLE) -# setting_update_img.set_src("U:/static/menu_upgrade.png") +# setting_update_img.set_src("U:/static/setting/menu_upgrade.png") # setting_update_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - class SettingScreen(Screen): NAME = "setting" def __init__(self): + self.is_sliding =0 super().__init__() - self.is_sliding = 0 - self.is_left_sliding = 0 self.meta = setting_screen - # setting_language.add_event_cb(lambda e: self.load_screen(e, {"screen": "language"}), lv.EVENT.SHORT_CLICKED, None) - # setting_dialswitch_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "dialswitch")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_imei_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "imei")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_app_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "app")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_bright_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "brightness")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_volume_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "totalvolume")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_restore_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restore")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_poweroff_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "poweroff")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_update_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "update")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_version_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "version")), (lv.EVENT.SHORT_CLICKED ), None) - + setting_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.setting_cb(e,"void")), lv.EVENT.GESTURE, None) # img regist btton - # setting_language.add_event_cb(lambda e: self.load_screen(e, {"screen": "language"}), (lv.EVENT.SHORT_CLICKED ), None) - # setting_dialswitch_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "dialswitch")), (lv.EVENT.SHORT_CLICKED ), None) - - setting_imei_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "imei")), (lv.EVENT.SHORT_CLICKED ), None) - setting_app_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "app")), (lv.EVENT.SHORT_CLICKED ), None) - setting_bright_img_btn_1.add_event_cb(lambda e:EventMesh.callback_wrapper( self.ui_setting_cb(e, "brightness")), (lv.EVENT.SHORT_CLICKED ), None) - setting_volume_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "totalvolume")), (lv.EVENT.SHORT_CLICKED ), None) - setting_restore_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restore")), (lv.EVENT.SHORT_CLICKED ), None) - setting_poweroff_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "poweroff")), (lv.EVENT.SHORT_CLICKED ), None) - setting_restart_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restart")), lv.EVENT.SHORT_CLICKED, None) - # setting_update_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "update")), (lv.EVENT.SHORT_CLICKED ), None) - setting_version_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "version")), (lv.EVENT.SHORT_CLICKED ), None) - # setting_dialswitch_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "dialswitch")), lv.EVENT.SHORT_CLICKED, None) - - # # setting_themeswitch.add_event_cb(lambda e: self.load_screen(e, {"screen": "themeswitch"}), lv.EVENT.SHORT_CLICKED, None) - # setting_imei_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "imei")), lv.EVENT.PRESSING, None) - # setting_app_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "app")), lv.EVENT.PRESSING, None) - # setting_bright_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "brightness")), lv.EVENT.PRESSING, None) - # setting_volume_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "totalvolume")), lv.EVENT.PRESSING, None) - # setting_restore_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restore")), lv.EVENT.PRESSING, None) - # setting_poweroff_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "poweroff")), lv.EVENT.PRESSING, None) - # setting_update_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "update")), lv.EVENT.PRESSING, None) - # setting_version_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "version")), lv.EVENT.PRESSING, None) + # setting_language.add_event_cb(lambda e: self.load_screen(e, {"screen": "language"}), lv.EVENT.CLICKED, None) + setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.SHORT_CLICKED, None) + setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.SHORT_CLICKED, None) + setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.SHORT_CLICKED, None) + setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.SHORT_CLICKED, None) + setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.SHORT_CLICKED, None) + setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.SHORT_CLICKED, None) + setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.SHORT_CLICKED, None) + setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.SHORT_CLICKED, None) + # setting_update_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "update")), lv.EVENT.CLICKED, None) + setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.SHORT_CLICKED, None) + + # setting_dialswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "dialswitch")), lv.EVENT.PRESSING, None) + # setting_themeswitch_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "themeswitch")), lv.EVENT.PRESSING, None) + # setting_imei_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "imei")), lv.EVENT.PRESSING, None) + # setting_app_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "app")), lv.EVENT.PRESSING, None) + # setting_bright_bg_img.add_event_cb(lambda e:EventMesh.callback_wrapper( self.setting_cb(e, "brightness")), lv.EVENT.PRESSING, None) + # setting_volume_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "totalvolume")), lv.EVENT.PRESSING, None) + # setting_restore_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "restore")), lv.EVENT.PRESSING, None) + # setting_poweroff_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "poweroff")), lv.EVENT.PRESSING, None) + # # setting_update_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "update")), lv.EVENT.PRESSING, None) + # setting_version_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.setting_cb(e, "version")), lv.EVENT.PRESSING, None) - # img regist btton - # setting_language.add_event_cb(lambda e: self.load_screen(e, {"screen": "language"}), lv.EVENT.SHORT_CLICKED, None) - # setting_dialswitch_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "dialswitch")), lv.EVENT.PRESSING, None) - # setting_themeswitch.add_event_cb(lambda e: self.load_screen(e, {"screen": "themeswitch"}), lv.EVENT.SHORT_CLICKED, None) - setting_imei_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "imei")), lv.EVENT.PRESSING, None) - setting_app_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "app")), lv.EVENT.PRESSING, None) - setting_bright_img_btn_1.add_event_cb(lambda e:EventMesh.callback_wrapper( self.ui_setting_cb(e, "brightness")), lv.EVENT.PRESSING, None) - setting_volume_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "totalvolume")), lv.EVENT.PRESSING, None) - setting_restore_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restore")), lv.EVENT.PRESSING, None) - setting_poweroff_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "poweroff")), lv.EVENT.PRESSING, None) - setting_restart_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "restart")), lv.EVENT.PRESSING, None) - # setting_update_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "update")), lv.EVENT.PRESSING, None) - setting_version_img_btn_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.ui_setting_cb(e, "version")), lv.EVENT.PRESSING, None) - def initialization(self): - self.is_left_sliding = 0 self.is_sliding = 0 - pass - def ui_setting_cb(self, e, msg): + def setting_cb(self,e,msg): code = e.get_code() - EventMesh.publish("publish_message_event_ui",{"func":self.ui_setting_cb_do,"data":[code,msg]}) - def ui_setting_cb_do(self, data): - #code = e.get_code() - - code = data[0] - msg = data[1] + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg != "void": + EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - #print("code!!!!!!!!",code,msg) - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 - elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding =0 - EventMesh.publish("load_screen", {"screen": "{}".format(msg)}) - print("2self.is_sliding",self.is_sliding) - - self.is_sliding =0 - - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "main_menu"}) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "main_menu"}) def btn1_release(self): EventMesh.publish("return_setiing") EventMesh.publish("load_screen", {"screen": "main_menu"}) - + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) - def done_bottom_to_top(self): - #print("done_bottom_to_top") - self.is_sliding = 0 - pass - def done_top_to_bottom(self): - #print("done_top_to_bottom") - self.is_sliding = 0 + def done_DOWN(self):#下滑 + scroll_y = setting_cont.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + setting_cont.scroll_to_y(scroll_y-SETTING_ICON_OFFSET_SIZE,lv.ANIM.ON) pass - def done_left_to_right(self): - #print("done_left_to_right") - self.is_sliding = 0 + + def done_UP(self):#上滑 + scroll_y = setting_cont.get_scroll_y() + print("scroll_y:{}".format(scroll_y)) + setting_cont.scroll_to_y(scroll_y+SETTING_ICON_OFFSET_SIZE,lv.ANIM.ON) pass - def done_right_to_left(self): - #print("done_right_to_left") - self.is_sliding = 0 - pass ################################################################## # -------------------------------------------language screen---------------------------------------------------------- language_screen = lv.obj() @@ -477,22 +357,22 @@ language_chinese_btn_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.ST # -------------------------------------------dialswitch screen---------------------------------------------------------- dialswitch_screen = lv.obj() dialswitch_screen.set_pos(0,0) -dialswitch_screen.set_size(240,320) +dialswitch_screen.set_size(240,284) print("dialswitch_screen") dialswitch_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) dialswitch_title = lv.label(dialswitch_screen) -dialswitch_title.set_pos(0, 5) -dialswitch_title.set_size(0, 0) -dialswitch_title.set_text(" ") +dialswitch_title.set_pos(0, 10) +dialswitch_title.set_size(240, 40) +dialswitch_title.set_text("表盘切换") dialswitch_title.set_long_mode(lv.label.LONG.WRAP) dialswitch_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) dialswitch_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) dialswitch_img1 = lv.img(dialswitch_screen)#表盘预览图 -dialswitch_img1.set_pos(19, 5) -dialswitch_img1.set_size(90, 90) +dialswitch_img1.set_pos(50, 60) +dialswitch_img1.set_size(140, 162) dialswitch_img1.set_src("U:/static/DIAL_PREV01.png") dialswitch_img1.add_flag(lv.obj.FLAG.CLICKABLE) dialswitch_img1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -501,20 +381,176 @@ dialswitch_img1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) dialswitch_btn1_label = lv.label(dialswitch_screen)#显示表盘1 表盘2 dialswitch_btn1_label.set_text(" ") -dialswitch_btn1_label.align(lv.ALIGN.TOP_MID, 0, 104) +dialswitch_btn1_label.align(lv.ALIGN.TOP_MID, 0, 240) dialswitch_btn1_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +dialswitch_butoom_crcile1 = lv.img(dialswitch_screen)#底部显示圆点 +dialswitch_butoom_crcile1.set_pos(95, 270) +dialswitch_butoom_crcile1.set_size(10, 10) +dialswitch_butoom_crcile1.set_src("U:/static/point_white.png") +dialswitch_butoom_crcile1.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +dialswitch_butoom_crcile2 = lv.img(dialswitch_screen)#底部显示圆点 +dialswitch_butoom_crcile2.set_pos(140, 270) +dialswitch_butoom_crcile2.set_size(10, 10) +dialswitch_butoom_crcile2.set_src("U:/static/point_black.png") +dialswitch_butoom_crcile2.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +# dialswitch_btn2 = lv.btn(dialswitch_screen) +# dialswitch_btn2.set_size(240,54) +# dialswitch_btn2.set_pos(0, 104) +# dialswitch_btn2.add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.PRESSED) +# dialswitch_btn2.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# dialswitch_btn2_label = lv.label(dialswitch_btn2) +# dialswitch_btn2_label.set_text("表盘2") +# dialswitch_btn2_label.align(lv.ALIGN.LEFT_MID, 10, 0) +# dialswitch_btn2_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# btn1_switch = lv.switch(dialswitch_btn1) +# btn1_switch.set_pos(185, 3) +# btn1_switch.set_size(10, 10) +# btn1_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN | lv.PART.INDICATOR) +# btn1_switch.set_style_bg_color(lv.color_make(0xff, 0x00, 0x00),lv.PART.KNOB | lv.STATE.CHECKED) +# btn1_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.KNOB) + +# btn2_switch = lv.switch(dialswitch_btn2) +# btn2_switch.set_pos(185, 3) +# btn2_switch.set_size(10, 10) +# btn2_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN | lv.PART.INDICATOR) +# btn2_switch.set_style_bg_color(lv.color_make(0xff, 0x00, 0x00),lv.PART.KNOB | lv.STATE.CHECKED) +# btn2_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.KNOB) + # -------------------------------------------menustyle screen---------------------------------------------------------- +menustyle_screen = lv.obj() +print("menustyle_screen") +menustyle_screen.center() +menustyle_screen.set_size(240, 284) +menustyle_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +menustyle_title = lv.label(menustyle_screen) +menustyle_title.set_pos(0, 10) +menustyle_title.set_size(240, 40) +menustyle_title.set_text("主菜单风格") +menustyle_title.set_long_mode(lv.label.LONG.WRAP) +menustyle_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +menustyle_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + + +menustyle_img1_bg_img = lv.img(menustyle_screen) +menustyle_img1_bg_img.set_pos(5, 54) +menustyle_img1_bg_img.set_size(230, 78) +menustyle_img1_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +menustyle_img1_bg_img.set_src("U:/static/list_bg.png") +menustyle_img1_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + + +menustyle_btn1_label = lv.label(menustyle_img1_bg_img) +menustyle_btn1_label.set_text("四宫格") +menustyle_btn1_label.align(lv.ALIGN.LEFT_MID, 20, 5) +menustyle_btn1_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +# menustyle_img1 = lv.img(menustyle_screen) +# menustyle_img1.set_pos(int(8),int(60)) +# menustyle_img1.set_size(220,65) +# menustyle_img1.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# menustyle_img1.add_flag(lv.obj.FLAG.CLICKABLE) +# menustyle_img1.set_src("U:/static/theme_four1.png") +# menustyle_img1.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) +# brightness_flip_sw1 = lv.switch(menustyle_screen) +# brightness_flip_sw1.set_pos(140, 54) +# brightness_flip_sw1.set_size(80, 39) +menustyle_img2_bg_img = lv.img(menustyle_screen) +menustyle_img2_bg_img.set_pos(5, 139) +menustyle_img2_bg_img.set_size(230, 78) +menustyle_img2_bg_img.add_flag(lv.obj.FLAG.CLICKABLE) +menustyle_img2_bg_img.set_src("U:/static/list_bg.png") +menustyle_img2_bg_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +menustyle_btn1_label = lv.label(menustyle_img2_bg_img) +menustyle_btn1_label.set_text("单页") +menustyle_btn1_label.align(lv.ALIGN.LEFT_MID, 20, 5) +menustyle_btn1_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -# -------------------------------------------app screen---------------------------------------------------------- +menustyle_select = lv.img(menustyle_screen) +menustyle_select.set_pos(int(190),int(165)) +menustyle_select.set_size(32,25) +menustyle_select.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# menustyle_select.add_flag(lv.obj.FLAG.CLICKABLE) +menustyle_select.set_src("U:/static/menustyle_select.png") +menustyle_select.add_style(style_img, lv.PART.MAIN|lv.STATE.DEFAULT) + +# menustyle_img2 = lv.img(menustyle_screen) +# menustyle_img2.set_pos(int(8),int(145)) +# menustyle_img2.set_size(220,65) +# menustyle_img2.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) +# menustyle_img2.add_flag(lv.obj.FLAG.CLICKABLE) +# menustyle_img2.set_src("U:/static/theme_single1.png") +# menustyle_img2.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) + + + + + +# brightness_flip_sw2 = lv.switch(menustyle_screen) +# brightness_flip_sw2.set_pos(140, 139) +# brightness_flip_sw2.set_size(80, 39) + + + +# menustyle_title = lv.label(menustyle_screen) +# menustyle_title.set_pos(0, 10) +# menustyle_title.set_size(240, 40) +# menustyle_title.set_text("主菜单风格") +# menustyle_title.set_long_mode(lv.label.LONG.WRAP) +# menustyle_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# menustyle_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +# menustyle_btn1 = lv.btn(menustyle_screen) +# menustyle_btn1.set_size(240,54) +# menustyle_btn1.set_pos(0, 50) +# menustyle_btn1.add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.PRESSED) +# menustyle_btn1.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# menustyle_btn1_label = lv.label(menustyle_btn1) +# menustyle_btn1_label.set_text("四宫格") +# menustyle_btn1_label.align(lv.ALIGN.LEFT_MID, 10, 0) +# menustyle_btn1_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -# style_font_youyuan_20_black.set_text_font(lv.K01_font_16_ALL) +# menu_btn1_switch = lv.switch(menustyle_btn1) +# menu_btn1_switch.set_pos(185, 3) +# menu_btn1_switch.set_size(30, 30) +# menu_btn1_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN | lv.PART.INDICATOR) +# menu_btn1_switch.set_style_bg_color(lv.color_make(0xff, 0x00, 0x00),lv.PART.KNOB | lv.STATE.CHECKED) +# menu_btn1_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.KNOB) +# menustyle_btn2 = lv.btn(menustyle_screen) +# menustyle_btn2.set_size(240,54) +# menustyle_btn2.set_pos(0, 104) +# menustyle_btn2.add_style(style_contact_btn, lv.PART.MAIN | lv.STATE.PRESSED) +# menustyle_btn2.add_style(style_btn, lv.PART.MAIN | lv.STATE.DEFAULT) +# menustyle_btn2_label = lv.label(menustyle_btn2) +# menustyle_btn2_label.set_text("单页") +# menustyle_btn2_label.align(lv.ALIGN.LEFT_MID, 10, 0) +# menustyle_btn2_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +# menu_btn2_switch = lv.switch(menustyle_btn2) +# menu_btn2_switch.set_pos(185, 3) +# menu_btn2_switch.set_size(30, 30) +# menu_btn2_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.MAIN | lv.PART.INDICATOR) +# menu_btn2_switch.set_style_bg_color(lv.color_make(0xff, 0x00, 0x00),lv.PART.KNOB | lv.STATE.CHECKED) +# menu_btn2_switch.set_style_bg_color(lv.color_make(0xff, 0xff, 0xff),lv.PART.KNOB) + + + + + +# -------------------------------------------app screen---------------------------------------------------------- #app_screen = lv.obj() app_screen = lv.obj() print("app_screen") @@ -523,8 +559,8 @@ app_screen.set_size(240, 320) app_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) app_img = lv.img(app_screen) -app_img.set_pos(int(24),int(5)) -app_img.set_size(80,80) +app_img.set_pos(int(30),int(20)) +app_img.set_size(180,180) app_img.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) app_img.add_flag(lv.obj.FLAG.CLICKABLE) app_img.set_src("U:/static/IMAGE_APP_QR_CODE.png") @@ -532,19 +568,18 @@ app_img.add_style(style_screen, lv.PART.MAIN|lv.STATE.DEFAULT) # app_qr = lv.qrcode(imei, 150, fg_color, bg_color) # app_qr.center() # Add a border with bg_color - # app_qr.set_style_border_color(bg_color, 0) # app_qr.set_style_border_width(5, 0) # app_qr_data = str("https://fangzoudiu.xcloudtech.com/xiao_jian") # app_qr.update(app_qr_data,len(app_qr_data)) app_label = lv.label(app_screen) -app_label.set_pos(0, 90) -app_label.set_size(128, 38) +app_label.set_pos(0, 240) +app_label.set_size(240, 20) app_label.set_text(" ") app_label.set_long_mode(lv.label.LONG.WRAP) app_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -app_label.add_style(style_font_youyuan_20_default, lv.PART.MAIN | lv.STATE.DEFAULT) +app_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # -------------------------------------------volume screen---------------------------------------------------------- @@ -622,7 +657,7 @@ phonering_reduce_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) phonering_add_imgbtn = lv.img(phonering_screen) phonering_add_imgbtn.set_pos(120, 150) -phonering_add_imgbtn.set_size(55, 23) +phonering_add_imgbtn.set_size(110, 46) phonering_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) phonering_add_imgbtn.set_src("U:/static/add_btn.png") @@ -672,7 +707,7 @@ alarmvolume_reduce_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) alarmvolume_add_imgbtn = lv.img(alarmvolume_screen) alarmvolume_add_imgbtn.set_pos(125, 150) -alarmvolume_add_imgbtn.set_size(55, 23) +alarmvolume_add_imgbtn.set_size(110, 46) alarmvolume_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) alarmvolume_add_imgbtn.set_src("U:/static/add_btn.png") @@ -722,7 +757,7 @@ msgvolume_reduce_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) msgvolume_add_imgbtn = lv.img(msgvolume_screen) msgvolume_add_imgbtn.set_pos(125, 150) -msgvolume_add_imgbtn.set_size(55, 23) +msgvolume_add_imgbtn.set_size(110, 46) msgvolume_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) msgvolume_add_imgbtn.set_src("U:/static/add_btn.png") @@ -730,6 +765,45 @@ msgvolume_add_imgbtn.set_src("U:/static/add_btn.png") msgvolume_add_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +# -------------------------------------------restore screen---------------------------------------------------------- +restore_screen = lv.obj() +print("restore_screen") +restore_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +restore_label = lv.label(restore_screen) +restore_label.set_pos(0, 90) +restore_label.set_size(240, 70) +restore_label.set_text("设备所有的数据将会被清除,确定继续吗?") +restore_label.set_long_mode(lv.label.LONG.WRAP) +restore_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +restore_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +restore_confirm_label = lv.label(restore_screen) +restore_confirm_label.set_text("确认") +restore_confirm_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +restore_confirm_label.set_size(120, 60) +restore_confirm_label.set_pos(0,180) +restore_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + + +restore_confirm = lv.label(restore_screen) +restore_confirm.set_text(" ") +restore_confirm.set_size(120, 80) +restore_confirm.set_pos(0,160) +restore_confirm.add_flag(lv.obj.FLAG.CLICKABLE) + +restore_cancel_label = lv.label(restore_screen) +restore_cancel_label.set_text("返回") +restore_cancel_label.set_size(120, 60) +restore_cancel_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +restore_cancel_label.set_pos(120,180) +restore_cancel_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +restore_cancel = lv.label(restore_screen) +restore_cancel.set_text(" ") +restore_cancel.set_size(120, 80) +restore_cancel.set_pos(120,160) +restore_cancel.add_flag(lv.obj.FLAG.CLICKABLE) @@ -739,7 +813,7 @@ msgvolume_add_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) version_screen = lv.obj() print("version_screen") version_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -version_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) + version_msg = "Software Version:\n\ MMI\n\ Version:UIX8910_C55_V\n\ @@ -752,37 +826,36 @@ IMEI:\n\ import versions version_label1 = lv.label(version_screen) -version_label1.set_pos(10, 5) -version_label1.set_size(118, 20) +version_label1.set_pos(10, 30) +version_label1.set_size(230, 30) version_label1.set_long_mode(lv.label.LONG.WRAP) -# version_label1.set_text("Software Version:") version_label1.set_text("产品名称:") -version_label1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 10) +version_label1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) version_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label2 = lv.label(version_screen) -# version_label2.set_pos(0, 45) -# version_label2.set_size(128, 20) +# version_label2.set_pos(0, 60) +# version_label2.set_size(240, 30) # version_label2.set_long_mode(lv.label.LONG.WRAP) # version_label2.set_text("Python Lvgl") # version_label2.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) # version_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label3 = lv.label(version_screen) -# version_label3.set_pos(0, 65) -# version_label3.set_size(128, 20) +# version_label3.set_pos(0, 90) +# version_label3.set_size(240, 30) # version_label3.set_long_mode(lv.label.LONG.WRAP) # version_label3.set_text("Version:") # version_label3.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) # version_label3.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) version_label3 = lv.label(version_screen) -version_label3.set_pos(10, 25) -version_label3.set_size(118, 40) +version_label3.set_pos(10, 70) +version_label3.set_size(230, 30) version_label3.set_long_mode(lv.label.LONG.WRAP) version_label3.set_text(EventMesh.version) -version_label3.set_style_text_align(lv.TEXT_ALIGN.LEFT, 10) +version_label3.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) version_label3.add_style(style_font_youyuan_20_gray, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label4 = lv.label(version_screen) @@ -794,19 +867,19 @@ version_label3.add_style(style_font_youyuan_20_gray, lv.PART.MAIN | lv.STATE.DEF # version_label4.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) version_label5 = lv.label(version_screen) -version_label5.set_pos(10, 55) -version_label5.set_size(118, 20) +version_label5.set_pos(10, 120) +version_label5.set_size(230, 30) version_label5.set_long_mode(lv.label.LONG.WRAP) version_label5.set_text("软件版本:") -version_label5.set_style_text_align(lv.TEXT_ALIGN.LEFT, 10) +version_label5.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) version_label5.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) version_label6 = lv.label(version_screen) -version_label6.set_pos(10, 75) -version_label6.set_size(118, 40) +version_label6.set_pos(10, 160) +version_label6.set_size(230, 60) version_label6.set_long_mode(lv.label.LONG.WRAP) version_label6.set_text(EventMesh.builTime) -version_label6.set_style_text_align(lv.TEXT_ALIGN.LEFT, 10) +version_label6.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) version_label6.add_style(style_font_youyuan_20_gray, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label7 = lv.label(version_screen) @@ -818,18 +891,19 @@ version_label6.add_style(style_font_youyuan_20_gray, lv.PART.MAIN | lv.STATE.DEF # version_label7.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label8 = lv.label(version_screen) -# version_label8.set_pos(0, 180) -# version_label8.set_size(128, 20) +# version_label8.set_pos(0, 210) +# version_label8.set_size(240, 30) # version_label8.set_long_mode(lv.label.LONG.WRAP) # version_label8.set_text("IMEI:") # version_label8.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) # version_label8.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) # version_label9 = lv.label(version_screen) -# version_label9.set_pos(0, 200) -# version_label9.set_size(128, 38) +# version_label9.set_pos(0, 240) +# version_label9.set_size(240, 30) +# version_label9.set_long_mode(lv.label.LONG.WRAP) # version_label9.set_text(" ") -# version_label9.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +# version_label9.set_style_text_align(lv.TEXT_ALIGN.LEF, 0) # version_label9.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -841,305 +915,74 @@ update_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) update_title = lv.label(update_screen) update_title.set_pos(0, 10) -update_title.set_size(128, 20) +update_title.set_size(240, 40) update_title.set_text("系统更新") update_title.set_long_mode(lv.label.LONG.WRAP) update_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) update_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) update_label = lv.label(update_screen) -update_label.set_text("已经是最新版本") +update_label.set_text(" 已经是最新版本") update_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -update_label.set_size(128, 20) -update_label.set_pos(0,40) +update_label.set_size(240, 50) +update_label.set_pos(0,50) update_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) update_return = lv.label(update_screen) update_return.set_text("返回") -update_return.set_size(128, 40) +update_return.set_size(240, 40) update_return.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -update_return.set_pos(0,70) +update_return.set_pos(0,240) update_return.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) update_return.add_flag(lv.obj.FLAG.CLICKABLE) - - -# -------------------------------------------restore screen---------------------------------------------------------- -restore_screen = lv.obj() -print("restore_screen") -restore_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -restore_label = lv.label(restore_screen) -restore_label.set_pos(0, 20) -restore_label.set_size(128, 40) -restore_label.set_text("设备所有的数据将被清除,是否继续?") -restore_label.set_long_mode(lv.label.LONG.WRAP) -restore_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -restore_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -restore_confirm_label = lv.label(restore_screen) -restore_confirm_label.set_text("确认") -restore_confirm_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -restore_confirm_label.set_size(64, 20) -restore_confirm_label.set_pos(0,80) -restore_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - -restore_confirm = lv.label(restore_screen) -restore_confirm.set_text(" ") -restore_confirm.set_size(64, 48) -restore_confirm.set_pos(0,80) -restore_confirm.add_flag(lv.obj.FLAG.CLICKABLE) - -restore_cancel_label = lv.label(restore_screen) -restore_cancel_label.set_text("返回") -restore_cancel_label.set_size(64, 20) -restore_cancel_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -restore_cancel_label.set_pos(64,80) -restore_cancel_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -restore_cancel = lv.label(restore_screen) -restore_cancel.set_text(" ") -restore_cancel.set_size(64, 48) -restore_cancel.set_pos(64,80) -restore_cancel.add_flag(lv.obj.FLAG.CLICKABLE) - class RestoreScreen(Screen): NAME = "restore" def __init__(self): + self.is_sliding = 0 super().__init__() self.meta = restore_screen - restore_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None) - restore_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None) - - - def confirm(self, e): - EventMesh.publish("load_screen", {"screen": "restore_confirm"}) + restore_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e,1)), lv.EVENT.GESTURE, None) - def concel(self, e): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + restore_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,2)),lv.EVENT.SHORT_CLICKED, None) + restore_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,3)),lv.EVENT.SHORT_CLICKED, None) - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "setting"}) - def btn8_press(self): - EventMesh.publish("watch_top_show") - EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -# -------------------------------------------restore screen---------------------------------------------------------- -restart_screen = lv.obj() -print("restart_screen") -restart_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -# restart_confirm_label = lv.label(restart_screen) -# restart_confirm_label.set_text("确认") -# restart_confirm_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# restart_confirm_label.set_size(64, 20) -# restart_confirm_label.set_pos(0,80) -# restart_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - - -# restart_confirm = lv.label(restart_screen) -# restart_confirm.set_text(" ") -# restart_confirm.set_size(64, 40) -# restart_confirm.set_pos(0,80) -# restart_confirm.add_flag(lv.obj.FLAG.CLICKABLE) - -# restart_cancel_label = lv.label(restart_screen) -# restart_cancel_label.set_text("返回") -# restart_cancel_label.set_size(64, 20) -# restart_cancel_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# restart_cancel_label.set_pos(64,80) -# restart_cancel_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# restart_cancel = lv.label(restart_screen) -# restart_cancel.set_text(" ") -# restart_cancel.set_size(64, 40) -# restart_cancel.set_pos(64,80) -# restart_cancel.add_flag(lv.obj.FLAG.CLICKABLE) - - -screen_slider_1 = lv.slider(restart_screen) -screen_slider_1.set_pos(int(4),int(55)) -screen_slider_1.set_size(120,40) -screen_slider_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.ON) -screen_slider_1.set_range(0, 100) -screen_slider_1.set_value(0, False) -screen_slider_1.add_flag(lv.obj.FLAG.ADV_HITTEST) - -# screen_slider_1.set_mode(lv.BAR_MODE.RANGE)#LV_BAR_MODE_RANGE - -# create style style_screen_slider_1_main_main_default -style_screen_slider_1_main_main_default = lv.style_t() -style_screen_slider_1_main_main_default.init() -style_screen_slider_1_main_main_default.set_radius(40) -style_screen_slider_1_main_main_default.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_main_default.set_bg_grad_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_main_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_slider_1_main_main_default.set_bg_opa(0) -style_screen_slider_1_main_main_default.set_outline_color(lv.color_make(0xff,0xff,0xff)) -style_screen_slider_1_main_main_default.set_outline_width(5) -style_screen_slider_1_main_main_default.set_outline_opa(0) - -# add style for screen_slider_1 -screen_slider_1.add_style(style_screen_slider_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - -# create style style_screen_slider_1_main_main_focused -style_screen_slider_1_main_main_focused = lv.style_t() -style_screen_slider_1_main_main_focused.init() -style_screen_slider_1_main_main_focused.set_outline_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_main_focused.set_outline_opa(255) - -# add style for screen_slider_1 -screen_slider_1.add_style(style_screen_slider_1_main_main_focused, lv.PART.MAIN|lv.STATE.FOCUSED) - -# create style style_screen_slider_1_main_indicator_default -style_screen_slider_1_main_indicator_default = lv.style_t() -style_screen_slider_1_main_indicator_default.init() -style_screen_slider_1_main_indicator_default.set_radius(40) -style_screen_slider_1_main_indicator_default.set_bg_color(lv.color_make(0x80,0x80,0x80)) -style_screen_slider_1_main_indicator_default.set_bg_grad_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_indicator_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_slider_1_main_indicator_default.set_bg_opa(100) - -# add style for screen_slider_1 -screen_slider_1.add_style(style_screen_slider_1_main_indicator_default, lv.PART.INDICATOR|lv.STATE.DEFAULT) - -# # create style style_screen_slider_1_main_indicator_focused -style_screen_slider_1_main_indicator_focused = lv.style_t() -style_screen_slider_1_main_indicator_focused.init() -style_screen_slider_1_main_indicator_focused.set_radius(40) -style_screen_slider_1_main_indicator_focused.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_indicator_focused.set_bg_grad_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_indicator_focused.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_slider_1_main_indicator_focused.set_bg_opa(0) - -# # add style for screen_slider_1 -# screen_slider_1.add_style(style_screen_slider_1_main_indicator_focused, lv.PART.INDICATOR|lv.STATE.FOCUSED) - -# create style style_screen_slider_1_main_knob_default -style_screen_slider_1_main_knob_default = lv.style_t() -style_screen_slider_1_main_knob_default.init() -style_screen_slider_1_main_knob_default.set_radius(40) -style_screen_slider_1_main_knob_default.set_bg_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_knob_default.set_bg_grad_color(lv.color_make(0x00,0x00,0x00)) -style_screen_slider_1_main_knob_default.set_bg_grad_dir(lv.GRAD_DIR.NONE) -style_screen_slider_1_main_knob_default.set_bg_opa(0) -style_screen_slider_1_main_knob_default.set_border_width(0) -style_screen_slider_1_main_knob_default.set_pad_all(0) - -# add style for screen_slider_1 -screen_slider_1.add_style(style_screen_slider_1_main_knob_default, lv.PART.KNOB|lv.STATE.DEFAULT) - - - -screen_slider_img_bg = lv.img(restart_screen) -screen_slider_img_bg.set_size(120,40) -screen_slider_img_bg.set_pos(4,55) -screen_slider_img_bg.set_src("U:/static/setting_poweroff_bg.png") -screen_slider_img_bg.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -screen_slider_img = lv.img(restart_screen) -screen_slider_img.set_size(30,30) -screen_slider_img.set_pos(10,65) -screen_slider_img.set_src("U:/static/setting_power_restart.png") -# screen_slider_img.add_flag(lv.obj.FLAG.CLICKABLE) -screen_slider_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - -restart_power_label = lv.label(restart_screen) -restart_power_label.set_text("滑动重启") -restart_power_label.set_size(128, 20) -restart_power_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -restart_power_label.set_pos(0,20) -restart_power_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -class RestartScreen(Screen): - NAME = "restart" - - def __init__(self): - super().__init__() - self.meta = restart_screen - self.old_x = 0 - # restart_confirm.add_event_cb(lambda e: EventMesh.callback_wrapper(self.confirm(e)),lv.EVENT.SHORT_CLICKED, None) - # restart_cancel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.concel(e)),lv.EVENT.SHORT_CLICKED, None) - screen_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.VALUE_CHANGED, None) - screen_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.RELEASED, None) - def initialization(self): - screen_slider_1.set_value(10, False) - screen_slider_img.set_pos(10,60) - screen_slider_1.set_style_bg_color(lv.color_make(0x00,0x00,0x00), lv.PART.INDICATOR|lv.STATE.DEFAULT) - - def save_choice(self,e): - state_on = 0 - state_offset = 0 + self.is_sliding = 0 + + def fun(self, e,msg): code = e.get_code() - value_slider = screen_slider_1.get_value() - total_len = 0+value_slider - if total_len >= 100-7: - total_len = 100-7 - if total_len <= 10: - total_len = 10 - - if total_len >= 100-7: - screen_slider_1.set_value(100, False) - - if total_len >= 20: - if total_len > 80: - screen_slider_img.set_pos(total_len,60) - else: - screen_slider_img.set_pos(total_len-5,60) - else: - screen_slider_img.set_pos(total_len,60) - screen_slider_1.set_style_bg_color(lv.color_make(0x80,0x80,0x80), lv.PART.INDICATOR|lv.STATE.DEFAULT) - - # print("RELEASED save_choice!!!!!!",code,total_len,value_slider,state_offset) - if code == lv.EVENT.RELEASED: - value_slider = screen_slider_1.get_value() - # print("RELEASED save_choice1111111!!!!!!",total_len,value_slider,state_on) - if total_len < 100-7: - screen_slider_1.set_value(10, False) - screen_slider_img.set_pos(10,60) - screen_slider_1.set_style_bg_color(lv.color_make(0x00,0x00,0x00), lv.PART.INDICATOR|lv.STATE.DEFAULT) - else: - screen_slider_1.set_value(100, False) - self.confirm(0) - pass - - # print("save_choice!!!!!!",value_slider) - pass - - def confirm(self, e): - Power.powerRestart() - - def concel(self, e): + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + EventMesh.publish("load_screen", {"screen": "restore_confirm"}) + pass + elif msg == 3: + EventMesh.publish("return_prev_screen") + pass + def done_return(self): EventMesh.publish("load_screen", {"screen": "setting"}) - def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) - - def btn1_release(self): - EventMesh.publish("load_screen", {"screen": "setting"}) - def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) + + class UpdateScreen(Screen): NAME = "update" def __init__(self): super().__init__() self.meta = update_screen - update_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.back(e)),lv.EVENT.SHORT_CLICKED, None) + update_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.back(e)),lv.EVENT.CLICKED, None) def back(self,e): EventMesh.publish("load_screen", {"screen": "setting"}) @@ -1161,15 +1004,25 @@ class VersionScreen(Screen): def __init__(self): super().__init__() self.meta = version_screen + version_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e)), lv.EVENT.GESTURE, None) self.btn_count = 0 def initialization(self): + imei = EventMesh.publish(constants.EVENT.GET_IMEI) - # print("imei",imei) - # version_label9.set_text("{}".format(imei)) + # version_label9.set_text(imei) def Close(self): self.btn_count = 0 - + + def fun(self, e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + def done_click(self): self.btn_count += 1 if self.btn_count >= 5 : @@ -1181,12 +1034,13 @@ class VersionScreen(Screen): EventMesh.publish("load_screen", {"screen": "factorymode"}) def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "setting"}) + + def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) - + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -1196,103 +1050,45 @@ poweroff_screen = lv.obj() print("poweroff_screen") poweroff_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) -# poweroff_img = lv.img(poweroff_screen) -# poweroff_img.set_pos(49, 5) -# poweroff_img.set_size(30, 30) -# poweroff_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -# poweroff_img.set_src("U:/static/setting_poweroff.png") - -# poweroff_label = lv.label(poweroff_screen) -# poweroff_label.set_text("是否关机?") -# poweroff_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -# poweroff_label.set_size(128, 20) -# poweroff_label.set_pos(0,40) -# poweroff_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# poweroff_confirm_img = lv.img(poweroff_screen) -# poweroff_confirm_img.set_size(88, 23) -# poweroff_confirm_img.set_pos(24, 65) -# poweroff_confirm_img.set_src("U:/static/off_icon.png") -# poweroff_confirm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -# poweroff_confirm_imgbtn = lv.img(poweroff_screen) -# poweroff_confirm_imgbtn.set_size(128, 35) -# poweroff_confirm_imgbtn.set_pos(0, 60) -# poweroff_confirm_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) -# poweroff_confirm_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - - -# poweroff_confirm_label = lv.label(poweroff_confirm_img) -# poweroff_confirm_label.set_text("关机") -# poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 0) -# poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -# poweroff_return = lv.img(poweroff_screen) -# poweroff_return.set_size(88, 23) -# poweroff_return.set_pos(24, 100) -# poweroff_return.set_src("U:/static/cancel_icon.png") -# poweroff_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -# poweroff_return_btn = lv.img(poweroff_screen) -# poweroff_return_btn.set_size(128, 33) -# poweroff_return_btn.set_pos(0, 95) -# poweroff_return_btn.add_flag(lv.obj.FLAG.CLICKABLE) -# poweroff_return_btn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - -# poweroff_return_label = lv.label(poweroff_return) -# poweroff_return_label.set_text("返回") -# poweroff_return_label.align(lv.ALIGN.CENTER, 0, 0) -# poweroff_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -# poweroff_return.set_ext_click_area(20) - - -poweroff_screen_slider_1 = lv.slider(poweroff_screen) -poweroff_screen_slider_1.set_pos(int(4),int(55)) -poweroff_screen_slider_1.set_size(120,40) -poweroff_screen_slider_1.set_scrollbar_mode(lv.SCROLLBAR_MODE.ON) -poweroff_screen_slider_1.set_range(0, 100) -poweroff_screen_slider_1.set_value(10, False) -poweroff_screen_slider_1.add_flag(lv.obj.FLAG.ADV_HITTEST) - -# screen_slider_1.set_mode(lv.BAR_MODE.RANGE)#LV_BAR_MODE_RANGE -# add style for screen_slider_1 -poweroff_screen_slider_1.add_style(style_screen_slider_1_main_main_default, lv.PART.MAIN|lv.STATE.DEFAULT) - - - -# add style for screen_slider_1 -poweroff_screen_slider_1.add_style(style_screen_slider_1_main_main_focused, lv.PART.MAIN|lv.STATE.FOCUSED) - - - -# add style for screen_slider_1 -poweroff_screen_slider_1.add_style(style_screen_slider_1_main_indicator_default, lv.PART.INDICATOR|lv.STATE.DEFAULT) - -# -poweroff_screen_slider_1.add_style(style_screen_slider_1_main_knob_default, lv.PART.KNOB|lv.STATE.DEFAULT) - - +poweroff_img = lv.img(poweroff_screen) +poweroff_img.set_pos(89, 30) +poweroff_img.set_size(61, 61) +poweroff_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +poweroff_img.set_src("U:/static/poweroff_icon.png") + +poweroff_label = lv.label(poweroff_screen) +poweroff_label.set_text("是否关机?") +poweroff_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +poweroff_label.set_size(240, 20) +poweroff_label.set_pos(0,120) +poweroff_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) + +poweroff_confirm_img = lv.img(poweroff_screen) +poweroff_confirm_img.set_size(176, 46) +poweroff_confirm_img.set_pos(32, 160) +poweroff_confirm_img.set_src("U:/static/off_icon.png") +poweroff_confirm_img.add_flag(lv.obj.FLAG.CLICKABLE) +poweroff_confirm_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) + +poweroff_confirm_label = lv.label(poweroff_confirm_img) +poweroff_confirm_label.set_text("关机") +poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 5) +poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) -poweroff_screen_slider_img_bg = lv.img(poweroff_screen) -poweroff_screen_slider_img_bg.set_size(120,40) -poweroff_screen_slider_img_bg.set_pos(4,55) -poweroff_screen_slider_img_bg.set_src("U:/static/setting_poweroff_bg.png") -poweroff_screen_slider_img_bg.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +poweroff_return = lv.img(poweroff_screen) +poweroff_return.set_size(176, 46) +poweroff_return.set_pos(32, 230) +poweroff_return.set_src("U:/static/cancel_icon.png") +poweroff_return.add_flag(lv.obj.FLAG.CLICKABLE) +poweroff_return.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) +poweroff_return_label = lv.label(poweroff_return) +poweroff_return_label.set_text("返回") +poweroff_return_label.align(lv.ALIGN.CENTER, 0, 5) +poweroff_return_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +poweroff_return.set_ext_click_area(20) -poweroff_screen_slider_img = lv.img(poweroff_screen) -poweroff_screen_slider_img.set_size(30,30) -poweroff_screen_slider_img.set_pos(10,65) -poweroff_screen_slider_img.set_src("U:/static/setting_poweroff.png") -# screen_slider_img.add_flag(lv.obj.FLAG.CLICKABLE) -poweroff_screen_slider_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -poweroff_power_label = lv.label(poweroff_screen) -poweroff_power_label.set_text("滑动关机") -poweroff_power_label.set_size(128, 20) -poweroff_power_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -poweroff_power_label.set_pos(0,20) -poweroff_power_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1301,123 +1097,42 @@ class PoweroffScreen(Screen): def __init__(self): super().__init__() + self.is_sliding = 0 self.meta = poweroff_screen - + poweroff_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.fun(e,1)), lv.EVENT.GESTURE, None) + poweroff_confirm_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,2)),lv.EVENT.SHORT_CLICKED, None) + poweroff_return.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,3)),lv.EVENT.SHORT_CLICKED, None) - poweroff_screen_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.VALUE_CHANGED, None) - poweroff_screen_slider_1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.save_choice(e)), lv.EVENT.RELEASED, None) - def initialization(self): - poweroff_screen_slider_1.set_value(10, False) - poweroff_screen_slider_img.set_pos(10,60) - poweroff_screen_slider_1.set_style_bg_color(lv.color_make(0x00,0x00,0x00), lv.PART.INDICATOR|lv.STATE.DEFAULT) - - def save_choice(self,e): - code = e.get_code() - value_slider = poweroff_screen_slider_1.get_value() - total_len = 0+value_slider - if total_len >= 100-7: - total_len = 100-7 - if total_len <= 10: - total_len = 10 - - if total_len >= 100-7: - poweroff_screen_slider_1.set_value(100, False) - - if total_len >= 20: - if total_len > 80: - poweroff_screen_slider_img.set_pos(total_len,60) - else: - poweroff_screen_slider_img.set_pos(total_len-5,60) - else: - poweroff_screen_slider_img.set_pos(total_len,60) - poweroff_screen_slider_1.set_style_bg_color(lv.color_make(0x80,0x80,0x80), lv.PART.INDICATOR|lv.STATE.DEFAULT) - - if code == lv.EVENT.RELEASED: - value_slider = poweroff_screen_slider_1.get_value() - if total_len < 100-7: - poweroff_screen_slider_1.set_value(10, False) - poweroff_screen_slider_img.set_pos(10,60) - poweroff_screen_slider_1.set_style_bg_color(lv.color_make(0x00,0x00,0x00), lv.PART.INDICATOR|lv.STATE.DEFAULT) - else: - poweroff_screen_slider_1.set_value(100, False) - self.confirm(0) - pass - - # print("save_choice!!!!!!",value_slider) + self.is_sliding = 0 pass + def fun(self, e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) + pass + elif msg == 3: + EventMesh.publish("load_screen", {"screen": "setting"}) + pass def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) - - def confirm(self, e): - EventMesh.publish("load_screen", {"screen": "poweroff_comfirm"}) - - def concel(self, e): EventMesh.publish("load_screen", {"screen": "setting"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) - - -poweroff_confirm_screen = lv.obj() -print("poweroff_confirm_screen") -poweroff_confirm_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) - -poweroff_confirm_label = lv.label(poweroff_confirm_screen) -poweroff_confirm_label.set_text("Goodbye") -poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 0) -poweroff_confirm_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) - -import utime -class PoweroffConfirmScreen(Screen): - NAME = "poweroff_comfirm" - - def __init__(self): - super().__init__() - self.meta = poweroff_confirm_screen - self.timer = osTimer() - self.aud = audio.Audio(0) - self.meta_type = "popup" - - - def initialization(self): - step = EventMesh.publish("get_old_step_value") - if step != 0: - EventMesh.publish("set_storage_config",["old_step",step]) - - date_tmp = utime.localtime() - time_tmp = utime.mktime(date_tmp) - EventMesh.publish("set_storage_config",["old_time",time_tmp])#关机保存一个是时间 - - self.count = 0 - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #文件名前面要加上路径 - self.timer.start(1*1000,1,self.power_off) - - def power_off(self,*args): - self.count+=1 - EventMesh.publish("system_sleep_rest")#防止黑屏 - # print("power off!!!!!!!",self.count) - if self.count > 5:#在上一个界面在播放音频时切换界面则关闭 以免一直播放 - self.count = 0 - self.timer.stop() - Power.powerDown() - - def done_return(self): - pass - - def btn1_release(self): - pass - - def btn8_press(self): - pass - poweron_screen = lv.obj() print("poweron_screen") poweron_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1425,46 +1140,63 @@ poweron_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) poweron_label = lv.label(poweron_screen) poweron_label.set_text("WELCOME") poweron_label.align(lv.ALIGN.CENTER, 0, 0) -poweron_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +poweron_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) class PowerOnScreen(Screen): NAME = "poweron" def __init__(self): super().__init__() self.meta = poweron_screen + self.meta_type = "popup" + self.timer = osTimer() self.timer1 = osTimer() self.timer2 = osTimer() self.aud = audio.Audio(0) - self.meta_type = "popup" - self.aud.set_pa(Pin.GPIO43) + self.aud.set_pa(Pin.GPIO29) self.volum_size = 8 check_volum = EventMesh.publish("get_storage_config","volum") - if check_volum != None: - self.volum_size = check_volum + self.volum_size = check_volum self.aud.setVolume(self.volum_size) self.count = 0 + self.flag = 0 def initialization(self): + print("power fun!!!!!!! initialization\r\n") + EventMesh.publish("set_UI_high_priority",1) self.count = 0 - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #播放开机铃声 - self.timer1.start(1000,1,self.fun) - self.timer2.start(4000,0,self.open_fun) - + self.aud.setVolume(11) + temp = Power.getVbatt() + if temp > 3400:#低电播放音频会导致一直复位 + self.aud.play(1, 1, 'E:/static/R_POWER_1.mp3') #播放来电铃声 + # EventMesh.publish("set_motor_time",[1,2,8,8,4])#设置马达参数 + EventMesh.publish("set_motor_time",[1,2,8*1,8,4])#设置马达参数 + # self.timer.start(1000,1,self.fun) + # self.timer1.start(3000,0,self.fun_motor) + EventMesh.publish("system_sleep_rest")#防止黑屏 + self.timer2.start(15000,0,self.to_main_page_fun) pass + def fun(self,*data): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb,"data":0}) - def fun(self,*argc): + def fun_cb(self,data): EventMesh.publish("system_sleep_rest")#防止黑屏 - - def open_fun(self,*argc): - EventMesh.publish("load_screen", {"screen": "main_menu"}) + def to_main_page_fun(self,*argc): + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + def fun_motor(self,*argc): + print("fun_motor!!!!!!!\r\n") + EventMesh.publish("set_motor_time",[1,2,8*1,8,4])#设置马达参数 def Close(self): - self.timer1.stop() - self.timer2.stop() + EventMesh.publish("set_UI_high_priority",0) + EventMesh.publish("close_motor_infor")#关闭马达和定时器 + self.timer.stop() + self.aud.stopAll() self.aud.setVolume(self.volum_size) pass def done_return(self): @@ -1476,6 +1208,58 @@ class PowerOnScreen(Screen): def btn8_press(self): pass +poweroff_confirm_screen = lv.obj() +print("poweroff_confirm_screen") +poweroff_confirm_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +poweroff_confirm_label = lv.label(poweroff_confirm_screen) +poweroff_confirm_label.set_text("Goodbye") +poweroff_confirm_label.align(lv.ALIGN.CENTER, 0, 0) +poweroff_confirm_label.add_style(style_font_youyuan_40, lv.PART.MAIN | lv.STATE.DEFAULT) + +import utime +class PoweroffConfirmScreen(Screen): + NAME = "poweroff_comfirm" + + def __init__(self): + super().__init__() + self.meta = poweroff_confirm_screen + self.timer = osTimer() + self.count = 0 + + def initialization(self): + step = EventMesh.publish("get_old_step_value") + if step != None: + EventMesh.publish("set_storage_config",["old_step",step]) + + date_tmp = utime.localtime() + time_tmp = utime.mktime(date_tmp) + EventMesh.publish("set_storage_config",["old_time",time_tmp])#关机保存一个是时间 + + #print("self.read_data:{}".format(self.read_data)) + EventMesh.publish("play_poewr_off_event")# + self.count = 0 + self.timer.start(1*1000,1,self.power_off) + + def power_off(self,*args): + self.count+=1 + EventMesh.publish("system_sleep_rest")#防止黑屏 + play_state = EventMesh.publish("get_audio_state")#音频播放状态 + if play_state != None: + # print("power off!!!!!!!",self.count) + if self.count > 5:#在上一个界面在播放音频时切换界面则关闭 以免一直播放 + self.count = 0 + self.timer.stop() + Power.powerDown() + + def done_return(self): + pass + + def btn1_release(self): + pass + + def btn8_press(self): + pass from common import Abstract class TimePoweroffScreen(Abstract): @@ -1483,7 +1267,7 @@ class TimePoweroffScreen(Abstract): def __init__(self): super().__init__() self.power_off_flag = 0 - self.read_data = {} + EventMesh.subscribe("get_time_power_off", self.get_time_power_off) EventMesh.subscribe("power_off_callback", self.power_off_callback) EventMesh.subscribe("set_time_power_off", self.set_time_power_off) @@ -1508,11 +1292,8 @@ class TimePoweroffScreen(Abstract): self.power_off_flag = 0 def set_time_power_off(self,event,msg): - self.read_data = EventMesh.publish("get_storage_data") - if self.read_data != {}: - b = str("off_on") in self.read_data().keys() - if b == True: - pass + + pass @@ -1549,9 +1330,10 @@ class DialswitchScreen(Screen): def __init__(self): super().__init__() self.meta = dialswitch_screen - self.read_data = {} self.watchface_style_num = "Watchface1" - dialswitch_img1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.watchface01(e)), + dialswitch_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,1)), lv.EVENT.GESTURE, None) + + dialswitch_img1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), lv.EVENT.SHORT_CLICKED, None) self.dial_num = 1 self.move = 0 @@ -1560,11 +1342,10 @@ class DialswitchScreen(Screen): def initialization(self): self.dial_num = 1 self.move = 0 - self.read_data = EventMesh.publish("get_storage_data") - if self.read_data != {}: - b = str("watchface") in self.read_data.keys() - if b == True: - self.watchface_style_num = self.read_data["watchface"] + read_data = EventMesh.publish("get_storage_config","watchface") + + if read_data != None: + self.watchface_style_num = read_data if self.watchface_style_num == "Watchface1": self.dial_num = 1 else: @@ -1575,67 +1356,86 @@ class DialswitchScreen(Screen): def watchface01(self,e): code = e.get_code() - # if code == lv.EVENT.SHORT_CLICKED: - # self.timer.start(50,0,self.enter_main_show) - self.enter_main_show(0) + if code == lv.EVENT.SHORT_CLICKED: + self.timer.start(50,0,self.enter_main_show) def enter_main_show(self,e): - self.dial_num = 1 + EventMesh.publish("set_storage_config",["watchface","Watchface{}".format(self.dial_num)]) EventMesh.publish("set_change_face", "Watchface{}".format(self.dial_num)) EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "setting"}) + + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + if self.dial_num > 1: + self.dial_num-=1 + else: + self.dial_num = 2 + self.show_info() + elif dir == lv.DIR.LEFT: + self.dial_num+=1 + if self.dial_num > 2: + self.dial_num = 1 + self.show_info() + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != 1: + self.enter_main_show(1) def done_left_to_right(self):#右滑 - pass + return #print("done_left_to_right!!!!!!!!!") - # self.move = 1 - # if self.dial_num > 1: - # self.dial_num-=1 - # else: - # self.dial_num = 2 - # self.timer.stop() - # self.show_info() + self.move = 1 + if self.dial_num > 1: + self.dial_num-=1 + else: + self.dial_num = 2 + self.timer.stop() + self.show_info() def done_right_to_left(self):#左滑 - pass + return #print("done_right_to_left!!!!!!!!!") - # self.move = 2 - # self.dial_num+=1 - # if self.dial_num > 2: - # self.dial_num = 1 - # self.show_info() - # self.timer.stop() + self.move = 2 + self.dial_num+=1 + if self.dial_num > 2: + self.dial_num = 1 + self.show_info() + self.timer.stop() def done_bottom_to_top(self): - pass - # self.move = 3 - # self.timer.stop() + return + self.move = 3 + self.timer.stop() def done_top_to_bottom(self): - pass - # self.move = 4 - # self.timer.stop() + return + self.move = 4 + self.timer.stop() def show_info(self): - dialswitch_img1.set_src("U:/static/DIAL_PREV01.png") - dialswitch_btn1_label.set_text("表盘1") - # dialswitch_img1.set_src("U:/static/DIAL_PREV01.png".format(self.dial_num)) - # dialswitch_btn1_label.set_text("表盘{}".format(self.dial_num)) - # if(self.dial_num == 1): - # pass - # # dialswitch_butoom_crcile1.set_src("U:/static/point_white.png") - # # dialswitch_butoom_crcile2.set_src("U:/static/point_black.png") - # else: - # pass - # dialswitch_butoom_crcile1.set_src("U:/static/point_black.png") - # dialswitch_butoom_crcile2.set_src("U:/static/point_white.png") + dialswitch_img1.set_src("U:/static/DIAL_PREV0{}.png".format(self.dial_num)) + dialswitch_btn1_label.set_text("表盘{}".format(self.dial_num)) + if(self.dial_num == 1): + dialswitch_butoom_crcile1.set_src("U:/static/point_white.png") + dialswitch_butoom_crcile2.set_src("U:/static/point_black.png") + else: + dialswitch_butoom_crcile1.set_src("U:/static/point_black.png") + dialswitch_butoom_crcile2.set_src("U:/static/point_white.png") def Close(self): - self.timer.stop() + pass + + def done_return(self): + EventMesh.publish("load_screen", {"screen": "setting"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) @@ -1645,7 +1445,70 @@ class DialswitchScreen(Screen): EventMesh.publish("load_screen", {"screen": "main_menu"}) +class ThemeswitchScreen(Screen):#主题风格选择 + NAME = "themeswitch" + + def __init__(self): + super().__init__() + self.meta = menustyle_screen + menustyle_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,1)), + lv.EVENT.GESTURE, None) + + menustyle_img1_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,2)), + lv.EVENT.SHORT_CLICKED, None) + + menustyle_img2_bg_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,3)), + lv.EVENT.SHORT_CLICKED, None) + + def initialization(self): + read_data = EventMesh.publish("get_storage_config","MainMenu") + if read_data != None: + if read_data == "1": + menustyle_select.set_pos(int(190),int(80)) + # menustyle_img1.set_src("U:/static/theme_four2.png") + # menustyle_img2.set_src("U:/static/theme_single1.png") + else: + menustyle_select.set_pos(int(190),int(165)) + # menustyle_img1.set_src("U:/static/theme_four1.png") + # menustyle_img2.set_src("U:/static/theme_single2.png") + else: + menustyle_select.set_pos(int(190),int(165)) + # menustyle_img1.set_src("U:/static/theme_four1.png") + # menustyle_img2.set_src("U:/static/theme_single2.png") + + def fun(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + + elif code == lv.EVENT.SHORT_CLICKED: + #utime.sleep_ms(10) + if msg == 2: + menustyle_select.set_pos(int(190),int(80)) + # menustyle_img1.set_src("U:/static/theme_four2.png") + # menustyle_img2.set_src("U:/static/theme_single1.png") + EventMesh.publish("set_mainmenu",msg = ["1",0]) + # self.set_mainmenu(msg = [read_data,0]) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + elif msg == 3: + menustyle_select.set_pos(int(190),int(165)) + # menustyle_img1.set_src("U:/static/theme_four1.png") + # menustyle_img2.set_src("U:/static/theme_single2.png") + EventMesh.publish("set_mainmenu",msg = ["2",0]) + EventMesh.publish("load_screen", {"screen": "main_menu"}) + def done_return(self): + EventMesh.publish("load_screen", {"screen": "setting"}) + + def btn8_press(self): + EventMesh.publish("watch_top_show") + EventMesh.publish("load_screen", {"screen": "main_menu"}) + + # -------------------------------------------imei screen---------------------------------------------------------- imei_screen = lv.obj() @@ -1655,41 +1518,57 @@ imei_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) bg_color = lv.palette_lighten(lv.PALETTE.LIGHT_BLUE, 5) fg_color = lv.palette_darken(lv.PALETTE.BLUE, 4) -imei_qr = lv.qrcode(imei_screen, 80, fg_color, bg_color) -imei_qr.set_pos(24, 4) +imei_qr_screen = lv.obj(imei_screen) +imei_qr_screen.set_size(240,200) +imei_qr_screen.set_pos(0,10) +imei_qr_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + +imei_qr = lv.qrcode(imei_qr_screen, 150, fg_color, bg_color) +imei_qr.center() # Add a border with bg_color imei_qr.set_style_border_color(bg_color, 0) -imei_qr.set_style_border_width(2, 0) +imei_qr.set_style_border_width(5, 0) imei_label = lv.label(imei_screen) -imei_label.set_pos(0, 90) -imei_label.set_size(128, 38) +imei_label.set_pos(0, 230) +imei_label.set_size(240, 20) imei_label.set_text(" ") imei_label.set_long_mode(lv.label.LONG.WRAP) imei_label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) -imei_label.add_style(style_font_youyuan_20_default, lv.PART.MAIN | lv.STATE.DEFAULT) +imei_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) class ImeiScreen(Screen): NAME = "imei" def __init__(self): super().__init__() self.meta = imei_screen + imei_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e)), + lv.EVENT.GESTURE, None) def initialization(self): - imei = EventMesh.publish(constants.EVENT.GET_IMEI) imei_qr_data = str(imei) imei_qr.update(imei_qr_data,len(imei_qr_data)) imei_label.set_text(imei) + def fun(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "setting"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) + + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -1701,17 +1580,28 @@ class AppScreen(Screen): def __init__(self): super().__init__() self.meta = app_screen + app_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e)), + lv.EVENT.GESTURE, None) def initialization(self): imei = EventMesh.publish(constants.EVENT.GET_IMEI) app_label.set_text(imei) + + def fun(self,e): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "setting"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) - + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -1722,24 +1612,24 @@ brightness_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_title = lv.label(brightness_screen) -brightness_title.set_pos(0, 5) -brightness_title.set_size(120, 20) +brightness_title.set_pos(0, 10) +brightness_title.set_size(240, 40) brightness_title.set_text("屏幕调节") brightness_title.set_long_mode(lv.label.LONG.WRAP) brightness_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) brightness_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_label1 = lv.label(brightness_screen) -brightness_label1.set_pos(5, 30) -brightness_label1.set_size(128-5, 20) +brightness_label1.set_pos(10, 60) +brightness_label1.set_size(230, 40) brightness_label1.set_text("亮度:") brightness_label1.set_long_mode(lv.label.LONG.WRAP) brightness_label1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) brightness_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_bar = lv.bar(brightness_screen) -brightness_bar.set_pos(10, 55) -brightness_bar.set_size(108, 12) +brightness_bar.set_pos(20, 90) +brightness_bar.set_size(200, 25) brightness_bar.set_style_anim_time(1000, lv.PART.INDICATOR | lv.STATE.DEFAULT) brightness_bar.set_mode(lv.bar.MODE.NORMAL) brightness_bar.set_value(50, lv.ANIM.OFF) @@ -1747,59 +1637,79 @@ brightness_bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_bar.add_style(style_bar_indic, lv.PART.INDICATOR | lv.STATE.DEFAULT) brightness_reduce_imgbtn = lv.img(brightness_screen) -brightness_reduce_imgbtn.set_pos(6, 70) -brightness_reduce_imgbtn.set_size(55, 23) +brightness_reduce_imgbtn.set_pos(5, 185) +brightness_reduce_imgbtn.set_size(110, 46) brightness_reduce_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) brightness_reduce_imgbtn.set_src("U:/static/reduce_btn.png") brightness_reduce_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_add_imgbtn = lv.img(brightness_screen) -brightness_add_imgbtn.set_pos(67, 70) -brightness_add_imgbtn.set_size(55, 23) +brightness_add_imgbtn.set_pos(125, 185) +brightness_add_imgbtn.set_size(110, 46) brightness_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) brightness_add_imgbtn.set_src("U:/static/add_btn.png") brightness_add_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_label_time = lv.label(brightness_screen) -brightness_label_time.set_pos(5, 97) -brightness_label_time.set_size(45, 20) +brightness_label_time.set_pos(10, 140) +brightness_label_time.set_size(80, 30) brightness_label_time.set_text("时间:") brightness_label_time.set_long_mode(lv.label.LONG.WRAP) brightness_label_time.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) brightness_label_time.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_reduce_img = lv.img(brightness_screen) -brightness_time_reduce_img.set_pos(50, 97) -brightness_time_reduce_img.set_size(15, 17) +brightness_time_reduce_img.set_pos(90, 135) +brightness_time_reduce_img.set_size(30, 34) brightness_time_reduce_img.set_src("U:/static/time_up2.png") brightness_time_reduce_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_reduce_imgbtn= lv.img(brightness_screen) -brightness_time_reduce_imgbtn.set_size(49, 32) -brightness_time_reduce_imgbtn.set_pos(79, 96) +brightness_time_reduce_imgbtn.set_size(80, 45) +brightness_time_reduce_imgbtn.set_pos(90, 130) brightness_time_reduce_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) brightness_label_time_text = lv.label(brightness_screen) -brightness_label_time_text.set_pos(65, 98) -brightness_label_time_text.set_size(45, 20) -brightness_label_time_text.set_text("5s") +brightness_label_time_text.set_pos(130, 142) +brightness_label_time_text.set_size(60, 30) +brightness_label_time_text.set_text("5秒") brightness_label_time_text.set_long_mode(lv.label.LONG.WRAP) -brightness_label_time_text.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) +brightness_label_time_text.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) brightness_label_time_text.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_add_img = lv.img(brightness_screen) -brightness_time_add_img.set_pos(110, 97) -brightness_time_add_img.set_size(15, 17) +brightness_time_add_img.set_pos(190, 135) +brightness_time_add_img.set_size(30, 34) brightness_time_add_img.set_src("U:/static/time_up1.png") brightness_time_add_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) brightness_time_add_imgbtn= lv.img(brightness_screen) -brightness_time_add_imgbtn.set_size(49, 32) -brightness_time_add_imgbtn.set_pos(30, 96) +brightness_time_add_imgbtn.set_size(70, 45) +brightness_time_add_imgbtn.set_pos(170, 130) brightness_time_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) +brightness_flip_label = lv.label(brightness_screen) +brightness_flip_label.set_pos(10, 250) +brightness_flip_label.set_size(140, 29) +brightness_flip_label.set_text("翻腕亮屏") +#brightness_flip_label.set_long_mode(lv.label.LONG.WRAP) +brightness_flip_label.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) +brightness_flip_label.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) +brightness_flip_label.add_flag(lv.obj.FLAG.HIDDEN) +brightness_flip_sw = lv.switch(brightness_screen) +brightness_flip_sw.set_pos(140, 240) +brightness_flip_sw.set_size(80, 39) +brightness_flip_sw.add_flag(lv.obj.FLAG.HIDDEN) + +brightness_flip_label_btn = lv.label(brightness_screen) +brightness_flip_label_btn.set_pos(135, 235) +brightness_flip_label_btn.set_size(105, 44) +brightness_flip_label_btn.set_text(" ") +brightness_flip_label_btn.add_flag(lv.obj.FLAG.CLICKABLE) +brightness_flip_label_btn.add_flag(lv.obj.FLAG.HIDDEN) + class BrightnessScreen(Screen): @@ -1807,20 +1717,24 @@ class BrightnessScreen(Screen): def __init__(self): super().__init__() - self.level = 2 + self.level = 6 self.time = 10 - self.read_data = {} + self.flip_sw =0 self.meta = brightness_screen - brightness_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_level(e)), + brightness_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,1)), + lv.EVENT.GESTURE, None) + brightness_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,2)), lv.EVENT.SHORT_CLICKED, None) - brightness_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_level(e)), + brightness_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,3)), lv.EVENT.SHORT_CLICKED, None) - brightness_time_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_time_level(e)), + brightness_time_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,4)), lv.EVENT.SHORT_CLICKED, None) - brightness_time_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_time_level(e)), + brightness_time_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,5)), lv.EVENT.SHORT_CLICKED, None) + brightness_flip_label_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,6)),lv.EVENT.SHORT_CLICKED, None) + def initialization(self): self.level = EventMesh.publish("get_brightness_level") self.time = EventMesh.publish("get_brightness_time") @@ -1828,49 +1742,75 @@ class BrightnessScreen(Screen): if self.time == None: self.time = 5 brightness_label_time_text.set_text("{}秒".format(self.time)) + EventMesh.publish("get_storage_config","flip_sw") + if self.flip_sw == None: + self.flip_sw = 0 + if self.flip_sw == 0: + brightness_flip_sw.clear_state(lv.STATE.CHECKED) + else: + brightness_flip_sw.add_state(lv.STATE.CHECKED) self.show_bar() - def add_level(self, e): - EventMesh.publish("push_add_brightness_level") - self.level = EventMesh.publish("get_brightness_level") - # print("self.level:{}".format(self.level)) - self.show_bar() - - def reduce_level(self, e): - EventMesh.publish("push_reduce_brightness_level") - self.level = EventMesh.publish("get_brightness_level") - self.show_bar() - - def reduce_time_level(self, e): - if self.time > 5: - self.time-=5 - EventMesh.publish("set_brightness_time",self.time) - brightness_label_time_text.set_text("{}秒".format(self.time)) - # print("reduce_time_level:{}".format(self.read_data)) + def fun(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + EventMesh.publish("push_add_brightness_level") + self.level = EventMesh.publish("get_brightness_level") + print("self.level:{}".format(self.level)) + self.show_bar() + + elif msg == 3: + EventMesh.publish("push_reduce_brightness_level") + self.level = EventMesh.publish("get_brightness_level") + self.show_bar() + + elif msg == 4: + if self.time > 5: + self.time-=5 + EventMesh.publish("set_brightness_time",self.time) + brightness_label_time_text.set_text("{}秒".format(self.time)) + + elif msg == 5: + self.time+=5 + if self.time >= 30: + self.time = 30 + EventMesh.publish("set_brightness_time",self.time) + brightness_label_time_text.set_text("{}秒".format(self.time)) + + elif msg == 6: + if self.flip_sw == 0: + self.flip_sw = 1 + brightness_flip_sw.add_state(lv.STATE.CHECKED) + else: + self.flip_sw = 0 + brightness_flip_sw.clear_state(lv.STATE.CHECKED) + # print("self.flip_sw:",self.flip_sw) + EventMesh.publish("set_storage_config",["flip_sw",self.flip_sw]) + - def add_time_level(self, e): - self.time+=5 - if self.time >= 30: - self.time = 30 - EventMesh.publish("set_brightness_time",self.time) - brightness_label_time_text.set_text("{}秒".format(self.time)) - # print("add_time_level:{}".format(self.read_data)) def show_bar(self): if self.level == None: - self.level = 2 - brightness_bar.set_value((100 // 10) * self.level,lv.ANIM.OFF) + self.level = 6 + brightness_bar.set_value((100 // 10) * self.level, lv.ANIM.OFF) - + + def done_return(self): - EventMesh.publish("return_prev_screen") - # EventMesh.publish("load_screen", {"screen": "setting"}) + EventMesh.publish("load_screen", {"screen": "setting"}) def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) - + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) @@ -1902,7 +1842,7 @@ class PhoneringScreen(Screen): def __init__(self): super().__init__() - self.level = 2 + self.level = 0 self.meta = phonering_screen phonering_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_level(e)), lv.EVENT.SHORT_CLICKED, None) @@ -1949,7 +1889,7 @@ class AlarmvolumeScreen(Screen): def __init__(self): super().__init__() - self.level = 2 + self.level = 0 self.meta = alarmvolume_screen alarmvolume_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_level(e)), lv.EVENT.SHORT_CLICKED, None) @@ -1989,7 +1929,7 @@ class MsgvolumeScreen(Screen): def __init__(self): super().__init__() - self.level = 2 + self.level = 0 self.meta = msgvolume_screen msgvolume_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_level(e)), lv.EVENT.SHORT_CLICKED, None) @@ -2031,24 +1971,24 @@ print("volume_adjust_screen") volume_adjust_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) totalvolume_title = lv.label(volume_adjust_screen) -totalvolume_title.set_pos(0, 5) -totalvolume_title.set_size(128, 20) +totalvolume_title.set_pos(0, 10) +totalvolume_title.set_size(240, 40) totalvolume_title.set_text("铃声调节") totalvolume_title.set_long_mode(lv.label.LONG.WRAP) totalvolume_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) totalvolume_title.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) totalvolume_label1 = lv.label(volume_adjust_screen) -totalvolume_label1.set_pos(5, 30) -totalvolume_label1.set_size(128-5, 20) +totalvolume_label1.set_pos(10, 70) +totalvolume_label1.set_size(230, 40) totalvolume_label1.set_text("铃声:") totalvolume_label1.set_long_mode(lv.label.LONG.WRAP) totalvolume_label1.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0) totalvolume_label1.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) totalvolume_bar = lv.bar(volume_adjust_screen) -totalvolume_bar.set_pos(10, 55) -totalvolume_bar.set_size(108, 12) +totalvolume_bar.set_pos(20, 100) +totalvolume_bar.set_size(200, 25) totalvolume_bar.set_style_anim_time(1000, lv.PART.INDICATOR | lv.STATE.DEFAULT) totalvolume_bar.set_mode(lv.bar.MODE.NORMAL) totalvolume_bar.set_value(50, lv.ANIM.OFF) @@ -2056,38 +1996,37 @@ totalvolume_bar.add_style(style_bar, lv.PART.MAIN | lv.STATE.DEFAULT) totalvolume_bar.add_style(style_bar_indic, lv.PART.INDICATOR | lv.STATE.DEFAULT) totalvolume_reduce_imgbtn = lv.img(volume_adjust_screen) -totalvolume_reduce_imgbtn.set_pos(6, 70) -totalvolume_reduce_imgbtn.set_size(55, 23) +totalvolume_reduce_imgbtn.set_pos(5, 145) +totalvolume_reduce_imgbtn.set_size(110, 46) totalvolume_reduce_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) totalvolume_reduce_imgbtn.set_src("U:/static/reduce_btn.png") totalvolume_reduce_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) totalvolume_add_imgbtn = lv.img(volume_adjust_screen) -totalvolume_add_imgbtn.set_pos(67, 70) -totalvolume_add_imgbtn.set_size(55, 23) +totalvolume_add_imgbtn.set_pos(125, 145) +totalvolume_add_imgbtn.set_size(110, 46) totalvolume_add_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) totalvolume_add_imgbtn.set_src("U:/static/add_btn.png") totalvolume_add_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) -class totalvolumeScreen(Screen): +class totalvolumeScreen(Screen):#总的铃声调节 NAME = "totalvolume" def __init__(self): super().__init__() self.meta = volume_adjust_screen - totalvolume_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.add_volum_size(e)), + volume_adjust_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,1)), + lv.EVENT.GESTURE, None) + totalvolume_add_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,2)), lv.EVENT.SHORT_CLICKED, None) - totalvolume_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.reduce_volum_size(e)), + totalvolume_reduce_imgbtn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.fun(e,3)), lv.EVENT.SHORT_CLICKED, None) - self.read_data = {} self.volum_size = 8 self.aud = audio.Audio(0) - # self.aud.set_pa(Pin.GPIO43) def initialization(self): - self.read_data = EventMesh.publish("get_storage_data") - # print("self.read_data:{}".format(self.read_data)) + num = EventMesh.publish("get_volum_size") if num == None: self.volum_size = 8 @@ -2095,38 +2034,47 @@ class totalvolumeScreen(Screen): self.volum_size = num self.aud.setVolume(self.volum_size) self.show_bar(0) - - def add_volum_size(self, e): - self.volum_size+=2 - if self.volum_size >= 11: - self.volum_size = 11 - self.show_bar(1) - - def reduce_volum_size(self, e): - - self.volum_size -= 2 - if self.volum_size < 0: - self.volum_size = 0 - self.show_bar(1) + def fun(self, e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "setting"}) + elif code == lv.EVENT.SHORT_CLICKED: + if msg == 2: + self.volum_size+=2 + if self.volum_size >= 11: + self.volum_size = 11 + self.show_bar(1) + elif msg == 3: + self.volum_size -= 2 + if self.volum_size < 0: + self.volum_size = 0 + self.show_bar(1) def show_bar(self,msg): totalvolume_bar.set_value((100 // 11) * self.volum_size, lv.ANIM.OFF) if msg == 1: self.aud.setVolume(self.volum_size) EventMesh.publish("set_volum_size",self.volum_size) - self.aud.play(1, 1, 'U:/static/R_VOLUME_SET_1.mp3') #播放声音 + # print("self.read_data:size :{}".format(self.read_data)) + + self.aud.play(1, 1, 'E:/static/audio_audio_haixiu.mp3') #播放声音 def Close(self): self.aud.stop() def done_return(self): self.aud.stop() + EventMesh.publish("load_screen", {"screen": "setting"}) - EventMesh.publish("return_prev_screen") + def btn1_release(self): EventMesh.publish("load_screen", {"screen": "setting"}) - + def btn8_press(self): EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) diff --git a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_video.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py similarity index 91% rename from 2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_video.py rename to 2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py index 3a7e70f2..600187b1 100644 --- a/2.sdk-ZY/Helios_SDK/services/microPython/ports/quectel/core/ui_video.py +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/ui_video.py @@ -99,14 +99,19 @@ class cameraFullScreen(Screen):#相册已满 def done_return(self): EventMesh.publish("return_prev_screen") # EventMesh.publish("load_screen", {"screen": "main_menu"}) - - + def btn1_release(self): EventMesh.publish("return_prev_screen") # EventMesh.publish("load_screen", {"screen": "main_menu"}) pass + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass + def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) pass @@ -150,7 +155,11 @@ class deletealbumScreen(Screen):#删除图片 def done_return(self): EventMesh.publish("return_prev_screen") # EventMesh.publish("load_screen", {"screen": "main_menu"}) - + + def done_left_to_right(self): + EventMesh.publish("return_prev_screen") + # EventMesh.publish("load_screen", {"screen": "main_menu"}) + pass def btn1_release(self): EventMesh.publish("return_prev_screen") @@ -158,6 +167,7 @@ class deletealbumScreen(Screen):#删除图片 pass def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) pass class cameraScreen(Screen):#相机拍照二级界面 @@ -187,7 +197,7 @@ class cameraScreen(Screen):#相机拍照二级界面 camera_img_test = lv.img(camera_popup_screen) - # img_test.set_src("E:/hang_up.png") + # img_test.set_src("U:/hang_up.png") ret = dec.set_img(camera_img_test) camera_img_test.align(lv.ALIGN.CENTER, 0, 0) @@ -198,26 +208,26 @@ class cameraScreen(Screen):#相机拍照二级界面 camera_camera_btn.add_flag(lv.obj.FLAG.CLICKABLE) camera_camera_btn.set_pos(90, 200) camera_camera_btn.set_size(60,60) - camera_camera_btn.set_src("E:/static/camera_btn.png") + camera_camera_btn.set_src("U:/static/camera_btn.png") # camera_camera_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_click(e)), lv.EVENT.SHORT_CLICKED, None) camera_camera_album_btn = lv.img(camera_popup_screen) camera_camera_album_btn.add_flag(lv.obj.FLAG.CLICKABLE) camera_camera_album_btn.set_pos(190, 20) camera_camera_album_btn.set_size(40,40) - camera_camera_album_btn.set_src("E:/static/camera_album_btn.png") + camera_camera_album_btn.set_src("U:/static/camera_album_btn.png") # camera_camera_album_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_album_click(e)), lv.EVENT.SHORT_CLICKED, None) camera_camera_return_btn = lv.img(camera_popup_screen) camera_camera_return_btn.add_flag(lv.obj.FLAG.CLICKABLE) camera_camera_return_btn.set_pos(20, 20) camera_camera_return_btn.set_size(36,36) - camera_camera_return_btn.set_src("E:/static/RED_RETURN_PNG.png") + camera_camera_return_btn.set_src("U:/static/RED_RETURN_PNG.png") # camera_camera_return_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_album_click(e)), lv.EVENT.SHORT_CLICKED, None) camera_camera_return_btn_label = lv.label(camera_popup_screen) camera_camera_return_btn_label.set_pos(0, 0) - camera_camera_return_btn_label.set_size(40, 40) + camera_camera_return_btn_label.set_size(70, 70) camera_camera_return_btn_label.set_text(" ") camera_camera_return_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) camera_camera_return_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.camera_return_click(e)), lv.EVENT.SHORT_CLICKED, None) @@ -306,7 +316,7 @@ class cameraScreen(Screen):#相机拍照二级界面 if int(album_data) <= 1: date_tmp = utime.localtime() time_tmp = utime.mktime(date_tmp) - dec.start(240,280, "E:/static/1_camera.jpg") + dec.start(240,280, "U:/static/1_camera.jpg") else: EventMesh.publish("load_screen", {"screen": "camera_full"}) @@ -319,6 +329,7 @@ class cameraScreen(Screen):#相机拍照二级界面 pass def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) pass @@ -342,12 +353,13 @@ class cameraalbumScreen(Screen):#相册 self.meta = None def initialization(self): - global camera_album_popup_screen ,camera_album_popup_label,camera_album_popup_img1,camera_album_popup_img2,camera_album_popup_img3,camera_album_popup_img4,camera_album_popup_img5 + global camera_album_popup_screen,camera_album_popup_img ,camera_album_popup_label,camera_album_popup_img1,camera_album_popup_img2,camera_album_popup_img3,camera_album_popup_img4,camera_album_popup_img5 if camera_album_popup_screen == None: camera_album_popup_screen = lv.obj() print("camera_album_popup_screen") camera_album_popup_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + camera_album_popup_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.click_album(e,0)), lv.EVENT.GESTURE, None) camera_album_popup_label = lv.label(camera_album_popup_screen) camera_album_popup_label.set_pos(0, 100) @@ -370,56 +382,68 @@ class cameraalbumScreen(Screen):#相册 camera_album_popup_img2.set_pos(100, 230) camera_album_popup_img2.set_size(35, 35) camera_album_popup_img2.add_flag(lv.obj.FLAG.CLICKABLE) - camera_album_popup_img2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,0)), lv.EVENT.SHORT_CLICKED, None) + camera_album_popup_img2.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) + + # camera_album_popup_img = lv.img(camera_album_popup_screen) + # camera_album_popup_img.set_pos(80, 220) + # camera_album_popup_img.set_size(60, 62) + # camera_album_popup_img.add_flag(lv.obj.FLAG.CLICKABLE) + # camera_album_popup_img.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) + + camera_album_return_btn_label = lv.label(camera_popup_screen) + camera_album_return_btn_label.set_pos(0, 0) + camera_album_return_btn_label.set_size(70, 70) + camera_album_return_btn_label.set_text(" ") + camera_album_return_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) + camera_album_return_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,2)), lv.EVENT.SHORT_CLICKED, None) camera_album_popup_img3 = lv.img(camera_album_popup_screen) camera_album_popup_img3.set_pos(20, 20) camera_album_popup_img3.set_size(36,36) camera_album_popup_img3.add_flag(lv.obj.FLAG.CLICKABLE) - camera_album_popup_img3.set_src("E:/static/RED_RETURN_PNG.png") - camera_album_popup_img3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,1)), lv.EVENT.SHORT_CLICKED, None) + camera_album_popup_img3.set_src("U:/static/RED_RETURN_PNG.png") + camera_album_popup_img3.add_event_cb(lambda e: EventMesh.callback_wrapper(self.click_album(e,2)), lv.EVENT.SHORT_CLICKED, None) self.meta = camera_album_popup_screen read_album = 0 read_album = EventMesh.publish("get_camera_num") print("read_album",read_album) - if int(read_album) != 0: + IFEXIST = ql_fs.path_exists("/usr/static/1_camera.jpg") + if IFEXIST == True: camera_album_popup_img1.clear_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img1.set_src("E:/static/1_camera.jpg") #'E:/6_camera.jpeg'"E:/static/1_camera.jpg" + camera_album_popup_img1.set_src("U:/static/1_camera.jpg") #'E:/6_camera.jpeg'"U:/static/1_camera.jpg" camera_album_popup_img2.clear_flag(lv.obj.FLAG.HIDDEN) - camera_album_popup_img2.set_src("E:/static/album_delete.png") + # camera_album_popup_img.add_flag(lv.obj.FLAG.HIDDEN) + camera_album_popup_img2.set_src("U:/static/album_delete.png") camera_album_popup_label.add_flag(lv.obj.FLAG.HIDDEN) else: camera_album_popup_img1.add_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_img2.add_flag(lv.obj.FLAG.HIDDEN) + # camera_album_popup_img.add_flag(lv.obj.FLAG.HIDDEN) camera_album_popup_label.clear_flag(lv.obj.FLAG.HIDDEN) def click_album(self,e,i): - if i == 0: - check_img = ql_fs.path_exists("/ext/static/1_camera.jpg") - if check_img == True :#图片存在 - uos.remove("/ext/static/1_camera.jpg")#删除单张图片 - album_data = int(EventMesh.publish("get_camera_num")) - - EventMesh.publish("set_camera_num",album_data-1) + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + elif code == lv.EVENT.SHORT_CLICKED: + if i == 1: + check_img = ql_fs.path_exists("/usr/static/1_camera.jpg") + if check_img == True :#图片存在 + uos.remove("/usr/static/1_camera.jpg")#删除单张图片 + album_data = int(EventMesh.publish("get_camera_num")) - EventMesh.publish("load_screen", {"screen": "delete_album"}) - return - - EventMesh.publish("load_screen", {"screen": "main_menu"}) + EventMesh.publish("set_camera_num",0) - # read_album = {} - # read_album = EventMesh.publish("get_camera_num") - # if len(read_album) != 0 and i < len(read_album): - # sort_new = {} - # sort_new = sorted(read_album.keys()) - # key = sort_new[i] - # value = int(read_album[key]["timeSec"]) - # self.meta_info = value - # print(self.meta_info,i) - # EventMesh.publish("load_screen", {"screen": "album_preview","meta": self.meta_info})#点击进入相册预览大图显示 - # print(i) + EventMesh.publish("load_screen", {"screen": "delete_album"}) + return + elif i == 2: + EventMesh.publish("load_screen", {"screen": "main_menu"}) pass def Close(self): @@ -438,6 +462,7 @@ class cameraalbumScreen(Screen):#相册 pass def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) pass @@ -502,7 +527,7 @@ class albumPreviewScreen(Screen):#点击预览 album_preview_popup_delet_can_label.add_event_cb(lambda e:EventMesh.callback_wrapper(self.cancel_pop(e)),lv.EVENT.SHORT_CLICKED,None) album_preview_popup_delet_con_label.add_event_cb(lambda e:EventMesh.callback_wrapper(self.confirm_pop(e)),lv.EVENT.SHORT_CLICKED,None) - album_preview_popup_img.set_src("E:/static/%d_camera.jpg"%(album_num_tmp))#'E:/6_camera.jpeg' + album_preview_popup_img.set_src("U:/static/%d_camera.jpg"%(album_num_tmp))#'E:/6_camera.jpeg' def cancel_pop(self,e):#取消删除 EventMesh.publish("load_screen", {"screen": "main_menu"})#点击回到相册界面 @@ -514,9 +539,9 @@ class albumPreviewScreen(Screen):#点击预览 # album_num_tmp = int(self.meta_info) # print(album_num_tmp) - # check_img = ql_fs.path_exists("/ext/static/%d_camera.jpg"%(album_num_tmp)) + # check_img = ql_fs.path_exists("/usr/static/%d_camera.jpg"%(album_num_tmp)) # if check_img == True :#图片存在 - # uos.remove("/ext/static/%d_camera.jpg"%(album_num_tmp))#删除单张图片 + # uos.remove("/usr/static/%d_camera.jpg"%(album_num_tmp))#删除单张图片 # read_album = {} # read_album = EventMesh.publish("get_camera_num")#删除的同时把数据部分也清掉 # print("img is exit1",read_album) @@ -549,6 +574,7 @@ class albumPreviewScreen(Screen):#点击预览 pass def btn8_press(self): + EventMesh.publish("watch_top_show") EventMesh.publish("load_screen", {"screen": "main_menu"}) pass @@ -682,11 +708,11 @@ class VoiceShowScreen(Screen):#正在语音通话中 camera_voice_answer_btn.add_flag(lv.obj.FLAG.CLICKABLE) camera_voice_answer_btn.set_pos(90, 210) camera_voice_answer_btn.set_size(64, 64) - camera_voice_answer_btn.set_src("E:/static/hang_up.png") + camera_voice_answer_btn.set_src("U:/static/hang_up.png") camera_voice_answer_btn_label = lv.label(camera_voice_answer_screen) - camera_voice_answer_btn_label.set_pos(18, 50) + camera_voice_answer_btn_label.set_pos(70, 200) camera_voice_answer_btn_label.set_text(" ") - camera_voice_answer_btn_label.set_size(90, 78) + camera_voice_answer_btn_label.set_size(90, 82) camera_voice_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) camera_voice_answer_btn_label.add_event_cb(lambda e: EventMesh.callback_wrapper(self.close_cb(e)), lv.EVENT.SHORT_CLICKED, None) @@ -999,13 +1025,13 @@ class VedioShowScreen(Screen):#正在视频通话中 camera_video_answer_btn.add_flag(lv.obj.FLAG.CLICKABLE) camera_video_answer_btn.set_pos(90, 210) camera_video_answer_btn.set_size(64,64) - camera_video_answer_btn.set_src("E:/static/hang_up.png") + camera_video_answer_btn.set_src("U:/static/hang_up.png") camera_video_answer_btn_label = lv.label(camera_video_answer_screen) - camera_video_answer_btn_label.set_pos(18, 50) + camera_video_answer_btn_label.set_pos(70, 200) camera_video_answer_btn_label.set_text(" ") - camera_video_answer_btn_label.set_size(90, 78) + camera_video_answer_btn_label.set_size(90, 82) camera_video_answer_btn_label.add_flag(lv.obj.FLAG.CLICKABLE) @@ -1051,9 +1077,10 @@ class VedioShowScreen(Screen):#正在视频通话中 EventMesh.publish("set_UI_high_priority", 0) EventMesh.publish("close_jrtc_event") EventMesh.publish("return_prev_screen") - + def fun(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb,"data":0}) - def fun(self,*argc): + def fun_cb(self,data): EventMesh.publish("system_sleep_rest")#防止黑屏 call_state = jrtc.get_state() if call_state == 5: @@ -1156,7 +1183,7 @@ class voiceInCallScreen(Screen):#语音通话打入中 # vedio_call_img = lv.img(voice_call_screen) # vedio_call_img.set_pos(48, 10) # vedio_call_img.set_size(32, 32) - # vedio_call_img.set_src("E:/static/IMAGE_NOTICE_CALL.png") + # vedio_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") # vedio_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) voice_call_name_label = lv.label(voice_call_screen) @@ -1171,14 +1198,14 @@ class voiceInCallScreen(Screen):#语音通话打入中 voice_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) voice_call_answer.set_pos(150, 210) voice_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - voice_call_answer.set_src("E:/static/answer.png") + voice_call_answer.set_src("U:/static/answer.png") voice_call_hangup = lv.img(voice_call_screen) voice_call_hangup.set_size(64, 64) voice_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) voice_call_hangup.set_pos(30, 210) voice_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - voice_call_hangup.set_src("E:/static/hang_up.png") + voice_call_hangup.set_src("U:/static/hang_up.png") voice_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)), lv.EVENT.SHORT_CLICKED, None) @@ -1202,8 +1229,10 @@ class voiceInCallScreen(Screen):#语音通话打入中 def call_timer_cb(self,e): self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 + def get_video_state(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.get_video_state_cb,"data":0}) - def get_video_state(self,e): + def get_video_state_cb(self,data): call_state = jrtc.get_state() # print("vedio_incall",call_state) self.timeout+=1 @@ -1309,7 +1338,7 @@ class vedioCallingCallScreen(Screen):#视频通话打入中 # vedio_call_img = lv.img(vedio_call_screen) # vedio_call_img.set_pos(48, 10) # vedio_call_img.set_size(32, 32) - # vedio_call_img.set_src("E:/static/IMAGE_NOTICE_CALL.png") + # vedio_call_img.set_src("U:/static/IMAGE_NOTICE_CALL.png") # vedio_call_img.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) vedio_call_name_label = lv.label(vedio_call_screen) @@ -1324,14 +1353,14 @@ class vedioCallingCallScreen(Screen):#视频通话打入中 vedio_call_answer.add_flag(lv.obj.FLAG.CLICKABLE) vedio_call_answer.set_pos(150, 210) vedio_call_answer.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - vedio_call_answer.set_src("E:/static/answer.png") + vedio_call_answer.set_src("U:/static/answer.png") vedio_call_hangup = lv.img(vedio_call_screen) vedio_call_hangup.set_size(64, 64) vedio_call_hangup.add_flag(lv.obj.FLAG.CLICKABLE) vedio_call_hangup.set_pos(30, 210) vedio_call_hangup.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) - vedio_call_hangup.set_src("E:/static/hang_up.png") + vedio_call_hangup.set_src("U:/static/hang_up.png") vedio_call_answer.add_event_cb(lambda e: EventMesh.callback_wrapper(self.answer(e)), lv.EVENT.SHORT_CLICKED, None) @@ -1352,12 +1381,15 @@ class vedioCallingCallScreen(Screen):#视频通话打入中 self.call_timer.start(6000, 1, self.call_timer_cb) self.timeout = 0 self.call_timer1.start(1*1000, 1, self.get_video_state) - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 + self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 def call_timer_cb(self,e): - self.aud.play(1, 1, 'U:/static/R_CALL_mp3.mp3') #播放来电铃声 + self.aud.play(1, 1, 'E:/static/R_CALL_mp3.mp3') #播放来电铃声 + + def get_video_state(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.get_video_state_cb,"data":0}) - def get_video_state(self,e): + def get_video_state_cb(self,data): call_state = jrtc.get_state() # print("vedio_incall",call_state) self.timeout+=1 @@ -1468,14 +1500,14 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 video_outcall_name = lv.label(video_outcall_screen) video_outcall_name.set_pos(0, 20) - video_outcall_name.set_size(LCD_SIZE_W, 20) + video_outcall_name.set_size(LCD_SIZE_W, 50) video_outcall_name.set_text(" ") - video_outcall_name.set_long_mode(lv.label.LONG.DOT) + video_outcall_name.set_long_mode(lv.label.LONG.WRAP) video_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) video_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) video_outcall_call = lv.label(video_outcall_screen) - video_outcall_call.set_pos(0, 50) + video_outcall_call.set_pos(0, 120) video_outcall_call.set_size(LCD_SIZE_W, 40) video_outcall_call.set_text("正在等待对方接听中...") video_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -1483,15 +1515,15 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 video_outcall_hangup_imgbtn = lv.img(video_outcall_screen) video_outcall_hangup_imgbtn.set_size(64,64) - video_outcall_hangup_imgbtn.set_src("E:/static/hang_up.png") + video_outcall_hangup_imgbtn.set_src("U:/static/hang_up.png") video_outcall_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) video_outcall_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) video_outcall_hangup_imgbtn.set_pos(90, 210) video_outcall_hangup_imgbtnlabel = lv.label(video_outcall_screen) - video_outcall_hangup_imgbtnlabel.set_pos(18, 50) + video_outcall_hangup_imgbtnlabel.set_pos(70, 200) video_outcall_hangup_imgbtnlabel.set_text(" ") - video_outcall_hangup_imgbtnlabel.set_size(90, 78) + video_outcall_hangup_imgbtnlabel.set_size(90, 82) video_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) video_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), @@ -1519,7 +1551,7 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 else: video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) video_outcall_call.set_text("正在等待对方接听中...") - video_outcall_call.set_pos(0, 50) + video_outcall_call.set_pos(0, 120) video_outcall_name.set_text(self.meta_info)#名称 video_outcall_name.set_pos(0, 20) @@ -1541,6 +1573,8 @@ class videoOutCallScreen(Screen):#正在拨号中...未打出 pass def fun_cb(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb_1,"data":0}) + def fun_cb_1(self,data): call_state = jrtc.get_state() print("video_outcall",call_state) EventMesh.publish("system_sleep_rest")#防止黑屏 @@ -1624,14 +1658,14 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 voice_outcall_name = lv.label(voice_outcall_screen) voice_outcall_name.set_pos(0, 20) - voice_outcall_name.set_size(LCD_SIZE_W, 20) + voice_outcall_name.set_size(LCD_SIZE_W, 50) voice_outcall_name.set_text(" ") - voice_outcall_name.set_long_mode(lv.label.LONG.DOT) + voice_outcall_name.set_long_mode(lv.label.LONG.WRAP) voice_outcall_name.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) voice_outcall_name.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) voice_outcall_call = lv.label(voice_outcall_screen) - voice_outcall_call.set_pos(0, 50) + voice_outcall_call.set_pos(0, 120) voice_outcall_call.set_size(LCD_SIZE_W, 40) voice_outcall_call.set_text("正在等待对方接听中...") voice_outcall_call.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -1639,15 +1673,15 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 voice_outcall_hangup_imgbtn = lv.img(voice_outcall_screen) voice_outcall_hangup_imgbtn.set_size(64, 64) - voice_outcall_hangup_imgbtn.set_src("E:/static/hang_up.png") + voice_outcall_hangup_imgbtn.set_src("U:/static/hang_up.png") voice_outcall_hangup_imgbtn.add_flag(lv.obj.FLAG.CLICKABLE) voice_outcall_hangup_imgbtn.add_style(style_img, lv.PART.MAIN | lv.STATE.DEFAULT) voice_outcall_hangup_imgbtn.set_pos(90, 210) voice_outcall_hangup_imgbtnlabel = lv.label(voice_outcall_screen) - voice_outcall_hangup_imgbtnlabel.set_pos(18, 50) + voice_outcall_hangup_imgbtnlabel.set_pos(70, 200) voice_outcall_hangup_imgbtnlabel.set_text(" ") - voice_outcall_hangup_imgbtnlabel.set_size(90, 78) + voice_outcall_hangup_imgbtnlabel.set_size(90, 82) voice_outcall_hangup_imgbtnlabel.add_flag(lv.obj.FLAG.CLICKABLE) voice_outcall_hangup_imgbtnlabel.add_event_cb(lambda e: EventMesh.callback_wrapper(self.hangup(e)), @@ -1675,7 +1709,7 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 else: # video_outcall_img_test.add_flag(lv.obj.FLAG.HIDDEN) voice_outcall_call.set_text("正在等待对方接听中...") - voice_outcall_call.set_pos(0, 50) + voice_outcall_call.set_pos(0, 120) voice_outcall_name.set_text(self.meta_info)#名称 voice_outcall_name.set_pos(0, 20) @@ -1697,8 +1731,10 @@ class voiceOutCallScreen(Screen):#等待对方接接听中 pass def fun_cb(self,*argc): + EventMesh.publish("publish_message_event_ui",{"func":self.fun_cb_1,"data":0}) + def fun_cb_1(self,data): call_state = jrtc.get_state() - print("voice_outcall",call_state) + # print("voice_outcall",call_state) EventMesh.publish("system_sleep_rest")#防止黑屏 if call_state == 5: voice_outcall_name.set_text("正在通话中...")# @@ -1791,17 +1827,19 @@ class videolistScreen(Screen): print("videolist_screen") videolist_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) videolist_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + videolist_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,0)), lv.EVENT.GESTURE, None) videolist_screen_list_screen = lv.obj(videolist_screen) - videolist_screen_list_screen.set_pos(0, 30) - videolist_screen_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-30) + videolist_screen_list_screen.set_pos(0, 40) + videolist_screen_list_screen.set_size(LCD_SIZE_W, LCD_SIZE_H-40) videolist_screen_list_screen.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) videolist_screen_list_screen.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + videolist_screen_list_screen.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,0)), lv.EVENT.GESTURE, None) videolist_top_title = lv.label(videolist_screen) videolist_top_title.set_pos(0, 5) - videolist_top_title.set_size(LCD_SIZE_W, 20) + videolist_top_title.set_size(LCD_SIZE_W, 30) videolist_top_title.set_text("视频通话账号") videolist_top_title.set_long_mode(lv.label.LONG.WRAP) videolist_top_title.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0) @@ -1809,7 +1847,7 @@ class videolistScreen(Screen): videolist_none_label = lv.label(videolist_screen) - videolist_none_label.set_pos(0, 60) + videolist_none_label.set_pos(0, 120) videolist_none_label.set_size(LCD_SIZE_W, 60) videolist_none_label.set_text("无SIM卡或未添加账号") videolist_none_label.set_long_mode(lv.label.LONG.WRAP) @@ -1818,15 +1856,15 @@ class videolistScreen(Screen): self.videolist_detail_list = lv.obj(videolist_screen_list_screen) self.videolist_detail_list.set_pos(0, 0) - self.videolist_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-30+1) + self.videolist_detail_list.set_size(LCD_SIZE_W, LCD_SIZE_H-40+1) self.videolist_detail_list.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) self.videolist_detail_list.add_style(style_screen, lv.PART.MAIN | lv.STATE.DEFAULT) + self.videolist_detail_list.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,0)), lv.EVENT.GESTURE, None) for i in range(self.MXA_phone_num): contact_btn = lv.btn(self.videolist_detail_list) contact_btn.add_flag(lv.obj.FLAG.CLICKABLE) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), + contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e,1)), lv.EVENT.SHORT_CLICKED, None) - contact_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_cb(e)), lv.EVENT.PRESSING, None) contact_btn.add_flag(lv.obj.FLAG.HIDDEN) # contact_btn.add_style(style_press_btn, lv.PART.MAIN | lv.STATE.PRESSED) @@ -1893,9 +1931,9 @@ class videolistScreen(Screen): #contact_btn_label_1 = lv.label(contact_btn) self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_pos(0, 0) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_SIZE_W-15, 20) + self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_size(LCD_SIZE_W-10, 20) self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_text(key_tmp[4:]) - self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.CLIP) + self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_1"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1907,9 +1945,9 @@ class videolistScreen(Screen): #contact_btn_label_3 = lv.label(contact_btn) self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_pos(0, 25) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_SIZE_W-15, 20) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_size(LCD_SIZE_W-10, 20) self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_text(name) - self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.CLIP) + self.videolist_detail_listt_dict[i]["contact_btn_label_3"].set_long_mode(lv.label.LONG.DOT) # self.videolist_detail_listt_dict[i]["contact_btn_label_3"].add_style(style_font_youyuan_20_black, lv.PART.MAIN | lv.STATE.DEFAULT) @@ -1926,26 +1964,42 @@ class videolistScreen(Screen): if self.videolist_detail_list != None: self.videolist_detail_list.add_flag(lv.obj.FLAG.HIDDEN)#隐藏空文本 - - def calling_cb(self,e): + def calling_cb(self,e,msg): code = e.get_code() - if code == lv.EVENT.PRESSING: - #print("PRESSING") - self.is_sliding += 1 + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: #手势向左还是向右 还是向下向上 + if dir == lv.DIR.RIGHT: + EventMesh.publish("load_screen", {"screen": "main_menu"}) elif code == lv.EVENT.SHORT_CLICKED: - #utime.sleep_ms(10) - print("1self.is_sliding",self.is_sliding) - if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 - self.is_sliding = 0 - if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡时触发sos报警 无卡时自动关机 + if msg == 1: + if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡 msg_text = e.get_target().get_child(1).get_text() - # EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) EventMesh.publish("load_screen", {"screen": "vedio_mode","meta":msg_text}) else: EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) + + # def calling_cb(self,e): + # code = e.get_code() + # if code == lv.EVENT.PRESSING: + # #print("PRESSING") + # self.is_sliding += 1 + + # elif code == lv.EVENT.SHORT_CLICKED: + # #utime.sleep_ms(10) + # print("1self.is_sliding",self.is_sliding) + # if self.is_sliding <= 5 and self.is_sliding != 0:#如果是在滑动中则不需要点击事件 + # self.is_sliding = 0 + # if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:#有卡 + # msg_text = e.get_target().get_child(1).get_text() + # # EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + # EventMesh.publish("load_screen", {"screen": "vedio_mode","meta":msg_text}) + # else: + # EventMesh.publish("load_screen", {"screen": "no_sim_popup_screen"}) - self.is_sliding =0 + # self.is_sliding =0 def calling(self,msg_text): @@ -2053,14 +2107,13 @@ class videoModeScreen(Screen):#通话模式选择 # video_select_mode_label2.add_style(style_font_youyuan_20, lv.PART.MAIN | lv.STATE.DEFAULT) self.meta = video_select_mode_screen + video_select_mode_screen.add_event_cb(lambda e:EventMesh.callback_wrapper(self.button_cb(e,0)), lv.EVENT.GESTURE, None) - video_select_mode_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,0)), + video_select_mode_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,1)), lv.EVENT.SHORT_CLICKED, None) - video_select_mode_btn.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,0)), lv.EVENT.PRESSING, None) - video_select_mode_btn1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,1)), + video_select_mode_btn1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.button_cb(e,2)), lv.EVENT.SHORT_CLICKED, None) - video_select_mode_btn1.add_event_cb(lambda e: EventMesh.callback_wrapper(self.calling_vedio_cb(e,1)), lv.EVENT.PRESSING, None) if self.meta_info != None: if len(str(self.meta_info)) != 0: @@ -2081,6 +2134,25 @@ class videoModeScreen(Screen):#通话模式选择 self.timer.stop() EventMesh.publish("return_prev_screen") pass + def button_cb(self,e,msg): + code = e.get_code() + indev = lv.indev_get_act() + lv.indev_t.wait_release(indev) + dir = lv.indev_t.get_gesture_dir(indev) + if code == lv.EVENT.GESTURE: + if dir == lv.DIR.RIGHT: + EventMesh.publish("return_prev_screen") + + elif code == lv.EVENT.SHORT_CLICKED: + if msg != 0: + if msg == 1: + msg_text = [self.meta_info,0] + EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + else: + msg_text = [self.meta_info,1] + EventMesh.publish("publish_message_event_ui",{"func":self.calling,"data":msg_text}) + + def calling_vedio_cb(self,e,data):#视频通话 code = e.get_code() if code == lv.EVENT.PRESSING: @@ -2118,7 +2190,6 @@ class videoModeScreen(Screen):#通话模式选择 self.timer.stop() def done_return(self): - pass EventMesh.publish("return_prev_screen") @@ -2180,9 +2251,9 @@ class cameraAlbumManager(Abstract):#保存相册数目 def __init__(self): self.album_list = {} self.album_num = 0 - # check_txt = ql_fs.path_exists("/ext/static/storage_file/album_config.json") + # check_txt = ql_fs.path_exists("/usr/static/storage_file/album_config.json") # if check_txt == True : - # with open("/ext/static/storage_file/album_config.json","r") as fd:#音频文件编号 + # with open("/usr/static/storage_file/album_config.json","r") as fd:#音频文件编号 # self.album_list = ujson.load(fd) # if not self.album_list: # self.album_list = {} @@ -2193,7 +2264,7 @@ class cameraAlbumManager(Abstract):#保存相册数目 # self.album_num = self.album_list["num"] # else : # self.album_list = {} - # with open("/ext/static/storage_file/album_config.json","w",encoding="utf-8") as fd: + # with open("/usr/static/storage_file/album_config.json","w",encoding="utf-8") as fd: # ujson.dump(self.album_list,fd) read_tmp = EventMesh.publish("get_storage_config","album_num") if read_tmp: @@ -2211,7 +2282,7 @@ class cameraAlbumManager(Abstract):#保存相册数目 def set_camera_num(self, event, msg): self.album_num = msg # self.album_list = msg - # with open("/ext/static/storage_file/album_config.json","w+",encoding="utf-8") as fd: + # with open("/usr/static/storage_file/album_config.json","w+",encoding="utf-8") as fd: # ujson.dump(self.album_list,fd) # # sorted_keys = sorted(self.album_list.keys()) # # print("self.album_list",self.album_list,sorted_keys) @@ -2226,10 +2297,10 @@ class videoBookManager(Abstract): def __init__(self): self.videobook = {} self.check_json = 0 - self.check_json = ql_fs.path_exists("/ext/static/storage_file/videobook.json") + self.check_json = ql_fs.path_exists("/usr/static/storage_file/videobook.json") if self.check_json == True: - with open("/ext/static/storage_file/videobook.json","r",encoding="utf-8") as fd: + with open("/usr/static/storage_file/videobook.json","r",encoding="utf-8") as fd: self.videobook = ujson.load(fd) print("读取视频通话账号列表") @@ -2238,7 +2309,7 @@ class videoBookManager(Abstract): EventMesh.subscribe("set_videobook_list", self.set) def get(self, event, msg): - self.check_json = ql_fs.path_exists("/ext/static/storage_file/videobook.json") + self.check_json = ql_fs.path_exists("/usr/static/storage_file/videobook.json") return [self.check_json,self.videobook] def set(self, event, msg): @@ -2333,7 +2404,7 @@ class MEMBERS_ProtoCol(ProtoCol):#获取账号列表 j+=1 print("videobook!!!:{}".format(str(videobook))) # print("phonebook!!!:{}".format(str(phonebook))) - with open("/ext/static/storage_file/videobook.json","w",encoding="utf-8") as fd: + with open("/usr/static/storage_file/videobook.json","w",encoding="utf-8") as fd: ujson.dump(videobook,fd) print("创建视频通话账号") @@ -2589,7 +2660,7 @@ class JMEMBERS_ProtoCol(ProtoCol):#获取账号列表 j+=1 print("videobook!!!:{}".format(str(videobook))) # print("phonebook!!!:{}".format(str(phonebook))) - with open("/ext/static/storage_file/videobook.json","w",encoding="utf-8") as fd: + with open("/usr/static/storage_file/videobook.json","w",encoding="utf-8") as fd: ujson.dump(videobook,fd) print("创建视频通话账号") diff --git a/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/versions.py b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/versions.py new file mode 100644 index 00000000..faa8e5cc --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/services/microPython/ports/quectel/core/versions.py @@ -0,0 +1,2 @@ +Version="V1.0" +Build_Time="2024-07-06 15:22:23" diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/EG810MCN_GA_VOLTE.mk b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/EG810MCN_GA_VOLTE.mk new file mode 100644 index 00000000..1c791569 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/EG810MCN_GA_VOLTE.mk @@ -0,0 +1,23 @@ +# Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +NAME := EG810MCN_GA_VOLTE + +GLOBAL_INCS = include + +$(NAME)_ARCHIVES = \ + libraries/libHeliosAPI.lib \ + libraries/ql_common_api.lib + diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h new file mode 100644 index 00000000..16fe13e3 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/autoconf.h @@ -0,0 +1,47 @@ +/* + * + * Automatically generated file; DO NOT EDIT. + * Helios SDK Configuration + * + */ +#define PROJECT_NAME_M36_W8 1 //项目宏定义 +#define CONFIG_LVGL_SPAN 1 +#define CONFIG_LVGL_FS_HELIOS 1 +//#define CONFIG_LVGL_GIF_DECODE 1 +#define CONFIG_LVGL_SPINNER 1 +#define CONFIG_LCD 1 +#define CONFIG_LVGL_ANIMIMG 1 +#define CONFIG_LVGL_KEYBOARD 1 +#define CONFIG_LVGL_CALENDAR 1 +#define CONFIG_LVGL_LED 1 +#define CONFIG_VIOCE_CALL 1 +#define CONFIG_LVGL_FS_EXTFLASH_HELIOS 1 +#define CONFIG_LVGL_TABVIEW 1 +#define CONFIG_LVGL_LINE 1 +#define CONFIG_LVGL 1 +#define CONFIG_LVGL_CHART 1 +#define CONFIG_LVGL_LIST 1 +#define CONFIG_LVGL_MSGBOX 1 +#define CONFIG_LVGL_ARC 1 +#define CONFIG_LVGL_METER 1 +#define CONFIG_LVGL_JPG_DECODE 1 +#define CONFIG_LVGL_PNG_DECODE 1 +#define CONFIG_LVGL_IMGBTN 1 +//#define CONFIG_GH301x 1 +#define CONFIG_MBEDTLS 1 +//#define CONFIG_TTS 1 +//#define CONFIG_SC7A20 1 +#define CONFIG_LVGL_WIN 1 +#define CONFIG_LVGL_COLORWHEEL 1 +#define CONFIG_LVGL_CANVAS 1 +#define CONFIG_LVGL_SPINBOX 1 +#define CONFIG_LVGL_QRCODE 1 +#define CONFIG_LVGL_TILEVIEW 1 +#define CONFIG_LVGL_HANDLER_TASK_PRIORITY 80 +#define CONFIG_CAMERA 1 +#define CONFIG_JPEG 1 +#define CONFIG_CAMERA_SAVEPHOTOS 1 +//菊风视频通话 +#define CONFIG_juphoon 1 +//#define CONFIG_LVGL_USE_FREETYPE 1//矢量字库 +#define PROJECT_NAME_G3_K01_font 1 \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.in b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.in new file mode 100644 index 00000000..e2f584ea --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.in @@ -0,0 +1,16 @@ + +mainmenu "Helios SDK Configuration" + +menu "System Configuration" +source "../system/config.in" +endmenu + +menu "EG810MCN_GA_VOLTE" +source "../services/microPython/config/config.in" +source "../components/poc/poc_option.in" +source "../components/GH301x/GH301x_option.in" +source "../components/SC7A20/SC7A20_option.in" +source "../components/juphoon/juphoon_option.in" +source "../components/audio/audio_option.in" +endmenu + diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk new file mode 100644 index 00000000..012987df --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/config.mk @@ -0,0 +1,68 @@ +# +# Automatically generated file; DO NOT EDIT. +# Helios SDK Configuration +# +PROJECT_NAME_M36_W8=y +# +# System Configuration +# +CONFIG_MBEDTLS=y + +# +# EG810MCN_GA_VOLTE +# +CONFIG_LVGL=y + +# +# lvgl option +# +CONFIG_LVGL_PNG_DECODE=y +# CONFIG_LVGL_GIF_DECODE is not set +CONFIG_LVGL_JPG_DECODE=y +CONFIG_LVGL_FS_HELIOS=y +# CONFIG_LVGL_FS_SD_HELIOS is not set +CONFIG_LVGL_FS_EXTFLASH_HELIOS=y +# CONFIG_LVGL_CUSTOMER_FONT_SUPPORT is not set +CONFIG_LVGL_QRCODE=y +# CONFIG_LVGL_FONT is not set +# CONFIG_LVGL_ARC is not set +CONFIG_LVGL_IMGBTN=y +CONFIG_LVGL_LINE=y +CONFIG_LVGL_LIST=y +# CONFIG_LVGL_CHART is not set +# CONFIG_LVGL_LED is not set +CONFIG_LVGL_CANVAS=y +CONFIG_LVGL_WIN=y +# CONFIG_LVGL_TABVIEW is not set +CONFIG_LVGL_TILEVIEW=y +CONFIG_LVGL_MSGBOX=y +# CONFIG_LVGL_METER is not set +# CONFIG_LVGL_CALENDAR is not set +# CONFIG_LVGL_SPINNER is not set +# CONFIG_LVGL_SPINBOX is not set +# CONFIG_LVGL_ANIMIMG is not set +# CONFIG_LVGL_COLORWHEEL is not set +CONFIG_LVGL_KEYBOARD=y +CONFIG_LVGL_SPAN=y +CONFIG_LVGL_HANDLER_TASK_PRIORITY=80 +# CONFIG_QRCODE is not set +CONFIG_CAMERA=y +# CONFIG_CAMERA_DECODE is not set +CONFIG_CAMERA_SAVEPHOTOS=y +# CONFIG_QUECTHING is not set +# CONFIG_SPINAND is not set +# CONFIG_RTMP is not set +CONFIG_JPEG=y +# CONFIG_SPI_SDCARD is not set +CONFIG_VIOCE_CALL=y +# CONFIG_TTS is not set +CONFIG_LCD=y +# CONFIG_UART_SLIP is not set +# CONFIG_POC is not set +#CONFIG_GH301x=y +#CONFIG_HX3918=y +#CONFIG_SC7A20=y +#CONFIG_LVGL_USE_FREETYPE=y +#菊风视频通话 +CONFIG_juphoon=y +PROJECT_NAME_G3_K01_font=y diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lcd.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lcd.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/animimg.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/animimg.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/arc.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/arc.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/calendar.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/calendar.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/canvas.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/canvas.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/chart.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/chart.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/colorwheel.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/colorwheel.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/fs/helios.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/fs/helios.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/handler/task/priority.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/handler/task/priority.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/imgbtn.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/imgbtn.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/jpg/decode.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/jpg/decode.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/keyboard.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/keyboard.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/led.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/led.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/line.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/line.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/list.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/list.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/meter.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/meter.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/msgbox.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/msgbox.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/png/decode.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/png/decode.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/qrcode.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/qrcode.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/span.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/span.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/spinbox.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/spinbox.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/spinner.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/spinner.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/tabview.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/tabview.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/tileview.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/tileview.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/win.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/lvgl/win.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/mbedtls.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/mbedtls.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/vioce/call.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/include/config/vioce/call.h new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h new file mode 100644 index 00000000..f0fd0145 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/config/mpconfigboard.h @@ -0,0 +1,224 @@ +/* + * Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MPCONFIGBOARD_H__ +#define __MPCONFIGBOARD_H__ + +#define MICROPY_QPY_MODULE_ATCMD (1) +#define MICROPY_QPY_MODULE_UOS (1) +#define MICROPY_QPY_MODULE_MACHINE (1) +#define MICROPY_QPY_MODULE_USOCKET (1) +#define MICROPY_QPY_MODULE_MISC (1) +#define MICROPY_QPY_MODULE_OSTIMER (1) +#define MICROPY_QPY_MODULE_EXAMPLE (1) +#define MICROPY_QPY_MODULE_DATACALL (1) +#define MICROPY_QPY_MODULE_MODEM (1) +#define MICROPY_QPY_MODULE_UTIME (1) +#define MICROPY_QPY_MODULE_UTILS (1) +#define MICROPY_QPY_MODULE_HMACSHA1 (1) +#define MICROPY_QPY_MODULE_SMS (1) +#define MICROPY_QPY_MODULE_SIM (1) +#define MICROPY_QPY_MODULE_DUALSIM (1) +#define MICROPY_QPY_MODULE_LPM (1) +#define MICROPY_QPY_MODULE_NET (1) +#define MICROPY_QPY_MODULE_CELLLOCATOR (0) +#define MICROPY_QPY_MODULE_CELLLOCATOR_QPY (1) +#define MICROPY_QPY_MODULE_AUDIO (1) +#define MICROPY_QPY_MODULE_FOTA (1) +#define MICROPY_QPY_MODULE_WIFISCAN (1) +#define MICROPY_QPY_MODULE_QUECGNSS (0) +#define MICROPY_QPY_MODULE_WIFILOCATOR (1) +#define MICROPY_QPY_MODULE_ETHERNET (0) +#define MICROPY_QPY_MODULE_SENSOR (1) +#define MICROPY_QPY_MODULE_SECUREDATA (1) +#define MICROPY_QPY_MODULE_SLIP (0) +#define MICROPY_QPY_MODULE_TP (1) +#define MICROPY_QPY_MODULE_AUDIOCODEC (0) +#define MICROPY_QPY_MODULE_CSD (0) +#define MICROPY_QPY_MODULE_LWM2M (0) +#define MICROPY_QPY_MODULE_NB (0) +#define MICROPY_QPY_MODULE_UHASHLIB (1) +#define MICROPY_QPY_MODULE_UCRYPTOLIB (1) +#define MICROPY_QPY_MODULE_ALIPAY (0) +#define MICROPY_QPY_MODULE_VFS_THREADSAFE (1) +#define MICROPY_QPY_MODULE_GPIO_ENCODER (0) +#if CONFIG_MBEDTLS + #define MICROPY_QPY_MODULE_USSL (0) + #define MICROPY_QPY_SSL_MBEDTLS (1) +#endif + +#if CONFIG_QUECTHING + #define MICROPY_QPY_MODULE_QUECIOT (1) +#else + #define MICROPY_QPY_MODULE_QUECIOT (0) +#endif + +#if CONFIG_LVGL + #define MICROPY_QPY_MODULE_LVGL (1) +#else + #define MICROPY_QPY_MODULE_LVGL (0) +#endif + +#if CONFIG_CAMERA + #define MICROPY_QPY_MODULE_CAMERA (1) +#else + #define MICROPY_QPY_MODULE_CAMERA (0) +#endif + +#if CONFIG_RTMP + #define MICROPY_QPY_MODULE_RTMP (1) +#else + #define MICROPY_QPY_MODULE_RTMP (0) +#endif +#if CONFIG_VIOCE_CALL + #define MICROPY_QPY_MODULE_VIOCE_CALL (1) +#else + #define MICROPY_QPY_MODULE_VIOCE_CALL (0) +#endif + +#if CONFIG_POC + #define MICROPY_QPY_MODULE_POC (1) +#else + #define MICROPY_QPY_MODULE_POC (0) +#endif +#if CONFIG_QRCODE + #define MICROPY_QPY_MODULE_QRCODE (1) +#else + #define MICROPY_QPY_MODULE_QRCODE (0) +#endif + +#ifdef CONFIG_QUEC_PROJECT_FEATURE_BLE_GATT + #define MICROPY_QPY_MODULE_BLE (1) +#else + #define MICROPY_QPY_MODULE_BLE (0) +#endif + +#ifdef CONFIG_QUEC_PROJECT_FEATURE_CLASSIC_BT + #define MICROPY_QPY_MODULE_BT (1) +#else + #define MICROPY_QPY_MODULE_BT (0) +#endif +#define MICROPY_QPY_CAMERA_LVGL_PREVIEW (1) + +//modmachine +#if MICROPY_QPY_MODULE_MACHINE + #define MICROPY_QPY_MACHINE_TIMER (1) + #define MICROPY_QPY_MACHINE_RTC (1) + #define MICROPY_QPY_MACHINE_WDT (1) + #define MICROPY_QPY_MACHINE_PIN (1) + #define MICROPY_QPY_MACHINE_EXTINT (1) + #define MICROPY_QPY_MACHINE_UART (1) + #define MICROPY_QPY_MACHINE_SPI (1) + #define MICROPY_QPY_MACHINE_I2C (1) + #define MICROPY_QPY_MACHINE_I2C_SOFT (1) + #ifdef CONFIG_LCD + #define MICROPY_QPY_MACHINE_LCD (1) +#else + #define MICROPY_QPY_MACHINE_LCD (0) +#endif + #define MICROPY_QPY_MACHINE_KEYPAD (1) + #ifdef CONFIG_SPINAND + #define MICROPY_QPY_MACHINE_NANDFLASH (1) + #else + #define MICROPY_QPY_MACHINE_NANDFLASH (0) + #endif + +#if MICROPY_QPY_MACHINE_UART + #define MICROPY_QPY_UART4 (1) +#endif + +#endif + +#if MICROPY_QPY_MODULE_MISC + #define MICROPY_QPY_MISC_POWER (1) + #define MICROPY_QPY_MISC_ADC (1) + #define MICROPY_QPY_MISC_POWERKEY (1) + #define MICROPY_QPY_MISC_TEMPERATURE (0) + #define MICROPY_QPY_MISC_PWM (1) + #define MICROPY_QPY_MISC_USB (1) + #define MICROPY_QPY_MISC_USBNET (1) + #define MICROPY_QPY_MISC_CFG_NETLIGHT (1) +#endif + +#if MICROPY_QPY_MODULE_AUDIO + #define MICROPY_QPY_AUDIO_AUDIO (1) + #if CONFIG_TTS + #define MICROPY_QPY_AUDIO_TTS (1) + #else + #define MICROPY_QPY_AUDIO_TTS (0) + #endif + #define MICROPY_QPY_AUDIO_RECORD (1) +#endif + +#if MICROPY_QPY_MODULE_ETHERNET + #define MICROPY_QPY_ETHERNET_DM9051 (0) + #define MICROPY_QPY_ETHERNET_W5500 (0) +#endif + +#if MICROPY_QPY_MODULE_TP + #define MICROPY_QPY_TP_XPT2046 (0) + #define MICROPY_QPY_TP_GT9XX (0) + #define MICROPY_QPY_TP_CST816 (1) +#endif + +#if MICROPY_QPY_MODULE_AUDIOCODEC + #define MICROPY_QPY_AUDIOCODEC_RT5616 (0) +#endif + +#if MICROPY_QPY_MODULE_SENSOR + #define MICROPY_QPY_SENSOR_SN95500 (0) + #define MICROPY_QPY_SENSOR_ICC_KEY (0) + #define MICROPY_QPY_SENSOR_GNSS (0) +#endif + +#if MICROPY_QPY_MODULE_CAMERA + #define MICROPY_QPY_CAMERA_CAMPREVIEW (1) + #if CONFIG_CAMERA_SAVEPHOTOS + #define MICROPY_QPY_CAMERA_CAMCAPTURE (1) + #else + #define MICROPY_QPY_CAMERA_CAMCAPTURE (0) + #endif + #ifdef CONFIG_CAMERA_DECODE + #define MICROPY_QPY_CAMERA_CAMSCANDECODE (1) + #else + #define MICROPY_QPY_CAMERA_CAMSCANDECODE (0) + #endif +#endif + +#if CONFIG_NFC + #define MICROPY_QPY_MODULE_NFC (1) +#if CONFIG_NFC_SL6320 + #define MICROPY_QPY_NFC_SL6320 (1) +#endif +#endif + + +#define MICROPY_QPY_DEVICE_REPORT (1) + +/***********************micropython opts*******************************/ +#define MICROPY_QPY_DEBUG_PRINTERS (0) //flash 4160 Byte +#define MICROPY_QPY_PY_MATH (1) //flash 14880 Byte +#define MICROPY_QPY_PY_CMATH (0) //flash 3136 Byte +#define MICROPY_QPY_PY_USELECT (0) //flash 1792 Byte +#define MICROPY_QPY_PY_UCTYPES (0) //flash 2816 Byte +#define MICROPY_QPY_PY_UZLIB (0) //flash 3072 Byte +#define MICROPY_QPY_PY_UASYNCIO (0) //flash 2048 Byte +#define MICROPY_QPY_PY_ENABLE_WEBSERVER (0) //flash 3424 Byte +#define MICROPY_QPY_PERSISTENT_CODE_LOAD (1) //flash 2048 Byte +#define MICROPY_QPY_EMIT_XTENSAWIN (0) //flash 19776 Byte +#define MICROPY_QPY_MODULE_VFS_THREADSAFE (1) +#define MICROPY_QPY_GC_HEAP_SIZE (1000 * 1024) +#endif \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.zip b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.zip new file mode 100644 index 00000000..13e60524 Binary files /dev/null and b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/DBG.zip differ diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base.json b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base.json new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip new file mode 100644 index 00000000..253bbc2b Binary files /dev/null and b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip differ diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h new file mode 100644 index 00000000..242610f4 --- /dev/null +++ b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/include/app_link_start_addr.h @@ -0,0 +1,11 @@ + +#ifndef __APP_LINK_START_ADDR_H__ +#define __APP_LINK_START_ADDR_H__ + +#define APP_LINK_START_ADDR 0x804E2000 +#define APP_FLASH_MAX_SIZE 0x220000 + +#define APP_RAM_START 0x7E3E0000 +#define APP_RAM_MAX_SIZE 0x180000 + +#endif diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib new file mode 100644 index 00000000..8f0ae189 Binary files /dev/null and b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/libHeliosAPI.lib differ diff --git a/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib new file mode 100644 index 00000000..2c9d26bb Binary files /dev/null and b/2.sdk-ZY/project/W9/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/libraries/ql_common_api.lib differ diff --git a/2.sdk-ZY/project/W9/usr/main.py b/2.sdk-ZY/project/W9/usr/main.py new file mode 100644 index 00000000..68ba3fff --- /dev/null +++ b/2.sdk-ZY/project/W9/usr/main.py @@ -0,0 +1,2 @@ +import main_init +main_init.main_init() \ No newline at end of file diff --git a/2.sdk-ZY/project/W9/usr/static/0_BAT.png b/2.sdk-ZY/project/W9/usr/static/0_BAT.png new file mode 100644 index 00000000..c37574ac Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/0_BAT.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_start.png b/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_start.png new file mode 100644 index 00000000..6fae0204 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_start.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_stop.png b/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_stop.png new file mode 100644 index 00000000..d58ea1fe Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/AI/ai_result_can_stop.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/AI/ai_talk_bt.png b/2.sdk-ZY/project/W9/usr/static/AI/ai_talk_bt.png new file mode 100644 index 00000000..ec42e3e7 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/AI/ai_talk_bt.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/AI/ai_warning.png b/2.sdk-ZY/project/W9/usr/static/AI/ai_warning.png new file mode 100644 index 00000000..df210cec Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/AI/ai_warning.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_1.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_1.png new file mode 100644 index 00000000..dfc8af1e Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_1.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_2.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_2.png new file mode 100644 index 00000000..07f2ea2a Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_2.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_3.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_3.png new file mode 100644 index 00000000..d9e83ed4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/R_3.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_1.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_1.png new file mode 100644 index 00000000..aeddf4c6 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_1.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_2.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_2.png new file mode 100644 index 00000000..e7861e04 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_2.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_3.png b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_3.png new file mode 100644 index 00000000..8c6c4e0b Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/APP/wechat/S_3.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_APP_QR_CODE.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_APP_QR_CODE.png new file mode 100644 index 00000000..69fe55c8 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_APP_QR_CODE.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DELKEY.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DELKEY.png new file mode 100644 index 00000000..d82916c8 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DELKEY.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL.png new file mode 100644 index 00000000..aa26f3a0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL_CONTACT.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL_CONTACT.png new file mode 100644 index 00000000..9161a2b8 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_BUTTON_DIAL_CONTACT.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NOTICE_CALL.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NOTICE_CALL.png new file mode 100644 index 00000000..793876c0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NOTICE_CALL.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY00_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY00_ICON.png new file mode 100644 index 00000000..c79e5c07 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY07_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY07_ICON.png new file mode 100644 index 00000000..a5c579e4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY07_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY09_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY09_ICON.png new file mode 100644 index 00000000..304ecb05 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY09_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY0_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY0_ICON.png new file mode 100644 index 00000000..a739ffb0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY0_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY1_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY1_ICON.png new file mode 100644 index 00000000..93aa580f Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY1_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY2_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY2_ICON.png new file mode 100644 index 00000000..01192662 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY2_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY3_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY3_ICON.png new file mode 100644 index 00000000..c38515b4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY3_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY4_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY4_ICON.png new file mode 100644 index 00000000..502e5c73 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY4_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY5_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY5_ICON.png new file mode 100644 index 00000000..8ee6b4f2 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY5_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY6_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY6_ICON.png new file mode 100644 index 00000000..7ac14078 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY6_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY7_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY7_ICON.png new file mode 100644 index 00000000..0784165d Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY7_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY8_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY8_ICON.png new file mode 100644 index 00000000..1878619d Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY8_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY9_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY9_ICON.png new file mode 100644 index 00000000..126ae77c Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEY9_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYHASH00_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYHASH00_ICON.png new file mode 100644 index 00000000..6278f30b Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYHASH00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYSTAR00_ICON.png b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYSTAR00_ICON.png new file mode 100644 index 00000000..c64ec927 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/IMAGE_NUMBER_KEYSTAR00_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/REDUCE_VOLUM_ICON.png b/2.sdk-ZY/project/W9/usr/static/REDUCE_VOLUM_ICON.png new file mode 100644 index 00000000..6e66a7ce Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/REDUCE_VOLUM_ICON.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/RED_RETURN_PNG.png b/2.sdk-ZY/project/W9/usr/static/RED_RETURN_PNG.png new file mode 100644 index 00000000..e7af8032 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/RED_RETURN_PNG.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/SOS_PLAY.mp3 b/2.sdk-ZY/project/W9/usr/static/SOS_PLAY.mp3 new file mode 100644 index 00000000..f2588cdb Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/SOS_PLAY.mp3 differ diff --git a/2.sdk-ZY/project/W9/usr/static/add_btn.png b/2.sdk-ZY/project/W9/usr/static/add_btn.png new file mode 100644 index 00000000..4e180873 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/add_btn.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/album_delete.png b/2.sdk-ZY/project/W9/usr/static/album_delete.png new file mode 100644 index 00000000..8ea8e288 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/album_delete.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/answer.png b/2.sdk-ZY/project/W9/usr/static/answer.png new file mode 100644 index 00000000..4121841f Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/answer.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/audio_audio_haixiu.mp3 b/2.sdk-ZY/project/W9/usr/static/audio_audio_haixiu.mp3 new file mode 100644 index 00000000..673a9977 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/audio_audio_haixiu.mp3 differ diff --git a/2.sdk-ZY/project/W9/usr/static/camera_album_btn.png b/2.sdk-ZY/project/W9/usr/static/camera_album_btn.png new file mode 100644 index 00000000..af0c9bee Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/camera_album_btn.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/camera_btn.png b/2.sdk-ZY/project/W9/usr/static/camera_btn.png new file mode 100644 index 00000000..e059ba2d Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/camera_btn.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/cancel_icon.png b/2.sdk-ZY/project/W9/usr/static/cancel_icon.png new file mode 100644 index 00000000..905ad0a9 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/cancel_icon.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/charge_ing.png b/2.sdk-ZY/project/W9/usr/static/charge_ing.png new file mode 100644 index 00000000..61cb943a Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/charge_ing.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/hang_up.png b/2.sdk-ZY/project/W9/usr/static/hang_up.png new file mode 100644 index 00000000..ef3e0fbb Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/hang_up.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/low_power.png b/2.sdk-ZY/project/W9/usr/static/low_power.png new file mode 100644 index 00000000..81883498 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/low_power.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/menu_time.png b/2.sdk-ZY/project/W9/usr/static/menu_time.png new file mode 100644 index 00000000..c7941f55 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/menu_time.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/menustyle_select.png b/2.sdk-ZY/project/W9/usr/static/menustyle_select.png new file mode 100644 index 00000000..1ad816b6 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/menustyle_select.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/mpsignal1.png b/2.sdk-ZY/project/W9/usr/static/mpsignal1.png new file mode 100644 index 00000000..2fad2fc4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/mpsignal1.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/mpsignal2.png b/2.sdk-ZY/project/W9/usr/static/mpsignal2.png new file mode 100644 index 00000000..0ae3897c Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/mpsignal2.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/mpsignal3.png b/2.sdk-ZY/project/W9/usr/static/mpsignal3.png new file mode 100644 index 00000000..facd701f Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/mpsignal3.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/mpsignal4.png b/2.sdk-ZY/project/W9/usr/static/mpsignal4.png new file mode 100644 index 00000000..59024dd9 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/mpsignal4.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/mpsignal5.png b/2.sdk-ZY/project/W9/usr/static/mpsignal5.png new file mode 100644 index 00000000..7edc0d2c Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/mpsignal5.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/poweroff_icon.png b/2.sdk-ZY/project/W9/usr/static/poweroff_icon.png new file mode 100644 index 00000000..744901d0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/poweroff_icon.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/reduce_btn.png b/2.sdk-ZY/project/W9/usr/static/reduce_btn.png new file mode 100644 index 00000000..3162f892 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/reduce_btn.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_app_qrcode.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_app_qrcode.png new file mode 100644 index 00000000..412cf837 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_app_qrcode.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_bright.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_bright.png new file mode 100644 index 00000000..9e7bc917 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_bright.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_imei_qrcode.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_imei_qrcode.png new file mode 100644 index 00000000..24d053e2 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_imei_qrcode.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_poweroff.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_poweroff.png new file mode 100644 index 00000000..ed8a1acb Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_poweroff.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_restore.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_restore.png new file mode 100644 index 00000000..cee5902a Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_restore.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_theme_menustyle.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_theme_menustyle.png new file mode 100644 index 00000000..0a69bfbd Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_theme_menustyle.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_upgrade.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_upgrade.png new file mode 100644 index 00000000..d5b673fd Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_upgrade.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_version.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_version.png new file mode 100644 index 00000000..623790c0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_version.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_volume.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_volume.png new file mode 100644 index 00000000..c22bb155 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_volume.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/menu_watch_switch.png b/2.sdk-ZY/project/W9/usr/static/setting/menu_watch_switch.png new file mode 100644 index 00000000..372e44b5 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/menu_watch_switch.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png b/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png new file mode 100644 index 00000000..7aedfa6c Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/setting/setting_text.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/stopwatch_play.png b/2.sdk-ZY/project/W9/usr/static/stopwatch_play.png new file mode 100644 index 00000000..73a652b4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/stopwatch_play.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/stopwatch_reset.png b/2.sdk-ZY/project/W9/usr/static/stopwatch_reset.png new file mode 100644 index 00000000..7a5e6d41 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/stopwatch_reset.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/stopwatch_stop.png b/2.sdk-ZY/project/W9/usr/static/stopwatch_stop.png new file mode 100644 index 00000000..ef1e7344 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/stopwatch_stop.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/storage_file/wechat_num.txt b/2.sdk-ZY/project/W9/usr/static/storage_file/wechat_num.txt new file mode 100644 index 00000000..e69de29b diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png new file mode 100644 index 00000000..b175b0f4 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CAMERA.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CONTACTS.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CONTACTS.png new file mode 100644 index 00000000..e62722a2 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_CONTACTS.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png new file mode 100644 index 00000000..2464976f Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_SETING.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_WECHAT.png b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_WECHAT.png new file mode 100644 index 00000000..2ab9e3ec Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/theme1/THEME1_WECHAT.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_ALARM.png b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_ALARM.png new file mode 100644 index 00000000..35efb026 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_ALARM.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_COUNTDOWN.png b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_COUNTDOWN.png new file mode 100644 index 00000000..e228bb87 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_COUNTDOWN.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STEP.png b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STEP.png new file mode 100644 index 00000000..1b56bdd0 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STEP.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STOPWATCH.png b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STOPWATCH.png new file mode 100644 index 00000000..726182e6 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_STOPWATCH.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_WEATHER.png b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_WEATHER.png new file mode 100644 index 00000000..b71ca3a5 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/IMAGE_SECMENU_WEATHER.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/sms_setting.png b/2.sdk-ZY/project/W9/usr/static/tool/sms_setting.png new file mode 100644 index 00000000..5a2c9492 Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/sms_setting.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png b/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png new file mode 100644 index 00000000..b6a3faec Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/tool/tool_text.png differ diff --git a/2.sdk-ZY/project/W9/usr/static/vbat_0.png b/2.sdk-ZY/project/W9/usr/static/vbat_0.png new file mode 100644 index 00000000..c3341e8b Binary files /dev/null and b/2.sdk-ZY/project/W9/usr/static/vbat_0.png differ diff --git a/2.sdk/Helios_SDK/config/autoconf.h b/2.sdk/Helios_SDK/config/autoconf.h index 17f50c23..2fe8e6bf 100644 --- a/2.sdk/Helios_SDK/config/autoconf.h +++ b/2.sdk/Helios_SDK/config/autoconf.h @@ -4,7 +4,7 @@ * Helios SDK Configuration * */ -#define PROJECT_NAME_G3_K01 1 //项目宏定义 +#define PROJECT_NAME_G3_C06S 1 //项目宏定义 #define CONFIG_LVGL_SPAN 1 #define CONFIG_LVGL_FS_HELIOS 1 #define CONFIG_LVGL_GIF_DECODE 1 @@ -28,6 +28,7 @@ #define CONFIG_LVGL_PNG_DECODE 1 #define CONFIG_LVGL_IMGBTN 1 //#define CONFIG_GH301x 1 +#define CONFIG_HX3918 1 #define CONFIG_MBEDTLS 1 #define CONFIG_SC7A20 1 #define CONFIG_LVGL_WIN 1 @@ -40,5 +41,3 @@ #define CONFIG_CAMERA 1 #define CONFIG_JPEG 1 #define CONFIG_CAMERA_SAVEPHOTOS 1 -//菊风视频通话 -#define CONFIG_juphoon 1 \ No newline at end of file diff --git a/2.sdk/Helios_SDK/config/config.in b/2.sdk/Helios_SDK/config/config.in index 343bad71..6e03ed93 100644 --- a/2.sdk/Helios_SDK/config/config.in +++ b/2.sdk/Helios_SDK/config/config.in @@ -10,6 +10,6 @@ source "../services/microPython/config/config.in" source "../components/poc/poc_option.in" source "../components/GH301x/GH301x_option.in" source "../components/SC7A20/SC7A20_option.in" -source "../components/juphoon/juphoon_option.in" + endmenu diff --git a/2.sdk/Helios_SDK/config/config.mk b/2.sdk/Helios_SDK/config/config.mk index 42b702bf..168ac944 100644 --- a/2.sdk/Helios_SDK/config/config.mk +++ b/2.sdk/Helios_SDK/config/config.mk @@ -2,7 +2,7 @@ # Automatically generated file; DO NOT EDIT. # Helios SDK Configuration # -PROJECT_NAME_G3_K01=y +PROJECT_NAME_G3_C06S=y # # System Configuration # @@ -60,7 +60,6 @@ CONFIG_LCD=y # CONFIG_UART_SLIP is not set # CONFIG_POC is not set #CONFIG_GH301x=y +CONFIG_HX3918=y CONFIG_SC7A20=y -#菊风视频通话 -CONFIG_juphoon=y diff --git a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py index 7e932af3..cd31639b 100644 --- a/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py +++ b/2.sdk/Helios_SDK/services/microPython/ports/quectel/core/motor.py @@ -31,8 +31,6 @@ class motorEventManager(Abstract):#马达事件 self.motor_mode = 0#模式 _thread.start_new_thread(self.motorInfo_queue_thread, ()) EventMesh.subscribe("publish_message_event_motorInfo",self.publish_message_event_motorInfo) - EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数 - EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器 pass def motorInfo_queue_thread(self): @@ -52,14 +50,15 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("publish_message_event_motorInfo",{"func":self.motor_fun_cb,"data":0}) def post_processor_after_instantiation(self): - pass + EventMesh.subscribe("set_motor_time", self.set_motor_time)#设置参数 + EventMesh.subscribe("close_motor_infor", self.close_motor_infor)#关闭马达和定时器 # msg 0马达使能 1 马达振动时间100ms单位 2 震动次数 3 间隔时间振动 4 是否需要长振 5 长振时间 6间隔时间长振 7长振次数1一次 要为200ms的倍数 def set_motor_time(self,event,msg): - # open_power = EventMesh.publish("get_power_on_state")#获取开机标识 - # if open_power != None: - # if open_power == 0: - # return + open_power = EventMesh.publish("get_power_on_state")#获取开机标识 + if open_power != None: + if open_power == 0: + return if msg != None: self.motor_enable = msg[0] if self.motor_enable == 1: #马达使能 @@ -79,7 +78,6 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("close_motor_infor")#关闭马达和定时器 return if self.motor_mode == 1:# - if self.motor_total_time > 0: self.motor_total_time-=1 if self.motor_total_time > 0: @@ -89,10 +87,8 @@ class motorEventManager(Abstract):#马达事件 EventMesh.publish("close_motor_infor")#关闭马达和定时器 return elif self.motor_mode == 2:# - # print("motor_fun_cb:{}\r\n".format(self.motor_total_time)) # print("self.motor_count",self.motor_count,self.motor_open_time,self.motor_close_time,self.motor_total_time) if self.motor_count % (self.motor_open_time) < self.motor_close_time: # 4 4 2 1%4 = 1 2%4 = 2 3%4 = 3 - # print("motor_fun_cb MORETO:{}\r\n".format(self.motor_total_time)) open_motor() else: close_motor() @@ -103,8 +99,6 @@ class motorEventManager(Abstract):#马达事件 def close_motor_infor(self,event,msg): print("close_motor_infor!!!") - if self.motor_enable == 0:#未使能马达定时器 - return close_motor() self.motor_enable = 0#马达使能 self.motor_total_time = 0#总的时间 diff --git a/2.sdk/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py b/2.sdk/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py index 2bf3df12..d0aff3e2 100644 --- a/2.sdk/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py +++ b/2.sdk/project/C06S/sdk/services/microPython/ports/quectel/core/versions.py @@ -1,2 +1,2 @@ Version="V1.0" -Build_Time="2024-01-25 16:47:49" +Build_Time="2024-07-06 10:51:43" diff --git a/2.sdk/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip b/2.sdk/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip index 5fb8defa..293f1d79 100644 Binary files a/2.sdk/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip and b/2.sdk/project/C06S/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip differ