陈嘉乐
2020-08-24 7ded9bc93b6beb5d7311ed4d013f90c521f85b5e
2020.08.24.1

打开GPS服务
2个文件已添加
13个文件已修改
9687 ■■■■■ 已修改文件
.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Application.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Common/CommonPage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.HDLWidget.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/Android/Shared.Droid.xml 4315 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.xml 5182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.DS_Store
Binary files differ
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,18 +1,32 @@
<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>
  <MonoDevelop.Ide.Workbench ActiveDocument="GateWay.Droid/Properties/AndroidManifest.xml">
    <Files>
      <File FileName="Shared/Phone/Device/Logic/AddLogicPage.cs" Line="477" Column="67" />
      <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="1370" Column="10" />
      <File FileName="GateWay.Droid/Application.cs" Line="190" Column="52" />
      <File FileName="Shared/Phone/Device/Logic/LogicCommunalPage.cs" Line="159" Column="44" />
      <File FileName="Shared/Phone/Device/Logic/LogicDveiceStatus.cs" Line="544" Column="54" />
      <File FileName="Shared/Common/CommonPage.cs" Line="41" Column="45" />
      <File FileName="Shared/Phone/UserView/HomePage.cs" Line="38" Column="36" />
      <File FileName="Shared/Phone/UserView/UserPage.cs" Line="81" Column="14" />
      <File FileName="GateWay.Droid/Properties/AndroidManifest.xml" Line="1" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="GateWay" expanded="True">
            <Node name="GateWay.Droid" expanded="True">
              <Node name="Properties" expanded="True">
                <Node name="AndroidManifest.xml" selected="True" />
              </Node>
            </Node>
            <Node name="Shared" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="Phone" expanded="True">
                <Node name="Device" expanded="True">
                  <Node name="Logic" expanded="True">
                    <Node name="AddLogicPage.cs" selected="True" />
                  </Node>
                </Node>
                <Node name="Device" expanded="True" />
                <Node name="UserView" expanded="True" />
              </Node>
            </Node>
          </Node>
@@ -20,7 +34,7 @@
      </Pad>
    </Pads>
  </MonoDevelop.Ide.Workbench>
  <MonoDevelop.Ide.ItemProperties.Home.IOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
  <MonoDevelop.Ide.ItemProperties.Home.IOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.D4411691-F5B8-40F4-97C1-964F33115DBC" />
  <MonoDevelop.Ide.DebuggingService.PinnedWatches />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
ZigbeeApp/GateWay.Droid/Application.cs
@@ -160,7 +160,7 @@
#if Release
                //保存获取的极光服务器上的注册ID到本地文件
                var registrationId = JPushInterface.GetRegistrationID(activity);
                System.Console.WriteLine("registrationId-极光id=" + registrationId);
                if (!string.IsNullOrEmpty(registrationId))
                {
                    Shared.Common.Config.Instance.RegistrationID = registrationId;
                    Shared.Common.Config.Instance.Save();
                }

