| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.7.1" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202410091"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.7.1" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202410151"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_SMS" /> |
| | | <!--程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,我的文件等--> |
| | |
| | | { |
| | | |
| | | |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.2.120")] |
| | | public partial class Resource |
| | | { |
| | | |
| | |
| | | <BundleResource Include="Resources\Phone\Collection\TokenInvalidTipIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\RightIcon2.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\Power80pIcon.png" /> |
| | | <BundleResource Include="Resources\BEBAS.ttf" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIAppFonts</key> |
| | | <array> |
| | | <string>titilliumtext25l005.otf</string> |
| | | <string>BEBAS.ttf</string> |
| | | </array> |
| | | <key>UIBackgroundModes</key> |
| | | <array> |
| | |
| | | case SPK.AcStandard: |
| | | case SPK.HvacAC:case SPK.HvacAcPanel: |
| | | var ac = new AC(); |
| | | |
| | | byte onoff = 0; |
| | | onoff = function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0; |
| | | byte mode = 0; |
| | |
| | | byte sanfan = 0; |
| | | byte temp = 16; |
| | | temp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | byte coolTemp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.CoolTemperatrue)); |
| | | byte heatTemp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.HeatTemperatrue)); |
| | | byte autoTemp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.AutoTemperatrue)); |
| | | byte dehumiTemp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.DehumiTemperatrue)); |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | switch (dic.Key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | onoff = dic.Value == "on" ? (byte)1 : (byte)0; |
| | | //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, |
| | | // new byte[] { 3, onoff, function.bus.LoopId }); |
| | | break; |
| | | case "mode": |
| | | switch (dic.Value) |
| | | { |
| | | case "auto": |
| | | mode = 3; |
| | | temp = autoTemp; |
| | | break; |
| | | case "cool": |
| | | mode = 0; |
| | | temp = coolTemp; |
| | | break; |
| | | case "heat": |
| | | mode = 1; |
| | | temp = heatTemp; |
| | | break; |
| | | case "dry": |
| | | temp = dehumiTemp; |
| | | mode = 4; |
| | | break; |
| | | case "fan": |
| | |
| | | mode = 0; |
| | | break; |
| | | } |
| | | //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, |
| | | // new byte[] { 6, mode, function.bus.LoopId }); |
| | | break; |
| | | case "fan": |
| | | switch (dic.Value) |
| | |
| | | fan = 0; |
| | | break; |
| | | } |
| | | //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, |
| | | // new byte[] { 5, fan, function.bus.LoopId }); |
| | | break; |
| | | case FunctionAttributeKey.SetTemp: |
| | | try |
| | |
| | | { |
| | | temp = 16; |
| | | } |
| | | //byte modeKey = 4; |
| | | //switch (ac.GetModeIndex(function)) |
| | | //{ |
| | | // case 3: |
| | | // modeKey = 8; |
| | | // break; |
| | | // case 0: |
| | | // modeKey = 4; |
| | | // break; |
| | | // case 1: |
| | | // modeKey = 7; |
| | | // break; |
| | | // case 4: |
| | | // modeKey = 19; |
| | | // break; |
| | | // case 2: |
| | | // modeKey = 2; |
| | | // break; |
| | | //} |
| | | |
| | | //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { |
| | | // modeKey, temp, function.bus.LoopId }); |
| | | break; |
| | | case FunctionAttributeKey.Swing: |
| | | //sanfan |
| | |
| | | break; |
| | | } |
| | | } |
| | | /// 设置空调模块命令 |
| | | /// 1空调号(1-128) |
| | | ///2温度模式(摄氏Celsius:0,华氏Fahrenheit:1) |
| | | ///3环境温度 (摄氏0-40,华氏32-99) |
| | | ///4制冷控制温度(摄氏0-30,华氏32-86) |
| | | ///5制热控制温度(摄氏0-30,华氏32-86) |
| | | ///6自动控制温度(摄氏0-30,华氏32-86) |
| | | ///7除湿控制温度(摄氏0-30,华氏32-86) |
| | | ///8椒缢偈导使ぷ髯此? 高4bit模式(0 制冷,1制热,2通风) 低4bit风速(0 自动,1高风?风,3低风) |
| | | ///9空调开关 (1开0关) |
| | | ///10设置模式 0 制冷1制热,2通风,3自动,4除湿 |
| | | ///11设置风速 0 自动,1高风2中风,3低风 |
| | | ///12工作模控制温肚掮摄氏0-30,华氏32-86) |
| | | ///13扫风模式:高4bit(实际扫风状态:0不扫风,1扫风),低4bit(设置扫风模式:0不扫风,1扫风) |
| | | switch (mode) |
| | | { |
| | | case 0: |
| | | coolTemp = temp; |
| | | break; |
| | | case 1: |
| | | heatTemp = temp; |
| | | break; |
| | | case 3: |
| | | autoTemp = temp; |
| | | break; |
| | | case 4: |
| | | dehumiTemp = temp; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.SetACMode, function.bus.SubnetID, function.bus.DeviceID, new byte[] { function.bus.LoopId, |
| | | 0,0,0,0,0,0,0,onoff,mode,fan,temp,sanfan}); |
| | | 0,0,coolTemp,heatTemp,autoTemp,dehumiTemp,0,onoff,mode,fan,temp,sanfan}); |
| | | |
| | | break; |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard:case SPK.HvacFloorHeatPanel: |
| | |
| | | break; |
| | | case Command.SetACModeACK: |
| | | case Command.ReadACModeACK: |
| | | foreach (var function in FunctionList.List.Functions) |
| | | foreach (var function in FunctionList.List.GetAcList()) |
| | | { |
| | | if (function.bus == null || function.spk != SPK.AcStandard) |
| | | if (function.bus == null) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | function.bus.DeviceID == deviceID && |
| | | function.bus.LoopId == receiveBytes[0]) |
| | | { |
| | | Console.WriteLine(function.GetBusId()); |
| | | function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.CoolTemperatrue, receiveBytes[3].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.HeatTemperatrue, receiveBytes[4].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.AutoTemperatrue, receiveBytes[5].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.DehumiTemperatrue, receiveBytes[6].ToString()); |
| | | function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[8] == 1 ? "on" : "off"); |
| | | acFunction.SetMode(receiveBytes[9], function); |
| | | acFunction.SetFan(receiveBytes[10], function); |
| | |
| | | try |
| | | { |
| | | var topic = e.ApplicationMessage.Topic; |
| | | MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //一端口主题处理 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | { |
| | |
| | | ///4制冷控制温度(摄氏0-30,华氏32-86) |
| | | ///5制热控制温度(摄氏0-30,华氏32-86) |
| | | ///6自动控制温度(摄氏0-30,华氏32-86) |
| | | ///7除湿控制露晴摄氏0-30,华氏32-86) |
| | | ///7除湿控制温度(摄氏0-30,华氏32-86) |
| | | ///8模式风速实使作壮? 高4bit模式(0 ?龋?风,3自动,4除湿) 低4bit风速(0 自动,1高风,2蟹?风) |
| | | ///9空调开关 (1开0关) |
| | | ///10设置模式 0 制冷,1迫龋?风,3自动,4除湿 |
| | | ///11设置风速 0 自动,1高风,2中纾?风 |
| | | ///10设置模式 0 制冷,1制热,2通风,3自动,4除湿 |
| | | ///11设置风速 0 自动,1高风,2中风,3高风 |
| | | ///12工作模式控制温度 (摄氏0-30,华氏32-86) |
| | | ///13扫风模式:?it(实噬ǚ缱刺?扫风,1扫风),低4bit(设置扫风模式:0簧ǚ纾?风) |
| | | /// 0x193B |
| | |
| | | /// <summary> |
| | | /// 设置属性状态 |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <param name="value"></param> |
| | | /// <param name="setKey"></param> |
| | | /// <param name="setValues"></param> |
| | | /// <returns>修改结果</returns> |
| | | public bool SetAttrState(string key, object value) |
| | | public bool SetAttrState(string setKey, object setValues) |
| | | { |
| | | var attr = attributes.Find((s) => s.key == key); |
| | | var attr = attributes.Find((s) => s.key == setKey); |
| | | if (attr == null) |
| | | { |
| | | switch (setKey) |
| | | { |
| | | case FunctionAttributeKey.CoolTemperatrue: |
| | | case FunctionAttributeKey.HeatTemperatrue: |
| | | case FunctionAttributeKey.AutoTemperatrue: |
| | | case FunctionAttributeKey.DehumiTemperatrue: |
| | | attributes.Add(new FunctionAttributes() |
| | | { |
| | | key = setKey, |
| | | state = setValues.ToString(), |
| | | curValue = setValues.ToString(), |
| | | }); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | attr.state = value.ToString(); |
| | | attr.curValue = value.ToString(); |
| | | attr.state = setValues.ToString(); |
| | | attr.curValue = setValues.ToString(); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | /// </summary> |
| | | public static class FunctionAttributeKey |
| | | { |
| | | #region 空调bus属性 |
| | | /// <summary> |
| | | /// 制冷模式温度 |
| | | /// </summary> |
| | | public const string CoolTemperatrue = "CoolTemperatrue"; |
| | | /// <summary> |
| | | /// 制热模式温度 |
| | | /// </summary> |
| | | public const string HeatTemperatrue = "HeatTemperatrue"; |
| | | /// <summary> |
| | | /// 自动模式温度 |
| | | /// </summary> |
| | | public const string AutoTemperatrue = "AutoTemperatrue"; |
| | | /// <summary> |
| | | /// 除湿模式温度 |
| | | /// </summary> |
| | | public const string DehumiTemperatrue = "DehumiTemperatrue"; |
| | | #endregion |
| | | |
| | | #region 空调bus属性 |
| | | /// <summary> |
| | | /// [4]普通:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string NormalTemperatrue = "NormalTemperatrue"; |
| | | /// <summary> |
| | | /// [5]白天:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string DayTemperatrue = "DayTemperatrue"; |
| | | /// <summary> |
| | | /// [6]夜晚:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string NightTemperatrue = "NightTemperatrue"; |
| | | /// <summary> |
| | | /// [7]离开:设置温度(摄氏0-100,华氏32-212)/功率值(0-10) (1byte) |
| | | /// </summary> |
| | | public const string AwayTemperatrue = "AwayTemperatrue"; |
| | | #region 三相空开属性 |
| | | |
| | | |
| | | /// <summary> |
| | | /// A相功率 |
| | | /// </summary> |
| | |
| | | public const string ElectricityC = "electricity_c"; |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | public const string _null = ""; |
| | |
| | | //etAccount.Text = "1272061968@qq.com";//万科城市之光E区8栋206 |
| | | //etAccount.Text = "marketing@australindo.co.id"; |
| | | //etAccount.Text = "13922115008";//刘总 |
| | | //etAccount.Text = "support7@hdlautomation.com"; |
| | | etAccount.Text = "13336018868"; |
| | | etAccount.Text = "649362315@qq.com";//蔡淑娴 |
| | | //etAccount.Text = "18402017839"; |
| | |
| | | //etAccount.Text = "13960905167"; |
| | | //etAccount.Text = "iot-en-public@hdlchina.com.cn"; |
| | | etAccount.Text = "13160677992"; |
| | | etAccount.Text = "support7@hdlautomation.com"; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | //if (SPK.LightSpkList().Contains(function.spk)) |
| | | //{ |
| | | |
| | | // { |
| | | // var localFunction = FunctionList.List.GetLightList().Find((obj) => obj.sid == function.sid); |
| | | // { |
| | |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btnSwitch.IsSelected = true; |
| | | //setTempBar.IsOffline = false; |
| | | //setTempBar.Enable = true; |
| | | //setTempBar.ProgressBarColor = CSS_Color.MainColor; |
| | | } |
| | | else |
| | | { |
| | | btnSwitch.IsBold = false; |
| | | //setTempBar.IsOffline = true; |
| | | //setTempBar.Enable = false; |
| | | //setTempBar.ProgressBarColor = CSS_Color.DividingLineColor; |
| | | } |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); |
| | |
| | | setTempBar.IsClickable = false; |
| | | } |
| | | |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "dry" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | if ( device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | setTempBar.IsOffline = true; |
| | | setTempBar.IsClickable = false; |
| | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(74), |
| | | Height = Application.GetRealHeight(Application.DesignHeight - 74), |
| | | Height = Application.GetRealHeight(Application.DesignHeight)- Application.GetRealHeight(74), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton); |
| | | |
| | |
| | | TextSize = 18, |
| | | TextAlignment = TextAlignment.TopRight, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | #if __IOS__ |
| | | pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34); |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | powerGenerationView.AddChidren(pvPower_ValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | powerUsageView.AddChidren(loadElec_ValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 18, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton); |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 24, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton); |
| | | |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(142), |
| | | Height = Application.GetRealWidth(142),//142 |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(socialContributionView); |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | socialContribution_Info1_ValuesButton.Width = socialContribution_Info1_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_1.AddChidren(socialContribution_Info1_ValuesButton); |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | socialContribution_Info2_ValuesButton.Width = socialContribution_Info2_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_2.AddChidren(socialContribution_Info2_ValuesButton); |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.BottomLeft, |
| | | IsBold = true, |
| | | FontName = "BEBAS", |
| | | }; |
| | | socialContribution_Info3_ValuesButton.Width = socialContribution_Info3_ValuesButton.GetTextWidth() + Application.GetRealWidth(8); |
| | | socialContribution_InfoView_3.AddChidren(socialContribution_Info3_ValuesButton); |
| | |
| | | { |
| | | |
| | | |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.2.120")] |
| | | public partial class Resource |
| | | { |
| | | |