| | |
| | | 579=Cancellation |
| | | 580=Are you sure to delete this combined dimming? |
| | | 581= |
| | | 582=Are you sure to delete this device? |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 579=立即注销 |
| | | 580=确定删除该组合调光吗? |
| | | 581= |
| | | |
| | | 582=确定删除该设备吗? |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 579=Cancellation |
| | | 580=Are you sure to delete this combined dimming? |
| | | 581= |
| | | 582=Are you sure to delete this device? |
| | | |
| | | |
| | | 2532=Visitor Invitation Record |
| | |
| | | 579=Cancellation |
| | | 580=Are you sure to delete this combined dimming? |
| | | 581= |
| | | 582=Are you sure to delete this device? |
| | | |
| | | |
| | | |
| | |
| | | 579=Cancellation |
| | | 580=Are you sure to delete this combined dimming? |
| | | 581= |
| | | 582=Are you sure to delete this device? |
| | | |
| | | |
| | | 1000=Влажност в стаята |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211181"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.3" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202211221"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!--友盟--> |
| | | <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> |
| | |
| | | //} |
| | | //else |
| | | //{ |
| | | // Console.WriteLine("HHH 网络变化但处于后台"); |
| | | //Console.WriteLine("HHH 网络变化但处于后台"+internetStatus); |
| | | //} |
| | | |
| | | //网络变化处理 |
| | |
| | | //} |
| | | mForceUpdateInfo.ReasonStr = appVersionRes.remark; |
| | | |
| | | Application.RunOnMainThread(() => |
| | | if (appVersionRes.version != MainPage.VersionString) |
| | | { |
| | | ShowForceUpdateDialog(mForceUpdateInfo); |
| | | }); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | ShowForceUpdateDialog(mForceUpdateInfo); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false) |
| | | { |
| | | MainPage.Log($"网络状态变化,当前网络:{internetStatus} 是否后台:{IsEnterBackground.ToString()}"); |
| | | MainPage.LinkHdlMqttCount = 0; |
| | | //网络状态变化 重置网关状态重新搜索 |
| | | Control.Ins.GatewayOnline_Cloud = false; |
| | | Control.Ins.GatewayOnline_Local = false; |
| | |
| | | if (internetStatus == 0)//没有网络连接 0 |
| | | { |
| | | MainPage.InternetStatus = 0; |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | } |
| | | else if (internetStatus == 1)//3,4G的网络连接 1 |
| | | { |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 确定删除该设备吗? |
| | | /// </summary> |
| | | public const int AreYouSureToDeleteThisDevice = 582; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public static async Task StartCloudMqtt() |
| | | { |
| | | if (MainPage.InternetStatus == 0) |
| | | //没有网络的状态下尝试一下连接mqtt ,安卓的网络状态变化监听有异常,修改底层麻烦 |
| | | if (MainPage.InternetStatus == 0 && MainPage.LinkHdlMqttCount > 1) |
| | | { |
| | | return; |
| | | } |
| | | MainPage.LinkHdlMqttCount++; |
| | | |
| | | if (!UserInfo.Current.IsLogin) |
| | | { |
| | |
| | | { |
| | | IfNeedReadAllDeviceStatus = true; |
| | | Control.Ins.GatewayOnline_Cloud = true; |
| | | if(MainPage.InternetStatus == 0) |
| | | { |
| | | MainPage.InternetStatus = 1; |
| | | } |
| | | Utlis.WriteLine($"============>Mqtt远程连接成功"); |
| | | SendPushSignOut(); |
| | | }); |
| | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除第三方设备 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Delete3tyDevice(string deviceId) |
| | | { |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson); |
| | | return responsePackNew; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public const string Api_Post_IndependentRegister3TyDevcie = "/home-wisdom/app/device/independentRegister"; |
| | | /// <summary> |
| | | /// 移除第三方设备 |
| | | /// </summary> |
| | | public const string Api_Post_Remove3tyDevcie = "/home-wisdom/app/device/remove"; |
| | | /// <summary> |
| | | /// 获取设备详情 |
| | | /// </summary> |
| | | public const string Api_Post_GetDevcieInfoList = "/home-wisdom/app/device/info"; |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string version = MainPage.VersionString; |
| | | public string version = "V" + MainPage.VersionString; |
| | | ///// <summary> |
| | | ///// 软件来源,Evoyo、ON、ON_Plus |
| | | ///// </summary> |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.6.2"; |
| | | public static string VersionString = "1.6.3"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | /// </summary> |
| | | public static int InternetStatus = 2; |
| | | /// <summary> |
| | | /// 连接mqtt次数 |
| | | /// </summary> |
| | | public static int LinkHdlMqttCount = 0; |
| | | /// <summary> |
| | | /// 是否进入后台 |
| | | /// </summary> |
| | | public static bool IsEnterBackground = false; |
| | |
| | | |
| | | var btnLogo = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(85), |
| | | Y = Application.GetRealHeight(65), |
| | | UnSelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png", |
| | | SelectedImagePath = "FunctionIcon/Acst/LvJianLogo.png", |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(37), |
| | | Height = Application.GetRealHeight(37), |
| | | }; |
| | | view.AddChidren(btnLogo); |
| | | |
| | |
| | | Button btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(83), |
| | | Width = Application.GetRealWidth(210), |
| | | //Width = Application.GetRealWidth(210), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | bool isFrist = true; |
| | | foreach (var device in deviceList) |
| | | { |
| | | FrameLayout row = new FrameLayout() |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | LineColor = 0x00000000, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | if(device.spk == SPK.IpCam_Imou) |
| | | { |
| | | var btnDel = new Button() |
| | | { |
| | | TextColor = CSS_Color.TextualColor, |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextID = StringId.Del, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | row.AddRightView(btnDel); |
| | | |
| | | btnDel.MouseUpEventHandler = (sender, e) => { |
| | | Action action = () => { |
| | | var waitPage = new Loading(); |
| | | this.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var result = http.Delete3tyDevice("3452daf");// device.deviceId); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Load3tyBrandDeviceList(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.OperationFailed)+$"\r\n({result.Code})", true); |
| | | }); |
| | | } |
| | | }catch (Exception ex) |
| | | { |
| | | MainPage.Log($"删除第三方设备失败:{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if(waitPage!= null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, Language.StringByID(StringId.AreYouSureToDeleteThisDevice), action); |
| | | }; |
| | | } |
| | | |
| | | if (isFrist) |
| | | { |
| | |
| | | |
| | | VerticalScrolViewLayout contentView; |
| | | |
| | | string helloText = "上午好"; |
| | | |
| | | #region 天气控件 |
| | | Button btnOutdoorTemp; |
| | |
| | | public AcstParentPage() |
| | | { |
| | | basePage = this; |
| | | var curTime = DateTime.Now; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good morning"; |
| | | } |
| | | if (curTime.Hour >= 8 && curTime.Hour < 12) |
| | | { |
| | | helloText = "上午好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good morning"; |
| | | } |
| | | curColor = CSS.CSS_Color.MainColor; |
| | | imageFolder = "blue"; |
| | | } |
| | | else if (curTime.Hour >= 12 && curTime.Hour < 18) |
| | | { |
| | | helloText = "下午好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good afternoon"; |
| | | } |
| | | curColor = 0xFFE7914F; |
| | | imageFolder = "orange"; |
| | | } |
| | | else |
| | | { |
| | | helloText = "晚上好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good evening"; |
| | | } |
| | | |
| | | curColor = 0xFF9175F3; |
| | | imageFolder = "purple"; |
| | | } |
| | | this.function = FunctionList.List.GetAcstParentList()[0]; |
| | | this.BackgroundColor = CSS.CSS_Color.BackgroundColor; |
| | | this.AddChidren(new Button() { Height = Application.GetRealHeight(50), BackgroundColor = curColor }); |
| | | contentView = new VerticalScrolViewLayout() { |
| | | Height = Application.GetRealHeight(667 - 56), |
| | | }; |
| | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | var curTime = DateTime.Now; |
| | | string helloText = "上午好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good morning"; |
| | | } |
| | | if (curTime.Hour >= 8 && curTime.Hour < 12) |
| | | { |
| | | helloText = "上午好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good morning"; |
| | | } |
| | | curColor = CSS.CSS_Color.MainColor; |
| | | imageFolder = "blue"; |
| | | } |
| | | else if (curTime.Hour >= 12 && curTime.Hour < 18) |
| | | { |
| | | helloText = "下午好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good afternoon"; |
| | | } |
| | | curColor = 0xFFE7914F; |
| | | imageFolder = "orange"; |
| | | } |
| | | else |
| | | { |
| | | helloText = "晚上好"; |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | helloText = "Good evening"; |
| | | } |
| | | |
| | | curColor = 0xFF9175F3; |
| | | imageFolder = "purple"; |
| | | } |
| | | |
| | | #region 头部信息区域 |
| | | FrameLayout topView = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | tempValues = tempValues.Remove(tempValues.IndexOf('.'), tempValues.Length - tempValues.IndexOf('.')); |
| | | } |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "°", Language.StringByID(StringId.Temp)); |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "°","", Language.StringByID(StringId.Temp)); |
| | | } |
| | | if (humiObj != null) |
| | | { |
| | |
| | | { |
| | | humiValues = humiValues.Remove(humiValues.IndexOf('.'), humiValues.Length - humiValues.IndexOf('.')); |
| | | } |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", Language.StringByID(StringId.Humidity)); |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", "", Language.StringByID(StringId.Humidity)); |
| | | } |
| | | if (pm25Obj != null) |
| | | { |
| | | sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "PM2.5"); |
| | | sensorDiyView_Pm25 = new SensorDiyView(sensorListView, curColor, pm25Obj.state == "" ? "--" : pm25Obj.state, "", "", "PM2.5"); |
| | | } |
| | | if (co2Obj != null) |
| | | { |
| | | sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "CO2"); |
| | | sensorDiyView_Co2 = new SensorDiyView(sensorListView, curColor, co2Obj.state == "" ? "--" : co2Obj.state, "", "", "CO2"); |
| | | } |
| | | if (tvocObj != null) |
| | | { |
| | | sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "TVOC"); |
| | | sensorDiyView_Tvoc = new SensorDiyView(sensorListView, curColor, tvocObj.state == "" ? "--" : tvocObj.state, "", "", "TVOC"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | text = "Power"; |
| | | } |
| | | sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "KW", text, 100); |
| | | sensorDiyView_EleActivePower = new SensorDiyView(energyListView, curColor, totalObj.state == "" ? "--" : totalObj.state, "", "KW", text, 100); |
| | | } |
| | | if (dayObj != null) |
| | | { |
| | |
| | | { |
| | | text = "Power of today"; |
| | | } |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "KWh", text, 100); |
| | | sensorDiyView_EleDay = new SensorDiyView(energyListView, curColor, dayObj.state == "" ? "--" : dayObj.state, "", "KWh", text, 100); |
| | | } |
| | | if (monthObj != null) |
| | | { |
| | |
| | | { |
| | | text = "Power of month"; |
| | | } |
| | | sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "KWh", text, 100); |
| | | sensorDiyView_EleMonth = new SensorDiyView(energyListView, curColor, monthObj.state == "" ? "--" : monthObj.state, "", "KWh", text, 100); |
| | | } |
| | | |
| | | |
| | |
| | | public string Tag; |
| | | public string unitString; |
| | | |
| | | public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr,string text,int setWidth = 60) |
| | | public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string unitStr, string unitStr2, string text,int setWidth = 60) |
| | | { |
| | | unitString = unitStr; |
| | | if (string.IsNullOrEmpty(value)) |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = color, |
| | | TextSize = 20, |
| | | Text = value, |
| | | Text = value + unitString, |
| | | }; |
| | | contentView.AddChidren(btnValue); |
| | | |
| | |
| | | }; |
| | | contentView.AddChidren(btnText); |
| | | |
| | | if(!string.IsNullOrEmpty(unitString)) |
| | | if(!string.IsNullOrEmpty(unitStr2)) |
| | | { |
| | | btnText.Text += "(" + unitString + ")"; |
| | | btnText.Text += "(" + unitStr2 + ")"; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | value = value.Remove(value.IndexOf('.'), value.Length - value.IndexOf('.')); |
| | | } |
| | | btnValue.Text = value; |
| | | btnValue.Text = value + unitString; |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView(); |
| | | new TopViewDiv(bodyView, function.name).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | //var contentView = new FrameLayout() |
| | |
| | | |
| | | public static void UpdateStatus(Function temp) |
| | | { |
| | | if(bodyView == null) |
| | | if(bodyView == null || bodyView.function.sid != temp.sid) |
| | | { |
| | | return; |
| | | } |
| | |
| | | if (setTempValue != 0) |
| | | bodyView.btnSetTempValues.Text = setTempValue.ToString(); |
| | | |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | |
| | | //int progress = 0; |
| | | //int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString()), out progress); |
| | |
| | | tempHumiView.AddChidren(tempValuesView); |
| | | btnTempValues = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(45), |
| | | Height = Application.GetRealWidth(35), |
| | | Y = Application.GetRealWidth(38), |
| | | Height = Application.GetRealWidth(66), |
| | | IsBold = true, |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.TopRight, |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString(),"---"), |
| | | }; |
| | | //btnTempValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()); |
| | | #if __IOS__ |
| | | btnTempValues.Width = btnTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #else |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | #endif |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | tempValuesView.AddChidren(btnTempValues); |
| | | var btnTempValuesUint = new Button() |
| | | { |
| | | X = btnTempValues.Right, |
| | | Y = Application.GetRealWidth(48), |
| | | //Y = Application.GetRealWidth(48), |
| | | Y = Application.GetRealWidth(45), |
| | | Height = Application.GetRealWidth(66), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | //Height = Application.GetRealWidth(30), |
| | | TextSize = 10, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | Text = "°C" |
| | | }; |
| | | tempValuesView.AddChidren(btnTempValuesUint); |
| | | |
| | | |
| | | |
| | | var humiValuesView = new FrameLayout() |
| | | { |
| | |
| | | tempHumiView.AddChidren(humiValuesView); |
| | | btnHumiValues = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(45), |
| | | Height = Application.GetRealWidth(35), |
| | | Y = Application.GetRealWidth(39), |
| | | Height = Application.GetRealWidth(66), |
| | | IsBold = true, |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | |
| | | var btnHumiValuesUint = new Button() |
| | | { |
| | | X = btnTempValues.Right, |
| | | Y = Application.GetRealWidth(48), |
| | | Y = Application.GetRealWidth(45), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(66), |
| | | TextSize = 10, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | Text = "%" |
| | |
| | | Text = setTempStr |
| | | }; |
| | | contentView.AddChidren(btnSetTempValues); |
| | | //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | |
| | | #if __IOS__ |
| | | bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | #endif |
| | | |
| | | |
| | | var btnSetTempUnit = new Button() |
| | | { |
| | | X = btnSetTempValues.Right + Application.GetRealWidth(3), |
| | | Y = Application.GetRealHeight(267), |
| | | Width = Application.GetRealWidth(30), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(50), |
| | | TextSize = 23, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |