| | |
| | | {
|
| | | case DeviceType.OnOffOutput:
|
| | | //开关功能
|
| | | if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6)
|
| | | if (common.DeviceStatusReport.CluterID == 6)
|
| | | {
|
| | | var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
|
| | | onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport;
|
| | | onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
|
| | |
|
| | | //记录、更新状态 |
| | | if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0) |
| | |
| | | |
| | | case DeviceType.AirSwitch:
|
| | | //开关功能
|
| | | if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
|
| | | if (common.DeviceStatusReport.CluterID == 6)
|
| | | {
|
| | | var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
|
| | | airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
|
| | | airSwitch.DeviceStatusReport = common.DeviceStatusReport;
|
| | | for (int j = 0; j < frameLayout.ChildrenCount; j++)
|
| | | {
|
| | | var tempView = frameLayout.GetChildren(j);
|
| | |
| | | }
|
| | | } |
| | | //当CluterID=3,就证明该设备在线,直接标记 |
| | | if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3) |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var airSwitch = deviceUI.CommonDevice as AirSwitch; |
| | | airSwitch.IsOnline = 1; |
| | |
| | | break;
|
| | | |
| | | case DeviceType.WindowCoveringDevice:
|
| | | if ((common as Rollershade).DeviceStatusReport.CluterID == 258) |
| | | if (common.DeviceStatusReport.CluterID == 258) |
| | | { |
| | | if ((common as Rollershade).DeviceStatusReport.AttriBute[0].AttributeId == 0) |
| | | if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0) |
| | | { |
| | | //窗帘类型 |
| | | var rollerShade = deviceUI.CommonDevice as Rollershade; |
| | | rollerShade.DeviceStatusReport = (common as Rollershade).DeviceStatusReport; |
| | | rollerShade.WcdType = (common as Rollershade).DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | rollerShade.DeviceStatusReport = common.DeviceStatusReport; |
| | | rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | | } |
| | | } |
| | | if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3) |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
|
| | | rollershade.IsOnline = 1; |
| | |
| | | |
| | | case DeviceType.Thermostat: |
| | | //AC功能 |
| | | if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513) |
| | | if (common.DeviceStatusReport.CluterID == 513) |
| | | { |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport; |
| | | ac.DeviceStatusReport = common.DeviceStatusReport; |
| | | var attriButeList = ac.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | |
| | | |
| | | } |
| | | //当CluterID=3,就证明该设备在线,直接标记 |
| | | if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3) |
| | | if (common.DeviceStatusReport.CluterID == 3) |
| | | { |
| | | var ac = deviceUI.CommonDevice as AC; |
| | | ac.IsOnline = 1; |
| | |
| | | case DeviceType.DimmableLight: |
| | | //调光灯功能 |
| | | //开关功能 |
| | | if ((common as DimmableLight).DeviceStatusReport.CluterID == 6) |
| | | if (common.DeviceStatusReport.CluterID == 6) |
| | | { |
| | | var dimmableLight = deviceUI.CommonDevice as DimmableLight; |
| | | dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | //记录、更新状态 |
| | | if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | //亮度 |
| | | if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8) |
| | | if (common.DeviceStatusReport.CluterID == 8) |
| | | { |
| | | var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight; |
| | | dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport; |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | var attriButeList = dimmableLight.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | |
| | | { |
| | | ShowNoGatewayTip(); |
| | | } |
| | | |
| | |
|
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void GoToAddGateWay(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWaySelectForm { }; |
| | | selectNewGateWayForm.AddForm(selectNewGateWayForm); |
| | | var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm { }; |
| | | selectNewGateWayForm.AddForm(); |
| | | } |
| | | |
| | | #endregion |