| | |
| | | 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; |
| | |
| | | if (bodyView.roomListView.GetChildren(i).GetType() == typeof(FrameLayout)) |
| | | { |
| | | var view1 = bodyView.roomListView.GetChildren(i) as FrameLayout; |
| | | if (!function.roomIdList.Contains(view1.Tag.ToString())) |
| | | if (!function.roomIds.Contains(view1.Tag.ToString())) |
| | | continue; |
| | | for (int j = 0; j < view1.ChildrenCount; j++) |
| | | { |
| | |
| | | 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; |
| | | } |
| | | else |
| | | { |
| | | foreach (var rId in function.roomIdList) |
| | | foreach (var rId in function.roomIds) |
| | | { |
| | | if(rId == null) |
| | | { |
| | |
| | | { |
| | | 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()); |
| | | Control.ins.SendWriteCommand(f, d); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | |
| | | foreach (var m in Music.A31MusicModel.A31MusicModelList) |
| | | { |
| | | if (m.roomIdList.Contains(room.sid)) |
| | | if (m.roomIds.Contains(room.sid)) |
| | | { |
| | | Music.SendMethod.Pause(m); |
| | | } |
| | |
| | | { |
| | | 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()); |
| | | Control.ins.SendWriteCommand(f, d); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | break; |
| | | case ShowFunction.Curtain: |
| | |
| | | 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()); |
| | | Control.ins.SendWriteCommand(f, d); |
| | | 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()); |
| | | Control.ins.SendWriteCommand(f, d); |
| | | 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()); |
| | | Control.ins.SendWriteCommand(f, d); |
| | | d.Add("on_off", f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | } |
| | | }; |
| | | |