| | |
| | | { |
| | | if (canRefresh) |
| | | { |
| | | MainPage.Log($"UserInfo.Current.RefreshToken 1 : " + UserInfo.Current.RefreshToken); |
| | | UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | MainPage.Log($"UserInfo.Current.RefreshToken 2 : " + UserInfo.Current.RefreshToken); |
| | | UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | RefreshToken(false); |
| | | } |
| | | } |
| | |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | |
| | | /// <returns></returns> |
| | | private Function ConvertFunctionObject() |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid); |
| | | if(localFunction == null) |
| | | if (type == "7") |
| | | { |
| | | localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); |
| | | var logic = Logic.LogicList.Find((obj) => obj.sid == sid); |
| | | if (logic != null) { |
| | | _localFunction = new Function() |
| | | { |
| | | name = logic.name |
| | | }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid); |
| | | if (localFunction == null) |
| | | { |
| | | localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); |
| | | } |
| | | } |
| | | return localFunction; |
| | | } |
| | |
| | | public string GetFunctionScnenInfo() |
| | | { |
| | | var sceneFunctionInfo = ""; |
| | | foreach (var sfs in status) |
| | | if (type == "7") |
| | | { |
| | | if (sfs.key == FunctionAttributeKey.OnOff) |
| | | foreach (var sfs in status) |
| | | { |
| | | if (sfs.value == "off") |
| | | if (sfs.key == "enable") |
| | | { |
| | | return Language.StringByID(StringId.Close); |
| | | if (sfs.value == "true") |
| | | return Language.StringByID(StringId.OpenArm); |
| | | else |
| | | { |
| | | return Language.StringByID(StringId.Close); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | sceneFunctionInfo += Language.StringByID(StringId.Open) + " "; |
| | | else |
| | | { |
| | | foreach (var sfs in status) |
| | | { |
| | | if (sfs.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | if (sfs.value == "off") |
| | | { |
| | | return Language.StringByID(StringId.Close); |
| | | } |
| | | } |
| | | } |
| | | sceneFunctionInfo += Language.StringByID(StringId.Open) + " "; |
| | | |
| | | var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode); |
| | | var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); |
| | | var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); |
| | | ////海信电视状态 |
| | | //var hisenseTvState = status.Find((obj) => obj.key == "wol"); |
| | | //if(hisenseTvState != null) |
| | | //{ |
| | | //} |
| | | if (modeState != null) |
| | | { |
| | | sceneFunctionInfo += modeState.GetValueText() + " "; |
| | | } |
| | | if (tempState != null) |
| | | { |
| | | sceneFunctionInfo += tempState.GetValueText(); |
| | | sceneFunctionInfo += tempState.GetUintString() + " "; |
| | | } |
| | | if (fanState != null) |
| | | { |
| | | sceneFunctionInfo += fanState.GetValueText() + " "; |
| | | } |
| | | var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (briState != null) |
| | | { |
| | | sceneFunctionInfo += briState.value + "%" + " "; |
| | | } |
| | | var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | if (perState != null) |
| | | { |
| | | sceneFunctionInfo += perState.value + "%" + " "; |
| | | } |
| | | var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT); |
| | | if (cctState != null) |
| | | { |
| | | sceneFunctionInfo += cctState.value + "K" + " "; |
| | | } |
| | | var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB); |
| | | if (rgbState != null) |
| | | { |
| | | //sceneFunctionInfo += new cctState.value + "%" + " "; |
| | | } |
| | | var modeState = status.Find((obj) => obj.key == FunctionAttributeKey.Mode); |
| | | var tempState = status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); |
| | | var fanState = status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); |
| | | ////海信电视状态 |
| | | //var hisenseTvState = status.Find((obj) => obj.key == "wol"); |
| | | //if(hisenseTvState != null) |
| | | //{ |
| | | //} |
| | | if (modeState != null) |
| | | { |
| | | sceneFunctionInfo += modeState.GetValueText() + " "; |
| | | } |
| | | if (tempState != null) |
| | | { |
| | | sceneFunctionInfo += tempState.GetValueText(); |
| | | sceneFunctionInfo += tempState.GetUintString() + " "; |
| | | } |
| | | if (fanState != null) |
| | | { |
| | | sceneFunctionInfo += fanState.GetValueText() + " "; |
| | | } |
| | | var briState = status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (briState != null) |
| | | { |
| | | sceneFunctionInfo += briState.value + "%" + " "; |
| | | } |
| | | var perState = status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | if (perState != null) |
| | | { |
| | | sceneFunctionInfo += perState.value + "%" + " "; |
| | | } |
| | | var cctState = status.Find((obj) => obj.key == FunctionAttributeKey.CCT); |
| | | if (cctState != null) |
| | | { |
| | | sceneFunctionInfo += cctState.value + "K" + " "; |
| | | } |
| | | var rgbState = status.Find((obj) => obj.key == FunctionAttributeKey.RGB); |
| | | if (rgbState != null) |
| | | { |
| | | //sceneFunctionInfo += new cctState.value + "%" + " "; |
| | | } |
| | | |
| | | |
| | | var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle); |
| | | if (perAngle != null) |
| | | { |
| | | sceneFunctionInfo += " " + perAngle.value + "°"; |
| | | } |
| | | var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle); |
| | | if (perAngle != null) |
| | | { |
| | | sceneFunctionInfo += " " + perAngle.value + "°"; |
| | | } |
| | | |
| | | var perSetVolume = status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume); |
| | | if (perSetVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSetVolume.value; |
| | | } |
| | | var perSetVolume = status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume); |
| | | if (perSetVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSetVolume.value; |
| | | } |
| | | |
| | | var perSignal = status.Find((obj) => obj.key == FunctionAttributeKey.Signal); |
| | | if (perSignal != null) |
| | | { |
| | | var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface(); |
| | | string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value); |
| | | sceneFunctionInfo += " " + key; |
| | | } |
| | | var perSignal = status.Find((obj) => obj.key == FunctionAttributeKey.Signal); |
| | | if (perSignal != null) |
| | | { |
| | | var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface(); |
| | | string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value); |
| | | sceneFunctionInfo += " " + key; |
| | | } |
| | | |
| | | var perVolume =status.Find((obj) => obj.key == FunctionAttributeKey.Volume); |
| | | if (perVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perVolume.value; |
| | | } |
| | | var perVolume = status.Find((obj) => obj.key == FunctionAttributeKey.Volume); |
| | | if (perVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perVolume.value; |
| | | } |
| | | |
| | | var perSongName =status.Find((obj) => obj.key == FunctionAttributeKey.SongName); |
| | | if (perSongName != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSongName.value; |
| | | var perSongName = status.Find((obj) => obj.key == FunctionAttributeKey.SongName); |
| | | if (perSongName != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSongName.value; |
| | | } |
| | | } |
| | | return sceneFunctionInfo; |
| | | } |
| | |
| | | /// 设备 |
| | | /// 场景 =scene |
| | | /// 群控=5 |
| | | /// 自动化=7 |
| | | /// |
| | | /// </summary> |
| | | public string type = "0"; |
| | | } |
| | |
| | | SPK.SensorSmoke, |
| | | SPK.SensorWater, |
| | | SPK.SensorGas, |
| | | SPK.SensorDryContact, |
| | | SPK.SensorDryContact2, |
| | | }; |
| | | |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3EnergyPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3SubloopEnergyPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Constant.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneTargetTypeChoosePage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneAutomationListChoosePage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// </summary> |
| | | Action backAction; |
| | | |
| | | public int maginY = 0; |
| | | |
| | | public TopViewDiv(FrameLayout frame, string str) |
| | | { |
| | | baseView = frame; |
| | |
| | | { |
| | | contentView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(64+ maginY), |
| | | BackgroundColor = color, |
| | | }; |
| | | baseView.AddChidren(contentView); |
| | |
| | | Button btnBackIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(29), |
| | | Y = Application.GetRealHeight(29 + maginY), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "Public/BackIcon.png", |
| | |
| | | btnTilte = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(30), |
| | | Y = Application.GetRealHeight(30 + maginY), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)).LoadTopView(); |
| | | var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | #region 添加场景 |
| | | FrameLayout addSceneView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(67), |
| | | Y = Application.GetRealHeight(67 + 10), |
| | | Width = Application.GetRealWidth(361), |
| | | Height = Application.GetRealWidth(202), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)).LoadTopView(); |
| | | var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.NewScene)); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603 - 50), |
| | | Y = Application.GetRealHeight(64+10), |
| | | Height = Application.GetRealHeight(603 - 50 -10), |
| | | //BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionInfo); |
| | | |
| | | var btnFunctionDelayInfo = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(327), |
| | | Y = Application.GetRealWidth(35), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | row.AddChidren(btnFunctionDelayInfo); |
| | | |
| | | if (Convert.ToInt32(scenefunction.delay) > 0) |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); |
| | | } |
| | | else |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); |
| | | } |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorAndRoom = new Button() |
| | | if (scenefunction.type == "7") |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(41), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = scenefunction.localFunction.GetRoomListName(), |
| | | }; |
| | | row.AddChidren(btnFunctionFloorAndRoom); |
| | | btnFunctionName.Gravity = Gravity.CenterVertical; |
| | | btnFunctionInfo.TextAlignment = TextAlignment.CenterRight; |
| | | btnFunctionInfo.Gravity = Gravity.CenterVertical; |
| | | |
| | | EventHandler<MouseEventArgs> skipEvent= (sender, e) => |
| | | btnFunctionName.MouseUpEventHandler = (sender, e) =>{ |
| | | try |
| | | { |
| | | LoadAutomationSettingDialog(scenefunction, btnFunctionInfo); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"load automation error : {ex.Message}"); |
| | | } |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | var btnFunctionDelayInfo = new Button() |
| | | { |
| | | var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(ssf); |
| | | ssf.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }catch(Exception ex) |
| | | Width = Application.GetRealWidth(327), |
| | | Y = Application.GetRealWidth(35), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | row.AddChidren(btnFunctionDelayInfo); |
| | | |
| | | if (Convert.ToInt32(scenefunction.delay) > 0) |
| | | { |
| | | MainPage.Log($"load SceneFunctionInfoEditPage error : {ex.Message}"); |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); |
| | | } |
| | | }; |
| | | else |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); |
| | | } |
| | | |
| | | btnFunctionName.MouseUpEventHandler = skipEvent; |
| | | btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; |
| | | var btnFunctionFloorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(41), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = scenefunction.localFunction.GetRoomListName(), |
| | | }; |
| | | row.AddChidren(btnFunctionFloorAndRoom); |
| | | EventHandler<MouseEventArgs> skipEvent = (sender, e) => |
| | | { |
| | | try |
| | | { |
| | | var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(ssf); |
| | | ssf.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"load SceneFunctionInfoEditPage error : {ex.Message}"); |
| | | } |
| | | }; |
| | | |
| | | btnFunctionName.MouseUpEventHandler = skipEvent; |
| | | btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; |
| | | } |
| | | |
| | | Button btnDelSceneFunction = new Button() |
| | | { |
| | |
| | | string GetFunctionScnenInfo(SceneFunction sceneFunction) |
| | | { |
| | | var sceneFunctionInfo = ""; |
| | | foreach (var sfs in sceneFunction.status) |
| | | if (sceneFunction.type == "7") |
| | | { |
| | | if (sfs.key == FunctionAttributeKey.OnOff) |
| | | foreach (var sfs in sceneFunction.status) |
| | | { |
| | | if (sfs.value == "off") |
| | | return Language.StringByID(StringId.Close); |
| | | } |
| | | } |
| | | |
| | | sceneFunctionInfo += Language.StringByID(StringId.Open); |
| | | |
| | | var modeState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode); |
| | | var tempState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); |
| | | var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); |
| | | if (modeState != null) |
| | | { |
| | | sceneFunctionInfo += modeState.GetValueText(); |
| | | } |
| | | if (tempState != null) |
| | | { |
| | | sceneFunctionInfo += tempState.GetValueText(); |
| | | sceneFunctionInfo += tempState.GetUintString(); |
| | | } |
| | | if (fanState != null) |
| | | { |
| | | sceneFunctionInfo += fanState.GetValueText(); |
| | | } |
| | | var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (briState != null) |
| | | { |
| | | sceneFunctionInfo += " " + briState.value + "%"; |
| | | } |
| | | var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | if (perState != null) |
| | | { |
| | | sceneFunctionInfo += " " + perState.value + "%"; |
| | | } |
| | | var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle); |
| | | if (perAngle != null) |
| | | { |
| | | sceneFunctionInfo += " "+ perAngle.value + "°"; |
| | | } |
| | | |
| | | var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); |
| | | if(perColorful != null) |
| | | { |
| | | if (perColorful.value == "on") |
| | | { |
| | | sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | } |
| | | else |
| | | { |
| | | if (sceneFunction.localFunction.spk == SPK.GroupControl) |
| | | if (sfs.key == "enable") |
| | | { |
| | | sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | if (sfs.value == "true") |
| | | return Language.StringByID(StringId.OpenArm); |
| | | else |
| | | { |
| | | return Language.StringByID(StringId.Close); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var sfs in sceneFunction.status) |
| | | { |
| | | if (sfs.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | if (sfs.value == "off") |
| | | return Language.StringByID(StringId.Close); |
| | | } |
| | | } |
| | | |
| | | sceneFunctionInfo += Language.StringByID(StringId.Open); |
| | | |
| | | var modeState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode); |
| | | var tempState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp); |
| | | var fanState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); |
| | | if (modeState != null) |
| | | { |
| | | sceneFunctionInfo += modeState.GetValueText(); |
| | | } |
| | | if (tempState != null) |
| | | { |
| | | sceneFunctionInfo += tempState.GetValueText(); |
| | | sceneFunctionInfo += tempState.GetUintString(); |
| | | } |
| | | if (fanState != null) |
| | | { |
| | | sceneFunctionInfo += fanState.GetValueText(); |
| | | } |
| | | var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (briState != null) |
| | | { |
| | | sceneFunctionInfo += " " + briState.value + "%"; |
| | | } |
| | | var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | if (perState != null) |
| | | { |
| | | sceneFunctionInfo += " " + perState.value + "%"; |
| | | } |
| | | var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle); |
| | | if (perAngle != null) |
| | | { |
| | | sceneFunctionInfo += " " + perAngle.value + "°"; |
| | | } |
| | | |
| | | var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); |
| | | if (perColorful != null) |
| | | { |
| | | if (perColorful.value == "on") |
| | | { |
| | | sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | } |
| | | else |
| | | { |
| | | sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | if (sceneFunction.localFunction.spk == SPK.GroupControl) |
| | | { |
| | | sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | } |
| | | else |
| | | { |
| | | sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var perSetVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume); |
| | | if (perSetVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSetVolume.value ; |
| | | } |
| | | var perSetVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume); |
| | | if (perSetVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSetVolume.value; |
| | | } |
| | | |
| | | var perSignal = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal); |
| | | if (perSignal != null) |
| | | { |
| | | var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface(); |
| | | string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value); |
| | | sceneFunctionInfo += " " + key; |
| | | } |
| | | var perSignal = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal); |
| | | if (perSignal != null) |
| | | { |
| | | var p = new HDL_ON.UI.UI2.Intelligence.Automation.PublicInterface(); |
| | | string key = p.GetKey(p.GetHisenseSignalSourceDic(), perSignal.value); |
| | | sceneFunctionInfo += " " + key; |
| | | } |
| | | |
| | | var perVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume); |
| | | if (perVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perVolume.value; |
| | | } |
| | | var perVolume = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume); |
| | | if (perVolume != null) |
| | | { |
| | | sceneFunctionInfo += " " + perVolume.value; |
| | | } |
| | | |
| | | var perSongName = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName); |
| | | if (perSongName != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSongName.value; |
| | | var perSongName = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName); |
| | | if (perSongName != null) |
| | | { |
| | | sceneFunctionInfo += " " + perSongName.value; |
| | | } |
| | | } |
| | | return sceneFunctionInfo; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载自动化配置弹窗 |
| | | /// </summary> |
| | | void LoadAutomationSettingDialog(SceneFunction temp,Button btnTipText) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(pView); |
| | | |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(500), |
| | | Height = Application.GetRealHeight(160), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(optionBaseView); |
| | | |
| | | var optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | ScrollEnabled = false, |
| | | }; |
| | | optionBaseView.AddChidren(optionView); |
| | | |
| | | var btnOn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OpenArm, |
| | | }; |
| | | optionView.AddChidren(btnOn); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnOff = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Close, |
| | | }; |
| | | optionView.AddChidren(btnOff); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optionBaseView.AddChidren(btnCancel); |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnOn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "true" |
| | | }); |
| | | btnTipText.TextID = StringId.OpenArm; |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "false" |
| | | }); |
| | | btnTipText.TextID = StringId.Close; |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | //-------------------------------------- |
| | | public partial class SceneAddPage |
| | |
| | | void LoadEvent_ChangeFunctionList() |
| | | { |
| | | btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => { |
| | | var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction); |
| | | //var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction); |
| | | var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(sefp); |
| | | sefp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class SceneAutomationListChoosePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | Scene scene; |
| | | Action refreshAction; |
| | | List<Logic> addedList = new List<Logic>(); |
| | | |
| | | public SceneAutomationListChoosePage(Scene function, Action action) |
| | | { |
| | | scene = function; |
| | | bodyView = this; |
| | | refreshAction = action; |
| | | refreshAction += () => { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | this.bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | var topView = new TopViewDiv(bodyView, "选择自动化"); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(74), |
| | | Height = Application.GetRealHeight(667-80), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | foreach (var logic in Logic.LogicList) |
| | | { |
| | | |
| | | |
| | | var funtionView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | contentView.AddChidren(funtionView); |
| | | |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | funtionView.AddChidren(btnRight); |
| | | |
| | | |
| | | if (scene.functions.Find((obj) => obj.sid == logic.sid) != null) |
| | | { |
| | | addedList.Add(logic); var btnTipAdded = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(327), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Added |
| | | }; |
| | | funtionView.AddChidren(btnTipAdded); |
| | | addedList.Add(logic); |
| | | } |
| | | |
| | | var btnFunctionTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(220), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = logic.name |
| | | }; |
| | | funtionView.AddChidren(btnFunctionTitle); |
| | | |
| | | var btnClick = new Button() |
| | | { |
| | | X = Application.GetRealWidth(300), |
| | | Width = Application.GetRealWidth(70), |
| | | }; |
| | | funtionView.AddChidren(btnClick); |
| | | btnClick.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEditDialog_OnOff(logic.sid); |
| | | }; |
| | | |
| | | contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载自动化配置弹窗 |
| | | /// </summary> |
| | | void LoadEditDialog_OnOff(string logicSid) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(pView); |
| | | |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(500), |
| | | Height = Application.GetRealHeight(160), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(optionBaseView); |
| | | |
| | | var optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | ScrollEnabled = false, |
| | | }; |
| | | optionBaseView.AddChidren(optionView); |
| | | |
| | | var btnOn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OpenArm, |
| | | }; |
| | | optionView.AddChidren(btnOn); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnOff = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Close, |
| | | }; |
| | | optionView.AddChidren(btnOff); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optionBaseView.AddChidren(btnCancel); |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnOn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | var temp = scene.functions.Find((obj) => obj.sid == logicSid); |
| | | if (temp != null) |
| | | { |
| | | temp.status.Clear(); |
| | | } |
| | | else |
| | | { |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.sid = logicSid; |
| | | scene.functions.Add(temp); |
| | | } |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "true" |
| | | }); |
| | | refreshAction(); |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | var temp = scene.functions.Find((obj) => obj.sid == logicSid); |
| | | if (temp != null) |
| | | { |
| | | temp.status.Clear(); |
| | | } |
| | | else |
| | | { |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.sid = logicSid; |
| | | scene.functions.Add(temp); |
| | | } |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "false" |
| | | }); |
| | | refreshAction(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public void LoadPage(Action backRefresh) |
| | | { |
| | | //DB_ResidenceData.Instance.sceneChooseRoomId |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh); |
| | | var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(backRefresh); |
| | | |
| | | initPage(); |
| | | } |
| | | |
| | |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603-50), |
| | | Y = Application.GetRealHeight(64 + 10), |
| | | Height = Application.GetRealHeight(603-50-10), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealWidth(12) }); |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionInfo); |
| | | |
| | | var btnFunctionDelayInfo = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(327), |
| | | Y = Application.GetRealWidth(35), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | row.AddChidren(btnFunctionDelayInfo); |
| | | |
| | | if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32( scenefunction.delay) > 0) |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); |
| | | } |
| | | else |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); |
| | | } |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorAndRoom = new Button() |
| | | if (scenefunction.type == "7") |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(41), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = scenefunction.localFunction.GetRoomListName(), |
| | | }; |
| | | row.AddChidren(btnFunctionFloorAndRoom); |
| | | btnFunctionName.Gravity = Gravity.CenterVertical; |
| | | btnFunctionInfo.TextAlignment = TextAlignment.CenterRight; |
| | | btnFunctionInfo.Gravity = Gravity.CenterVertical; |
| | | |
| | | EventHandler<MouseEventArgs> skipEvent = (sender, e) => |
| | | btnFunctionName.MouseUpEventHandler = (sender, e) => { |
| | | try |
| | | { |
| | | LoadAutomationSettingDialog(scenefunction, btnFunctionInfo); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"load automation error : {ex.Message}"); |
| | | } |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(ssf); |
| | | ssf.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnFunctionName.MouseUpEventHandler = skipEvent; |
| | | btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; |
| | | btnFunctionDelayInfo.MouseUpEventHandler = skipEvent; |
| | | btnFunctionInfo.MouseUpEventHandler = skipEvent; |
| | | btnRight.MouseUpEventHandler = skipEvent; |
| | | row.MouseUpEventHandler = skipEvent; |
| | | var btnFunctionDelayInfo = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(327), |
| | | Y = Application.GetRealWidth(35), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.TopRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | row.AddChidren(btnFunctionDelayInfo); |
| | | |
| | | if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32(scenefunction.delay) > 0) |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); |
| | | } |
| | | else |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.NoDelay); |
| | | } |
| | | |
| | | |
| | | var btnFunctionFloorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(41), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = scenefunction.localFunction.GetRoomListName(), |
| | | }; |
| | | row.AddChidren(btnFunctionFloorAndRoom); |
| | | |
| | | EventHandler<MouseEventArgs> skipEvent = (sender, e) => |
| | | { |
| | | var ssf = new SceneFunctionInfoEditPage(scene, scenefunction, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(ssf); |
| | | ssf.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnFunctionName.MouseUpEventHandler = skipEvent; |
| | | btnFunctionFloorAndRoom.MouseUpEventHandler = skipEvent; |
| | | btnFunctionDelayInfo.MouseUpEventHandler = skipEvent; |
| | | btnFunctionInfo.MouseUpEventHandler = skipEvent; |
| | | btnRight.MouseUpEventHandler = skipEvent; |
| | | row.MouseUpEventHandler = skipEvent; |
| | | } |
| | | |
| | | Button btnDelSceneFunction = new Button() { |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载自动化配置弹窗 |
| | | /// </summary> |
| | | void LoadAutomationSettingDialog(SceneFunction temp, Button btnTipText) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var pView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(pView); |
| | | |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(500), |
| | | Height = Application.GetRealHeight(160), |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | pView.AddChidren(optionBaseView); |
| | | |
| | | var optionView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | ScrollEnabled = false, |
| | | }; |
| | | optionBaseView.AddChidren(optionView); |
| | | |
| | | var btnOn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OpenArm, |
| | | }; |
| | | optionView.AddChidren(btnOn); |
| | | |
| | | optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnOff = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Close, |
| | | }; |
| | | optionView.AddChidren(btnOff); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optionBaseView.AddChidren(btnCancel); |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnOn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "true" |
| | | }); |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var code = scene.EditScene(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (code == "0") |
| | | { |
| | | btnTipText.TextID = StringId.OpenArm; |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if(waitPage!= null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "false" |
| | | }); |
| | | |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var code = scene.EditScene(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (code == "0") |
| | | { |
| | | btnTipText.TextID = StringId.Close; |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | //-------------------------------------- |
| | | public partial class SceneEditPage |
| | |
| | | void LoadEvent_ChangeFunctionList() |
| | | { |
| | | btnAddFunctionTitle.MouseUpEventHandler = (sender, e) => { |
| | | var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction); |
| | | //var sefp =new SceneFunctionListChoosePage(scene,refreshFunctionRowAction); |
| | | var sefp = new SceneTargetTypeChoosePage(scene, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(sefp); |
| | | sefp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)).LoadTopView(); |
| | | //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.AddFunction)); |
| | | var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | #region 显示的功能类型切换区域 |
| | | showdFunctionTypeRow = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(62), |
| | | Y = Application.GetRealHeight(64+10), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(showdFunctionTypeRow); |
| | |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloor); |
| | | |
| | | |
| | | //btnScreenIcon = new Button() |
| | | //{ |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // X = Application.GetRealWidth(122), |
| | | // Y = Application.GetRealHeight(18), |
| | | // UnSelectedImagePath = "Public/DownIcon.png", |
| | | //}; |
| | | //showdFunctionTypeRow.AddChidren(btnScreenIcon); |
| | | |
| | | //btnScreenText = new Button() |
| | | //{ |
| | | // X = btnScreenIcon.Right, |
| | | // Y = Application.GetRealHeight(18), |
| | | // Width = Application.GetRealWidth(200), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextID = StringId.Screen |
| | | //}; |
| | | //showdFunctionTypeRow.AddChidren(btnScreenText); |
| | | |
| | | showdFunctionTypeRow.AddChidren(new Button() |
| | | { |
| | | Y = Application.GetRealHeight(49), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | #endregion |
| | | |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 场景模板类型选择界面 |
| | | /// 功能 |
| | | /// 自动化 |
| | | /// </summary> |
| | | public class SceneTargetTypeChoosePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | Scene scene; |
| | | /// <summary> |
| | | /// 更新功能row |
| | | /// </summary> |
| | | Action refreshFunctionRowAction; |
| | | |
| | | public SceneTargetTypeChoosePage(Scene function, Action action) |
| | | { |
| | | bodyView = this; |
| | | scene = function; |
| | | refreshFunctionRowAction = () => |
| | | { |
| | | this.RemoveFromParent(); |
| | | action(); |
| | | }; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | bodyView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(20), |
| | | BackgroundColor = CSS_Color.BackgroundColor |
| | | }); |
| | | var topView = new TopViewDiv(bodyView, "添加执行动作"); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(74), |
| | | Height = Application.GetRealHeight(530), |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | var funtionView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | contentView.AddChidren(funtionView); |
| | | |
| | | |
| | | var btnFunctionIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/ClassificationIcon.png", |
| | | }; |
| | | funtionView.AddChidren(btnFunctionIcon); |
| | | |
| | | var btnFunctionRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | funtionView.AddChidren(btnFunctionRight); |
| | | |
| | | var btnFunctionTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(50), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Functions, |
| | | }; |
| | | funtionView.AddChidren(btnFunctionTitle); |
| | | |
| | | btnFunctionTitle.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | refreshFunctionRowAction += () => { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | var sefp = new SceneFunctionListChoosePage(scene, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(sefp); |
| | | sefp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var automationView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | contentView.AddChidren(automationView); |
| | | |
| | | |
| | | var btnAutomationRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | automationView.AddChidren(btnAutomationRight); |
| | | var btnAutomationIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetMinRealAverage(22), |
| | | Height = Application.GetMinRealAverage(22), |
| | | UnSelectedImagePath = "Navigation/IntellectualizationIcon.png", |
| | | }; |
| | | automationView.AddChidren(btnAutomationIcon); |
| | | |
| | | var btnAutomationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(50), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.Automation, |
| | | }; |
| | | automationView.AddChidren(btnAutomationTitle); |
| | | |
| | | btnAutomationTitle.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | refreshFunctionRowAction += () => { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | var sefp = new SceneAutomationListChoosePage(scene, refreshFunctionRowAction); |
| | | MainPage.BasePageView.AddChidren(sefp); |
| | | sefp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | contentView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView(); |
| | | var topView = new TopViewDiv(bodyView, sceneFunction.localFunction.name); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(520), |
| | | Y = Application.GetRealHeight(64 + 10), |
| | | Height = Application.GetRealHeight(510), |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |