| | |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control.cs"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget." /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Packet.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs" Line="469" Column="1" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs" Line="133" Column="31" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="991" Column="44" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs" Line="106" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" Line="388" Column="58" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs" Line="177" Column="49" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" Line="230" Column="28" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="21" Column="89" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="943" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="237" Column="59" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" Line="741" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="853" Column="21" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="340" Column="36" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="170" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="315" Column="1" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="55" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="1050" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="272" Column="45" /> |
| | | <File FileName="HDL_ON/Entity/Function/Function.cs" Line="1326" Column="32" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs" Line="8" Column="28" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="384" Column="1" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True"> |
| | | <Node name="Control.cs" selected="True" /> |
| | | <Node name="Packet.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="Electrical" expanded="True" /> |
| | | <Node name="AC" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | | <Pad Id="MonoDevelop.Debugger.WatchPad"> |
| | | <State /> |
| | | </Pad> |
| | | </Pads> |
| | | </MonoDevelop.Ide.Workbench> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="343" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" line="148" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="865" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2689" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2685" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2691" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2687" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" line="524" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="322" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="943" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" line="236" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="798" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="852" column="11" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="837" column="12" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="835" column="12" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" line="200" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="727" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 510=Please select the deployment target. |
| | | 511=Combined dimming |
| | | 512=Message push is not enabled, please go to settings. |
| | | |
| | | 513=Please enter the pairing code |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 510=请选择布防目标。 |
| | | 511=组合调光 |
| | | 512=消息推送未开启,请前往设置。 |
| | | 513=请输入配对码 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109281" android:versionName="1.2.202109281" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202110112" android:versionName="1.2.202110112" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | 510=Please select the deployment target. |
| | | 511=Combined dimming |
| | | 512=Message push is not enabled, please go to settings. |
| | | |
| | | 513=Please enter the pairing code |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 510=请选择布防目标。 |
| | | 511=组合调光 |
| | | 512=消息推送未开启,请前往设置。 |
| | | 513=请输入配对码 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 请输入配对码 |
| | | /// </summary> |
| | | public const int PlsEntryPairCode = 513; |
| | | /// <summary> |
| | | /// 安卓消息推送提示 |
| | | /// </summary> |
| | | public const int Android_MessagePushTip = 512; |
| | |
| | | return $"/base/{Control.Ins.GatewayId}/thing/property/up"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 网关上报设备状态 |
| | | /// 去掉id对比 |
| | | /// </summary> |
| | | public string GatewayUpSortTopic |
| | | { |
| | | get |
| | | { |
| | | return "/thing/property/up"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 场景执行 |
| | | /// </summary> |
| | |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" || |
| | | receiveObj.Topic == CommunicationTopic.ct.ControlFunctionTopic + "_reply" || |
| | | receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus) |
| | | receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus || |
| | | receiveObj.Topic.Contains( CommunicationTopic.ct.GatewayUpSortTopic)) |
| | | { |
| | | //TODO 暂时不传正确的数据上去,如果后面要优化前面这些代码 |
| | | UpdataFunctionStatus(receiveObj.BodyDataString, null); |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | case SPK.SensorHcho: |
| | | if(localFunction.spk == SPK.SensorTemperature) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | |
| | | case SPK.SensorWater: |
| | | case SPK.ClothesHanger: |
| | | case SPK.AcIr: |
| | | case SPK.HvacAC: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | case SPK.SensorGas: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | FunctionPage.UpdataStates(function); |
| | | HomePage.UpdataFunctionStates(function); |
| | | ClassificationPage.UpdataInfo(function); |
| | | ACPage.UpdataStates(function); |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status); |
| | | |
| | | } |
| | | } |
| | | break; |
| | |
| | | FunctionPage.UpdataStates(function); |
| | | HomePage.UpdataFunctionStates(function); |
| | | ClassificationPage.UpdataInfo(function); |
| | | ACPage.UpdataStates(function); |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status); |
| | | } |
| | | } |
| | | break; |
| | |
| | | /// <param name="productPlatform"></param> |
| | | /// <param name="productBrand"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew IndependentRegister3TyDevcie(string spk,string extDevId,string deviceName) |
| | | public ResponsePackNew IndependentRegister3TyDevcie(string spk,string extDevId,string deviceName,string pairCode = "") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("spk", spk); |
| | | d.Add("extDevId", extDevId); |
| | | d.Add("name", deviceName); |
| | | d.Add("code", pairCode); |
| | | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson); |
| | |
| | | /// value |
| | | /// </summary> |
| | | public const string Value = "value"; |
| | | |
| | | public const string Co2 = "co2"; |
| | | public const string Temperature = "temperature"; |
| | | public const string Hcho = "hcho"; |
| | | public const string Humidity = "humidity"; |
| | | public const string Pm25 = "pm25"; |
| | | public const string Tvoc = "tvoc"; |
| | | /// <summary> |
| | | /// 状态,传感器 |
| | | /// </summary> |
| | |
| | | /// 节能 |
| | | /// </summary> |
| | | public const string Energy = "energy"; |
| | | /// <summary> |
| | | /// 湿度 |
| | | /// </summary> |
| | | public const string Humidity = "humidity"; |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | | public const string Temperature = "temperature"; |
| | | /// <summary> |
| | | /// 室内温度 |
| | | /// </summary> |
| | |
| | | case SPK.SensorSmoke: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | if (con.value == "true" || con.value == "alarm") |
| | | { |
| | | text += Language.StringByID(StringId.InAlarm) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | else if (con.value == "false" || con.value == "normal") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | |
| | | case SPK.SensorWater: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | if (con.value == "true" || con.value == "alarm") |
| | | { |
| | | text += Language.StringByID(StringId.WaterLeakage) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | else if (con.value == "false" || con.value == "normal") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | |
| | | case SPK.SensorDoorWindow: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | if (con.value == "true" || con.value == "open") |
| | | { |
| | | text += Language.StringByID(StringId.Open) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | else if (con.value == "false" || con.value == "close") |
| | | { |
| | | text += Language.StringByID(StringId.Close) + " "; |
| | | } |
| | |
| | | /// </summary> |
| | | public double GetValues(Function function) |
| | | { |
| | | var value = function.GetAttrState(FunctionAttributeKey.Value); |
| | | FunctionAttributes attr = function.GetAttribute(FunctionAttributeKey.Value); |
| | | if (attr == null) |
| | | { |
| | | switch (function.spk) |
| | | { |
| | | case SPK.SensorCO2: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Co2); |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Temperature); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Tvoc); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Pm25); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Hcho); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | attr = function.GetAttribute(FunctionAttributeKey.Humidity); |
| | | break; |
| | | } |
| | | } |
| | | double value = 0.0; |
| | | double.TryParse( attr.state,out value); |
| | | |
| | | return Convert.ToDouble(value); |
| | | } |
| | | /// <summary> |
| | |
| | | break; |
| | | |
| | | case SPK.BrandType.Tuya: |
| | | lock (Functions) |
| | | { |
| | | foreach (var function in Functions) |
| | | { |
| | | if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(function.spk)) |
| | |
| | | resultFunctions.Add(function); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | return resultFunctions; |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0928"; |
| | | public static string VersionString = "1.2.1012"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | public static List<string> SceneSupportFunctionList = new List<string> { |
| | | SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.AcIr,SPK.AcStandard,SPK.HvacAC, |
| | | SPK.FloorHeatStandard,SPK.HvacFloorHeat, |
| | | SPK.AirFreshStandard,SPK.HvacAirFresh, |
| | | SPK.AirSwitch, |
| | |
| | | break; |
| | | case SPK.AcIr: |
| | | case SPK.AcStandard: |
| | | case SPK.HvacAC: |
| | | var acPage = new AcControlPage(); |
| | | acPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | | etAccount.Text = "13226233133";//豆豆 |
| | | //etAccount.Text = "18316672920"; |
| | | etAccount.Text = "18316672920"; |
| | | //etAccount.Text = "18316120654";//tujie |
| | | etAccount.Text = "15626203746"; |
| | | etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | //etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | } |
| | | else |
| | | { |
| | |
| | | //etAccount.Text = "tf@smarttech.com.ua"; |
| | | //etAccount.Text = "18814122445";//董泽斌 天河办公室 |
| | | //etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "18402017839";//wjc |
| | | //etAccount.Text = "13430286286";//cwc |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, curValue="0",state = "0" ,min = 2700,max = 6500 }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | |
| | | #if DEBUG |
| | | |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.SensorDryContact, |
| | | name = "干接点", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "status",curValue= "on",state = "on" }, |
| | | }, |
| | | }); |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.SensorDryContact, |
| | | // name = "干接点", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "status",curValue= "on",state = "on" }, |
| | | // }, |
| | | //}); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.AirSwitch, |
| | | name = "智能空开", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | }, |
| | | }); |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.AirSwitch, |
| | | // name = "智能空开", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | |
| | | }; |
| | | textView.AddChidren(editText); |
| | | |
| | | string pairString = ""; |
| | | if (integratedDevice.spk == SPK.SensorEnvironment2) |
| | | { |
| | | //请输入设备机上的配对码 |
| | | var pairView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(309), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyFrameLayout.AddChidren(pairView); |
| | | pairView.AddChidren(new Button() { Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor }); |
| | | |
| | | EditText pairText = new EditText() |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPairCode), |
| | | PlaceholderTextColor = CSS.CSS_Color.PromptingColor1, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | }; |
| | | pairView.AddChidren(pairText); |
| | | |
| | | pairText.TextChangeEventHandler = (sender, e) => { |
| | | pairString = e; |
| | | }; |
| | | } |
| | | |
| | | |
| | | if (integratedDevice.spk == SPK.SensorEnvironment2 || integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | editText.PlaceholderText = Language.StringByID(StringId.PlsEntryMacCode); |
| | |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.IndependentRegister3TyDevcie(integratedDevice.spk, snCode, Language.StringByID(StringId.SensorEnvironment)); |
| | | var pack = pm.IndependentRegister3TyDevcie(integratedDevice.spk, snCode,integratedDevice.productName,pairString);// Language.StringByID(StringId.SensorEnvironment) |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString()); |
| | |
| | | input = new SecurityInput(); |
| | | input.sid = function.sid; |
| | | |
| | | var inKey = "status"; |
| | | var inValue = "true"; |
| | | switch(function.spk) |
| | | { |
| | | case SPK.SensorWater: |
| | | inKey = ""; |
| | | break; |
| | | case SPK.SensorPir: |
| | | inKey = "people_status"; |
| | | break; |
| | | case SPK.SensorSmoke: |
| | | inKey = "alarm_status"; |
| | | inValue = "alarm"; |
| | | break; |
| | | case SPK.SensorGas: |
| | | inKey = "alarm_status"; |
| | | inValue = "alarm"; |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | inKey = "contact_status"; |
| | | inValue = "open"; |
| | | break; |
| | | } |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = "status", |
| | | value = "true", |
| | | key = inKey, |
| | | value = inValue, |
| | | } |
| | | }; |
| | | |
| | |
| | | SelectedTextColor = CSS_Color.AuxiliaryColor2, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnSuctionView); |
| | | RefreshFormStatu(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.Status); |
| | | if (temp == null) |
| | | { |
| | | temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); |
| | | } |
| | | if (temp != null) |
| | | { |
| | | if (temp.state == "alarm") |
| | | { |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorSmokeStateBgIconOn.png"; |
| | | btnSuctionView.TextID = StringId.InAlarm; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | else |
| | | else if (temp.state == "normal") |
| | | { |
| | | btnIcon.IsSelected = false; |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorSmokeStateBgIcon.png"; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | break; |
| | | case "hcho": |
| | | newTemp.spk = SPK.SensorHcho; |
| | | break; |
| | | } |
| | | if(!string.IsNullOrEmpty(newTemp.spk)) |
| | | { |
| | |
| | | { |
| | | if (btn.Tag != null) |
| | | { |
| | | FunctionAttributes attr = updateTemp.GetAttribute(FunctionAttributeKey.Value); |
| | | if(attr == null) |
| | | { |
| | | switch(updateTemp.spk) |
| | | { |
| | | case SPK.SensorCO2: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Co2); |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Temperature); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Tvoc); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Pm25); |
| | | break; |
| | | case SPK.SensorHcho: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Hcho); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | attr = updateTemp.GetAttribute(FunctionAttributeKey.Humidity); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | (btn as Button).Text = attr.state;// updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | |
| | | controlView.AddChidren(btnBrightnessText);
|
| | |
|
| | | #region 色温
|
| | | var cctAttr = function.GetAttribute(FunctionAttributeKey.CCT);
|
| | | if(cctAttr.min == 0) |
| | | { |
| | | cctAttr.min = 2700; |
| | | }
|
| | | if(cctAttr.max == 0) |
| | | { |
| | | cctAttr.max = 6500; |
| | | }
|
| | |
|
| | | //色温
|
| | | var btnTempClolor = new Button();
|
| | | btnTempClolor.X = Application.GetRealWidth(35);
|
| | |
| | | btnTempClolor.TextID = StringId.ColorTemperature;
|
| | | controlView.AddChidren(btnTempClolor);
|
| | |
|
| | |
|
| | | //2700K
|
| | | var btnTempClolorMin = new Button();
|
| | | btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9);
|
| | | btnTempClolorMin.Width = Application.GetRealWidth(54);
|
| | | btnTempClolorMin.Height = Application.GetRealHeight(21);
|
| | | btnTempClolorMin.Text = "2700K";
|
| | | btnTempClolorMin.Text = cctAttr.min + "K";
|
| | | btnTempClolorMin.TextAlignment = TextAlignment.CenterRight;
|
| | | btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
|
| | | btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
|
| | |
| | | barColorTemplatrue = new CCTSeekBarControl();
|
| | | barColorTemplatrue.X = btnTempClolorMin.Right;
|
| | | barColorTemplatrue.Y = Application.GetRealHeight(340);
|
| | | barColorTemplatrue.MinValue = 27;
|
| | | barColorTemplatrue.MaxValue = 65;
|
| | | barColorTemplatrue.MinValue = cctAttr.min /100;
|
| | | barColorTemplatrue.MaxValue = cctAttr.max / 100;
|
| | | barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明
|
| | | barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
|
| | | barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
|
| | |
| | | btnTempClolorMax.X = barColorTemplatrue.Right;
|
| | | btnTempClolorMax.Width = Application.GetRealWidth(54);
|
| | | btnTempClolorMax.Height = Application.GetRealHeight(21);
|
| | | btnTempClolorMax.Text = "6500K";
|
| | | btnTempClolorMax.Text = cctAttr.max + "K";
|
| | | btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft;
|
| | | btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
|
| | | btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
|