Merge branch 'master' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/ASR1603_G5
authordxy15521469561 <1731678236@qq.com>
Mon, 28 Aug 2023 06:44:00 +0000 (14:44 +0800)
committerdxy15521469561 <1731678236@qq.com>
Mon, 28 Aug 2023 06:44:00 +0000 (14:44 +0800)
# Conflicts:
# 2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/btn_device_ec800m.py
# 2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py
# 2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py

1  2 
2.sdk/Helios_SDK/config/autoconf.h
2.sdk/Helios_SDK/config/config.in
2.sdk/Helios_SDK/config/config.mk
2.sdk/Helios_SDK/system/include/quectel_version.h
2.sdk/project/D10/sdk/system/platform/ASR_1606/boards/EG810MCN_GA_VOLTE/images/firmware_base_release_pack.zip
2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/K01/sdk/services/microPython/ports/quectel/core/protocol.py

@@@ -4,7 -4,7 +4,7 @@@
   * Helios SDK Configuration
   *
   */
--#define PROJECT_NAME_G5_K5  1
++#define PROJECT_NAME_G3_K01  1  //项目宏定义
  #define CONFIG_LVGL_SPAN 1
  #define CONFIG_LVGL_FS_HELIOS 1
  #define CONFIG_LVGL_GIF_DECODE 1
@@@ -28,7 -28,7 +28,6 @@@
  #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
@@@ -5,11 -5,11 +5,10 @@@ menu "System Configuration
  source "../system/config.in"
  endmenu
  
--menu "EG810MCN_GA_ALIPAY"
++menu "EG810MCN_GA_VOLTE"
  source "../services/microPython/config/config.in"
  source "../components/poc/poc_option.in"
  source "../components/GH301x/GH301x_option.in"
--source "../components/HX3918/HX3918_option.in"
  source "../components/SC7A20/SC7A20_option.in"
  
  endmenu
@@@ -2,7 -2,7 +2,7 @@@
  # Automatically generated file; DO NOT EDIT.
  # Helios SDK Configuration
  #
--PROJECT_NAME_G5_K5=y
++PROJECT_NAME_G3_K01=y
  #
  # System Configuration
  #
@@@ -58,5 -58,5 +58,5 @@@ CONFIG_LCD=
  # CONFIG_UART_SLIP is not set
  # CONFIG_POC is not set
  #CONFIG_GH301x=y
--CONFIG_HX3918=y
  CONFIG_SC7A20=y
++
@@@ -1,6 -1,6 +1,6 @@@
  #ifndef __QUECTEL_VERSION_H__
  #define __QUECTEL_VERSION_H__
  
--char mob_sw_rev[] = "EG810MCN_GA_ALIPAY";
++char mob_sw_rev[] = "EG810MCN_GA_VOLTE";
  
  #endif
@@@ -821,12 -829,13 +829,13 @@@ class DeviceInfoManager(Abstract)
          if self.upload_time != None:
              if  math.fabs(time_tmp - self.UD_time) > self.upload_time: #30分钟一次定位
                  self.UD_time = time_tmp
-                 if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1:
+                 step_tmp = self.gsensor.get_step()
+                 if EventMesh.publish(constants.EVENT.GET_CONNECT) == 1 and step_tmp != self.GPS_step_t :
                      EventMesh.publish(constants.EVENT.START_LOCATION,constants.PROTOCOL.UD_SEND) #开始UD定位
+                     self.GPS_step_t = step_tmp#记录步数
          EventMesh.publish(constants.EVENT.PUSH_STEP, self.get_step_count())
  
 -        """电池平均值"""
 +        EventMesh.publish("get_class_in_time_page")
- 
          temp = Power.getVbatt()
          
          if self.bat_count < 10:
@@@ -2857,191 -2874,10 +2877,187 @@@ class testSmsSetIPManager(Abstract):
          Power.powerRestart()
  
      def get_new_ip(self, event, msg):
-         
+         tmp_data = EventMesh.publish("get_storage_config","set_new_ip_addr")
          # return [self.newip,self.newcom,self.newmd5]
-         return [self.newip,self.newcom]
-     
- 
- 
 -        if(tmp_data != None):
 -            return [self.newip,self.newcom]
 +class setkeyboardManager(Abstract):#设置键盘开关状态
 +    def __init__(self):
 +        self.key_state = 0
 +        tmp_data = EventMesh.publish("get_storage_config","key_board")
 +        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])
 +        
 +
 +    def get_key_board(self, event, msg):
 +        
 +        return self.key_state
 +    
 +class setclassTimeManager(Abstract):#设置上课禁用时间
 +    def __init__(self):
 +        self.class_buf = {}
 +        self.class_state = 0
 +        check_json = ql_fs.path_exists("/usr/static/storage_file/class_msg.json")
 +
 +        if check_json == True:
 +            with open("/usr/static/storage_file/class_msg.json","r",encoding="utf-8") as fd:
 +                self.class_buf = ujson.load(fd)
 +                print("读取上课禁用时间段")
 +                # print("self.class_buf:",self.class_buf)
 +        
 +
 +
 +    def post_processor_after_instantiation(self):
 +        EventMesh.subscribe("set_class_time", self.set_class_time)#设置上课禁用时间段
 +        EventMesh.subscribe("get_class_time", self.get_class_time)
 +        EventMesh.subscribe("get_cur_class_time_state", self.get_cur_class_time_state)
 +        EventMesh.subscribe("get_class_in_time_page",self.get_class_in_time_page)
 +
 +    def set_class_time(self, event, msg): 
 +        self.class_buf = msg
 +        # print("self.class_buf",self.class_buf)
 +        
 +
 +    def get_class_time(self, event, msg):
 +        
 +        return self.class_buf
 +    
 +    def get_cur_class_time_state(self, event, msg):
 +        data = RTC().datetime()
 +        hour = data[4]#当前小时
 +        min = data[5]#当前分钟
 +
 +        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
 +        # {'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):
 +        EventMesh.publish("get_cur_class_time_state")
 +        phone_call = EventMesh.publish("get_UI_high_priority")
 +
 +        screen_NAME = EventMesh.publish("get_screen_NAME")
 +        if self.class_state == 1:
 +            if screen_NAME != None:
 +                if screen_NAME != "system_init" or screen_NAME != "poweron":
 +                    if screen_NAME != "class_time" and phone_call == 0:
 +                        EventMesh.publish("load_screen", {"screen": "class_time"}) 
 +        else:
 +            if screen_NAME != None:
 +                if screen_NAME == "class_time":
 +                   EventMesh.publish("load_screen", {"screen": "main_menu"})
 +            
 +        pass
 +
 +