| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 当前选择的住宅索引 |
| | | /// 0:A协议网关 |
| | | /// 1:bus网关 |
| | | /// 2:knx网关 |
| | | /// </summary> |
| | | public int CurReginIndex = 0; |
| | | public int GatewayType = 0; |
| | | |
| | | /// <summary> |
| | | /// 住宅基础信息 |
| | | /// </summary> |
| | | public RegionInfoRes residecenInfo { |
| | | public RegionInfoRes residecenInfo |
| | | { |
| | | get |
| | | { |
| | | return MainPage.LoginUser.regionList[CurReginIndex]; |
| | | if (MainPage.LocalMode) |
| | | { |
| | | return new RegionInfoRes() { Name = "本地模式" }; |
| | | } |
| | | else |
| | | { |
| | | return MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == CurReginID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 当前选择的住宅索引 |
| | | /// </summary> |
| | | public string CurReginID = ""; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 楼层列表 |
| | | /// </summary> |
| | | public List<string> floors = new List<string>(); |
| | | public List<Floor> floors = new List<Floor>(); |
| | | |
| | | /// <summary> |
| | | /// 房间列表 |
| | |
| | | if (instance.rooms.Count == 0) |
| | | { |
| | | //-------------------- |
| | | var r111 = new Room() { sid = "0001", name = "Room-1", floorIndex = 0, backgroundImage = "Classification/Room/Roombg.png" }; |
| | | var r111 = new Room() { sid = "0001", name = "Room-1", floorId = "", backgroundImage = "Classification/Room/Roombg.png" }; |
| | | instance.rooms.Add(r111); |
| | | instance.floors.Add("1 F"); |
| | | instance.floors.Add(new Floor() { sid = "", name = "1 F" }); |
| | | instance.functionList.aCs.Add(new AC() |
| | | { |
| | | sid = "12341212345678901234560604010001ABCD", |
| | |
| | | lastState = "20%", |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 111, |
| | | DeviceID = 2, |
| | | SubnetID = 42, |
| | | DeviceID = 9, |
| | | LoopID = 1, |
| | | }, |
| | | |
| | |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 42, |
| | | DeviceID = 7, |
| | | LoopID = 12, |
| | | DeviceID = 17, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | instance.functionList.floorHeatings.Add(new FloorHeating() |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | });; |
| | | |
| | | instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | | { |
| | | sid = "1234121234567890123456100B020006ABCD", |
| | | sid = "1234121234567890123456100B060006ABCD", |
| | | name = "PM2.5", |
| | | roomIdList = new List<string>() { "0001" }, |
| | | function = new List<Trait>() { |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | //instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | |
| | | //}); |
| | | instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | | { |
| | | sid = "1234121234567890123456100B050006ABCD", |
| | | sid = "1234121234567890123456100B070006ABCD", |
| | | name = "CO2", |
| | | roomIdList = new List<string>() { "0001" }, |
| | | function = new List<Trait>() { |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | | { |
| | | sid = "1234121234567890123456100B060006ABCD", |
| | | sid = "1234121234567890123456100B020006ABCD", |
| | | name = "温度", |
| | | roomIdList = new List<string>() { "0001" }, |
| | | function = new List<Trait>() { |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | | { |
| | | sid = "1234121234567890123456100B070006ABCD", |
| | | sid = "1234121234567890123456100B050006ABCD", |
| | | name = "TVOC", |
| | | roomIdList = new List<string>() { "0001" }, |
| | | function = new List<Trait>() { |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | instance.functionList.sensorsEnvironmentalScience.Add(new Sensor() |
| | | { |
| | | sid = "1234121234567890123456100B080006ABCD", |
| | | sid = "1234121234567890123456100B030006ABCD", |
| | | name = "湿度", |
| | | roomIdList = new List<string>() { "0001" }, |
| | | function = new List<Trait>() { |
| | |
| | | }, |
| | | bus_Data = new BusData |
| | | { |
| | | SubnetID = 142, |
| | | DeviceID = 4, |
| | | LoopID = 111, |
| | | SubnetID = 111, |
| | | DeviceID = 15, |
| | | LoopID = 1, |
| | | }, |
| | | }); |
| | | |
| | |
| | | return instance; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 退出账号清空数据 |
| | | /// </summary> |
| | | public void EixtAccount() |
| | | { |
| | | instance = null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 住宅图片 |
| | |
| | | /// </summary> |
| | | bool hasChange = false; |
| | | /// <summary> |
| | | /// 当前住宅的网关MAC |
| | | /// </summary> |
| | | public string residenceGatewayMAC = "4E47323347591243"; |
| | | /// <summary> |
| | | /// 保存住宅数据 |
| | | /// </summary> |
| | | public void SaveResidenceData() |