#endif
            };
            BaseActivity.RefreshUIAction += (activity) => {
                Shared.Language.CurrentLanguage = "Chinese";
                Shared.Common.CommonPage.Instance.Show();
             };
            BaseActivity.OnResumeAction += (activity) => {
             };
            BaseActivity.NetworkStateChanged += (v) =>
            {
                //网络状态变化处理事件
#endif
            };
            BaseActivity.RefreshUIAction += (activity) => {
                Shared.Language.CurrentLanguage = "Chinese";
                Shared.Common.CommonPage.Instance.Show();
               
             };
            BaseActivity.OnResumeAction += (activity) => {
             };
            BaseActivity.NetworkStateChanged += (v) =>
            {
                //网络状态变化处理事件
                Shared.Common.CommonPage.nowNetworkMode = v;
            };
            BaseActivity.OnDestroyAction += (activity) => {
            //socket停止连接
            //ZigBee.Device.ZbGateway.FindGateWaySocket.Stop();
            };

            HDLUtils.SetAuthoritiesName("com.hdl.home.fileProvider");
         }

        public static bool IsShowTip = true;
        JpushNotificationReceiver myReceiver = new JpushNotificationReceiver { };

        /// <summary>
        /// 项目启动时网络查询
        /// </summary>
        void checkSomeInfo()
        {
            var status = isNetworkAvailable(this);
            string internetStatus = "Available";
            if (!status)
            {
                internetStatus = "UnaVailable";
            }
            else
            {
                var isWifi = isWifiConnected(this);
                if (isWifi)
                {
                    internetStatus = "WiFiConnect";
                }
                else
                {
                    internetStatus = "MobileConnect";
                }
            }

            int connectState = 0;
            if (internetStatus == "UnaVailable")
            {
                connectState = 0;
            }
            else if (internetStatus == "WiFiConnect")
            {
                connectState = 2;
            }
            else
            {
                connectState = 1;
            }
            //ZigBee.Device.ZbGateway.CheckConnection(connectState);
         }

        /// <summary>
        /// 网络是否可用
        /// </summary>
        /// <returns><c>true</c>, if network available was ised, <c>false</c> otherwise.</returns>
        /// <param name="context">Context.</param>
        bool isNetworkAvailable(Context context)
        {
            var cm = (ConnectivityManager)context.GetSystemService(ConnectivityService);

            if (cm == null || cm.ActiveNetworkInfo == null)
            {
                //当前网络不可用
                return false;
            }
            else
            {
                return cm.ActiveNetworkInfo.IsAvailable;
            }
        }

        /// <summary>
        /// 网络是否连接
        /// </summary>
        /// <returns><c>true</c>, if wifi connected was ised, <c>false</c> otherwise.</returns>
        /// <param name="context">Context.</param>
        bool isWifiConnected(Context context)
        {
            if (context != null)
            {
                var cm = (ConnectivityManager)context.GetSystemService(ConnectivityService);

                var mWiFiNetworkInfo = cm.GetNetworkInfo(ConnectivityType.Wifi);
                if (Android.Net.NetworkInfo.State.Connected == mWiFiNetworkInfo.GetState())
                {
                    //当前网络是Wi-Fi连接
                    return true;
                }

                var moWiFiNetworkInfo = cm.GetNetworkInfo(ConnectivityType.Mobile);
                if (Android.Net.NetworkInfo.State.Connected == moWiFiNetworkInfo.GetState())
                {
                    //当前网络是Mobile连接
                    return false;
                }
            }
            return false;
        }
    }
ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs
@@ -2897,8 +2897,8 @@
            // aapt resource value: 0x7F080079
            public const int hangup = 2131230841;
            
            // aapt resource value: 0x7F08008E
            public const int Icon = 2131230862;
            // aapt resource value: 0x7F08009A
            public const int Icon = 2131230874;
            
            // aapt resource value: 0x7F08007A
            public const int ic_gdmap_add = 2131230842;
