| | |
| | | switch (functionCategory) |
| | | { |
| | | case ShowFunction.FloorHeating: |
| | | btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.AC: |
| | | btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.Curtain: |
| | | btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.Light: |
| | | btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.Electric: |
| | | btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | | btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString(); |
| | | break; |
| | | } |
| | | if (btn.Tag.ToString() == functionCategory + "_onCount") |
| | |
| | | var btn = view1.GetChildren(j) as Button; |
| | | if (btn.Tag != null && btn.Tag.ToString() == "AllClose") |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | if (function.trait_on_off.state.ToString() == "on") |
| | | { |
| | | btn.Visible = true; |
| | | } |
| | |
| | | { |
| | | continue; |
| | | } |
| | | var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on"); |
| | | var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.state.ToString() == "on"); |
| | | var sss = ssd.Count; |
| | | if (sss == 0) |
| | | { |
| | |
| | | { |
| | | foreach (var f in room.GetRoomFunctions(false)) |
| | | { |
| | | f.trait_on_off.curValue = "off"; |
| | | f.trait_on_off.state = "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | d.Add("on_off", f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | |
| | |
| | | }; |
| | | foreach (var f in room.GetRoomFunctions(false)) |
| | | { |
| | | if (f.trait_on_off.curValue.ToString() == "on") |
| | | if (f.trait_on_off.state.ToString() == "on") |
| | | { |
| | | btn.Visible = true; |
| | | break; |
| | |
| | | case ShowFunction.AC: |
| | | foreach (var f in FunctionList.List.GetAcList()) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | f.trait_on_off.state = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | |
| | | case ShowFunction.FloorHeating: |
| | | foreach (var f in FunctionList.List.GetFloorHeatingList()) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | f.trait_on_off.state = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | |
| | | case ShowFunction.Light: |
| | | foreach (var f in FunctionList.List.GetLightList()) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | f.trait_on_off.state = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | |
| | | case ShowFunction.Electric: |
| | | foreach (var f in FunctionList.List.GetElectricals()) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | f.trait_on_off.state = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | |
| | | case ShowFunction.FreshAir: |
| | | foreach (var f in FunctionList.List.GetAirFreshList()) |
| | | { |
| | | f.trait_on_off.curValue = onoff; |
| | | f.trait_on_off.state = onoff; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | |
| | | { |
| | | foreach (var f in FunctionList.List.GetCurtainList()) |
| | | { |
| | | f.trait_on_off.curValue = "on"; |
| | | f.trait_on_off.state = "on"; |
| | | f.SetAttrState(FunctionAttributeKey.Percent, "100"); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | d.Add("on_off", f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | |
| | | btnOpen.IsSelected = false; |
| | | foreach (var f in FunctionList.List.GetCurtainList()) |
| | | { |
| | | f.trait_on_off.curValue = "off"; |
| | | f.trait_on_off.state = "off"; |
| | | f.SetAttrState(FunctionAttributeKey.Percent, "0"); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | d.Add("on_off", f.trait_on_off.state.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | }; |