| | |
| | | switch (functionType) |
| | | { |
| | | case FunctionType.FloorHeating: |
| | | btnText = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count.ToString(); |
| | | btnText = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case FunctionType.AC: |
| | | btnText = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count.ToString(); |
| | | btnText = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | btnText = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count.ToString(); |
| | | btnText = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case FunctionCategory.Light: |
| | | btnText = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count.ToString(); |
| | | btnText = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | case FunctionCategory.Electrical: |
| | | btnText = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count.ToString(); |
| | | btnText = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); |
| | | break; |
| | | } |
| | | btn.Text = btnText; |
| | |
| | | switch (functionType) |
| | | { |
| | | case FunctionType.FloorHeating: |
| | | openCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | openCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case FunctionType.AC: |
| | | openCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | openCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | openCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | openCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case FunctionCategory.Light: |
| | | openCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | openCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case FunctionCategory.Electrical: |
| | | openCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | openCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | } |
| | | btn.IsSelected = openCount != 0; |
| | |
| | | var btn = view1.GetChildren(j) as Button; |
| | | if (btn.Tag != null && btn.Tag.ToString() == "AllClose") |
| | | { |
| | | if (function.trait_on_off.value.ToString() == "on") |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btn.Visible = true; |
| | | } |
| | |
| | | { |
| | | continue; |
| | | } |
| | | var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.value.ToString() == "on" && obj.functionCategory != FunctionCategory.Scene); |
| | | var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on" && obj.functionCategory != FunctionCategory.Scene); |
| | | var sss = ssd.Count; |
| | | if (sss == 0) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | f.trait_on_off.value = "off"; |
| | | f.trait_on_off.curValue = "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.value.ToString()); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | |
| | |
| | | { |
| | | continue; |
| | | } |
| | | if (f.trait_on_off.value.ToString() == "on") |
| | | if (f.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btn.Visible = true; |
| | | break; |
| | |
| | | case ShowFunction.AC: |
| | | foreach(var f in DB_ResidenceData.functionList.aCs) |
| | | { |
| | | f.trait_on_off.value = onoff; |
| | | f.trait_on_off.curValue = onoff; |
| | | //Control.Send(CommandType_A.write, f); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.value.ToString()); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | |
| | | case ShowFunction.Light: |
| | | foreach (var f in DB_ResidenceData.functionList.lights) |
| | | { |
| | | f.trait_on_off.value = onoff; |
| | | f.trait_on_off.curValue = onoff; |
| | | //Control.Send(CommandType_A.write, f); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.value.ToString()); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | |
| | | { |
| | | foreach (var f in DB_ResidenceData.functionList.curtains) |
| | | { |
| | | f.trait_on_off.value = "on"; |
| | | f.trait_on_off.curValue = "on"; |
| | | f.percent = 100; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.value.ToString()); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | }; |
| | |
| | | { |
| | | foreach (var f in DB_ResidenceData.functionList.curtains) |
| | | { |
| | | f.trait_on_off.value = "off"; |
| | | f.trait_on_off.curValue = "off"; |
| | | f.percent = 0; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", f.trait_on_off.value.ToString()); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | }; |