@@ -2960,89 +2960,125 @@
            // aapt resource value: 0x7F08008D
            public const int ic_wd_curtain_roll_progress = 2131230861;
            
            // aapt resource value: 0x7F08008E
            public const int ic_wd_on_curtain_blinds_progress = 2131230862;
            // aapt resource value: 0x7F08008F
            public const int Loading = 2131230863;
            public const int ic_wd_on_curtain_blinds_progress2 = 2131230863;
            
            // aapt resource value: 0x7F080090
            public const int navigation_empty_icon = 2131230864;
            public const int ic_wd_on_curtain_blinds_progress_close = 2131230864;
            
            // aapt resource value: 0x7F080091
            public const int notification_action_background = 2131230865;
            public const int ic_wd_on_curtain_blinds_progress_close2 = 2131230865;
            
            // aapt resource value: 0x7F080092
            public const int notification_bg = 2131230866;
            public const int ic_wd_on_curtain_h_bg = 2131230866;
            
            // aapt resource value: 0x7F080093
            public const int notification_bg_low = 2131230867;
            public const int ic_wd_on_curtain_h_open = 2131230867;
            
            // aapt resource value: 0x7F080094
            public const int notification_bg_low_normal = 2131230868;
            public const int ic_wd_on_curtain_h_progress = 2131230868;
            
            // aapt resource value: 0x7F080095
            public const int notification_bg_low_pressed = 2131230869;
            public const int ic_wd_on_curtain_h_progress_close = 2131230869;
            
            // aapt resource value: 0x7F080096
            public const int notification_bg_normal = 2131230870;
            public const int ic_wd_on_curtain_open = 2131230870;
            
            // aapt resource value: 0x7F080097
            public const int notification_bg_normal_pressed = 2131230871;
            public const int ic_wd_on_curtain_roll_bg = 2131230871;
            
            // aapt resource value: 0x7F080098
            public const int notification_icon_background = 2131230872;
            public const int ic_wd_on_curtain_roll_progress = 2131230872;
            
            // aapt resource value: 0x7F080099
            public const int notification_template_icon_bg = 2131230873;
            // aapt resource value: 0x7F08009A
            public const int notification_template_icon_low_bg = 2131230874;
            public const int ic_wd_on_curtain_roll_progress_close = 2131230873;
            
            // aapt resource value: 0x7F08009B
            public const int notification_tile_bg = 2131230875;
            public const int Loading = 2131230875;
            
            // aapt resource value: 0x7F08009C
            public const int notify_panel_notification_icon_bg = 2131230876;
            public const int navigation_empty_icon = 2131230876;
            
            // aapt resource value: 0x7F08009D
            public const int screenshot = 2131230877;
            public const int notification_action_background = 2131230877;
            
            // aapt resource value: 0x7F08009E
            public const int screenshot_def = 2131230878;
            public const int notification_bg = 2131230878;
            
            // aapt resource value: 0x7F08009F
            public const int screenshot_sel = 2131230879;
            public const int notification_bg_low = 2131230879;
            
            // aapt resource value: 0x7F0800A0
            public const int selector_pickerview_btn = 2131230880;
            public const int notification_bg_low_normal = 2131230880;
            
            // aapt resource value: 0x7F0800A1
            public const int sure_background_def = 2131230881;
            public const int notification_bg_low_pressed = 2131230881;
            
            // aapt resource value: 0x7F0800A2
            public const int sure_background_sel = 2131230882;
            public const int notification_bg_normal = 2131230882;
            
            // aapt resource value: 0x7F0800A3
            public const int tip_background = 2131230883;
            public const int notification_bg_normal_pressed = 2131230883;
            
            // aapt resource value: 0x7F0800A4
            public const int tooltip_frame_dark = 2131230884;
            public const int notification_icon_background = 2131230884;
            
            // aapt resource value: 0x7F0800A5
            public const int tooltip_frame_light = 2131230885;
            public const int notification_template_icon_bg = 2131230885;
            
            // aapt resource value: 0x7F0800A6
            public const int unlock = 2131230886;
            public const int notification_template_icon_low_bg = 2131230886;
            
            // aapt resource value: 0x7F0800A7
            public const int unlock_def = 2131230887;
            public const int notification_tile_bg = 2131230887;
            
            // aapt resource value: 0x7F0800A8
            public const int unlock_disable = 2131230888;
            public const int notify_panel_notification_icon_bg = 2131230888;
            
            // aapt resource value: 0x7F0800A9
            public const int unlock_sel = 2131230889;
            public const int screenshot = 2131230889;
            
            // aapt resource value: 0x7F0800AA
            public const int video_background = 2131230890;
            public const int screenshot_def = 2131230890;
            // aapt resource value: 0x7F0800AB
            public const int screenshot_sel = 2131230891;
            // aapt resource value: 0x7F0800AC
            public const int selector_pickerview_btn = 2131230892;
            // aapt resource value: 0x7F0800AD
            public const int sure_background_def = 2131230893;
            // aapt resource value: 0x7F0800AE
            public const int sure_background_sel = 2131230894;
            // aapt resource value: 0x7F0800AF
            public const int tip_background = 2131230895;
            // aapt resource value: 0x7F0800B0
            public const int tooltip_frame_dark = 2131230896;
            // aapt resource value: 0x7F0800B1
            public const int tooltip_frame_light = 2131230897;
            // aapt resource value: 0x7F0800B2
            public const int unlock = 2131230898;
            // aapt resource value: 0x7F0800B3
            public const int unlock_def = 2131230899;
            // aapt resource value: 0x7F0800B4
            public const int unlock_disable = 2131230900;
            // aapt resource value: 0x7F0800B5
            public const int unlock_sel = 2131230901;
            // aapt resource value: 0x7F0800B6
            public const int video_background = 2131230902;
            
            static Drawable()
            {
ZigbeeApp/Shared/Common/CommonPage.cs
old mode 100755 new mode 100644
@@ -28,6 +28,7 @@
        public static Loading Loading = new Loading();
        public void Show()
        {
            //if (Application.IsPad)
            //{
            //    Application.DesignWidth = 2048;
@@ -43,6 +44,11 @@
            Application.MainPage.AddChidren(Loading);
            //}
            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/DLL/Android/Shared.Droid.HDLWidget.dll
old mode 100755 new mode 100644 Binary files differ
ZigbeeApp/Shared/DLL/Android/Shared.Droid.dll
old mode 100755 new mode 100644 Binary files differ
ZigbeeApp/Shared/DLL/Android/Shared.Droid.xml
New file
Diff too large
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.TBL.dll
old mode 100755 new mode 100644 Binary files differ
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.dll
old mode 100755 new mode 100644 Binary files differ
ZigbeeApp/Shared/DLL/IOS/Shared.IOS.xml
New file
Diff too large
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -479,8 +479,17 @@
                    accounts.Add("Latitude", latitudW.ToString());
                    accounts.Add("Longitude", longitudeH.ToString());
                    accounts.Add("Radius", mRadius.ToString());
                    if (Send.It_Exist == "0")
                    {
                        //如果没有开启GPS服务,打开服务并且保存状态在本地;
                        Application.StartGPSLocationService();
                        Send.SaveLocalFile("GPS_File", "1");
                    }
                    LogicIfon.Addaccounts(accounts);
                    LogicIfon.AddLocationconditions(LocationConditionsInfo);
                    var logicCommunalPage = new LogicCommunalPage();
                    UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                    UserView.HomePage.Instance.PageIndex += 1;
ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs
@@ -537,6 +537,13 @@
                        alert.ConfirmClickEvent += () =>
                        {
                            Common.Logic.CurrentLogic.Conditions.Remove(conditions);
                            var exist = Common.Logic.CurrentLogic.Conditions.Find((obj) => obj["Type"] == "7");
                            if (exist == null)
                            {
                                //如果没有开启GPS服务,打开服务并且保存状态在本地;
                                Application.StopGPSLocationService();
                                Send.SaveLocalFile("GPS_File", "0");
                            }
                            selecteddevice.selecetdFrameLayout.RemoveFromParent();
                            //var logicCommunalPage = new LogicCommunalPage();
                            //UserView.HomePage.Instance.AddChidren(logicCommunalPage);
ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -12,6 +12,7 @@
{
    public class Send
    {
        #region  ----Logic所有发送命令
        /// <summary>
        /// 获取LogicId的方法
@@ -1324,6 +1325,22 @@
        #endregion
        #region  存取本地文件的方法 ---暂时不用合并该方法---
        /// <summary>
        /// 判断是否开启GPS服务
        /// </summary>
        public static string It_Exist
        {
            get
            {
                //读取本地GPS服务状态
                if (ReadLocalFile("GPS_File") == "0")
                {
                    return "0";
                }
                return "1";
            }
        }
        /// <summary>
        /// 文件保存
        /// </summary>
@@ -1337,20 +1354,27 @@
            var byteData = System.Text.Encoding.UTF8.GetBytes(data);
            //写入数据;
            Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData);
        }
        /// <summary>
        /// 文件保存
        /// </summary>
        /// <param name="FileName">文件路径</param>
        /// <param name="data">字符串</param>
        public static void SaveLocalFile(string FileName, string data)
        {
            //先序列化数据;
            //数据转换为字节流;
            var byteData = System.Text.Encoding.UTF8.GetBytes(data);
            //写入数据;
            Shared.IO.FileUtils.WriteFileByBytes(FileName, byteData);
        }
        /// <summary>
        /// 文件读取
        /// </summary>
        /// <param name="FileName">文件路径</param>
        /// <returns></returns>
        public static string ReadLocalFile(string FileName)
        {
            if (System.IO.File.Exists(FileName) == false)
            {
                ///判断是否有文件;
                return null;
            }
        {
            //读出保存该路径的文件;
            var varByte = Shared.IO.FileUtils.ReadFile(FileName);
            //字节流转换为字符串;