陈嘉乐
2020-08-28 78c5b5715518c0017d9f629ce16ee9c173a48690
2020-08-28-1

优化GPS服务的代码,请合并
6个文件已修改
85 ■■■■■ 已修改文件
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,11 +1,12 @@
<Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default">
  <MonoDevelop.Ide.ItemProperties.GateWay.Droid AndroidDesignerPreferredTheme="MyTheme1" AndroidDesignerPreferredDevice="Nexus 4" PreferredExecutionTarget="Android.5c86e4357d63" />
  <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/SkipView.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/LogicCommunalPage.cs">
    <Files>
      <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="1" Column="1" />
      <File FileName="Shared/Phone/Device/Logic/SkipView.cs" Line="462" Column="1" />
      <File FileName="Shared/Phone/ZigBee/Common/Application.cs" Line="302" Column="1" />
      <File FileName="Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs" Line="963" Column="48" />
      <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="1326" Column="38" />
      <File FileName="Shared/Phone/Device/Logic/Method.cs" Line="843" Column="22" />
      <File FileName="Shared/Phone/Device/Logic/LogicCommunalPage.cs" Line="1" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
@@ -16,12 +17,11 @@
              <Node name="Phone" expanded="True">
                <Node name="Device" expanded="True">
                  <Node name="Logic" expanded="True">
                    <Node name="DoorLockLogic" expanded="True" />
                    <Node name="SkipView.cs" selected="True" />
                    <Node name="LogicCommunalPage.cs" selected="True" />
                  </Node>
                </Node>
                <Node name="ZigBee" expanded="True">
                  <Node name="Common" expanded="True" />
                <Node name="UserCenter" expanded="True">
                  <Node name="CommonBase" expanded="True" />
                </Node>
              </Node>
            </Node>
@@ -34,9 +34,7 @@
  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/hdl/Desktop/wjc/HomeApp/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs" relfile="Shared/Phone/Device/Logic/SkipView.cs" line="462" column="1" />
    </BreakpointStore>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
</Properties>
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
ZigbeeApp/Shared/Common/CommonPage.cs
@@ -45,10 +45,6 @@
            //}
            Phone.UserView.HomePage.Instance.InitPage();
            if (Shared.Phone.Device.Logic.Send.It_Exist == "1")
            {//以本地状态为主打开GPS服务
                Application.StartGPSLocationService();
            }
        }
        //public static string RequestHttpsHost = "https://global.hdlcontrol.com/HangZhouHdlCloudApi";
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -901,28 +901,58 @@
            UserView.HomePage.Instance.RemoveViewByTag("Logic");//移除所有标记Logic界面
            if (LogicView.IfString._Logic == if_logic)
            {
                //查询逻辑是否添加地理位置作为条件
                //查询-当前逻辑-是否添加地理位置作为条件
                var exist = Common.Logic.CurrentLogic.Conditions.Find((obj) => obj["Type"] == "7");
                if (exist==null)
                {
                    //如果找不到地理位置作为条件的话,关闭GPS服务(减少耗电)
                    if (Send.It_Exist == "1")
                    bool if_type = false;
                    //查询-逻辑列表-是否添加过地理位置作为条件
                    for (int a = 0; a < Common.Logic.LogicList.Count; a++)
                    {
                        //关闭GPS服务
                        Application.StopGPSLocationService();
                        //保存GPS服务关闭状态
                        Send.SaveLocalFile("GPS_File", "0");
                        var logic = Common.Logic.LogicList[a];
                        var exist_logic = logic.Conditions.Find((obj) => obj["Type"] == "7");
                        if (exist_logic != null)
                        {
                            //是否存在地理位置条件
                            if_type = true;
                            //退出for循环
                            break;
                        }
                    }
                    if (if_type)
                    {
                        //查询之前状态是否已经开启GPS服务(以本地存储状态为主 0:没开启; 1:开启)
                        if (Send.If_Exist == "0")
                        {
                            //开启GPS服务
                            Application.StartGPSLocationService();
                            //保存GPS服务开启状态
                            Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1");
                        }
                    }
                    else
                    {
                        //如果找不到地理位置作为条件的话,关闭GPS服务(减少耗电)
                        if (Send.If_Exist == "1")
                        {
                            //关闭GPS服务
                            Application.StopGPSLocationService();
                            //保存GPS服务关闭状态
                            Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "0");
                        }
                    }
                }
                else
                {
                    if (Send.It_Exist == "0")
                    //查询之前状态是否已经开启GPS服务(以本地存储状态为主 0:没开启; 1:开启)
                    if (Send.If_Exist == "0")
                    {
                        //开启GPS服务
                        Application.StartGPSLocationService();
                        //保存GPS服务开启状态
                        Send.SaveLocalFile("GPS_File", "1");
                        Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1");
                    }
                }
                //只刷新分类-自动化上下滑动view;
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -1323,11 +1323,11 @@
        /// <summary>
        /// 判断是否开启GPS服务
        /// </summary>
        public static string It_Exist
        public static string If_Exist
        {
            get
            {
                string value = ReadLocalFile("GPS_File");
                string value = ReadLocalFile(Config.Instance.HomeId+"_GPS_File");
                //读取本地GPS服务状态
                if (value == "0"||string.IsNullOrEmpty(value))
                {
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
old mode 100755 new mode 100644
@@ -959,8 +959,11 @@
                ShowGuideForm(result);
            }
            //APP缓存加载完成
            UserCenterResourse.AccountOption.AppCanSignout = true;
            UserCenterResourse.AccountOption.AppCanSignout = true;
            if (Shared.Phone.Device.Logic.Send.If_Exist == "1")
            {//以本地状态为主打开GPS服务
                Application.StartGPSLocationService();
            }
            return true;
        }