JLChen
2021-01-05 f500e14c0a994487070380c50c85e0929cbc8e63
2021-01-05 1.更新
9个文件已修改
783 ■■■■ 已修改文件
Crabtree/.vs/SmartHome/xs/UserPrefs.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/DroidService/Web References/service.hdlcontrol.com_WebServiceAirQuality/Reference.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/DroidService/Web References/service.hdlcontrol.com_push/Reference.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/IosService/Web References/service.hdlcontrol.com_WebServiceAirQuality/Reference.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/IosService/Web References/service.hdlcontrol.com_push/Reference.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorHistoryPage.cs 732 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/dll/IOS/JLJailBreak.dll 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/UserPrefs.xml
@@ -1,15 +1,24 @@
<Properties StartupConfiguration="{9D9EF20B-6E65-4A65-92BF-567EBF1E1443}|Default">
  <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.364c4b3158493098" />
  <MonoDevelop.Ide.Workbench>
<Properties StartupConfiguration="{1D83BF28-BA88-4152-BA41-D7EFE90A5437}|Default">
  <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
  <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorPage.cs">
    <Files>
      <File FileName="SmartHome/UI/SimpleControl/CommonPage.cs" Line="13" Column="22" />
      <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" Line="405" Column="48" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorHistoryPage.cs" Line="6" Column="41" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorPage.cs" Line="197" Column="49" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="SmartHome" expanded="True">
            <Node name="ON.Ios" expanded="True" selected="True" />
            <Node name="Shared" expanded="True">
              <Node name="HDL" expanded="True">
                <Node name="Operation" expanded="True">
                  <Node name="ResponseEntity" expanded="True" />
              <Node name="UI" expanded="True">
                <Node name="SimpleControl" expanded="True">
                  <Node name="Phone" expanded="True">
                    <Node name="Sensor" expanded="True">
                      <Node name="UserSensorPage.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
            </Node>
@@ -25,12 +34,10 @@
    <String>Shared.IOS/Shared.IOS.csproj</String>
    <String>DroidLib/DroidLib.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" />
  <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.08FD445C-3EE8-4ED2-BF28-B42ADD0DA92C" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/jlchen/JLChen/ProjectsCode/HDLGit/CrabtreeOn/Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs" relfile="SmartHome/UI/SimpleControl/Phone/Room/UserDeviceListPage.cs" line="477" column="11" />
    </BreakpointStore>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
</Properties>
Crabtree/DroidService/Web References/service.hdlcontrol.com_WebServiceAirQuality/Reference.cs
@@ -33,7 +33,7 @@
        {
            this.Url = "http://service.hdlcontrol.com:8000/WebService/WebServiceAirQuality.asmx";
#if Crabtree
            this.Url = "https://homeautomation.havells.com/api/WebService/WebServiceAirQuality.asmx";
            this.Url = "https://smarth-api.havells.com/api/WebService/WebServiceAirQuality.asmx";
#endif
        }
        
Crabtree/DroidService/Web References/service.hdlcontrol.com_push/Reference.cs
@@ -45,7 +45,7 @@
        {
            this.Url = "http://service.hdlcontrol.com:8000/WebService/WebServicePush.asmx";
#if Crabtree
            this.Url = "https://homeautomation.havells.com/api/WebService/WebServicePush.asmx";
            this.Url = "https://smarth-api.havells.com/api/WebService/WebServicePush.asmx";
#endif
        }
        
Crabtree/IosService/Web References/service.hdlcontrol.com_WebServiceAirQuality/Reference.cs
@@ -31,7 +31,7 @@
        {
            this.Url = "http://service.hdlcontrol.com:8000/WebService/WebServiceAirQuality.asmx";
            #if Crabtree
            this.Url = "https://homeautomation.havells.com/api/WebService/WebServiceAirQuality.asmx";
            this.Url = "https://smarth-api.havells.com/api/WebService/WebServiceAirQuality.asmx";
            #endif
        }
        
