wxr
2024-10-15 9523ea8fc874c27ad1369c076de59c00bbc5d470
空调功能更新

优化bus协议控制
1个文件已添加
14个文件已修改
188 ■■■■■ 已修改文件
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/BEBAS.ttf 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Enumerative/Command.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
NunitTest-Android/Resources/Resource.designer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?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)的文件,我的文件等-->
HDL-ON_Android/Resources/Resource.designer.cs
@@ -15,7 +15,7 @@
{
    
    
    [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
    {
        
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1850,6 +1850,7 @@
      <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" />
HDL-ON_iOS/Info.plist
@@ -98,6 +98,7 @@
    <key>UIAppFonts</key>
    <array>
        <string>titilliumtext25l005.otf</string>
        <string>BEBAS.ttf</string>
    </array>
    <key>UIBackgroundModes</key>
    <array>
HDL-ON_iOS/Resources/BEBAS.ttf
Binary files differ
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -611,7 +611,6 @@
                    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;
@@ -621,28 +620,34 @@
                        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":
@@ -652,8 +657,6 @@
                                            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)
@@ -674,8 +677,6 @@
                                            fan = 0;
                                            break;
                                    }
                                    //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID,
                                    //    new byte[] { 5, fan, function.bus.LoopId });
                                    break;
                                case FunctionAttributeKey.SetTemp:
                                    try
@@ -686,28 +687,6 @@
                                    {
                                        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
@@ -717,22 +696,23 @@
                                    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:
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -344,9 +344,9 @@
                        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;
                            }
@@ -355,9 +355,12 @@
                                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);
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -404,7 +404,7 @@
                            try
                            {
                                var topic = e.ApplicationMessage.Topic;
                                MainPage.Log($"收到mqtt主题:{topic}");
                                //MainPage.Log($"收到mqtt主题:{topic}");
                                //一端口主题处理
                                if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull())
                                {
HDL_ON/Entity/Enumerative/Command.cs
@@ -1634,11 +1634,11 @@
        ///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
HDL_ON/Entity/Function/Function.cs
@@ -145,20 +145,34 @@
        /// <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;
        }
@@ -1294,7 +1308,45 @@
    /// </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>
@@ -1365,6 +1417,7 @@
        public const string ElectricityC = "electricity_c";
        #endregion
        #endregion
        public const string _null = "";
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -307,7 +307,6 @@
                    //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";
@@ -319,6 +318,7 @@
                    //etAccount.Text = "13960905167";
                    //etAccount.Text = "iot-en-public@hdlchina.com.cn";
                    etAccount.Text = "13160677992";
                    etAccount.Text = "support7@hdlautomation.com";
                }
                else
                {
HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs
@@ -20,7 +20,6 @@
                }
                //if (SPK.LightSpkList().Contains(function.spk))
                //{
                //    {
                //        var localFunction = FunctionList.List.GetLightList().Find((obj) => obj.sid == function.sid);
                //        {
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -998,16 +998,10 @@
                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());
@@ -1093,7 +1087,7 @@
                        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;
HDL_ON/UI/UI2/FuntionControlView/Acst/InverterJinmaoPage.cs
@@ -143,7 +143,7 @@
            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);
@@ -202,6 +202,7 @@
                TextColor = CSS_Color.MainBackgroundColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            electricityGenerationView.AddChidren(pvGenerate_TodayValuesButton);
@@ -304,6 +305,7 @@
                TextSize = 18,
                TextAlignment = TextAlignment.TopRight,
                IsBold = true,
                FontName = "BEBAS",
            };
#if __IOS__
            pvLoad_TodayValuesButton.Y = Application.GetRealWidth(34);
@@ -463,6 +465,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 24,
                IsBold = true,
                FontName = "BEBAS",
            };
            powerGenerationView.AddChidren(pvPower_ValuesButton);
@@ -492,6 +495,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_TodayValuesButton);
@@ -521,6 +525,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_MonthValuesButton);
@@ -550,6 +555,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            pvEleGenerationInfoView.AddChidren(pvGeneration_YearValuesButton);
@@ -686,6 +692,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 24,
                IsBold = true,
                FontName = "BEBAS",
            };
            powerUsageView.AddChidren(loadElec_ValuesButton);
@@ -714,6 +721,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            electricityUsageStatusView.AddChidren(powerUsage_TodayValuesButton);
@@ -741,6 +749,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            electricityUsageStatusView.AddChidren(loadElec_MonthValuesButton);
@@ -769,6 +778,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 18,
                IsBold = true,
                FontName = "BEBAS",
            };
            electricityUsageStatusView.AddChidren(powerUsage_YearValuesButton);
@@ -953,6 +963,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = 24,
                    IsBold = true,
                FontName = "BEBAS",
                };
                esRunStatus_ChargeValuesView.AddChidren(esRunStatus_ChargeValuesButton);
@@ -987,6 +998,7 @@
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = 24,
                    IsBold = true,
                FontName = "BEBAS",
                };
                esRunStatus_DischargeValuesView.AddChidren(esRunStatus_DischargeValuesButton);
@@ -1031,7 +1043,7 @@
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(142),
                Height = Application.GetRealWidth(142),//142
                ScrollEnabled = false,
            };
            contentView.AddChidren(socialContributionView);
@@ -1066,6 +1078,7 @@
                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);
@@ -1135,6 +1148,7 @@
                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);
@@ -1204,6 +1218,7 @@
                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);
NunitTest-Android/Resources/Resource.designer.cs
@@ -15,7 +15,7 @@
{
    
    
    [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
    {