| | |
| | | { |
| | | public class SkipView:FrameLayout |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 其它界面跳进来的入口 |
| | | /// </summary> |
| | |
| | | |
| | | } |
| | | #region ◆ 自动化__________________________ |
| | | |
| | | static bool If_once = true; |
| | | public static bool If_once = true;//进来只读一次标识; |
| | | /// <summary> |
| | | /// 自动化功能代码入口 |
| | | /// </summary> |
| | |
| | | //functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; |
| | | #region ---推荐模板的组件 |
| | | //推荐模板背景控件 |
| | | |
| | | |
| | | var bjFrameLayout1 = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | X = Application.GetRealWidth(58), |
| | | //Radius = (uint)Application.GetRealHeight(50), |
| | | Y = Application.GetRealHeight(30), |
| | | |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(bjFrameLayout1); |
| | | var bjFrameLayout = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080 - 58), |
| | |
| | | X = Application.GetRealWidth(58), |
| | | //Radius = (uint)Application.GetRealHeight(50), |
| | | Y = Application.GetRealHeight(30), |
| | | |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(bjFrameLayout); |
| | | bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); |
| | | bjFrameLayout1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); |
| | | bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerBottomLeft); |
| | | //图标控件 |
| | | var sigBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(84), |
| | | Height = Application.GetMinRealAverage(84), |
| | | Width = Application.GetRealWidth(84), |
| | | Height = Application.GetRealWidth(84), |
| | | UnSelectedImagePath = "ZigeeLogic/sign.png", |
| | | X = Application.GetRealWidth(58), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | //推荐模板文本控件 |
| | | var recommendtextBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(300), |
| | | Height = Application.GetMinRealAverage(84), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(84), |
| | | X = sigBtn.Right + Application.GetRealWidth(35), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | //Text = "推荐模板", |
| | |
| | | var recommendswitchBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(104), |
| | | Height = Application.GetRealHeight(63), |
| | | Height = Application.GetRealWidth(63), |
| | | UnSelectedImagePath = "ZigeeLogic/logicclose.png", |
| | | SelectedImagePath = "ZigeeLogic/logicopen.png", |
| | | X = bjFrameLayout.Width - Application.GetRealWidth(104 + 58), |
| | |
| | | |
| | | var frameLayout = new FrameLayout |
| | | { |
| | | Width = Application.GetMinRealAverage(369 + 46), |
| | | Height = Application.GetMinRealAverage(246), |
| | | Width = Application.GetRealWidth(369 + 46), |
| | | Height = Application.GetRealHeight(246), |
| | | }; |
| | | scenehorizontalScrol.AddChidren(frameLayout); |
| | | var logiciocnBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(369), |
| | | Height = Application.GetMinRealAverage(246), |
| | | Width = Application.GetRealWidth(369), |
| | | Height = Application.GetRealWidth(246), |
| | | UnSelectedImagePath = "ZigeeLogic/" + i + ".png", |
| | | Tag = i, |
| | | }; |
| | |
| | | |
| | | var logicnameBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(250), |
| | | Height = Application.GetMinRealAverage(80), |
| | | Width = Application.GetRealWidth(250), |
| | | Height = Application.GetRealHeight(80), |
| | | X = Application.GetRealWidth(23), |
| | | Y = Application.GetRealHeight(246 - 23 - 80), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | }; |
| | | //下拉刷新自动化列表的事件 |
| | | logicScrolView.BeginHeaderRefreshingAction += () => |
| | | {
|
| | | { |
| | | if (!Config.Instance.Home.IsVirtually) |
| | | {//虚拟的不获取网关逻辑列表 |
| | | //重新刷新logic列表 |
| | | //重新刷新logic列表 |
| | | If_once = true; |
| | | Common.Logic.LogicList.Clear(); |
| | | Read(logicScrolView, no); |
| | |
| | | { |
| | | if (!Config.Instance.Home.IsVirtually)//虚拟的不获取网关逻辑列表 |
| | | { |
| | | if (If_once)
|
| | | {
|
| | | If_once = false;
|
| | | if (Common.Logic.LogicList.Count == 0)
|
| | | {
|
| | | var Idlist1 = await Send.GetLogicId(0);//
|
| | | var Idlist2 = await Send.GetLogicId(2);//门锁常开模式
|
| | | if (Idlist1.Count != 0)
|
| | | {
|
| | | var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
|
| | | for (int j = 0; j < listlogic1.Count; j++)
|
| | | {
|
| | | var logic = listlogic1[j];
|
| | | if (logic.LogicType != 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | Common.Logic.LogicList.Add(logic);
|
| | | }
|
| | | }
|
| | | if (Idlist2.Count != 0)
|
| | | {
|
| | | var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
|
| | | for (int j = 0; j < listlogic2.Count; j++)
|
| | | {
|
| | | var logic = listlogic2[j];
|
| | | if (logic.LogicType != 2)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | Common.Logic.LogicList.Add(logic);
|
| | | }
|
| | | }
|
| | | if (If_once) |
| | | { |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | If_once = false; |
| | | var Idlist1 = await Send.GetLogicId(0);// |
| | | var Idlist2 = await Send.GetLogicId(2);//门锁常开模式 |
| | | if (Idlist1.Count != 0) |
| | | { |
| | | var listlogic1 = await Send.ReadList(Idlist1.Count, 0); |
| | | for (int j = 0; j < listlogic1.Count; j++) |
| | | { |
| | | var logic = listlogic1[j]; |
| | | if (logic.LogicType != 0) |
| | | { |
| | | continue; |
| | | } |
| | | Common.Logic.LogicList.Add(logic); |
| | | } |
| | | } |
| | | if (Idlist2.Count != 0) |
| | | { |
| | | var listlogic2 = await Send.ReadList(Idlist2.Count, 2); |
| | | for (int j = 0; j < listlogic2.Count; j++) |
| | | { |
| | | var logic = listlogic2[j]; |
| | | if (logic.LogicType != 2) |
| | | { |
| | | continue; |
| | | } |
| | | Common.Logic.LogicList.Add(logic); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | static RowLayout selectedRow = new RowLayout() { Tag = "0" };//记录左滑状态 |
| | | |
| | | /// <summary> |
| | | /// 加载自动化列表界面 |
| | | /// </summary> |
| | |
| | | var noIconBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(294 - 55), |
| | | Width = Application.GetMinRealAverage(757), |
| | | Height = Application.GetMinRealAverage(435), |
| | | Width = Application.GetRealWidth(757), |
| | | Height = Application.GetRealWidth(435), |
| | | UnSelectedImagePath = "Item/NoFunction.png", |
| | | X = Application.GetRealWidth(104), |
| | | }; |
| | |
| | | |
| | | var logicswitchBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(104), |
| | | Height = Application.GetMinRealAverage(63), |
| | | Width = Application.GetRealWidth(104), |
| | | Height = Application.GetRealWidth(63), |
| | | UnSelectedImagePath = "ZigeeLogic/logicclose.png", |
| | | SelectedImagePath = "ZigeeLogic/logicopen.png", |
| | | X = logicRowlayout.Width - Application.GetRealWidth(104 + 58), |
| | |
| | | logicRowlayout.AddRightView(del); |
| | | del.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | var alert = new UserCenter.ShowMsgControl(ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | |
| | | |
| | | var typeIconBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(58), |
| | | Height = Application.GetMinRealAverage(58), |
| | | Width = Application.GetRealWidth(58), |
| | | Height = Application.GetRealWidth(58), |
| | | Gravity = Gravity.Center, |
| | | |
| | | }; |
| | |
| | | Y = typebjBtn.Y + Application.GetRealHeight(35), |
| | | X = Application.GetRealWidth(58) + Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i), |
| | | Width = Application.GetRealWidth(48), |
| | | Height = Application.GetRealHeight(15), |
| | | Height = Application.GetRealWidth(15), |
| | | UnSelectedImagePath = "ZigeeLogic/connect.png", |
| | | }; |
| | | logicRowlayout.AddChidren(connectIconBtn); |
| | |
| | | timeConditionsInfo.Add("EnDelay", "0"); |
| | | timeConditionsInfo.Add("DelayTime", "0"); |
| | | timeConditionsInfo.Add("StartHour", h); |
| | | timeConditionsInfo.Add("StartMin", m);
|
| | | if (UserCenter.UserCenterResourse.HideOption.DoorLockNomallyOpenTimeMode == 1)
|
| | | {
|
| | | //强制变更时间模式为分钟
|
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 60).ToString());
|
| | | timeConditionsInfo.Add("StartMin", m); |
| | | if (UserCenter.UserCenterResourse.HideOption.DoorLockNomallyOpenTimeMode == 1) |
| | | { |
| | | //强制变更时间模式为分钟 |
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 60).ToString()); |
| | | } |
| | | else
|
| | | {
|
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString());
|
| | | else |
| | | { |
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString()); |
| | | } |
| | | Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); |
| | | actionsInfo.Add("LinkType", 8); |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |