old mode 100755
new mode 100644
| | |
| | | private readonly int sleepSpan = 300; |
| | | |
| | | |
| | | private FrameLayout itemView; |
| | | |
| | | private FrameLayout itemView=new FrameLayout(); |
| | | /// <summary> |
| | | /// floorBtn |
| | | /// </summary> |
| | | private Button floorBtn; |
| | | #endregion |
| | | |
| | | #region ◆ 接口____________________________ |
| | |
| | | {
|
| | | case DeviceType.OnOffOutput:
|
| | | //开关功能
|
| | | if (common.DeviceStatusReport.CluterID == 6)
|
| | | if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6)
|
| | | {
|
| | | var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
|
| | | onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
|
| | | onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport;
|
| | |
|
| | | //记录、更新状态 |
| | | if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0) |
| | |
| | | |
| | | case DeviceType.AirSwitch:
|
| | | //开关功能
|
| | | if (common.DeviceStatusReport.CluterID == 6)
|
| | | if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
|
| | | {
|
| | | var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
|
| | | airSwitch.DeviceStatusReport = common.DeviceStatusReport;
|
| | | airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
|
| | | for (int j = 0; j < frameLayout.ChildrenCount; j++)
|
| | | {
|
| | | var tempView = frameLayout.GetChildren(j);
|
| | |
| | | }
|
| | | } |
| | | //当CluterID=3,就证明该设备在线,直接标记 |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var airSwitch = deviceUI.CommonDevice as AirSwitch; |
| | | airSwitch.IsOnline = 1; |
| | |
| | | break;
|
| | | |
| | | case DeviceType.WindowCoveringDevice:
|
| | | if (common.DeviceStatusReport.CluterID == 258) |
| | | if ((common as Rollershade).DeviceStatusReport.CluterID == 258) |
| | | { |
| | | if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0) |
| | | if ((common as Rollershade).DeviceStatusReport.AttriBute[0].AttributeId == 0) |
| | | { |
| | | //窗帘类型 |
| | | var rollerShade = deviceUI.CommonDevice as Rollershade; |
| | | rollerShade.DeviceStatusReport = common.DeviceStatusReport; |
| | | rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | rollerShade.DeviceStatusReport = (common as Rollershade).DeviceStatusReport; |
| | | rollerShade.WcdType = (common as Rollershade).DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | | } |
| | | } |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
|
| | | rollershade.IsOnline = 1; |
| | |
| | | |
| | | case DeviceType.Thermostat: |
| | | //AC功能 |
| | | if (common.DeviceStatusReport.CluterID == 513) |
| | | if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513) |
| | | { |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | ac.DeviceStatusReport = common.DeviceStatusReport; |
| | | ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport; |
| | | var attriButeList = ac.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | |
| | | |
| | | } |
| | | //当CluterID=3,就证明该设备在线,直接标记 |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var ac = deviceUI.CommonDevice as AC; |
| | | ac.IsOnline = 1; |
| | |
| | | case DeviceType.DimmableLight: |
| | | //调光灯功能 |
| | | //开关功能 |
| | | if (common.DeviceStatusReport.CluterID == 6) |
| | | if ((common as DimmableLight).DeviceStatusReport.CluterID == 6) |
| | | { |
| | | var dimmableLight = deviceUI.CommonDevice as DimmableLight; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport; |
| | | //记录、更新状态 |
| | | if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | //亮度 |
| | | if (common.DeviceStatusReport.CluterID == 8) |
| | | if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) |
| | | { |
| | | var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; |
| | | var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | |
| | | }; |
| | | topFrameLayout.AddChidren(floor); |
| | | |
| | | var floorBtn = new Button |
| | | floorBtn = new Button |
| | | { |
| | | X=floor.Right, |
| | | Width=Application.GetRealWidth(500), |
| | |
| | | } |
| | | AddChidren(residecneName); |
| | | |
| | | EventHandler<MouseEventArgs> selectFloor = (send, e) => |
| | | { |
| | | var floorFL = new Phone.Device.Category.SelectFloor(); |
| | | AddChidren(floorFL); |
| | | floorFL.Init(35,153); |
| | | floorFL.FloorAction = (floorName) => |
| | | { |
| | | floorBtn.Text = floorName; |
| | | }; |
| | | }; |
| | | floor.MouseUpEventHandler += selectFloor; |
| | | floorBtn.MouseUpEventHandler += selectFloor; |
| | | floor.MouseUpEventHandler += SelectFloor; |
| | | floorBtn.MouseUpEventHandler += SelectFloor; |
| | | //切换住宅 |
| | | residecneName.MouseLongEventHandler += (send, e) => |
| | | { |
| | |
| | | { |
| | | //Room.CurrentRoom = Room.CurrentRoom == null ? Room.Lists[0] : Room.CurrentRoom; |
| | | Room.CurrentRoom = Room.Lists[0]; |
| | | foreach (var room in Room.Lists) |
| | | foreach (var room in Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom()) |
| | | { |
| | | var roomBackView = new FrameLayout() |
| | | { |
| | |
| | | //{ |
| | | // Show(); |
| | | //}; |
| | | |
| | | if(room.IsLove) |
| | | { |
| | | return; |
| | | } |
| | | var editRoom = new Device.Room.EditRoom(); |
| | | HomePage.Instance.AddChidren(editRoom); |
| | | HomePage.Instance.PageIndex += 1; |
| | |
| | | #endregion |
| | | |
| | | #region ◆ 刷新____________________________ |
| | | |
| | | /// <summary> |
| | | /// RefreshBodyView |
| | | /// </summary> |
| | | public void RefreshBodyView() |
| | | { |
| | | if (Room.CanInitAllRoom == false) |
| | |
| | | { |
| | | ShowScene(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SelectFloor |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | public void SelectFloor(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | var floorFL = new Phone.Device.Category.SelectFloor(); |
| | | AddChidren(floorFL); |
| | | floorFL.Init(35, 153); |
| | | floorFL.FloorAction = (floorName) => |
| | | { |
| | | floorBtn.Text = floorName; |
| | | Show(); |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | Shared.Common.Room.GetLoveRoom().DeleteDevice(device.FileName); |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName); |
| | | (sender as Button).IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.GetLoveRoom().AddDevice(device.FileName); |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName); |
| | | (sender as Button).IsSelected = true; |
| | | } |
| | | if (Room.CurrentRoom.IsLove) |
| | |
| | | sceneView.Init(); |
| | | sceneView.SetSceneNameText(scene.Name); |
| | | sceneView.SetIcon($"SceneIcon/{i}.png"); |
| | | sceneView.SetCollect(scene.IsCollected); |
| | | sceneView.SetCollect(Common.Room.CurrentRoom.GetLoveRoom().SceneUIFilePathList.Contains(scene.FileName)); |
| | | |
| | | if (scene.SceneDelayTime == 0) |
| | | { |
| | |
| | | //收藏 |
| | | EventHandler<MouseEventArgs> collectionEvent = (sender, e) => |
| | | { |
| | | (sender as Button).IsSelected = !(sender as Button).IsSelected; |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | scene.Collect(false); |
| | | (sender as Button).IsSelected = false; |
| | | //scene.IsCollected = true; |
| | | Room.CurrentRoom.GetLoveRoom().AddScene(scene); |
| | | } |
| | | else |
| | | { |
| | | scene.Collect(true); |
| | | (sender as Button).IsSelected = true; |
| | | //scene.IsCollected = false; |
| | | Room.CurrentRoom.GetLoveRoom().RemoveScene(scene); |
| | | } |
| | | scene.Save(); |
| | | |
| | | //if ((sender as Button).IsSelected) |
| | | //{ |
| | | // scene.Collect(false); |
| | | // (sender as Button).IsSelected = false; |
| | | //} |
| | | //else |
| | | //{ |
| | | // scene.Collect(true); |
| | | // (sender as Button).IsSelected = true; |
| | | //} |
| | | //scene.Save(); |
| | | //if (Room.CurrentRoom.IsLove) |
| | | //{ |
| | | // RefreshBodyView(); |