Crabtree/IosService/Web References/service.hdlcontrol.com_push/Reference.cs
@@ -45,7 +45,7 @@
        {
            this.Url = "http://service.hdlcontrol.com:8000/WebService/WebServicePush.asmx";
            #if Crabtree
            this.Url = "https://homeautomation.havells.com/api/WebService/WebServicePush.asmx";
            this.Url = "https://smarth-api.havells.com/api/WebService/WebServicePush.asmx";
            #endif
        }
        
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
@@ -26,7 +26,7 @@
                        //127.0.0.1
                        if (ip == "0.0.0.0") {
                            try {
                                ip = System.Net.Dns.GetHostEntry ("homeautomation.havells.com").AddressList [0].ToString ();
                                ip = System.Net.Dns.GetHostEntry ("smarth-api.havells.com").AddressList [0].ToString ();
                            } catch { }
                        }
                        return new System.Net.IPEndPoint (System.Net.IPAddress.Parse (ip), 9999);
@@ -1243,7 +1243,7 @@
                            common.isMixBox = true;
                        } else {
                            Application.RunOnMainThread (() => {
                                MainPage.Loading.Start ("Search for device:" + devcieTempName);
                                //MainPage.Loading.Start ("Search for device:" + devcieTempName);
                                ++searchTotal;
                                GuideSettingGateway.InitSearchDeviceList (common);
                                for (int k = 1; k <= common.LoopCount; k++) {
Crabtree/SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorHistoryPage.cs
@@ -1,393 +1,393 @@
using System;
using System.Collections.Generic;
//using System;
//using System.Collections.Generic;
namespace Shared.SimpleControl.Phone
{
    public class UserSensorHistoryPage :FrameLayout
    {
        public UserSensorHistoryPage ()
        {
        }
//namespace Shared.SimpleControl.Phone
//{
//    public class UserSensorHistoryPage :FrameLayout
//    {
//        public UserSensorHistoryPage ()
//        {
//        }
        public void ShowPage(Common sensor)
        {
#if DEBUG
            //UserConfig.Instance.GatewayMAC = "00005AF30A845F00";
#endif
            string unitText = "PM2.5";
            string titleText = "";
            switch (sensor.Type) {
            case DeviceType.SensorPM25:
                titleText = "PM2.5";
                unitText = @"μg/m³";
                break;
            case DeviceType.SensorCO2:
                titleText = "CO2";
                unitText = "ppm";
                break;
            case DeviceType.SensorTVOC:
                titleText = "TVOC";
                unitText = "ppm";
                break;
            case DeviceType.SensorTemperature:
                titleText = Language.StringByID (R.MyInternationalizationString.Temp);
                unitText = "°C";
                break;
            case DeviceType.SensorHumidity:
                titleText = Language.StringByID (R.MyInternationalizationString.Humidity);
                unitText = "%";
                break;
            }
//        public void ShowPage(Common sensor)
//        {
//#if DEBUG
//            //UserConfig.Instance.GatewayMAC = "00005AF30A845F00";
//#endif
//            string unitText = "PM2.5";
//            string titleText = "";
//            switch (sensor.Type) {
//            case DeviceType.SensorPM25:
//                titleText = "PM2.5";
//                unitText = @"μg/m³";
//                break;
//            case DeviceType.SensorCO2:
//                titleText = "CO2";
//                unitText = "ppm";
//                break;
//            case DeviceType.SensorTVOC:
//                titleText = "TVOC";
//                unitText = "ppm";
//                break;
//            case DeviceType.SensorTemperature:
//                titleText = Language.StringByID (R.MyInternationalizationString.Temp);
//                unitText = "°C";
//                break;
//            case DeviceType.SensorHumidity:
//                titleText = Language.StringByID (R.MyInternationalizationString.Humidity);
//                unitText = "%";
//                break;
//            }
            List<SensorPushHistoryRes> revertData = new List<SensorPushHistoryRes> ();
            this.BackgroundColor = SkinStyle.Current.MainColor;
            #region 标题
            var topView = new FrameLayout () {
                Y = Application.GetRealHeight (36),
                Height = Application.GetRealHeight (90),
                BackgroundColor = SkinStyle.Current.MainColor
            };
            AddChidren (topView);
//            List<SensorPushHistoryRes> revertData = new List<SensorPushHistoryRes> ();
//            this.BackgroundColor = SkinStyle.Current.MainColor;
//            #region 标题
//            var topView = new FrameLayout () {
//                Y = Application.GetRealHeight (36),
//                Height = Application.GetRealHeight (90),
//                BackgroundColor = SkinStyle.Current.MainColor
//            };
//            AddChidren (topView);
            var title = new Button () {
                TextAlignment = TextAlignment.Center,
                Text = titleText +" " + Language.StringByID(R.MyInternationalizationString.DataHistory) ,
                //TextID = R.MyInternationalizationString.SetPush,
                TextColor = SkinStyle.Current.TextColor1,
                TextSize = 19,
            };
            topView.AddChidren (title);
//            var title = new Button () {
//                TextAlignment = TextAlignment.Center,
//                Text = titleText +" " + Language.StringByID(R.MyInternationalizationString.DataHistory) ,
//                //TextID = R.MyInternationalizationString.SetPush,
//                TextColor = SkinStyle.Current.TextColor1,
//                TextSize = 19,
//            };
//            topView.AddChidren (title);
            var logo = new Button () {
                Width = Application.GetRealWidth (154),
                Height = Application.GetRealHeight (90),
                X = Application.GetRealWidth (486),
                UnSelectedImagePath = MainPage.LogoString,
            };
            topView.AddChidren (logo);
            var back = new Button () {
                Height = Application.GetRealHeight (90),
                Width = Application.GetRealWidth (85),
                UnSelectedImagePath = "Item/Back.png",
                SelectedImagePath = "Item/BackSelected.png",
            };
            topView.AddChidren (back);
            back.MouseUpEventHandler += (sender, e) => {
                (Parent as PageLayout).PageIndex -= 1;
            };
            #endregion
//            var logo = new Button () {
//                Width = Application.GetRealWidth (154),
//                Height = Application.GetRealHeight (90),
//                X = Application.GetRealWidth (486),
//                UnSelectedImagePath = MainPage.LogoString,
//            };
//            topView.AddChidren (logo);
//            var back = new Button () {
//                Height = Application.GetRealHeight (90),
//                Width = Application.GetRealWidth (85),
//                UnSelectedImagePath = "Item/Back.png",
//                SelectedImagePath = "Item/BackSelected.png",
//            };
//            topView.AddChidren (back);
//            back.MouseUpEventHandler += (sender, e) => {
//                (Parent as PageLayout).PageIndex -= 1;
//            };
//            #endregion
            FrameLayout bodyView = new FrameLayout () {
                Y = topView.Bottom,
                Height = Application.GetRealHeight(1136 -126),
                BackgroundColor = SkinStyle.Current.ViewColor,
            };
            AddChidren (bodyView);
//            FrameLayout bodyView = new FrameLayout () {
//                Y = topView.Bottom,
//                Height = Application.GetRealHeight(1136 -126),
//                BackgroundColor = SkinStyle.Current.ViewColor,
//            };
//            AddChidren (bodyView);
            FrameLayout timeView = new FrameLayout () {
                X = Application.GetRealWidth(20),
                Height = Application.GetRealHeight (200),
                Width = Application.GetRealWidth (600),
            };
            bodyView.AddChidren (timeView);
            Button btnYear = new Button () {
                Y = Application.GetRealHeight (50),
                Width = Application.GetRealWidth (150),
                Height = Application.GetRealHeight (80),
                BorderColor = SkinStyle.Current.BorderColor,
                BorderWidth = 1,
                Radius = 1,
                TextID = R.MyInternationalizationString.Year,
                TextAlignment = TextAlignment.Center,
                TextColor = SkinStyle.Current.TextColor1,
                SelectedTextColor = SkinStyle.Current.SelectedColor,
            };
            timeView.AddChidren (btnYear);
//            FrameLayout timeView = new FrameLayout () {
//                X = Application.GetRealWidth(20),
//                Height = Application.GetRealHeight (200),
//                Width = Application.GetRealWidth (600),
//            };
//            bodyView.AddChidren (timeView);
//            Button btnYear = new Button () {
//                Y = Application.GetRealHeight (50),
//                Width = Application.GetRealWidth (150),
//                Height = Application.GetRealHeight (80),
//                BorderColor = SkinStyle.Current.BorderColor,
//                BorderWidth = 1,
//                Radius = 1,
//                TextID = R.MyInternationalizationString.Year,
//                TextAlignment = TextAlignment.Center,
//                TextColor = SkinStyle.Current.TextColor1,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//            };
//            timeView.AddChidren (btnYear);
            Button btnMonth = new Button () {
                X = btnYear.Right,
                Y = Application.GetRealHeight (50),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight (80),
                BorderColor = SkinStyle.Current.BorderColor,
                BorderWidth = 1,
                Radius = 1,
                Text = GetMonthText(DateTime.Now.Month),
                TextAlignment = TextAlignment.Center,
                TextColor= SkinStyle.Current.TextColor1,
                SelectedTextColor = SkinStyle.Current.SelectedColor,
            };
            timeView.AddChidren (btnMonth);
//            Button btnMonth = new Button () {
//                X = btnYear.Right,
//                Y = Application.GetRealHeight (50),
//                Width = Application.GetRealWidth(150),
//                Height = Application.GetRealHeight (80),
//                BorderColor = SkinStyle.Current.BorderColor,
//                BorderWidth = 1,
//                Radius = 1,
//                Text = GetMonthText(DateTime.Now.Month),
//                TextAlignment = TextAlignment.Center,
//                TextColor= SkinStyle.Current.TextColor1,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//            };
//            timeView.AddChidren (btnMonth);
            Button btnDay = new Button () {
                X = btnMonth.Right,
                Y = Application.GetRealHeight (50),
                Width = Application.GetRealWidth (150),
                Height = Application.GetRealHeight(80),
                BorderColor = SkinStyle.Current.BorderColor,
                BorderWidth = 1,
                Radius = 1,
                TextID = R.MyInternationalizationString.CurDay,
                TextAlignment = TextAlignment.Center,
                TextColor = SkinStyle.Current.TextColor1,
                SelectedTextColor = SkinStyle.Current.SelectedColor,
            };
            timeView.AddChidren (btnDay);
//            Button btnDay = new Button () {
//                X = btnMonth.Right,
//                Y = Application.GetRealHeight (50),
//                Width = Application.GetRealWidth (150),
//                Height = Application.GetRealHeight(80),
//                BorderColor = SkinStyle.Current.BorderColor,
//                BorderWidth = 1,
//                Radius = 1,
//                TextID = R.MyInternationalizationString.CurDay,
//                TextAlignment = TextAlignment.Center,
//                TextColor = SkinStyle.Current.TextColor1,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//            };
//            timeView.AddChidren (btnDay);
            Button btnTime = new Button () {
                X = btnDay.Right,
                Y = Application.GetRealHeight (50),
                Width = Application.GetRealWidth (150),
                Height = Application.GetRealHeight (80),
                BorderColor = SkinStyle.Current.BorderColor,
                BorderWidth = 1,
                Radius = 1,
                TextID = R.MyInternationalizationString.Days7,
                TextAlignment = TextAlignment.Center,
                TextColor = SkinStyle.Current.TextColor1,
                SelectedTextColor = SkinStyle.Current.SelectedColor,
            };
            timeView.AddChidren (btnTime);
//            Button btnTime = new Button () {
//                X = btnDay.Right,
//                Y = Application.GetRealHeight (50),
//                Width = Application.GetRealWidth (150),
//                Height = Application.GetRealHeight (80),
//                BorderColor = SkinStyle.Current.BorderColor,
//                BorderWidth = 1,
//                Radius = 1,
//                TextID = R.MyInternationalizationString.Days7,
//                TextAlignment = TextAlignment.Center,
//                TextColor = SkinStyle.Current.TextColor1,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//            };
//            timeView.AddChidren (btnTime);
            FrameLayout chartView = new FrameLayout () {
                Y = Application.GetRealHeight(200),
                Height = Application.GetRealHeight(600),
            };
            bodyView.AddChidren (chartView);
//            FrameLayout chartView = new FrameLayout () {
//                Y = Application.GetRealHeight(200),
//                Height = Application.GetRealHeight(600),
//            };
//            bodyView.AddChidren (chartView);
            //MyEchartsView myEchartsView = new MyEchartsView ();
            //chartView.AddChidren (myEchartsView);
            Random random = new Random ();
            List<string> xstrings = new List<string> ();
            List<string> ystrings = new List<string> ();
//            //MyEchartsView myEchartsView = new MyEchartsView ();
//            //chartView.AddChidren (myEchartsView);
//            Random random = new Random ();
//            List<string> xstrings = new List<string> ();
//            List<string> ystrings = new List<string> ();
         
            btnMonth.BorderColor = SkinStyle.Current.SelectedColor;
            btnMonth.IsSelected = true;
            btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
            btnDay.IsSelected = btnDay.IsSelected = false;
//            btnMonth.BorderColor = SkinStyle.Current.SelectedColor;
//            btnMonth.IsSelected = true;
//            btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
//            btnDay.IsSelected = btnDay.IsSelected = false;
            btnYear.MouseUpEventHandler += (df, fd) => {
                xstrings.Clear ();
                ystrings.Clear ();
                btnYear.BorderColor = SkinStyle.Current.SelectedColor;
                btnYear.IsSelected = true;
                btnMonth.BorderColor = btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
                btnMonth.IsSelected = btnDay.IsSelected = btnTime.IsSelected = false;
                System.Threading.Tasks.Task.Run (() => {
                    try {
                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowYear, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
                        if (revertObj != null) {
                            Application.RunOnMainThread (() => {
                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
                                    int ass = 0;
                                    for (int i = 0; i < revertData.Count;i++) {
                                        if (revertData [i].TargetValue.ToString () == "NaN") {
                                            ass = 0;
                                        } else {
                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
                                        }
                                        xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().Month.ToString ());
                                        ystrings.Add (ass.ToString ());
                                    }
                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
                                }
                            });
                        }
                    } catch (Exception ex) {
                        Utlis.WriteLine (ex.ToString ());
                    } finally {
                        Application.RunOnMainThread (() => {
                            MainPage.Loading.Hide ();
                        });
                    }
                });
//            btnYear.MouseUpEventHandler += (df, fd) => {
//                xstrings.Clear ();
//                ystrings.Clear ();
//                btnYear.BorderColor = SkinStyle.Current.SelectedColor;
//                btnYear.IsSelected = true;
//                btnMonth.BorderColor = btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
//                btnMonth.IsSelected = btnDay.IsSelected = btnTime.IsSelected = false;
//                System.Threading.Tasks.Task.Run (() => {
//                    try {
//                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowYear, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
//                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
//                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
//                        if (revertObj != null) {
//                            Application.RunOnMainThread (() => {
//                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
//                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
//                                    int ass = 0;
//                                    for (int i = 0; i < revertData.Count;i++) {
//                                        if (revertData [i].TargetValue.ToString () == "NaN") {
//                                            ass = 0;
//                                        } else {
//                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
//                                        }
//                                        xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().Month.ToString ());
//                                        ystrings.Add (ass.ToString ());
//                                    }
//                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
//                                }
//                            });
//                        }
//                    } catch (Exception ex) {
//                        Utlis.WriteLine (ex.ToString ());
//                    } finally {
//                        Application.RunOnMainThread (() => {
//                            MainPage.Loading.Hide ();
//                        });
//                    }
//                });
            };
//            };
           
            btnMonth.MouseUpEventHandler += (df, fd) => {
                xstrings.Clear ();
                ystrings.Clear ();
                btnMonth.BorderColor = SkinStyle.Current.SelectedColor;
                btnMonth.IsSelected = true;
                btnYear.IsSelected = btnDay.IsSelected = btnDay.IsSelected = false;
                btnYear.BorderColor = btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
//            btnMonth.MouseUpEventHandler += (df, fd) => {
//                xstrings.Clear ();
//                ystrings.Clear ();
//                btnMonth.BorderColor = SkinStyle.Current.SelectedColor;
//                btnMonth.IsSelected = true;
//                btnYear.IsSelected = btnDay.IsSelected = btnDay.IsSelected = false;
//                btnYear.BorderColor = btnDay.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
                Dialog dialogChooseMonth = new Dialog ();
//                Dialog dialogChooseMonth = new Dialog ();
                var chooseMonthView = new FrameLayout () {
                BackgroundColor = SkinStyle.Current.Black50Transparent,
                };
                dialogChooseMonth.AddChidren (chooseMonthView);
                chooseMonthView.MouseUpEventHandler += (ddfd, fdfd) => {
                    dialogChooseMonth.Close ();
                };
//                var chooseMonthView = new FrameLayout () {
//                BackgroundColor = SkinStyle.Current.Black50Transparent,
//                };
//                dialogChooseMonth.AddChidren (chooseMonthView);
//                chooseMonthView.MouseUpEventHandler += (ddfd, fdfd) => {
//                    dialogChooseMonth.Close ();
//                };
                VerticalScrolViewLayout chooseMothView = new VerticalScrolViewLayout () {
                    Y = Application.GetRealHeight (636),
                    Height = Application.GetRealHeight(500),
                    BackgroundColor = SkinStyle.Current.DialogColor,
                };
                chooseMonthView.AddChidren (chooseMothView);
//                VerticalScrolViewLayout chooseMothView = new VerticalScrolViewLayout () {
//                    Y = Application.GetRealHeight (636),
//                    Height = Application.GetRealHeight(500),
//                    BackgroundColor = SkinStyle.Current.DialogColor,
//                };
//                chooseMonthView.AddChidren (chooseMothView);
                for (int ii = 1; ii < DateTime.Now.Month+1; ii++) {
                    Button btn = new Button () {
                        Height = Application.GetRealHeight (100),
                        TextAlignment = TextAlignment.Center,
                        TextColor = SkinStyle.Current.TextColor,
                        Tag = ii
                    };
                    btn.Text = GetMonthText (ii);
                    chooseMothView.AddChidren (btn);
                    btn.MouseUpEventHandler += (dff, ffd) => {
                        chooseMothView.RemoveAll ();
                        chooseMothView.RemoveFromParent ();
                        dialogChooseMonth.Close ();
                        btnMonth.Text = ((Button)dff).Text;
                        System.Threading.Tasks.Task.Run (() => {
                            try {
                                var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowMonth, LoopID = 1, NowMonth = Convert.ToInt32 (((Button)dff).Tag), MAC = UserConfig.Instance.GatewayMAC };
                                var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                                var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
                                if (revertObj != null) {
                                    Application.RunOnMainThread (() => {
                                        if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                                            revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
                                            int ass = 0;
                                            for (int i = 0; i < revertData.Count; i++) {
                                                if (revertData [i].TargetValue.ToString () == "NaN") {
                                                    ass = 0;
                                                } else {
                                                    ass = Convert.ToInt32 (revertData [i].TargetValue);
                                                }
                                                xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().Day.ToString ());
                                                ystrings.Add (ass.ToString ());
                                            }
                                            //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
                                        }
                                    });
                                }
                            } catch (Exception ex) {
                                Utlis.WriteLine (ex.ToString ());
                            } finally {
                                Application.RunOnMainThread (() => {
                                    MainPage.Loading.Hide ();
                                });
                            }
                        });
                    };
//                for (int ii = 1; ii < DateTime.Now.Month+1; ii++) {
//                    Button btn = new Button () {
//                        Height = Application.GetRealHeight (100),
//                        TextAlignment = TextAlignment.Center,
//                        TextColor = SkinStyle.Current.TextColor,
//                        Tag = ii
//                    };
//                    btn.Text = GetMonthText (ii);
//                    chooseMothView.AddChidren (btn);
//                    btn.MouseUpEventHandler += (dff, ffd) => {
//                        chooseMothView.RemoveAll ();
//                        chooseMothView.RemoveFromParent ();
//                        dialogChooseMonth.Close ();
//                        btnMonth.Text = ((Button)dff).Text;
//                        System.Threading.Tasks.Task.Run (() => {
//                            try {
//                                var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowMonth, LoopID = 1, NowMonth = Convert.ToInt32 (((Button)dff).Tag), MAC = UserConfig.Instance.GatewayMAC };
//                                var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
//                                var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
//                                if (revertObj != null) {
//                                    Application.RunOnMainThread (() => {
//                                        if (revertObj.StateCode.ToUpper() == "SUCCESS") {
//                                            revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
//                                            int ass = 0;
//                                            for (int i = 0; i < revertData.Count; i++) {
//                                                if (revertData [i].TargetValue.ToString () == "NaN") {
//                                                    ass = 0;
//                                                } else {
//                                                    ass = Convert.ToInt32 (revertData [i].TargetValue);
//                                                }
//                                                xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().Day.ToString ());
//                                                ystrings.Add (ass.ToString ());
//                                            }
//                                            //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
//                                        }
//                                    });
//                                }
//                            } catch (Exception ex) {
//                                Utlis.WriteLine (ex.ToString ());
//                            } finally {
//                                Application.RunOnMainThread (() => {
//                                    MainPage.Loading.Hide ();
//                                });
//                            }
//                        });
//                    };
                    Button btnLine = new Button (){
                        BackgroundColor = SkinStyle.Current.Black50Transparent,
                        Height = 1
                    };
                    chooseMothView.AddChidren (btnLine);
                }
                dialogChooseMonth.Show ();
            };
            btnDay.MouseUpEventHandler += (df, fd) => {
                xstrings.Clear ();
                ystrings.Clear ();
                btnDay.BorderColor = SkinStyle.Current.SelectedColor;
                btnDay.IsSelected = true;
                btnYear.BorderColor = btnMonth.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
                btnYear.IsSelected = btnMonth.IsSelected = btnTime.IsSelected = false;
                System.Threading.Tasks.Task.Run (() => {
                    try {
                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowDay, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
                        if (revertObj != null) {
                            Application.RunOnMainThread (() => {
                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
                                    int ass = 0;
                                    for (int i = 0; i < revertData.Count; i++) {
                                        if (revertData [i].TargetValue.ToString () == "NaN") {
                                            ass = 0;
                                        } else {
                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
                                        }
                                        xstrings.Add (revertData [i].CreatedOnUtc.Hour.ToString ());
                                        ystrings.Add (ass.ToString ());
                                    }
                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
                                }
                            });
                        }
                    } catch (Exception ex) {
                        Utlis.WriteLine (ex.ToString ());
                    } finally {
                        Application.RunOnMainThread (() => {
                            MainPage.Loading.Hide ();
                        });
                    }
                });
//                    Button btnLine = new Button (){
//                        BackgroundColor = SkinStyle.Current.Black50Transparent,
//                        Height = 1
//                    };
//                    chooseMothView.AddChidren (btnLine);
//                }
//                dialogChooseMonth.Show ();
//            };
//            btnDay.MouseUpEventHandler += (df, fd) => {
//                xstrings.Clear ();
//                ystrings.Clear ();
//                btnDay.BorderColor = SkinStyle.Current.SelectedColor;
//                btnDay.IsSelected = true;
//                btnYear.BorderColor = btnMonth.BorderColor = btnTime.BorderColor = SkinStyle.Current.BorderColor;
//                btnYear.IsSelected = btnMonth.IsSelected = btnTime.IsSelected = false;
//                System.Threading.Tasks.Task.Run (() => {
//                    try {
//                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.NowDay, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
//                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
//                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
//                        if (revertObj != null) {
//                            Application.RunOnMainThread (() => {
//                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
//                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
//                                    int ass = 0;
//                                    for (int i = 0; i < revertData.Count; i++) {
//                                        if (revertData [i].TargetValue.ToString () == "NaN") {
//                                            ass = 0;
//                                        } else {
//                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
//                                        }
//                                        xstrings.Add (revertData [i].CreatedOnUtc.Hour.ToString ());
//                                        ystrings.Add (ass.ToString ());
//                                    }
//                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
//                                }
//                            });
//                        }
//                    } catch (Exception ex) {
//                        Utlis.WriteLine (ex.ToString ());
//                    } finally {
//                        Application.RunOnMainThread (() => {
//                            MainPage.Loading.Hide ();
//                        });
//                    }
//                });
            };
//            };
          
            Action action = () => {
                xstrings.Clear ();
                ystrings.Clear ();
                btnTime.BorderColor = SkinStyle.Current.SelectedColor;
                btnTime.IsSelected = true;
                btnYear.BorderColor = btnMonth.BorderColor = btnDay.BorderColor = SkinStyle.Current.BorderColor;
                btnYear.IsSelected = btnMonth.IsSelected = btnDay.IsSelected = false;
                MainPage.Loading.Start ("Please wait...");
                System.Threading.Tasks.Task.Run (() => {
                    try {
                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.LatelySevenDay, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
                        if (revertObj != null) {
                            Application.RunOnMainThread (() => {
                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
                                    int ass = 0;
                                    for (int i = 0; i < revertData.Count; i++) {
                                        if (revertData [i].TargetValue.ToString () == "NaN") {
                                            ass = 0;
                                        } else {
                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
                                        }
                                        xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().ToString ("MM/dd"));
                                        ystrings.Add (ass.ToString ());
                                    }
                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
                                }
                            });
                        }
                    } catch (Exception ex) {
                        Utlis.WriteLine (ex.ToString ());
                    } finally {
                        Application.RunOnMainThread (() => {
                            MainPage.Loading.Hide ();
                        });
                    }
                });
//            Action action = () => {
//                xstrings.Clear ();
//                ystrings.Clear ();
//                btnTime.BorderColor = SkinStyle.Current.SelectedColor;
//                btnTime.IsSelected = true;
//                btnYear.BorderColor = btnMonth.BorderColor = btnDay.BorderColor = SkinStyle.Current.BorderColor;
//                btnYear.IsSelected = btnMonth.IsSelected = btnDay.IsSelected = false;
//                MainPage.Loading.Start ("Please wait...");
//                System.Threading.Tasks.Task.Run (() => {
//                    try {
//                        var requestObj = new SensorPushHistory () { SubnetID = sensor.SubnetID, DeviceID = sensor.DeviceID, LargeType = sensor.BigClass, SmallType = sensor.MinClass, QueryType = QueryType.LatelySevenDay, LoopID = 1, NowMonth = 0, MAC = UserConfig.Instance.GatewayMAC };
//                        var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
//                        var revertObj = MainPage.RequestHttps ("GetSensorPushHistory", requestJson);
//                        if (revertObj != null) {
//                            Application.RunOnMainThread (() => {
//                                if (revertObj.StateCode.ToUpper() == "SUCCESS") {
//                                    revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SensorPushHistoryRes>> (revertObj.ResponseData.ToString ());
//                                    int ass = 0;
//                                    for (int i = 0; i < revertData.Count; i++) {
//                                        if (revertData [i].TargetValue.ToString () == "NaN") {
//                                            ass = 0;
//                                        } else {
//                                            ass = Convert.ToInt32 (revertData [i].TargetValue);
//                                        }
//                                        xstrings.Add (revertData [i].CreatedOnUtc.ToLocalTime ().ToString ("MM/dd"));
//                                        ystrings.Add (ass.ToString ());
//                                    }
//                                    //myEchartsView.Show (unitText, xstrings.ToArray (), ystrings.ToArray ());
//                                }
//                            });
//                        }
//                    } catch (Exception ex) {
//                        Utlis.WriteLine (ex.ToString ());
//                    } finally {
//                        Application.RunOnMainThread (() => {
//                            MainPage.Loading.Hide ();
//                        });
//                    }
//                });
            };
            btnTime.MouseUpEventHandler += (df, fd) => {
                action ();
            };
//            };
//            btnTime.MouseUpEventHandler += (df, fd) => {
//                action ();
//            };
            action ();
        }
//            action ();
//        }
        string GetMonthText (int InMonth)
        {
            string strReturn = "";
            if (Language.CurrentLanguage == "English") {
                string strParaMonthn = "Jan._Feb._Mar._Apr._May_Jun._Jul._Aug._Sep._Oct._Nov._Dec.";
                string [] strSubMonth = strParaMonthn.Split ("_".ToCharArray ());
                strReturn = strSubMonth [InMonth - 1];
            } else {
                strReturn = InMonth + "  月";
            }
            return strReturn;
        }
    }
}
//        string GetMonthText (int InMonth)
//        {
//            string strReturn = "";
//            if (Language.CurrentLanguage == "English") {
//                string strParaMonthn = "Jan._Feb._Mar._Apr._May_Jun._Jul._Aug._Sep._Oct._Nov._Dec.";
//                string [] strSubMonth = strParaMonthn.Split ("_".ToCharArray ());
//                strReturn = strSubMonth [InMonth - 1];
//            } else {
//                strReturn = InMonth + "  月";
//            }
//            return strReturn;
//        }
//    }
//}
Crabtree/SmartHome/UI/SimpleControl/Phone/Sensor/UserSensorPage.cs
@@ -194,10 +194,10 @@
            updateTextThreadList.Add (thread);
            thread.Start ();
            EventHandler<MouseEventArgs> eventHandler = (dd, ff) => {
                UserSensorHistoryPage usp = new UserSensorHistoryPage ();
                UserMiddle.DevicePageView.AddChidren (usp);
                usp.ShowPage (sensor);
                UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
                //UserSensorHistoryPage usp = new UserSensorHistoryPage ();
                //UserMiddle.DevicePageView.AddChidren (usp);
                //usp.ShowPage (sensor);
                //UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
            };
            btnUnit.MouseUpEventHandler += eventHandler;
            bntTitle.MouseUpEventHandler += eventHandler;
Crabtree/SmartHome/dll/IOS/JLJailBreak.dll
Binary files differ