| | |
| | | <?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="202211081"> |
| | | <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="202211111"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!--友盟--> |
| | | <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> |
| | |
| | | { |
| | | endTime = DateTime.Now.AddSeconds(5); |
| | | |
| | | MainPage.Log($"读取设备信息成功"); |
| | | MainPage.Log($"sid列表获取====" + deviceResult.Data.ToString()); |
| | | var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | //MainPage.Log($"读取设备信息成功"); |
| | | //MainPage.Log($"sid列表获取====" + deviceResult.Data.ToString()); |
| | | var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | if (deviceList == null) |
| | | { |
| | | deviceList = new DevcieApiPack(); |
| | |
| | | var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + ""); |
| | | if (deviceResult2.Code == StateCode.SUCCESS) |
| | | { |
| | | var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | var deviceList2 = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString()); |
| | | deviceList.pageNo = deviceList2.pageNo; |
| | | deviceList.list.AddRange(deviceList2.list); |
| | | } |
| | |
| | | } |
| | | } |
| | | //处理剩下的新增功能 |
| | | int iiii = 0; |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | newFunction.AssembleStatus(); |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath); |
| | | MainPage.Log($"============设备============{iiii++}"); |
| | | } |
| | | endTime = DateTime.Now.AddSeconds(5); |
| | | } |
| | |
| | | finally |
| | | { |
| | | complateDevice = true; |
| | | MainPage.Log($"============设备============完成"); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | private List<ShowFunction> showFunctions; |
| | | private List<ShowFunction> dddd; |
| | | |
| | | /// <summary> |
| | | /// 功能类型列表 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public List<ShowFunction> functionTypeList |
| | | public List<ShowFunction> ShowFunctionTypeList |
| | | { |
| | | get |
| | | { |
| | | if (showFunctions == null) |
| | | if (dddd == null) |
| | | { |
| | | showFunctions = new List<ShowFunction> { |
| | | dddd = new List<ShowFunction>(){ |
| | | ShowFunction.Light,ShowFunction.AC,ShowFunction.Curtain, |
| | | ShowFunction.FloorHeating,ShowFunction.Music, |
| | | ShowFunction.Electric,ShowFunction.Environmental, |
| | |
| | | ShowFunction.SecurityCenter,ShowFunction.Acst, |
| | | ShowFunction.MechanicalArm }; |
| | | } |
| | | return showFunctions; |
| | | return dddd; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | instance = temp; |
| | | } |
| | | instance.functionTypeList.AddRange(new List<ShowFunction> { |
| | | ShowFunction.Light,ShowFunction.AC,ShowFunction.Curtain, |
| | | ShowFunction.FloorHeating,ShowFunction.Music, |
| | | ShowFunction.Electric,ShowFunction.Environmental, |
| | | ShowFunction.EnergyMonitoring, |
| | | ShowFunction.FreshAir,ShowFunction.DoorLock, |
| | | ShowFunction.Panel,ShowFunction.SecurityMonitoring, |
| | | ShowFunction.Sensor,ShowFunction.VideoIntercom, |
| | | ShowFunction.SecurityCenter,ShowFunction.Acst, |
| | | ShowFunction.MechanicalArm |
| | | }); |
| | | instance.SupportFacePass = false; |
| | | instance.SaveResidenceData(); |
| | | } |
| | |
| | | switch (brandType) |
| | | { |
| | | case SPK.BrandType.Hdl: |
| | | foreach (var function in Functions) |
| | | try |
| | | { |
| | | if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(function.spk)) |
| | | foreach (var function in Functions) |
| | | { |
| | | resultFunctions.Add(function); |
| | | if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(function.spk)) |
| | | { |
| | | resultFunctions.Add(function); |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | break; |
| | | |
| | | case SPK.BrandType.Tuya: |
| | | lock (Functions) |
| | | { |
| | | foreach (var function in Functions) |
| | | try |
| | | { |
| | | if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk)) |
| | | foreach (var function in Functions) |
| | | { |
| | | resultFunctions.Add(function); |
| | | if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk)) |
| | | { |
| | | resultFunctions.Add(function); |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | } |
| | | break; |
| | | } |
| | |
| | | var btnSetting = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337-37), |
| | | Y = Application.GetRealHeight(10), |
| | | Y = Application.GetRealHeight(20), |
| | | Width = Application.GetMinRealAverage(28+37), |
| | | Height = Application.GetMinRealAverage(28+19), |
| | | TextID = StringId.CombinedDimming, |
| | |
| | | //etAccount.Text = "13226233133";//豆豆 |
| | | //etAccount.Text = "18316120654";//tujie |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | etAccount.Text = "18244942707"; |
| | | etAccount.Text = "tf@smarttech.com.ua"; |
| | | etAccount.Text = "13288623489"; |
| | | etAccount.Text = "455740454@qq.com"; |
| | | etAccount.Text = "13335135632"; |
| | | etAccount.Text = "18688565449"; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | | if(etAccount.Text == "13335135632") |
| | | if(etAccount.Text == "18688565449") |
| | | { |
| | | etPassword.Text = "borui1123"; |
| | | etPassword.Text = "CISQSMJH"; |
| | | } |
| | | //etPassword.Text = "Hdl85521566"; |
| | | btnLogin.IsSelected = true; |
| | |
| | | var lastY2 = Application.GetRealWidth(16); |
| | | var functionContentViewHeight = Application.GetRealWidth(16); |
| | | |
| | | foreach (var item in DB_ResidenceData.Instance.functionTypeList) |
| | | foreach (var item in DB_ResidenceData.Instance.ShowFunctionTypeList) |
| | | { |
| | | int functionCount = 0; |
| | | int functionOnCount = 0; |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = scene.collect |
| | | }; |
| | | this.AddChidren(btnCollectionIcon); |
| | | if (scene.sceneType != SceneType.LightScene) |
| | | { |
| | | this.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; |
| | | if (scene.sceneType == SceneType.MovieScene) |
| | |
| | | /// </summary> |
| | | void LoadEvent_ControlScene(Button btnName, Button btnFromFloor, Scene scene) |
| | | { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => { |
| | | DriverLayer.Control.Ins.ControlScene(scene); |
| | | string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | | }; |
| | | btnName.MouseUpEventHandler = upEvent; |
| | | btnFromFloor.MouseUpEventHandler = upEvent; |
| | | this.MouseUpEventHandler = upEvent; |
| | | if (scene.sceneType == SceneType.LightScene) |
| | | { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => |
| | | { |
| | | if (scene.functions.Count == 0) |
| | | { |
| | | |
| | | var waitPage = new Loading(); |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.BaseView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.GetSceneInfo(scene.userSceneId); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); |
| | | var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId); |
| | | if (tempScene != null) |
| | | { |
| | | scene.name = tempScene.name; |
| | | scene.delay = tempScene.delay; |
| | | scene.roomIds = tempScene.roomIds; |
| | | scene.functions = tempScene.functions; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var sceneLishtList = new List<Function>(); |
| | | foreach (var light in FunctionList.List.GetLightList()) |
| | | { |
| | | var temp = scene.functions.Find((obj) => obj.sid == light.sid); |
| | | if (temp != null) |
| | | { |
| | | sceneLishtList.Add(light); |
| | | } |
| | | } |
| | | Action<Scene> action = (Scene) => { }; |
| | | var lightSceneDialog = new LightSceneEditDialog(sceneLishtList, scene, action); |
| | | lightSceneDialog.ShowDialog(); |
| | | |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | }); |
| | | } |
| | | }).Start(); |
| | | } |
| | | else |
| | | { |
| | | var sceneLishtList = new List<Function>(); |
| | | foreach (var light in FunctionList.List.GetLightList()) |
| | | { |
| | | var temp = scene.functions.Find((obj) => obj.sid == light.sid); |
| | | if (temp != null) |
| | | { |
| | | sceneLishtList.Add(light); |
| | | } |
| | | } |
| | | Action<Scene> action = (Scene) => { }; |
| | | var lightSceneDialog = new LightSceneEditDialog(sceneLishtList, scene, action); |
| | | lightSceneDialog.ShowDialog(); |
| | | } |
| | | }; |
| | | btnName.MouseUpEventHandler = upEvent; |
| | | btnFromFloor.MouseUpEventHandler = upEvent; |
| | | this.MouseUpEventHandler = upEvent; |
| | | } |
| | | else |
| | | { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => |
| | | { |
| | | DriverLayer.Control.Ins.ControlScene(scene); |
| | | string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | | }; |
| | | btnName.MouseUpEventHandler = upEvent; |
| | | btnFromFloor.MouseUpEventHandler = upEvent; |
| | | this.MouseUpEventHandler = upEvent; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | PlaceholderText = UserInfo.Current.AccountString,// Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Enable = false |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | |
| | | var btnLogin = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(403), |
| | | Y = Application.GetRealHeight(353), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | |
| | | }; |
| | | bodyView.AddChidren(btnLogin); |
| | | |
| | | string account = ""; |
| | | etAccount.TextChangeEventHandler = (sender, e) => |
| | | { |
| | | account = etAccount.Text.Trim(); |
| | | if (account.Length > 0 && etPassword.Text.Trim().Length > 0) |
| | | { |
| | | btnLogin.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | btnLogin.IsSelected = false; |
| | | } |
| | | }; |
| | | etPassword.TextChangeEventHandler += (sender, e) => |
| | | { |
| | | if (etAccount.Text.Trim().Length > 0 && etPassword.Text.Trim().Length > 0) |
| | | if ( etPassword.Text.Trim().Length > 0) |
| | | { |
| | | btnLogin.IsSelected = true; |
| | | } |
| | |
| | | { |
| | | static AcstParentPage basePage; |
| | | |
| | | VerticalScrolViewLayout bodyView; |
| | | VerticalScrolViewLayout contentView; |
| | | |
| | | |
| | | #region 天气控件 |
| | | Button btnOutdoorTemp; |
| | |
| | | basePage = this; |
| | | this.function = FunctionList.List.GetAcstParentList()[0]; |
| | | this.BackgroundColor = CSS.CSS_Color.BackgroundColor; |
| | | bodyView = new VerticalScrolViewLayout(); |
| | | this.AddChidren(bodyView); |
| | | contentView = new VerticalScrolViewLayout() { |
| | | Height = Application.GetRealHeight(667 - 56), |
| | | }; |
| | | this.AddChidren(contentView); |
| | | subViewList = new Dictionary<string, AcstSubControlView>(); |
| | | } |
| | | /// <summary> |
| | |
| | | Height = Application.GetRealHeight(180), |
| | | BackgroundImagePath = $"FunctionIcon/Acst/{imageFolder}/TopViewBg.png", |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | | contentView.AddChidren(topView); |
| | | |
| | | var backView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | bodyView.AddChidren(new Button |
| | | contentView.AddChidren(new Button |
| | | { |
| | | Height = Application.GetRealHeight(8), |
| | | }); |
| | |
| | | Height = Application.GetRealHeight(104), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(infoView); |
| | | contentView.AddChidren(infoView); |
| | | |
| | | var infoContentView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | if (tempObj != null) |
| | | { |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempObj.state == "" ? "--" : tempObj.state, "°", Language.StringByID(StringId.Temp)); |
| | | string tempValues = tempObj.state == "" ? "--" : tempObj.state; |
| | | if (tempValues.Contains(".")) |
| | | { |
| | | tempValues = tempValues.Remove(tempValues.IndexOf('.'), tempValues.Length - tempValues.IndexOf('.')); |
| | | } |
| | | sensorDiyView_Temp = new SensorDiyView(sensorListView, curColor, tempValues, "°", Language.StringByID(StringId.Temp)); |
| | | } |
| | | if (humiObj != null) |
| | | { |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiObj.state == "" ? "--" : humiObj.state, "%", Language.StringByID(StringId.Humidity)); |
| | | string humiValues = humiObj.state == "" ? "--" : humiObj.state; |
| | | if (humiValues.Contains(".")) |
| | | { |
| | | humiValues = humiValues.Remove(humiValues.IndexOf('.'), humiValues.Length - humiValues.IndexOf('.')); |
| | | } |
| | | sensorDiyView_Humi = new SensorDiyView(sensorListView, curColor, humiValues , "%", Language.StringByID(StringId.Humidity)); |
| | | } |
| | | if (pm25Obj != null) |
| | | { |
| | |
| | | { |
| | | Height = Application.GetRealHeight(54-11), |
| | | }; |
| | | bodyView.AddChidren(subTitleView); |
| | | contentView.AddChidren(subTitleView); |
| | | |
| | | var btnCollection = new Button() |
| | | { |
| | |
| | | { |
| | | Height = Application.GetRealHeight(88), |
| | | }; |
| | | bodyView.AddChidren(subFunctionListView); |
| | | contentView.AddChidren(subFunctionListView); |
| | | |
| | | |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(9) }); |
| | | foreach (var sub in FunctionList.List.GetAcstSubList()) |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (subViewList.ContainsKey(sub.sid)) |
| | | try |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (subFunctionCount > 0 && subFunctionCount % 2 == 0) |
| | | { |
| | | subFunctionListView = new HorizontalScrolViewLayout() |
| | | foreach (var sub in FunctionList.List.GetAcstSubList()) |
| | | { |
| | | Height = Application.GetRealHeight(93), |
| | | }; |
| | | bodyView.AddChidren(subFunctionListView); |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(9) }); |
| | | if (subViewList.ContainsKey(sub.sid)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (subFunctionCount > 0 && subFunctionCount % 2 == 0) |
| | | { |
| | | subFunctionListView = new HorizontalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(93), |
| | | }; |
| | | contentView.AddChidren(subFunctionListView); |
| | | subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(9) }); |
| | | } |
| | | |
| | | AcstSubControlView subFunctionView = new AcstSubControlView(sub, subFunctionListView, imageFolder); |
| | | subViewList.Add(sub.sid, subFunctionView); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(sub); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | subFunctionCount++; |
| | | }); |
| | | |
| | | System.Threading.Thread.Sleep(10); |
| | | } |
| | | } |
| | | |
| | | AcstSubControlView subFunctionView = new AcstSubControlView(sub, subFunctionListView,imageFolder); |
| | | |
| | | subViewList.Add(sub.sid, subFunctionView); |
| | | |
| | | Control.Ins.SendReadCommand(sub); |
| | | |
| | | subFunctionCount++; |
| | | } |
| | | |
| | | catch { } |
| | | finally{ |
| | | |
| | | } |
| | | }).Start(); |
| | | #endregion |
| | | |
| | | bodyView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(72), |
| | | }); |
| | | |
| | | #region 底部控制栏 |
| | | var bottomView = new FrameLayout() |
| | |
| | | Language.StringByID(StringId.AtHome), curColor, function.GetAttrState(AcstParent_AttrEnum.scene.ToString()) == AcstParent_Attr_SceneValueEnum.at_home.ToString()); |
| | | atHomeIconButton.Click(() => |
| | | { |
| | | btnModeControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneAtHome2.png"; |
| | | btnWorkSceneControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneAtHome2.png"; |
| | | dialog.Close(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | Language.StringByID(StringId.AwayHome), curColor, function.GetAttrState(AcstParent_AttrEnum.scene.ToString()) == AcstParent_Attr_SceneValueEnum.leave_home.ToString()); |
| | | awayHomeIconButton.Click(() => |
| | | { |
| | | btnModeControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneAwayHomeIcon2.png"; |
| | | btnWorkSceneControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneAwayHomeIcon2.png"; |
| | | dialog.Close(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | Language.StringByID(StringId.Sleep), curColor, function.GetAttrState(AcstParent_AttrEnum.scene.ToString()) == AcstParent_Attr_SceneValueEnum.sleep.ToString()); |
| | | sleepIconButton.Click(() => |
| | | { |
| | | btnModeControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneSleepIcon2.png"; |
| | | btnWorkSceneControl.SelectedImagePath = $"FunctionIcon/Acst/{imageFolder}/SceneSleepIcon2.png"; |
| | | dialog.Close(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | |
| | | InitGetWeatherAction(); |
| | | |
| | | Control.Ins.SendReadCommand(function); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(function); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = 0xFF949AA5, |
| | | TextSize = 12, |
| | | Text = text + "(" + unitString+")", |
| | | Text = text , |
| | | }; |
| | | contentView.AddChidren(btnText); |
| | | |
| | | if(!string.IsNullOrEmpty(unitString)) |
| | | { |
| | | btnText.Text += "(" + unitString + ")"; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | { |
| | | value = value.Remove(value.IndexOf('.'), value.Length - value.IndexOf('.')); |
| | | } |
| | | btnValue.Text = value + unitString; |
| | | btnValue.Text = value; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //int progress = 0; |
| | | //int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString()), out progress); |
| | | bodyView.tempBar.Progress = setTempValue - 16; |
| | | if (bodyView.tempBar.Progress != setTempValue - 16) |
| | | bodyView.tempBar.Progress = setTempValue - 16; |
| | | if(temp.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.btnPowerControl.IsSelected = true; |
| | |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.TopRight, |
| | | Text = "---", |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString(),"---"), |
| | | }; |
| | | btnTempValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()); |
| | | //btnTempValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()); |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | btnTempValues.Gravity = Gravity.CenterHorizontal; |
| | | tempValuesView.AddChidren(btnTempValues); |
| | |
| | | IsBold = true, |
| | | TextSize = 30, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | Text = "---", |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString(),"---"), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | }; |
| | | btnHumiValues.Text = function.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()); |
| | | btnHumiValues.Width = btnTempValues.GetTextWidth(); |
| | | btnHumiValues.Gravity = Gravity.CenterHorizontal; |
| | | humiValuesView.AddChidren(btnHumiValues); |
| | |
| | | #endregion |
| | | |
| | | |
| | | btnSetTempValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth((375 - 77 -30)/2), |
| | | Y = Application.GetRealHeight(260), |
| | | Width = Application.GetRealWidth(77), |
| | | Height = Application.GetRealHeight(90), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = 60, |
| | | Text = function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--") |
| | | }; |
| | | contentView.AddChidren(btnSetTempValues); |
| | | int setTempValue = 0; |
| | | string setTempStr = "--"; |
| | | double dd = 0; |
| | | double.TryParse(function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--"), out dd); |
| | | setTempValue = Convert.ToInt32(dd); |
| | | if (setTempValue != 0) |
| | | btnSetTempValues.Text = setTempValue.ToString(); |
| | | setTempStr = setTempValue.ToString(); |
| | | btnSetTempValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth((375 - 77 -30)/2), |
| | | Y = Application.GetRealHeight(260), |
| | | Width = Application.GetRealWidth(73), |
| | | Height = Application.GetRealHeight(90), |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = 60, |
| | | Text = setTempStr |
| | | }; |
| | | contentView.AddChidren(btnSetTempValues); |
| | | //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10); |
| | | |
| | | |
| | |
| | | ThumbImageHeight = Application.GetRealHeight(51), |
| | | ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? curColor : CSS_Color.DividingLineColor, |
| | | MaxValue = 14, |
| | | Progress = progress + 16, |
| | | Progress = progress - 16, |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | IsProgressTextShow = false, |
| | | ProgressChangeDelayTime = 0, |
| | |
| | | /// </summary> |
| | | public class LightSceneEditDialog :Dialog |
| | | { |
| | | |
| | | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | List<Function> listSwitch = new List<Function>(); |
| | | List<Function> lightDimming = new List<Function>(); |
| | | List<Function> lightCCT = new List<Function>(); |
| | | List<Function> lightRGB = new List<Function>(); |
| | | |
| | | /// <summary> |
| | | /// 传入的灯光列表 |
| | | /// 加入场景控制功能列表 |
| | |
| | | { |
| | | commandDic.Add(FunctionAttributeKey.OnOff, "off"); |
| | | |
| | | var hadDimming = lights.Find((obj) => obj.spk == SPK.LightDimming) != null; |
| | | var hadCCT = lights.Find((obj) => obj.spk == SPK.LightCCT) != null; |
| | | var hadRGB = lights.Find((obj) => obj.spk == SPK.LightRGB) != null; |
| | | listSwitch = lights.FindAll((obj) => obj.spk == SPK.LightSwitch); |
| | | lightDimming = lights.FindAll((obj) => obj.spk == SPK.LightDimming); |
| | | lightCCT = lights.FindAll((obj) => obj.spk == SPK.LightCCT); |
| | | lightRGB = lights.FindAll((obj) => obj.spk == SPK.LightRGB); |
| | | |
| | | var hadDimming = lightDimming.Count > 0; |
| | | var hadCCT = lightCCT.Count > 0; |
| | | var hadRGB = lightRGB.Count > 0; |
| | | |
| | | var bodyView = new FrameLayout(); |
| | | this.AddChidren(bodyView); |
| | |
| | | }; |
| | | titleView.AddChidren(btnEditIcon); |
| | | |
| | | Action<string> callBack = (str) => |
| | | Action<string> callBack = (str) => |
| | | { |
| | | //名称不能为空 |
| | | if (string.IsNullOrEmpty(str)) |
| | |
| | | |
| | | var brightnessValue = 0; |
| | | var cctValue = 27; |
| | | if(rgbLight!= null) |
| | | { |
| | | int.TryParse(rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | } |
| | | if (cctLight != null) |
| | | { |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); |
| | | } |
| | | if(dimmingLight!=null) |
| | | { |
| | | int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); |
| | | } |
| | | //if(rgbLight!= null) |
| | | //{ |
| | | // int.TryParse(rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | //} |
| | | //if (cctLight != null) |
| | | //{ |
| | | // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); |
| | | // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); |
| | | //} |
| | | //if(dimmingLight!=null) |
| | | //{ |
| | | // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out brightnessValue); |
| | | //} |
| | | |
| | | |
| | | //属性设置区域 |
| | |
| | | btnClose.IsSelected = true; |
| | | btnOpen.IsSelected = false; |
| | | commandDic[FunctionAttributeKey.OnOff] = "off"; |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.OnOff, "off"); |
| | | foreach (var light in lights) |
| | | { |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | }; |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = true; |
| | | commandDic[FunctionAttributeKey.OnOff] = "on"; |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.OnOff, "on"); |
| | | foreach (var light in lights) |
| | | { |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | contentView.AddChidren(bottomView); |
| | | bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnSave = new Button() |
| | | var btnCacel = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(172), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextID = StringId.Save, |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | bottomView.AddChidren(btnSave); |
| | | bottomView.AddChidren(btnCacel); |
| | | |
| | | var btnComplete = new Button() |
| | | var btnSave = new Button() |
| | | { |
| | | X = Application.GetRealWidth(172), |
| | | Width = Application.GetRealWidth(172), |
| | |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = "执行" |
| | | TextID = StringId.Save |
| | | }; |
| | | bottomView.AddChidren(btnComplete); |
| | | bottomView.AddChidren(btnSave); |
| | | |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnComplete.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); |
| | | btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); |
| | | |
| | | |
| | | |
| | | btnComplete.MouseUpEventHandler = (sender, e) => { |
| | | //this.Close(); |
| | | btnCacel.MouseUpEventHandler = (sender, e) => { |
| | | this.Close(); |
| | | |
| | | var waitPage = new Loading(); |
| | | MainPage.BaseView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | //var waitPage = new Loading(); |
| | | //MainPage.BaseView.AddChidren(waitPage); |
| | | //waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | //new Thread(() => |
| | | //{ |
| | | // try |
| | | // { |
| | | // foreach (var light in lights) |
| | | // { |
| | | // Dictionary<string, string> sendDate = new Dictionary<string, string>(); |
| | | // //赋值场景功能数据 |
| | | // foreach (var attr in light.GetAttributes()) |
| | | // { |
| | | // if (commandDic.ContainsKey(attr)) |
| | | // { |
| | | // try |
| | | // { |
| | | // sendDate.Add(attr, commandDic[attr]); |
| | | // } |
| | | // catch { } |
| | | // } |
| | | |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | foreach (var light in lights) |
| | | { |
| | | Dictionary<string, string> sendDate = new Dictionary<string, string>(); |
| | | //赋值场景功能数据 |
| | | foreach (var attr in light.GetAttributes()) |
| | | { |
| | | if (commandDic.ContainsKey(attr)) |
| | | { |
| | | try |
| | | { |
| | | sendDate.Add(attr, commandDic[attr]); |
| | | } |
| | | catch { } |
| | | } |
| | | |
| | | } |
| | | Control.Ins.SendWriteCommand(light, sendDate); |
| | | Thread.Sleep(50); |
| | | } |
| | | } |
| | | catch |
| | | { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | new PublicAssmebly().TipMsgAutoClose("组合控制已执行", true); |
| | | if (waitPage != null) |
| | | { |
| | | //backAction(null); |
| | | waitPage.RemoveFromParent(); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | // } |
| | | // Control.Ins.SendWriteCommand(light, sendDate); |
| | | // Thread.Sleep(50); |
| | | // } |
| | | // } |
| | | // catch |
| | | // { } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // waitPage.Hide(); |
| | | // new PublicAssmebly().TipMsgAutoClose("组合控制已执行", true); |
| | | // if (waitPage != null) |
| | | // { |
| | | // //backAction(null); |
| | | // waitPage.RemoveFromParent(); |
| | | // } |
| | | // }); |
| | | // } |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | |
| | | |
| | | btnSave.MouseUpEventHandler += (sender, e) => |
| | | btnSave.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(scene.name)) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.SceneNameCannotBeEmpty), |
| | | Text = Language.StringByID(StringId.NameCannotBeEmpty), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | |
| | | { |
| | | if (scene.name == tempRoom.name) |
| | | { |
| | | new PublicAssmebly().TipMsg(StringId.Tip, StringId.SceneNameAlreadyExists); |
| | | new PublicAssmebly().TipMsg(StringId.Tip, StringId.NameAlreadyExists); |
| | | return; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (result == StateCode.SUCCESS) |
| | | { |
| | | scene = serverScene; |
| | | scene.userSceneId = serverScene.userSceneId; |
| | | FunctionList.List.scenes.Add(scene); |
| | | backAction(scene); |
| | | backAction?.Invoke(scene); |
| | | this.Close(); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | if (result == "124005") |
| | | IMessageCommon.Current.ShowErrorInfoAlter(Language.StringByID(StringId.GatewayOffline)); |
| | | else |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result); |
| | | } |
| | | }); |
| | | } |
| | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | commandDic[FunctionAttributeKey.Percent] = dimmerBar.Progress.ToString(); |
| | | btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; |
| | | |
| | | foreach (var light in lights) |
| | | { |
| | | if (light.spk == SPK.LightSwitch) |
| | | { |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.OnOff, e > 0 ? "on" : "off"); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | else |
| | | { |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.Brightness, e.ToString()); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | |
| | | barColorTemplatrue.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | commandDic[FunctionAttributeKey.CCT] = (barColorTemplatrue.Progress*100).ToString(); |
| | | |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString()); |
| | | foreach (var light in lightCCT) |
| | | { |
| | | if (light.spk == SPK.LightCCT) |
| | | { |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | } |
| | | }; |
| | | //变更背景图的Y轴坐标 |
| | | btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2; |
| | |
| | | //圆的半径(考虑边界,需要设置它的半径比较小一点) |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); |
| | | |
| | | |
| | | colorPicker.MouseUpEventHandler = (sender2, e) => { |
| | | d.Clear(); |
| | | d.Add(FunctionAttributeKey.RGB, commandDic[FunctionAttributeKey.RGB]); |
| | | foreach (var light in lightCCT) |
| | | { |
| | | if (light.spk == SPK.LightCCT) |
| | | { |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | } |
| | | } |
| | | }; |
| | | colorPicker.ColorChaged += (sender2, e2) => { |
| | | string rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); |
| | | commandDic[FunctionAttributeKey.RGB] = rgbString; |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |