| | |
| | | <Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.4b65c4650918" /> |
| | | <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.4b65c4650918" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/LogicDveiceStatus.cs"> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/PublicInterface.cs"> |
| | | <Files> |
| | | <File FileName="Home.Ios/Resources/Language.ini" Line="659" Column="10" IsPinned="True" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicDveiceStatus.cs" Line="1196" Column="86" /> |
| | | <File FileName="Shared/Phone/Device/Logic/PublicInterface.cs" Line="549" Column="26" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicCommunalPage.cs" Line="99" Column="13" /> |
| | | <File FileName="Shared/Phone/Device/Logic/CurrentDeviceState.cs" Line="1346" Column="34" /> |
| | | <File FileName="Shared/Phone/Device/Logic/DelayTime.cs" Line="23" Column="1" /> |
| | | <File FileName="Shared/Phone/Device/Logic/DelayTime.cs" Line="23" Column="1" /> |
| | | <File FileName="Shared/Phone/Device/Logic/DeviceTarget.cs" Line="119" Column="30" /> |
| | | <File FileName="Shared/Common/Logic.cs" Line="66" Column="21" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicDveiceStatus.cs" Line="1184" Column="80" /> |
| | | <File FileName="Shared/Phone/Device/Logic/CurrentDeviceState.cs" Line="1538" Column="29" /> |
| | | <File FileName="Shared/Phone/Device/Logic/MemberList.cs" Line="21" Column="21" /> |
| | | <File FileName="Shared/Phone/Device/Logic/SoneLogicList.cs" Line="702" Column="44" /> |
| | | <File FileName="Shared/Phone/Device/Logic/OneLogic.cs" Line="435" Column="41" /> |
| | | <File FileName="Shared/Phone/Device/Logic/LogicIfon.cs" Line="17" Column="1" /> |
| | | <File FileName="Shared/Phone/Device/Logic/PublicInterface.cs" Line="290" Column="1" /> |
| | | <File FileName="Shared/Phone/Device/Logic/PublicInterface.cs" Line="290" Column="1" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | |
| | | <Node name="Device" expanded="True"> |
| | | <Node name="Logic" expanded="True"> |
| | | <Node name="LogicView" expanded="True" /> |
| | | <Node name="LogicDveiceStatus.cs" selected="True" /> |
| | | <Node name="PublicInterface.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <MonoDevelop.Ide.DebuggingService.PinnedWatches /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore /> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/hdl/Desktop/wjc/HomeApp/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs" relfile="Shared/Phone/Device/Logic/LogicIfon.cs" line="17" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { common }); |
| | | |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.AirQualitySensor) |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common, devices); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | private static void AirSonser(FrameLayout flMain,string SelectedDeviceStatus,bool edit,CommonDevice common) { |
| | | /// <summary> |
| | | /// 空气质量传感器View(特殊处理) |
| | | /// </summary> |
| | | /// <param name="flMain"></param> |
| | | /// <param name="SelectedDeviceStatus"></param> |
| | | /// <param name="edit"></param> |
| | | /// <param name="common"></param> |
| | | /// <param name="dic"></param> |
| | | private static void AirSonser(FrameLayout flMain,string SelectedDeviceStatus,bool edit,CommonDevice common, Dictionary<string, string> dic=null) { |
| | | flMain.RemoveAll(); |
| | | PublicInterface publicInterface = new PublicInterface(); |
| | | var list0 = publicInterface.GetViewList("空气质量传感器"); |
| | | publicInterface.SingleSelectionShow(flMain, list0, MyInternationalizationString.airqualitysensor, "", (tagText) => |
| | | if (edit&&dic!=null) { |
| | | AirProperty(flMain, dic, common,"", edit, SelectedDeviceStatus); |
| | | } |
| | | else |
| | | { |
| | | flMain.RemoveAll(); |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | PublicInterface publicInterface = new PublicInterface(); |
| | | var list0 = publicInterface.GetViewList("空气质量传感器"); |
| | | publicInterface.SingleSelectionShow(flMain, list0, MyInternationalizationString.airqualitysensor, "", (tagText) => |
| | | { |
| | | flMain.RemoveAll(); |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | AirProperty(flMain, dic, common,tagText, edit, SelectedDeviceStatus); |
| | | }, () => { flMain.RemoveFromParent(); }); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 空气质量传感器属性值(特殊处理) |
| | | /// </summary> |
| | | /// <param name="flMain"></param> |
| | | /// <param name="dic"></param> |
| | | /// <param name="common"></param> |
| | | /// <param name="tagText"></param> |
| | | /// <param name="edit"></param> |
| | | /// <param name="SelectedDeviceStatus"></param> |
| | | private static void AirProperty(FrameLayout flMain, Dictionary<string, string> dic,CommonDevice common,string tagText,bool edit, string SelectedDeviceStatus) { |
| | | PublicInterface publicInterface = new PublicInterface(); |
| | | string range = ""; |
| | | string stateText = ""; |
| | | if (edit&& dic!=null) |
| | | { |
| | | range = dic["Range"]; |
| | | switch (dic["Cluster_ID"]) |
| | | { |
| | | case "1066": |
| | | { |
| | | if (dic["AttriButeId"] == "57344") |
| | | { |
| | | tagText = Language.StringByID(MyInternationalizationString.kongqizhiliang); |
| | | switch (dic["AttriButeData1"]) |
| | | { |
| | | |
| | | case "1": |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.you); |
| | | } |
| | | break; |
| | | case "2": |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.liang); |
| | | } |
| | | break; |
| | | case "3": |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.cha); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | tagText = Language.StringByID(MyInternationalizationString.pm25); |
| | | ///Pm2.5 |
| | | int intValue = int.Parse(dic["AttriButeData1"]); |
| | | if (0 < intValue && intValue < 30) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.pmyou); |
| | | } |
| | | else if (36 < intValue && intValue < 75) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.pmliang); |
| | | } |
| | | else if (76 < intValue && intValue < 115) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.pmqingdu); |
| | | } |
| | | else if (intValue > 115) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.pmzhongdu); |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |
| | | case "1037": |
| | | { |
| | | tagText = Language.StringByID(MyInternationalizationString.co2); |
| | | ///co2 |
| | | int intValue = int.Parse(dic["AttriButeData1"]); |
| | | if (0 < intValue && intValue < 1000) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.co2qingxin); |
| | | } |
| | | else if (1000 < intValue && intValue < 2000) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.co2huizhuo); |
| | | } |
| | | else if (2000 < intValue && intValue < 5000) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.co2queyang); |
| | | } |
| | | else if (intValue > 5000) |
| | | { |
| | | stateText = Language.StringByID(MyInternationalizationString.co2yanzhongqueyang); |
| | | } |
| | | } |
| | | break; |
| | | case "1026": |
| | | { |
| | | tagText = Language.StringByID(MyInternationalizationString.sensortemperature); |
| | | stateText = dic["AttriButeData1"]; |
| | | } |
| | | break; |
| | | case "1029": |
| | | { |
| | | tagText = Language.StringByID(MyInternationalizationString.sensorhumidity); |
| | | stateText = dic["AttriButeData1"]; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | Dictionary<string, string> airqualitysensorDic = new Dictionary<string, string>(); |
| | | Send.dictionary(airqualitysensorDic, "Type", "1"); |
| | | Send.dictionary(airqualitysensorDic, "IsValid", "1"); |
| | | Send.dictionary(airqualitysensorDic, "MacAddr", common.DeviceAddr); |
| | | Send.dictionary(airqualitysensorDic, "Epoint", common.DeviceEpoint.ToString()); |
| | | //编辑时的状态值 |
| | | string stateText = ""; |
| | | if (tagText == Language.StringByID(MyInternationalizationString.kongqizhiliang)) |
| | | if (tagText == Language.StringByID(MyInternationalizationString.kongqizhiliang)) |
| | | { |
| | | |
| | | |
| | | var list1 = publicInterface.GetViewList("空气质量"); |
| | | publicInterface.SingleSelectionShow(flMain, list1, MyInternationalizationString.airqualitysensor, stateText, (strText) => |
| | | { |
| | |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | |
| | | |
| | | }, () =>{ AirSonser(flMain, SelectedDeviceStatus, edit, common); }); |
| | | }, () => { |
| | | if (edit) { flMain.RemoveFromParent(); } |
| | | else |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | } }); |
| | | |
| | | } |
| | | else if (tagText == Language.StringByID(MyInternationalizationString.pm25)) |
| | | { |
| | | var list2= publicInterface.GetViewList("pm2.5"); |
| | | publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.pm25, stateText, (strText) => |
| | | var list2 = publicInterface.GetViewList("pm2.5"); |
| | | publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.pm25, stateText, (strText) => |
| | | { |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | string valuaStr = ""; |
| | | if (strText == Language.StringByID(MyInternationalizationString.pmyou)) |
| | | { |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | string valuaStr = ""; |
| | | if (strText == Language.StringByID(MyInternationalizationString.pmyou)) |
| | | { |
| | | valuaStr = "18"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmliang)) |
| | | { |
| | | valuaStr = "54"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmqingdu)) |
| | | { |
| | | valuaStr = "105"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmzhongdu)) |
| | | { |
| | | valuaStr = "130"; |
| | | } |
| | | Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | Send.dictionary(airqualitysensorDic, "Range", "1"); |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | valuaStr = "18"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmliang)) |
| | | { |
| | | valuaStr = "54"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmqingdu)) |
| | | { |
| | | valuaStr = "105"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.pmzhongdu)) |
| | | { |
| | | valuaStr = "130"; |
| | | } |
| | | Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | Send.dictionary(airqualitysensorDic, "Range", "1"); |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | |
| | | |
| | | }, () => {AirSonser(flMain, SelectedDeviceStatus, edit, common); }); |
| | | }, () => { |
| | | if (edit) { flMain.RemoveFromParent(); } |
| | | else |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | else if (tagText == Language.StringByID(MyInternationalizationString.co2)) |
| | | { |
| | | |
| | | var list2 = publicInterface.GetViewList("co2"); |
| | | publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.co2, stateText, (strText) => |
| | | var list2 = publicInterface.GetViewList("co2"); |
| | | publicInterface.SingleSelectionShow(flMain, list2, MyInternationalizationString.co2, stateText, (strText) => |
| | | { |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | string valuaStr = ""; |
| | | if (strText == Language.StringByID(MyInternationalizationString.co2qingxin)) |
| | | { |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | string valuaStr = ""; |
| | | if (strText == Language.StringByID(MyInternationalizationString.co2qingxin)) |
| | | { |
| | | valuaStr = "500"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2huizhuo)) |
| | | { |
| | | valuaStr = "1000"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2queyang)) |
| | | { |
| | | valuaStr = "2500"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2yanzhongqueyang)) |
| | | { |
| | | valuaStr = "5500"; |
| | | } |
| | | Send.dictionary(airqualitysensorDic, "Cluster_ID", "1037"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | Send.dictionary(airqualitysensorDic, "Range", "1"); |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | valuaStr = "500"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2huizhuo)) |
| | | { |
| | | valuaStr = "1500"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2queyang)) |
| | | { |
| | | valuaStr = "2500"; |
| | | } |
| | | else if (strText == Language.StringByID(MyInternationalizationString.co2yanzhongqueyang)) |
| | | { |
| | | valuaStr = "5500"; |
| | | } |
| | | Send.dictionary(airqualitysensorDic, "Cluster_ID", "1037"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr); |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | Send.dictionary(airqualitysensorDic, "Range", "1"); |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | |
| | | |
| | | }, () => { AirSonser(flMain, SelectedDeviceStatus, edit, common); }); |
| | | }, () => { |
| | | if (edit) { flMain.RemoveFromParent(); } |
| | | else |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else if (tagText == Language.StringByID(MyInternationalizationString.sensortemperature)) |
| | | { |
| | | //编辑时的状态值 |
| | | string str1 = ""; |
| | | string str2 = ""; |
| | | publicInterface.TemperatureShow1(flMain, tagText, "℃", str2, str1, (relationValueStr, tempValueStr) => |
| | | string str1 = range; |
| | | string str2 = stateText; |
| | | publicInterface.TemperatureShow1(flMain, tagText, "℃", str1, str2, (relationValueStr, tempValueStr) => |
| | | { |
| | | |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | |
| | | |
| | | }, () => |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | if (edit) { flMain.RemoveFromParent(); } |
| | | else |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | else if (tagText == Language.StringByID(MyInternationalizationString.sensorhumidity)) |
| | | { |
| | | //编辑时的状态值 |
| | | string str1 = ""; |
| | | string str2 = ""; |
| | | publicInterface.TemperatureShow1(flMain, tagText, "%", str2, str1, (relationValueStr, tempValueStr) => |
| | | string str1 = range; |
| | | string str2 = stateText; |
| | | publicInterface.TemperatureShow1(flMain, tagText, "%", str1, str2, (relationValueStr, tempValueStr) => |
| | | { |
| | | SelectedDeviceStatus = "TemperatureSensor"; |
| | | Send.dictionary(airqualitysensorDic, "Cluster_ID", "1029"); |
| | |
| | | Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | Send.dictionary(airqualitysensorDic, "Range", relationValueStr); |
| | | AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | }, () => { AirSonser(flMain, SelectedDeviceStatus, edit, common);}); |
| | | }, () => { |
| | | if (edit) { flMain.RemoveFromParent(); } |
| | | else |
| | | { |
| | | AirSonser(flMain, SelectedDeviceStatus, edit, common); |
| | | } |
| | | }); |
| | | } |
| | | }, () => { flMain.RemoveFromParent(); }); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 空气质量传感器 |
| | | /// 空气质量传感器(特殊处理) |
| | | /// </summary> |
| | | /// <param name="flMain"></param> |
| | | /// <param name="SelectedDeviceStatus"></param> |
| | | /// <param name="edit"></param> |
| | | /// <param name="common"></param> |
| | | /// <param name="dic"></param> |
| | | private static void AddDic(FrameLayout flMain, string SelectedDeviceStatus, bool edit, CommonDevice common, Dictionary<string, string> dic) |
| | | private static void AddDic(FrameLayout flMain, string SelectedDeviceStatus, bool edit, CommonDevice common, Dictionary<string, string> dic ) |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | if (SelectedDeviceStatus != "") |
| | |
| | | UserView.HomePage.Instance.AddChidren(timePoint); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | timePoint.IsEditor = true; |
| | | timePoint.Show(conditions); |
| | | timePoint.Show(dic); |
| | | } |
| | | break; |
| | | case 5: |
| | |
| | | UserView.HomePage.Instance.AddChidren(memberList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | MemberList.edit = true; |
| | | memberList.Show(deviceinof, conditions); |
| | | memberList.Show(deviceinof, dic); |
| | | } |
| | | } |
| | | break; |
| | |
| | | } |
| | | |
| | | |
| | | public void dddd(FrameLayout flMain,string MacAddr,string Epoint) { |
| | | |
| | | //Dictionary<string, string> airqualitysensorDic = new Dictionary<string, string>(); |
| | | //Send.dictionary(airqualitysensorDic, "Type", "1"); |
| | | //Send.dictionary(airqualitysensorDic, "IsValid", "1"); |
| | | //Send.dictionary(airqualitysensorDic, "MacAddr", MacAddr); |
| | | //Send.dictionary(airqualitysensorDic, "Epoint", Epoint); |
| | | |
| | | //string tagText =""; |
| | | //string SelectedDeviceStatus = ""; |
| | | //if (tagText == Language.StringByID(MyInternationalizationString.airqualitysensor)) |
| | | //{ |
| | | // string stateText = ""; |
| | | // PublicInterface publicInterface = new PublicInterface(); |
| | | // var list1 = publicInterface.GetViewList("空气质量"); |
| | | // publicInterface.SingleSelectionShow(flMain, list1, MyInternationalizationString.airqualitysensor, stateText, (strText) => |
| | | // { |
| | | // SelectedDeviceStatus = "TemperatureSensor"; |
| | | // string valuaStr = ""; |
| | | // if (strText == Language.StringByID(MyInternationalizationString.you)) |
| | | // { |
| | | // valuaStr = "1"; |
| | | // } |
| | | // else if (strText == Language.StringByID(MyInternationalizationString.liang)) |
| | | // { |
| | | // valuaStr = "2"; |
| | | // } |
| | | // else if (strText == Language.StringByID(MyInternationalizationString.cha)) |
| | | // { |
| | | // valuaStr = "3"; |
| | | // } |
| | | // Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeId", "57344"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData1", valuaStr); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "Range", "1"); |
| | | // AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | |
| | | |
| | | // }, () => { }); |
| | | |
| | | //} |
| | | //else if (tagText == Language.StringByID(MyInternationalizationString.pm25)) |
| | | //{ |
| | | // //编辑时的状态值 |
| | | // string str1 = ""; |
| | | // string str2 = ""; |
| | | // PublicInterface publicInterface = new PublicInterface(); |
| | | // publicInterface.TemperatureShow1(flMain, tagText, "℃", str2, str1, (relationValueStr, tempValueStr) => |
| | | // { |
| | | // SelectedDeviceStatus = "TemperatureSensor"; |
| | | // Send.dictionary(airqualitysensorDic, "Cluster_ID", "1066"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData1", tempValueStr); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "Range", relationValueStr); |
| | | // AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | // }, () => { }); |
| | | |
| | | //} |
| | | //else if (tagText == Language.StringByID(MyInternationalizationString.sensortemperature)) |
| | | //{ |
| | | // //编辑时的状态值 |
| | | // string str1 = ""; |
| | | // string str2 = ""; |
| | | // PublicInterface publicInterface = new PublicInterface(); |
| | | // publicInterface.TemperatureShow1(flMain, tagText, "℃", str2, str1, (relationValueStr, tempValueStr) => |
| | | // { |
| | | |
| | | // SelectedDeviceStatus = "TemperatureSensor"; |
| | | // Send.dictionary(airqualitysensorDic, "Cluster_ID", "1026"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData1", tempValueStr); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "Range", relationValueStr); |
| | | // AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | |
| | | |
| | | // }, () => { }); |
| | | //} |
| | | //else if (tagText == Language.StringByID(MyInternationalizationString.sensorhumidity)) |
| | | //{ |
| | | // //编辑时的状态值 |
| | | // string str1 = ""; |
| | | // string str2 = ""; |
| | | // PublicInterface publicInterface = new PublicInterface(); |
| | | // publicInterface.TemperatureShow1(flMain, tagText, "%", str2, str1, (relationValueStr, tempValueStr) => |
| | | // { |
| | | // SelectedDeviceStatus = "TemperatureSensor"; |
| | | // Send.dictionary(airqualitysensorDic, "Cluster_ID", "1029"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeId", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData1", tempValueStr); |
| | | // Send.dictionary(airqualitysensorDic, "AttriButeData2", "0"); |
| | | // Send.dictionary(airqualitysensorDic, "Range", relationValueStr); |
| | | // AddDic(flMain, SelectedDeviceStatus, edit, common, airqualitysensorDic); |
| | | // }, () => { }); |
| | | //} |
| | | } |
| | | |
| | | } |
| | | } |
old mode 100755
new mode 100644
| | |
| | | /// </summary> |
| | | /// <param name="common">Common.</param> |
| | | /// <param name="objecttype">Objecttype.</param> |
| | | public static void AddDeviceconditions(CommonDevice common, Dictionary<string, string> objecttype) |
| | | public static void AddDeviceconditions(CommonDevice common, Dictionary<string, string> objecttype) |
| | | { |
| | | for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++) |
| | | { |
| | |
| | | { |
| | | if ((Common.Logic.CurrentLogic.Conditions[i]["MacAddr"] == common.DeviceAddr) && (Common.Logic.CurrentLogic.Conditions[i]["Epoint"] == common.DeviceEpoint.ToString())) |
| | | { |
| | | if (common.Type == DeviceType.TemperatureSensor)//设备温度传感器有点特别 |
| | | if (common.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var dev = common as TemperatureSensor; |
| | | string str = ""; |
| | | if (dev.SensorDiv == 1) |
| | | |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { common }); |
| | | |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | str = "1026"; |
| | | var cluster_ID1 = Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"]; |
| | | var attriButeId1 = Common.Logic.CurrentLogic.Conditions[i]["AttriButeId"]; |
| | | var cluster_ID2 = objecttype["Cluster_ID"]; |
| | | var attriButeId2 = objecttype["AttriButeId"]; |
| | | |
| | | bool cluster_ID = false; |
| | | if (cluster_ID1 == cluster_ID2 && attriButeId1 == attriButeId2) |
| | | { |
| | | cluster_ID = true; |
| | | } |
| | | |
| | | if (cluster_ID) |
| | | { |
| | | //已经存在移除再重新添加 |
| | | Common.Logic.CurrentLogic.Conditions.RemoveAt(i); |
| | | Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | str = "1029"; |
| | | } |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == str) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.RemoveAt(i); |
| | | Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype); |
| | | return; |
| | | } |
| | | //设备温度传感器 |
| | | var dev = common as TemperatureSensor; |
| | | string str = ""; |
| | | if (dev.SensorDiv == 1) |
| | | { |
| | | str = "1026"; |
| | | } |
| | | else |
| | | { |
| | | str = "1029"; |
| | | } |
| | | if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == str) |
| | | { |
| | | Common.Logic.CurrentLogic.Conditions.RemoveAt(i); |
| | | Common.Logic.CurrentLogic.Conditions.Insert(i, objecttype); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | } |
| | | else if (common.Type == DeviceType.IASZone) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 添加Logic条件的方法 |
| | | /// </summary> |
| | | /// <param name="common">Common.</param> |
| | | /// <param name="logic">Common.</param> |
| | | /// <param name="objecttype">Objecttype.</param> |
| | | public static void AddLogicconditions(Common.Logic logic, Dictionary<string, string> objecttype) |
| | | { |
| | |
| | | Common.Logic.CurrentLogic.Accounts.Add(accountsInfo); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="frame">显示在哪个界面的父控件</param> |
| | | /// <param name="symbol">符号(%,℃)</param> |
| | | /// <param name="state1">之前状态</param> |
| | | /// <param name="state1">之前状态(比较符号)</param> |
| | | /// <param name="state2">之前状态</param> |
| | | /// <param name="action">返回值</param> |
| | | public void TemperatureShow1(FrameLayout frame, string tlite,string symbol, string state1, string state2, Action<string, string> action, Action cancelAction) |
| | |
| | | case "空气质量传感器": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(MyInternationalizationString.airqualitysensor), |
| | | Language.StringByID(MyInternationalizationString.kongqizhiliang), |
| | | Language.StringByID(MyInternationalizationString.pm25), |
| | | Language.StringByID(MyInternationalizationString.co2), |
| | | Language.StringByID(MyInternationalizationString.sensortemperature), |