| | |
| | | <Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.5c86e4357d63" /> |
| | | <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/SkipView.cs"> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs"> |
| | | <Files> |
| | | <File FileName="Shared/Phone/Category/SelectFloorForm.cs" Line="149" Column="1" IsPinned="True" /> |
| | | <File FileName="Shared/Phone/Device/Logic/SkipView.cs" Line="24" Column="23" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicView/TipView.cs" Line="99" Column="61" /> |
| | | <File FileName="Shared/Phone/Device/Logic/SoneLogicList.cs" Line="24" Column="21" /> |
| | | <File FileName="Shared/Phone/Device/Logic/AddLogicPage.cs" /> |
| | | <File FileName="Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs" Line="1066" Column="15" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicCommunalPage.cs" Line="1265" Column="28" /> |
| | | <File FileName="Shared/Phone/Device/Logic/OneLogic.cs" Line="190" Column="43" /> |
| | | <File FileName="Shared/Phone/Device/Logic/Method.cs" Line="658" Column="10" /> |
| | | <File FileName="Shared/Phone/Category/CategoryMainForm.cs" Line="58" Column="13" /> |
| | | <File FileName="Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs" Line="1441" Column="43" /> |
| | | <File FileName="Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs" Line="10" Column="36" /> |
| | | <File FileName="Shared/Phone/Device/Logic/SoneLogicList.cs" Line="12" Column="40" /> |
| | | <File FileName="Shared/Phone/ZigBee/Device/DoorLock.cs" Line="2757" Column="81" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="GateWay" expanded="True"> |
| | | <Node name="GateWay.Droid" expanded="True"> |
| | | <Node name="Assets" expanded="True" /> |
| | | </Node> |
| | | <Node name="Home.IOS" expanded="True"> |
| | | <Node name="Resources" expanded="True" /> |
| | | </Node> |
| | | <Node name="Shared" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="Phone" expanded="True"> |
| | |
| | | <Node name="Device" expanded="True"> |
| | | <Node name="Logic" expanded="True"> |
| | | <Node name="LogicView" expanded="True" /> |
| | | <Node name="SkipView.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="UserCenter" expanded="True"> |
| | | <Node name="CommonBase" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="Controls" expanded="True"> |
| | | <Node name="BaseCommonControl" expanded="True"> |
| | | <Node name="Base" expanded="True" /> |
| | | <Node name="DoorLock" expanded="True"> |
| | | <Node name="DoorLockCommonInfo.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="MessageControls" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="DoorLock" expanded="True" /> |
| | | <Node name="Residence" expanded="True" /> |
| | | </Node> |
| | | <Node name="ZigBee" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
old mode 100755
new mode 100644
| | |
| | | accounts.Add("Account", Config.Instance.Guid); |
| | | accounts.Add("AccountName",accountName);
|
| | | ///mac+端口是为识别是那个门锁; |
| | | accounts.Add("MacAddr", Send.CurrentDoorLock.DeviceAddr); |
| | | accounts.Add("Epoint", Send.CurrentDoorLock.DeviceEpoint.ToString()); |
| | | accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr); |
| | | accounts.Add("Option2", Send.CurrentDoorLock.DeviceEpoint.ToString()); |
| | | accounts.Add("UserId", userId); |
| | | if (SelectedDeviceStatuscondition != "") |
| | | { |
old mode 100755
new mode 100644
| | |
| | | this.AddChidren(view.TopRowView()); |
| | | view.toptitleNameBtn.TextID = MyInternationalizationString.linkageevent; |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; |
| | | //加大点击热键 |
| | | var addiocnclick = new Button |
| | | { |
| | | Width = Application.GetRealWidth(108+58), |
| | | Height = Application.GetRealHeight(72+20), |
| | | X = Application.GetRealWidth(1080 - 108 - 58), |
| | | Y = Application.GetRealHeight(184 - 72), |
| | | }; |
| | | view.topRowLayout.AddChidren(addiocnclick); |
| | | |
| | | var addiocn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(72), |
| | | Height = Application.GetRealHeight(72), |
| | | Width = Application.GetMinRealAverage(72), |
| | | Height = Application.GetMinRealAverage(72), |
| | | X = Application.GetRealWidth(1080 - 108 - 58), |
| | | UnSelectedImagePath = "ZigeeLogic/lockadd.png", |
| | | Y = Application.GetRealHeight(184 - 72 - 20), |
| | | }; |
| | | view.topRowLayout.AddChidren(addiocn); |
| | | addiocn.MouseUpEventHandler += (sender, e) => |
| | | |
| | | EventHandler<MouseEventArgs> addclick = (sender, e) => |
| | | { |
| | | //new一个新逻辑对象; |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | addiocnclick.MouseUpEventHandler += addclick; |
| | | addiocn.MouseUpEventHandler += addclick; |
| | | |
| | | #endregion |
| | | middle = new VerticalRefreshLayout |
| | | { |
| | |
| | | /// </summary> |
| | | public async void Read() |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.LockLogicList.Count == 0) |
| | | if (!BoolExist()) |
| | | { |
| | | var Idlist = await Send.GetLogicId(1); |
| | | if (Idlist.Count != 0) |
| | |
| | | bool yes = false; |
| | | for (int a = 0; a < logic.Accounts.Count; a++) |
| | | { |
| | | if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) |
| | | //Option4是设备mac;Option2是设备端口; |
| | | if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) |
| | | { |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | |
| | | { |
| | | middle.RemoveAll(); |
| | | |
| | | if (Common.Logic.LockLogicList.Count == 0) |
| | | //if (Common.Logic.LockLogicList.Count == 0) |
| | | if (!BoolExist()) |
| | | { |
| | | //就是为了显示引导添加图标; |
| | | var noFrameLayout = new FrameLayout |
| | |
| | | for (int i = 0; i < Common.Logic.LockLogicList.Count; i++) |
| | | { |
| | | var logic = Common.Logic.LockLogicList[i]; |
| | | if (!Exist(logic)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | var logicRowlayout = new RowLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查找该门锁是否存在自动化 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool BoolExist() |
| | | { |
| | | bool yes = false; |
| | | for (int i = 0; i < Common.Logic.LockLogicList.Count; i++) |
| | | { |
| | | var logic = Common.Logic.LockLogicList[i]; |
| | | if (logic.LogicType != 1) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (Exist(logic)) |
| | | { |
| | | yes = true; |
| | | //存在就退出 |
| | | break; |
| | | } |
| | | } |
| | | return yes; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找这一条自动化是否属于该门锁 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool Exist(Common.Logic logic) |
| | | { |
| | | bool yes = false; |
| | | for (int j = 0; j < logic.Accounts.Count; j++) |
| | | { |
| | | //Option4是设备mac;Option2是设备端口; |
| | | if (logic.Accounts[j]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) |
| | | { |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | | yes = false; |
| | | break; |
| | | } |
| | | if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid) |
| | | { |
| | | //查找自己账号下的创建联动事件; |
| | | yes = true; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | return yes; |
| | | } |
| | | } |
| | | } |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | //Height =Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | //Height =Application.GetRealHeight(127), |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | // Height = Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | //Height = Application.GetRealHeight(127), |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | |
| | | ["AccountName"] = dictionary["AccountName"], |
| | | |
| | | }; |
| | | |
| | | if (dictionary.ContainsKey("Option4")) |
| | | { |
| | | accounts1.Add("Option4",dictionary["Option4"]); |
| | | } |
| | | if (dictionary.ContainsKey("Option2")) |
| | | { |
| | | accounts1.Add("Option2", int.Parse(dictionary["Option2"])); |
| | | } |
| | | accounts.Add(accounts1); |
| | | } |
| | | } |
| | |
| | | using Shared.Common; |
| | | using Shared.R; |
| | | using Shared; |
| | | using Shared.Phone.UserCenter.DoorLock; |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | public class SoneLogicList : FrameLayout |
| | | { |
| | | |
| | | public static SoneLogicList soneLogicList; |
| | | public SoneLogicList() |
| | | { |
| | |
| | | |
| | | public async void Show() |
| | | { |
| | | |
| | | #region 界面的布局代码 |
| | | UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑 |
| | | TopView view = new TopView(); |
| | |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | if (updateThread != null && updateThread.IsAlive) |
| | | { |
| | | updateThread.Abort(); |
| | | } |
| | | //把静态变量的这个东西置空 |
| | | soneLogicList = null; |
| | | this.RemoveFromParent(); |
| | |
| | | |
| | | button1.MouseUpEventHandler = async (sender, e) => |
| | | { |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); |
| | | if (result)
|
| | | { |
| | |
| | | { |
| | | LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.closeFailed)); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | }); |
| | | } |
| | | }; |
| | | if (logic != null) |
| | | { |
| | |
| | | button2.TextSize = 15; |
| | | button2.TextColor = ZigbeeColor.Current.LogicTextBlackColor; |
| | | ///有时效性常开才显示时间条件文本 |
| | | } |
| | | else |
| | | { |
| | | button2.Width = Application.GetRealWidth(0); |
| | | button2.Height = Application.GetRealHeight(0); |
| | | } |
| | | ///时效性常开只有一个条件; |
| | | try |
| | | { |
| | | |
| | | var y = DateTime.Now.Year.ToString();//那一年 |
| | | var m = DateTime.Now.Month.ToString();//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | |
| | | string text5 = Language.StringByID(MyInternationalizationString.executeSone); |
| | | button2.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5; |
| | | } |
| | | catch { } |
| | | else { |
| | | button2.Y = Application.GetRealHeight(0); |
| | | button2.X = Application.GetRealWidth(0); |
| | | button2.Width = Application.GetRealWidth(0); |
| | | button2.Height = Application.GetRealHeight(0); |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | |
| | | button2.UnSelectedImagePath = "ZigeeLogic/nextIconSone.png"; |
| | | button2.TextSize = 15; |
| | | button2.TextColor = ZigbeeColor.Current.LogicTextBlackColor; |
| | | button2.Text =""; |
| | | button2.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | ///xm |
| | | |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | | ModeView(); |
| | | |
| | | |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //public static Action<bool> action1=DoorLockCommonInfo.LogicAction; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 定时更新常开模式(防止通过门锁关闭没及时刷新状态) |
| | | /// </summary> |
| | | System.Threading.Thread updateThread; |
| | | public void UpdateModeIcon() |
| | | { |
| | | updateThread = new System.Threading.Thread(() => |
| | | { |
| | | while (this.Parent != null) |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | ModeView(); |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | updateThread.Start(); |
| | | } |
| | | //System.Threading.Thread updateThread; |
| | | //public void UpdateModeIcon() |
| | | //{ |
| | | // updateThread = new System.Threading.Thread(() => |
| | | // { |
| | | // while (this.Parent != null) |
| | | // { |
| | | // System.Threading.Thread.Sleep(1000); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // try |
| | | // { |
| | | // ModeView(); |
| | | // } |
| | | // catch { } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // updateThread.Start(); |
| | | //} |
| | | |
| | | |
| | | } |
old mode 100755
new mode 100644
| | |
| | | public static async System.Threading.Tasks.Task<bool> SetNormallyOpenModeFuncAsync(ZigBee.Device.DoorLock doorLock)
|
| | | {
|
| | | //app设置“常开模式”失败
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(true);
|
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0)
|
| | | {
|
| | | return false;
|
| | |
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, msg); |
| | | contr.Show(); |
| | | }); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | addLogicPage.Show();
|
| | | addLogicPage.UpdateModeIcon();
|
| | | |
| | | addLogicPage.action += (w) =>
|
| | | {
|
| | | doorLock.IsDoorLockNormallyMode = w;
|