wxr
2022-07-19 bb4bcd1b320502b36d19aacec52ed886a975249a
1.5.9打包

1.适配bus协议194A控制
2.温控器二期
3.毫米波传感器
4.可视对讲功能,门禁二维码,徘徊报警
7个文件已添加
30个文件已修改
1867 ■■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/UdpSocket.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewApiRes.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs 518 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SiriIntents/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini
@@ -531,6 +531,20 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
@@ -1719,6 +1733,20 @@
543=获取更多
544=角度
545=报警数据统计
546=实验室模式
547=报警功能
548=室内
549=表面温度
550=温度校准
551=湿度校准
552=毛细阀
553=地暖阀
554=*为保障最佳延时效果,建议人数在4人一下。
555=退出实验室模式
556=有人在跑
557=有人站着
558=有人坐着
 
2532=访客邀请记录
@@ -2887,6 +2915,20 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
@@ -4066,6 +4108,40 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
2534=Visitor Invitation
2535=Record
2536=*After you initiate the visitor certificate, you can  unlock the door by password or swipe the code  freely within the validity period you set. Please share the certificate carefully.
2537=Input phone number of the visitor
2538=Input 6-digits temporary password
2539=Random Generation
2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone.
2541=Are you sure to delete visitor credentials?
2542=Long press the QR code to save the QR code to the album
2543=QR code is invalid
2544=Generate Visitor Credentials
2545=Cancle Visitor Credentials
2546=Visitor QR Code
2547=Phone Number
2548=Please enter a correct phone number
2549=Please select a effective time
2550=Please select a expire time
2551=Temporary password is invalid
1000=Humedad de ambiente
1001=V-chip
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -253,6 +253,9 @@
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\curtaindream.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\CAC\HvacCacHumidityIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\CAC\HvacCacTempIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneRunBgIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneSitBgIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\values\colors.xml" />
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="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207081">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207181">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!--友盟-->
    <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1415,6 +1415,9 @@
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_white.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\CAC\HvacCacHumidityIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\CAC\HvacCacTempIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneRunBgIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneSitBgIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\ArmSensor\SomeoneStandBgIcon.png" />
    </ItemGroup>
    <ItemGroup>
      <ITunesArtwork Include="iTunesArtwork" />
HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.5.502206301</string>
    <string>1.5.902207181</string>
    <key>CFBundleVersion</key>
    <string>1.5.506301</string>
    <string>1.5.907181</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/Language.ini
@@ -531,6 +531,21 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
@@ -1719,6 +1734,20 @@
543=获取更多
544=角度
545=报警数据统计
546=实验室模式
547=报警功能
548=室内
549=表面温度
550=温度校准
551=湿度校准
552=毛细阀
553=地暖阀
554=*为保障最佳延时效果,建议人数在4人一下。
555=退出实验室模式
556=有人在跑
557=有人站着
558=有人坐着
 
2532=访客邀请记录
@@ -2887,6 +2916,20 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
@@ -4066,6 +4109,40 @@
543=Get more
544=Angle
545=Alarm data statistics
546=Laboratory mode
547=Alarm function
548=Indoor
549=Surface temperature
550=Temperature calibration
551=Humidity calibration
552=Capillary valve
553=Floor heating valve
554=In order to ensure the best delay effect, it is recommended that the number of people be less than 4.
555=Exit lab mode
556=Someone is running
557=Someone is standing
558=Someone is sitting
2532=Visitor Invitation Record
2533=Visitor management
2534=Visitor Invitation
2535=Record
2536=*After you initiate the visitor certificate, you can  unlock the door by password or swipe the code  freely within the validity period you set. Please share the certificate carefully.
2537=Input phone number of the visitor
2538=Input 6-digits temporary password
2539=Random Generation
2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone.
2541=Are you sure to delete visitor credentials?
2542=Long press the QR code to save the QR code to the album
2543=QR code is invalid
2544=Generate Visitor Credentials
2545=Cancle Visitor Credentials
2546=Visitor QR Code
2547=Phone Number
2548=Please enter a correct phone number
2549=Please select a effective time
2550=Please select a expire time
2551=Temporary password is invalid
1000=Humedad de ambiente
1001=V-chip
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneRunBgIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneSitBgIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmSensor/SomeoneStandBgIcon.png
HDL_ON/Common/R.cs
@@ -5,6 +5,58 @@
    public static class StringId
    {
        /// <summary>
        /// 有人坐着
        /// </summary>
        public const int SomeoneSitting = 558;
        /// <summary>
        /// 有人站着
        /// </summary>
        public const int SomeoneStanding = 557;
        /// <summary>
        /// 有人在跑
        /// </summary>
        public const int SomeoneRunning = 556;
        /// <summary>
        /// 退出实验室模式
        /// </summary>
        public const int ExitLabModel = 555;
        /// <summary>
        /// 毫米波实验室模式提示文本
        /// </summary>
        public const int LabTipText = 554;
        /// <summary>
        /// 地暖阀门
        /// </summary>
        public const int FloorHeatingValve = 553;
        /// <summary>
        /// 毛细阀门
        /// </summary>
        public const int CapillaryValve = 552;
        /// <summary>
        /// 湿度校准
        /// </summary>
        public const int HumidityCalibration = 551;
        /// <summary>
        /// 温度校准
        /// </summary>
        public const int TemperatureCalibration = 550;
        /// <summary>
        /// 表面温度
        /// </summary>
        public const int SurfaceTemperature = 549;
        /// <summary>
        /// 室内
        /// </summary>
        public const int Indoor = 548;
        /// <summary>
        /// 报警功能
        /// </summary>
        public const int AlarmFunction = 547;
        /// <summary>
        /// 实验室模式
        /// </summary>
        public const int LaboratoryMode = 546;
        /// <summary>
        /// 报警数据统计
        /// </summary>
        public const int AlarmDataStatistics = 545;
HDL_ON/DAL/DriverLayer/Control.cs
@@ -917,13 +917,16 @@
                            byte[] bodyBytes = new byte[receiveObj.Length];
                            Array.Copy(originalReceiveBytes, topicBytes.Length + 4, bodyBytes, 0, receiveObj.Length);
                            byte[] receiveBytes = Securitys.EncryptionService.AesDecryptPayload(bodyBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret);
                            var revString = Encoding.UTF8.GetString(receiveBytes);
                            receiveObj.BodyDataString = revString;
                            MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString);
                            //if (receiveObj.Topic.EndsWith("/thing/property/up"))
                            //{
                            //    MsgInfoList.Add(revString + "\r\n");
                            //}
                            if (receiveBytes != null)
                            {
                                var revString = Encoding.UTF8.GetString(receiveBytes);
                                receiveObj.BodyDataString = revString;
                                MainPage.Log($"局域网信息: 解密后:" + receiveObj.BodyDataString);
                                //if (receiveObj.Topic.EndsWith("/thing/property/up"))
                                //{
                                //    MsgInfoList.Add(revString + "\r\n");
                                //}
                            }
                        }
                        else
                        {
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -262,12 +262,17 @@
                                                break;
                                        }
                                        break;
                                    case FunctionAttributeKey.SetTemp:
                                        ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] {
                                                modeKey, Convert.ToByte(attr.value), f.localFunction.bus.LoopId });
                                        break;
                                }
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 3, onoff, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 6, mode, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 5, fan, f.localFunction.bus.LoopId });
                                ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { modeKey, modeKey, f.localFunction.bus.LoopId });
                            }
                    }
                            break;
                        case SPK.LightSwitch:
                        case SPK.LightDimming:
@@ -554,47 +559,129 @@
                    case SPK.AcStandard:
                    case SPK.HvacAC:
                        var ac = new AC();
                        byte onoff = 0;
                        onoff = function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0;
                        byte mode = 0;
                        mode = ac.GetModeIndex(function);
                        byte fan = 0;
                        fan = ac.GetFanIndex(function);
                        byte sanfan = 0;
                        byte temp = 16;
                        temp = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp));
                        foreach (var dic in commandDictionary)
                        {
                            switch (dic.Key)
                            {
                                case FunctionAttributeKey.OnOff:
                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                    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":
                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId });
                                    break;
                                case "fan":
                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 5, ac.GetFanIndex(function), function.bus.LoopId });
                                    break;
                                case FunctionAttributeKey.SetTemp:
                                    byte modeKey = 4;
                                    switch (ac.GetModeIndex(function))
                                    switch (dic.Value)
                                    {
                                        case 3:
                                            modeKey = 8;
                                        case "auto":
                                            mode = 3;
                                            break;
                                        case 0:
                                            modeKey = 4;
                                        case "cool":
                                            mode = 0;
                                            break;
                                        case 1:
                                            modeKey = 7;
                                        case "heat":
                                            mode = 1;
                                            break;
                                        case 4:
                                            modeKey = 19;
                                        case "dry":
                                            mode = 4;
                                            break;
                                        case 2:
                                            modeKey = 2;
                                        case "fan":
                                            mode = 2;
                                            break;
                                        default:
                                            mode = 0;
                                            break;
                                    }
                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] {
                                                modeKey, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), function.bus.LoopId });
                                    //ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID,
                                    //    new byte[] { 6, mode, function.bus.LoopId });
                                    break;
                                case "fan":
                                    switch (dic.Value)
                                    {
                                        case "high":
                                            fan = 1;
                                            break;
                                        case "medium":
                                            fan = 2;
                                            break;
                                        case "low":
                                            fan = 3;
                                            break;
                                        case "auto":
                                            fan = 0;
                                            break;
                                        default:
                                            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 = Convert.ToByte(dic.Value);
                                    }
                                    catch
                                    {
                                        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;
                                default:
                                    MainPage.Log($"功能未支持 : {dic.Key}");
                                    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扫风)
                        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});
                        break;
                    case SPK.HvacFloorHeat:case SPK.FloorHeatStandard:
                        var fhTemp = new FloorHeating();
@@ -656,8 +743,8 @@
                                    var dicTempString = "";
                                    commandDictionary.TryGetValue("set_temp", out dicTempString);
                                    var dicTemp = Convert.ToByte(dicTempString);
                                    var mode = function.GetAttrState(FunctionAttributeKey.Mode);
                                    switch (mode)
                                    var mode22 = function.GetAttrState(FunctionAttributeKey.Mode);
                                    switch (mode22)
                                    {
                                        case "day":
                                            function.Fh_Mode_Temp["day"] = dicTemp;
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -53,8 +53,11 @@
        /// </summary>
        public virtual void Manager()
        {
#if DEBUG
#else
            try
            {
            {
#endif
                //对于操作数据库的时间比较长的,可以创建另一个线程处理
                if (!"HDLMIRACLE".Equals(Encoding.ASCII.GetString(Bytes, 4, 10)))
                {
@@ -102,11 +105,15 @@
#endif
                //处理是否要重发数据
                ManagerReceive(subnetID, deviceID, command, usefulBytes);
            }
#if DEBUG
#else
              }
            catch (Exception ex)
            {
                MainPage.Log($"packet {ex.Message} ");
            }
#endif
        }
        /// <summary>
@@ -118,8 +125,11 @@
        /// <param name="receiveBytes"></param>
        void UdpPacket_DataProcessing(byte subnetID, byte deviceID, Command command, byte[] receiveBytes)
        {
#if DEBUG
#else
            try
            {
#endif
                switch (command)
                {
                    case Command.SetSingleLightACK:
@@ -329,11 +339,18 @@
                        break;
                    case Command.SetACModeACK:
                    case Command.ReadACModeACK:
                        foreach (var function in FunctionList.List.GetAcList())
                        foreach (var function in FunctionList.List.Functions)
                        {
                        if (function.bus == null || function.spk != SPK.AcStandard)
                        {
                            continue;
                        }
                            var acFunction = new AC();
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            if (function.bus.SubnetID == subnetID &&
                                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.OnOff,  receiveBytes[8] == 1 ? "on" : "off");
@@ -379,7 +396,7 @@
                                FunctionPage.UpdataStates(function);
                                HomePage.UpdataFunctionStates(function);
                                ClassificationPage.UpdataInfo(function);
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status);
                                Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function);
                            }
                        }
@@ -652,7 +669,9 @@
                                }
                                function.lastState = "";
                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
                                function.lastState += acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.Mode)) +
                                    acFunction.GetModeAttrText(function.GetAttrState(FunctionAttributeKey.FanSpeed)) +
                                    " " + function.GetAttrState(FunctionAttributeKey.SetTemp) + acFunction.GetTempUnitString(function);
                                RoomPage.UpdataStates(function);
                                FunctionPage.UpdataStates(function);
                                HomePage.UpdataFunctionStates(function);
@@ -726,11 +745,16 @@
                        }
                        break;
                }
            }
#if DEBUG
#else
              }
            catch (Exception ex)
            {
                MainPage.Log($"Bus Rev Erorr : {ex.Message}");
            }
#endif
        }
        /// <summary>
        /// byte转16进制字符串
HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -120,9 +120,12 @@
            {
                return;
            }
            try
            {
                if (busSocket == null)
                {
                    return;
                }
                asyncBeginReceive();
                Packet packet = (Packet)iar.AsyncState;
                int len = busSocket.EndReceiveFrom(iar, ref packet.RemoteEndPoint);
@@ -137,10 +140,11 @@
                {
                    Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString());
                }
                else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据
                else if (((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据
                {
                    packet.Manager();
                }
            }
            catch (Exception ex)
            {
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -44,6 +44,7 @@
        /// <param name="qType">时间查询类型:hour=近24小时、week=近一周、month = 近一月 </param>
        /// <param name="deviceId">设备ID</param>
        /// <param name="deviceKey">功能查询类型:pm25</param>
        /// <param name="time">具体查询的日期,金茂温控器使用</param>
        /// <returns></returns>
        public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "")
        {
@@ -2183,6 +2184,51 @@
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson);
        }
        /// <summary>
        /// 设备扩展配置
        /// </summary>
        public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId",  deviceId );
            d.Add("extSet", extSet);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson);
        }
        /// <summary>
        /// 获取设备消息规则配置
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew GetDeviceMessageRulesSet(string deviceId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson);
        }
        /// <summary>
        /// 设备消息规则配置
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="conditionIdentify"></param>
        /// <param name="push"></param>
        /// <returns></returns>
        public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("deviceId", deviceId);
            d.Add("conditionIdentify", conditionIdentify);
            d.Add("push", push);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson);
        }
        #endregion
HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>
HDL_ON/DAL/Server/NewAPI.cs
@@ -431,6 +431,18 @@
        /// 读取最近一个月的数据
        /// </summary>
        public const string Api_Post_SensorLastMonthHistoricalData = "/home-wisdom/app/statistics/device/monthDiff";
        /// <summary>
        /// 设备扩展配置
        /// </summary>
        public const string Api_Post_DeviceExtSet = "/home-wisdom/app/device/deviceExtSet";
        /// <summary>
        /// 获取设备消息规则配置
        /// </summary>
        public const string Api_Post_GetDeviceMessageRulesSet = "/home-wisdom/app/device/getDeviceMessageRulesSet";
        /// <summary>
        /// 设备消息规则配置
        /// </summary>
        public const string Api_Post_DeviceMessageRulesSet = "/home-wisdom/app/device/deviceMessageRulesSet";
        #endregion
        #region Kaede -- 场景接口____________________________
HDL_ON/DAL/Server/NewApiRes.cs
@@ -1121,6 +1121,18 @@
    }
    /// <summary>
    /// 设备推送消息规则
    /// </summary>
    [Serializable]
    public class DeviceMessageRules
    {
        public string homeId;
        public string deviceId;
        public string conditionIdentify;
        public bool push;
    }
    /// <summary>
    /// 
    /// </summary>
    [System.Serializable]
HDL_ON/Entity/Function/Function.cs
@@ -403,7 +403,17 @@
        /// </summary>
        public string modifyTime = "";
        /// <summary>
        /// 扩展信息
        /// </summary>
        public ExtSet extSet = new ExtSet();
        #endregion
        //public void
        /// <summary>
        /// 延时
        /// </summary>
@@ -1029,6 +1039,27 @@
        /// </summary>
        public const string dew_point_temp = "dew_point_temp";
        /// <summary>
        /// 表面温度
        /// </summary>
        public const string surface_temp = "surface_temp";
        /// <summary>
        /// 室内湿度补偿值
        /// </summary>
        public const string room_humidity_cc = "room_humidity_cc";
        /// <summary>
        /// 室内温度补偿值
        /// </summary>
        public const string room_temp_cc = "room_temp_cc";
        /// <summary>
        /// 毛细阀门
        /// </summary>
        public const string cac_valve = "cac_valve";
        /// <summary>
        /// 地暖阀门
        /// </summary>
        public const string fh_valve = "fh_valve";
        /// <summary>
        /// value
        /// </summary>
        public const string Value = "value";
@@ -1133,6 +1164,7 @@
        /// 打开等级(风扇)
        /// </summary>
        public const string OpenLevel = "openLevel";
        public const string fan_speed_percent = "fan_speed_percent";
        /// <summary>
        /// 红外按键
        /// </summary>
@@ -1952,4 +1984,15 @@
        /// </summary>
        public string desc = string.Empty;
    }
    /// <summary>
    /// 扩展信息设置
    /// </summary>
    public class ExtSet
    {
        /// <summary>
        /// 是否开启实验室模式
        /// </summary>
        public bool labModel = false;
    }
}
HDL_ON/HDL_ON.projitems
@@ -506,6 +506,7 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\TempPasswordInfo.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTimeDialogCallBak.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Visitor\LpTipDialogCallBack.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorMegahealth_AlarmDataStatisticsPage.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -166,7 +166,6 @@
                    case SPK.SenesorMegahealth:
                    case SPK.SenesorMegahealth2:
                        var smPage = new SenesorMegahealthPage();
                        smPage.ShowColltionButton = false;
                        smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
                        break;
                    case SPK.SensorGas:
HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs
@@ -40,7 +40,7 @@
        /// <param name="updateData">云端推送的更新数据</param>
        public Function UpdateDeviceStatu(string sId ,List<AttributesStatus> updateData)
        {
            var localDevice = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sId);
            var localDevice = FunctionList.List.Functions.Find((obj) => obj.sid == sId);
            if (localDevice != null)
            {
                foreach (var attr in updateData)
@@ -51,8 +51,19 @@
                HdlFormLogic.Current.DeviceStatuPush(localDevice);
            }
            return localDevice;
        }
        /// <summary>
        /// 设备状态更新
        /// </summary>
        public Function UpdateDeviceStatu(Function function)
        {
            //全部界面推送
            HdlFormLogic.Current.DeviceStatuPush(function);
            return function;
        }
        #endregion
    }
}
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -218,6 +218,7 @@
                    //etAccount.Text = "13450425807";//黄竹溪 knx项目
                    etAccount.Text = "18244942707";
                    etAccount.Text = "tf@smarttech.com.ua";
                    etAccount.Text = "13418062953";
                }
                else
                {
@@ -251,9 +252,9 @@
                }
                b = !b;
                etPassword.Text = "123456";
                if(etAccount.Text == "15014291819")
                if(etAccount.Text == "13418062953")
                {
                    etPassword.Text = "hdl123456";
                    etPassword.Text = "a123456";
                }
                //etPassword.Text = "Hdl85521566";
                btnLogin.IsSelected = true;
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -63,7 +63,7 @@
                case SPK.LightRGB:
                case SPK.LightRGBW:
                case SPK.LightCCT:
                //case SPK.LightSwitch:
                case SPK.LightSwitch:
                //窗帘
                case SPK.CurtainSwitch:
                case SPK.CurtainRoller:
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -90,11 +90,11 @@
            this.InitFrameWhiteContent1();
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(this.device);
            //this.RefreshNowDeviceStatuMemory(this.device);
            //刷新界面状态
            this.RefreshFormStatu();
            //读取状态
                        Control.Ins.SendReadCommand(device);
            Control.Ins.SendReadCommand(device);
            //new System.Threading.Thread(() =>
            //{
            //    while (true)
@@ -128,7 +128,9 @@
                temp = 16;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
            }
            arcBar = new DiyArcSeekBar()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -171,7 +173,9 @@
                Text = Convert.ToDouble(temp).ToString(),
                TextAlignment = TextAlignment.Center,
            };
            btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
            FrameWhiteCentet1.AddChidren(btnTemp);
            btnTempUint = new Button()
            {
@@ -193,7 +197,7 @@
                Y = btnTemp.Bottom,
                Width = Application.GetRealWidth(120),
                Height = Application.GetRealHeight(20),
                Text = Language.StringByID(StringId.IndoorTemp) + "20°C",
                Text = Language.StringByID(StringId.Indoor) + " 20°C",
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
@@ -871,7 +875,7 @@
            if (this.device.sid != i_LocalDevice.sid) { return; }
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //刷新界面状态
            this.RefreshFormStatu();
        }
@@ -910,6 +914,8 @@
                controlTime = DateTime.Now;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                btnTempUint.X = btnTemp.Right;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -938,6 +944,8 @@
                controlTime = DateTime.Now;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                btnTempUint.X = btnTemp.Right;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -959,6 +967,8 @@
                {
                    device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
                    btnTemp.Text = e.ToString();
                    btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                    btnTempUint.X = btnTemp.Right;
                };
                //arcBar.MouseDownEventHandler = (sender, e) => {
                //    Console.WriteLine("ddd");
@@ -1051,7 +1061,9 @@
                }
                else
                {
                    btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C";
                    //device = FunctionList.List.Functions.Find((obj) => obj.sid == device.sid);
                    btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C";
                    btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                    btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing));
                    btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
@@ -1062,7 +1074,9 @@
                   
                    arcBar.Progress = temp;
                    btnTemp.Text = temp.ToString() ;
                    btnTemp.Text = temp.ToString();
                    btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                    btnTempUint.X = btnTemp.Right;
                    if (device.trait_on_off.curValue.ToString() == "on")
                    {
@@ -1101,15 +1115,5 @@
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 刷新当前设备的状态缓存
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
        }
        #endregion
    }
}
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/CacWeekHistoryPage.cs
@@ -20,7 +20,8 @@
        /// room_humidity 湿度
        /// </summary>
        string showType;
            Dictionary<string, double> dataDic = new Dictionary<string, double>();
        Dictionary<string, double> dataDic = new Dictionary<string, double>();
        public CacWeekHistoryPage(Function device,string type)
        {
            bodyView = this;
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs
@@ -3,6 +3,7 @@
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
using System;
using HDL_ON.DAL.Server;
namespace HDL_ON.UI
{
@@ -18,6 +19,11 @@
        /// 文本控件
        /// </summary>
        private NormalViewControl btnSuctionView = null;
        /// <summary>
        /// 退出实验室模式控制区域
        /// </summary>
        FrameLayout exitLabView;
        #endregion
@@ -79,7 +85,7 @@
            //加载瞬时值
            var btnInstantaneousValue = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -103,16 +109,79 @@
            };
            FrameWhiteCentet1.AddChidren(btnInstantaneousValueText);
            EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                //var page = new SocketPage_InstantaneousValue(function);
                //MainPage.BasePageView.AddChidren(page);
                //page.LoadPage();
                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                var page = new SensorMegahealth_AlarmDataStatisticsPage(device);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            btnInstantaneousValue.MouseUpEventHandler = eventHandler;
            btnInstantaneousValueText.MouseUpEventHandler = eventHandler;
            exitLabView = new FrameLayout()
            {
                Y = Application.GetRealHeight(391),
                Height = Application.GetRealHeight(135),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Visible = device.extSet.labModel,
            };
            FrameWhiteCentet1.AddChidren(exitLabView);
            var labTipText = new Button()
            {
                Y = Application.GetRealHeight(10),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(250),
                Height = Application.GetRealHeight(50),
                TextColor = CSS_Color.TextualColor,
                TextID = StringId.LabTipText,
                IsMoreLines = true,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            exitLabView.AddChidren(labTipText);
            var btnExitLab = new Button()
            {
                Y = Application.GetRealHeight(75),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(148),
                Height = Application.GetRealHeight(40),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                IsBold = true,
                Radius = (uint)Application.GetRealHeight(20),
                TextSize = 16,
                TextID = StringId.ExitLabModel,
                BackgroundColor = CSS_Color.MainColor,
            };
            exitLabView.AddChidren(btnExitLab);
            btnExitLab.MouseUpEventHandler = (sender, e) => {
                new System.Threading.Thread(() =>
                {
                    device.extSet.labModel = false;
                    var result = new HttpServerRequest().DeviceExtSet(device.deviceId, device.extSet);
                    Application.RunOnMainThread(() =>
                    {
                        if (result != null && result.Code == StateCode.SUCCESS)
                        {
                            exitLabView.Visible = false;
                        }
                    });
                })
                { IsBackground = true }.Start();
            };
            base.SettionFinishEvent += () => {
                exitLabView.Visible = device.extSet.labModel;
            };
        }
        /// <summary>
        /// 初始化第二个索引页的内容
@@ -169,7 +238,7 @@
                    else if (temp.state == "uninhabited")//无人
                    {
                        btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png";
                        btnSuctionView.TextID = StringId.UnderProtection;
                        btnSuctionView.TextID = StringId.SensorNormalState;
                        btnSuctionView.IsSelected = false;
                    }
                    else//有人
@@ -187,8 +256,10 @@
                    {
                        if (temp.state == "true")
                        {
                            btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png";
                            btnIcon.IsSelected = true;
                            btnSuctionView.TextID = StringId.Someone;
                            btnIcon.IsSelected = false;
                            btnSuctionView.TextID = StringId.SomeoneIn;
                            btnSuctionView.IsSelected = true;
                        }
                        else
@@ -201,12 +272,67 @@
                        var tempStatus = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus);
                        if(tempStatus != null)
                        {
                            if(tempStatus.state == "4")
                            {
                                btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png";
                                btnSuctionView.TextID = StringId.SomeoneFell;
                                btnSuctionView.IsSelected = true;
                            switch (tempStatus.state)
                            {//0空,1走,2跑,3坐,4跌倒,5站
                                case "0":
                                    btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png";
                                    btnIcon.IsSelected = true;
                                    btnIcon.IsSelected = false;
                                    btnSuctionView.TextID = StringId.SensorNormalState;
                                    btnSuctionView.IsSelected = false;
                                    break;
                                case "1":
                                    btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png";
                                    btnIcon.IsSelected = true;
                                    btnIcon.IsSelected = false;
                                    btnSuctionView.TextID = StringId.SomeoneIn;
                                    btnSuctionView.IsSelected = true;
                                    break;
                                case "2":
                                    if (device.extSet.labModel)
                                    {
                                        btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneRunBgIcon.png";
                                        btnIcon.IsSelected = true;
                                        btnIcon.IsSelected = false;
                                        btnSuctionView.TextID = StringId.SomeoneRunning;
                                        btnSuctionView.IsSelected = true;
                                    }
                                    break;
                                case "3":
                                    if (device.extSet.labModel)
                                    {
                                        btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneSitBgIcon.png";
                                        btnIcon.IsSelected = true;
                                        btnIcon.IsSelected = false;
                                        btnSuctionView.TextID = StringId.SomeoneSitting;
                                        btnSuctionView.IsSelected = true;
                                    }
                                    break;
                                case "4":
                                    btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png";
                                    btnIcon.IsSelected = true;
                                    btnIcon.IsSelected = false;
                                    btnSuctionView.TextID = StringId.SomeoneFell;
                                    btnSuctionView.IsSelected = true;
                                    break;
                                case "5":
                                    if (device.extSet.labModel)
                                    {
                                        btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneStandBgIcon.png";
                                        btnIcon.IsSelected = true;
                                        btnIcon.IsSelected = false;
                                        btnSuctionView.TextID = StringId.SomeoneStanding;
                                        btnSuctionView.IsSelected = true;
                                    }
                                    Console.WriteLine(btnSuctionView.Text);
                                    break;
                                default:
                                    break;
                            }
                        }
                    }
                }
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorMegahealth_AlarmDataStatisticsPage.cs
New file
@@ -0,0 +1,270 @@
using System;
using System.Collections.Generic;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public partial class SensorMegahealth_AlarmDataStatisticsPage : FrameLayout
    {
        SensorMegahealth_AlarmDataStatisticsPage bodyView;
        FrameLayout showDataTypeView;
        Button btnShowHistroyData_Day;
        Button btnShowHistroyData_Week;
        Button btnShowHistroyData_Month;
        FrameLayout historyDataView;
        MyEchartsViewOn myEchartsView;
        Sensor sensorTemp = new Sensor();
        Function function;
        List<Function> showFunctions;
        List<Function> sensorList;
        /// <summary>
        /// 当前查询类型
        /// </summary>
        string curQueryType = "hour";
        List<string> tipColorStringList = new List<string>()
        {
            "#80AEFF","#FFD154","#FF9D54","#FE6A6A","#B183C3","#ADE764",
        };
        public SensorMegahealth_AlarmDataStatisticsPage(Function ss)
        {
            bodyView = this;
            function = ss;
            showFunctions = new List<Function>();
            showFunctions.Add(ss);
            sensorList = FunctionList.List.GetEnvirSensorsList();
        }
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(600),
                ScrollEnabled = false
            };
            bodyView.AddChidren(contentView);
            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(16) });
            FrameLayout diagramView = new FrameLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealWidth(450),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
                BorderColor = 0x00000000,
                BorderWidth = 0,
            };
            contentView.AddChidren(diagramView);
            #region 选择数据日期范围
            showDataTypeView = new FrameLayout()
            {
                X = Application.GetRealWidth(183),
                Y = Application.GetRealHeight(12),
                Width = Application.GetRealWidth(144),
                Height = Application.GetRealHeight(24),
                BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png",
            };
            diagramView.AddChidren(showDataTypeView);
            btnShowHistroyData_Day = new Button()
            {
                Width = Application.GetRealWidth(48),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor2,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                IsSelected = true,
                TextID = StringId.day,
            };
            showDataTypeView.AddChidren(btnShowHistroyData_Day);
            btnShowHistroyData_Week = new Button()
            {
                X = Application.GetRealWidth(48),
                Width = Application.GetRealWidth(48),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor2,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextID = StringId.week,
            };
            showDataTypeView.AddChidren(btnShowHistroyData_Week);
            btnShowHistroyData_Month = new Button()
            {
                X = Application.GetRealWidth(48 * 2),
                Width = Application.GetRealWidth(48),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.PromptingColor2,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = Language.StringByID(StringId.month),//DateTime.Now.Month.ToString() +
            };
            showDataTypeView.AddChidren(btnShowHistroyData_Month);
            #endregion
            historyDataView = new FrameLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(52),
                Width = Application.GetRealWidth(343 - 22),
                Height = Application.GetRealWidth(370),
            };
            diagramView.AddChidren(historyDataView);
            myEchartsView = new MyEchartsViewOn();
            historyDataView.AddChidren(myEchartsView);
            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
            new TopViewDiv(bodyView, Language.StringByID(StringId.AlarmDataStatistics)).LoadTopView();
            LoadMothed_GetSensorHistoryData();
            LoadEvent_ChangeSensorHistoryShowType();
        }
    }
    //------------
    public partial class SensorMegahealth_AlarmDataStatisticsPage
    {
        /// <summary>
        /// 读取传感器历史数据
        /// </summary>
        void LoadMothed_GetSensorHistoryData()
        {
            var loadPage = new Loading()
            {
                LodingBackgroundColor = 0x88888888,
            };
            historyDataView.AddChidren(loadPage);
            new System.Threading.Thread(() =>
            {
                try
                {
                    Application.RunOnMainThread(() => {
                        loadPage.Start(Language.StringByID(StringId.PleaseWait));
                    });
                    int i = 0;
                    var ebl = new EchartsOption_BrokenLine();
                    string yDataString = "";
                    foreach (var sr in showFunctions)
                    {
                        if (sr.spk != function.spk)
                        {
                            continue;
                        }
                        if (showFunctions.Find((obj) => obj.sid == sr.sid) == null)
                        {
                            i++;
                            continue;
                        }
                        var sensorType = sr.spk.Split(".")[1];
                        var queryType = sr.GetAttrState("spk").ToString();
                        if (queryType == "0")
                        {
                            queryType = "value";
                        }
                        var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, "target_status");
                        if (revertObj != null)
                        {
                            if (revertObj.Code == StateCode.SUCCESS)
                            {
                                var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString());
                                if (i == 0)
                                {
                                    List<string> vs = new List<string>();
                                    foreach (var data in revertData)
                                    {
                                        vs.Add(data.fieldName);
                                    }
                                    ebl.InitXdataText(vs);
                                }
                                yDataString += ebl.InitYdataText(sr.name, revertData, tipColorStringList[i]);
                            }
                        }
                        i++;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        myEchartsView.ShowWithOption(ebl.InitOption());
                    });
                }
                catch (Exception ex)
                {
                    MainPage.Log($"sensor history error : {ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() => {
                        loadPage.Hide();
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        void LoadEvent_ChangeSensorHistoryShowType()
        {
            btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png";
                btnShowHistroyData_Day.IsSelected = true;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = "hour";
                LoadMothed_GetSensorHistoryData();
            };
            btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png";
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = true;
                btnShowHistroyData_Week.IsSelected = false;
                curQueryType = "month";
                LoadMothed_GetSensorHistoryData();
            };
            btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) =>
            {
                showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png";
                btnShowHistroyData_Day.IsSelected = false;
                btnShowHistroyData_Month.IsSelected = false;
                btnShowHistroyData_Week.IsSelected = true;
                curQueryType = "week";
                LoadMothed_GetSensorHistoryData();
            };
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -20,7 +20,7 @@
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
                    bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.fan_speed_percent));
                }
                catch (Exception ex)
                {
@@ -110,14 +110,13 @@
            if (function.online)
            {
                barGradualChange.OnProgressChangedEvent = (sender, e) =>
                barGradualChange.OnStopTrackingTouchEvent = (sender, e) =>
                {
                    function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
                    function.SetAttrState(FunctionAttributeKey.fan_speed_percent, e.ToString());
                    new System.Threading.Thread(() =>
                    {
                        function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                        d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                        d.Add("fan_speed_percent", e.ToString());
                        Control.Ins.SendWriteCommand(function, d);
                    })
                    { IsBackground = true }.Start();
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using HDL_ON.DAL.Server;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Newtonsoft.Json.Linq;
@@ -367,6 +369,8 @@
            else if (function.spk == SPK.HvacCac)
            {
                #region 露点温度
                if (function.GetAttribute(FunctionAttributeKey.dew_point_temp) != null)
                {
@@ -385,7 +389,7 @@
                    var btnText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(160),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
@@ -406,14 +410,526 @@
                #endregion
                #region 表面温度
                if (function.GetAttribute(FunctionAttributeKey.surface_temp) != null)
                {
                    contentView.AddChidren(new Button
                    {
                        Height = Application.GetRealHeight(10),
                    });
                    var surfaceTempRow = new FrameLayout()
                    {
                        Height = Application.GetRealHeight(55),
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    contentView.AddChidren(surfaceTempRow);
                    var btnSurfacaTempText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextID = StringId.SurfaceTemperature,
                    };
                    surfaceTempRow.AddChidren(btnSurfacaTempText);
                    var btnSurfaceTempValue = new Button()
                    {
                        Width = Application.GetRealWidth(355),
                        TextAlignment = TextAlignment.CenterRight,
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = function.GetAttrState(FunctionAttributeKey.surface_temp) + "°C",
                    };
                    surfaceTempRow.AddChidren(btnSurfaceTempValue);
                }
                #endregion
                #region 温度校准
                if (function.GetAttribute(FunctionAttributeKey.room_temp_cc) != null)
                {
                    contentView.AddChidren(new Button
                    {
                        Height = Application.GetRealHeight(10),
                    });
                    var tempCCrow = new FrameLayout()
                    {
                        Height = Application.GetRealHeight(55),
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    contentView.AddChidren(tempCCrow);
                    var btnTempCcText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextID = StringId.TemperatureCalibration,
                    };
                    tempCCrow.AddChidren(btnTempCcText);
                    var btnTempCcValue = new Button()
                    {
                        Width = Application.GetRealWidth(335),
                        TextAlignment = TextAlignment.CenterRight,
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = function.GetAttrState(FunctionAttributeKey.room_temp_cc) + "°C",
                    };
                    tempCCrow.AddChidren(btnTempCcValue);
                    var btnRightTempCc = new Button()
                    {
                        X = Application.GetRealWidth(339),
                        Gravity = Gravity.CenterVertical,
                        Width = Application.GetMinRealAverage(16),
                        Height = Application.GetMinRealAverage(16),
                        UnSelectedImagePath = "Public/RightIcon.png",
                    };
                    tempCCrow.AddChidren(btnRightTempCc);
                    btnTempCcValue.MouseUpEventHandler = (sender, e) =>
                    {
                        LoadEditDialog(-5, 5, Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.room_humidity_cc)), (reslut) =>
                        {
                            btnTempCcValue.Text = reslut + "°C";
                            Dictionary<string, string> dic = new Dictionary<string, string>();
                            dic.Add(FunctionAttributeKey.room_temp_cc, reslut);
                            Control.Ins.SendWriteCommand(function, dic);
                        });
                    };
                }
                #endregion
                #region 湿度校准
                if (function.GetAttribute(FunctionAttributeKey.room_humidity_cc) != null)
                {
                    contentView.AddChidren(new Button
                    {
                        Height = Application.GetRealHeight(10),
                    });
                    var humidityCCrow = new FrameLayout()
                    {
                        Height = Application.GetRealHeight(55),
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    contentView.AddChidren(humidityCCrow);
                    var btnHumidityCcText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextID = StringId.HumidityCalibration,
                    };
                    humidityCCrow.AddChidren(btnHumidityCcText);
                    var btnHumidityCcValue = new Button()
                    {
                        Width = Application.GetRealWidth(335),
                        TextAlignment = TextAlignment.CenterRight,
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = function.GetAttrState(FunctionAttributeKey.room_humidity_cc) + "%",
                    };
                    humidityCCrow.AddChidren(btnHumidityCcValue);
                    var btnRightHumidityCc = new Button()
                    {
                        X = Application.GetRealWidth(339),
                        Gravity = Gravity.CenterVertical,
                        Width = Application.GetMinRealAverage(16),
                        Height = Application.GetMinRealAverage(16),
                        UnSelectedImagePath = "Public/RightIcon.png",
                    };
                    humidityCCrow.AddChidren(btnRightHumidityCc);
                    btnHumidityCcValue.MouseUpEventHandler = (sender, e) =>
                    {
                        LoadEditDialog(-10, 10, Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.room_humidity_cc)), (reslut) =>
                        {
                            btnHumidityCcValue.Text = reslut + "%";
                            Dictionary<string, string> dic = new Dictionary<string, string>();
                            dic.Add(FunctionAttributeKey.room_humidity_cc, reslut);
                            Control.Ins.SendWriteCommand(function, dic);
                        });
                    };
                }
                #endregion
                #region 毛细阀门
                if (function.GetAttribute(FunctionAttributeKey.cac_valve) != null)
                {
                    contentView.AddChidren(new Button
                    {
                        Height = Application.GetRealHeight(10),
                    });
                    var cacValveRow = new FrameLayout()
                    {
                        Height = Application.GetRealHeight(55),
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    contentView.AddChidren(cacValveRow);
                    var btnCacValveText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextID = StringId.CapillaryValve,
                    };
                    cacValveRow.AddChidren(btnCacValveText);
                    var btnCacValvaValue = new Button()
                    {
                        Width = Application.GetRealWidth(355),
                        TextAlignment = TextAlignment.CenterRight,
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = function.GetAttrState(FunctionAttributeKey.cac_valve) + "°C",
                    };
                    cacValveRow.AddChidren(btnCacValvaValue);
                }
                #endregion
                #region 地暖阀门
                if (function.GetAttribute(FunctionAttributeKey.fh_valve) != null)
                {
                    contentView.AddChidren(new Button
                    {
                        Height = Application.GetRealHeight(10),
                    });
                    var fhValveRow = new FrameLayout()
                    {
                        Height = Application.GetRealHeight(55),
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                    };
                    contentView.AddChidren(fhValveRow);
                    var btnFhValveText = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(260),
                        TextAlignment = TextAlignment.CenterLeft,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.SubheadingFontSize,
                        TextID = StringId.FloorHeatingValve,
                    };
                    fhValveRow.AddChidren(btnFhValveText);
                    var btnFhValvaValue = new Button()
                    {
                        Width = Application.GetRealWidth(355),
                        TextAlignment = TextAlignment.CenterRight,
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.TextFontSize,
                        Text = function.GetAttrState(FunctionAttributeKey.fh_valve),
                    };
                    fhValveRow.AddChidren(btnFhValvaValue);
                }
                #endregion
            }
            else if(function.spk == SPK.SenesorMegahealth)
            {
                contentView.AddChidren(new Button
                {
                    Height = Application.GetRealHeight(8),
                });
                #region 推送开关
                var viewRow0 = new FrameLayout()
                {
                    Height = Application.GetRealHeight(55),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(viewRow0);
                var btnRowTitle0 = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(160),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.AlarmFunction,
                };
                viewRow0.AddChidren(btnRowTitle0);
                var btnSwtichIcon0 = new Button()
                {
                    X = Application.GetRealWidth(322),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(36),
                    Height = Application.GetMinRealAverage(36),
                    UnSelectedImagePath = "Public/Switch_2.png",
                    SelectedImagePath = "Public/SwitchOn_2.png",
                };
                viewRow0.AddChidren(btnSwtichIcon0);
                DeviceMessageRules deviceMessageRules = new DeviceMessageRules()
                {
                    deviceId = function.deviceId
                };
                btnSwtichIcon0.MouseUpEventHandler = (sender, e) => {
                    var push = btnSwtichIcon0.IsSelected = !btnSwtichIcon0.IsSelected;
                    new System.Threading.Thread(() => {
                        var result = new HttpServerRequest().DeviceMessageRulesSet(function.deviceId, deviceMessageRules.conditionIdentify, push);//设置推送信息
                        Application.RunOnMainThread(() =>
                        {
                            if (result != null && result.Code == StateCode.SUCCESS)
                            {
                                if (result.Data.ToString() == "true")
                                {
                                    deviceMessageRules.push = push;
                                }
                                else
                                {
                                    btnSwtichIcon0.IsSelected = deviceMessageRules.push;
                                }
                            }
                            else
                            {
                                btnSwtichIcon0.IsSelected = deviceMessageRules.push;
                            }
                        });
                    })
                    { IsBackground = true }.Start();
                };
                Loading waitView = new Loading();
                viewRow0.AddChidren(waitView);
                new System.Threading.Thread(() => {
                    Application.RunOnMainThread(() => {
                        waitView.Start("");
                    });
                    var result = new HttpServerRequest().GetDeviceMessageRulesSet(function.deviceId);
                    //var result1 = new HttpServerRequest().DeviceMessageRulesSet(function.deviceId);//设置推送信息
                    Application.RunOnMainThread(() =>
                    {
                        if (result != null && result.Code == StateCode.SUCCESS && result.Data != null)
                        {
                            var data = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DeviceMessageRules>>(result.Data.ToString());
                            if (data.Count > 0)
                            {
                                deviceMessageRules = data[0];
                                btnSwtichIcon0.IsSelected = deviceMessageRules.push;
                            }
                        }
                        else
                        {
                            btnSwtichIcon0.IsSelected = false;
                        }
                        waitView.Hide();
                        waitView.RemoveFromParent();
                    });
                })
                { IsBackground = true }.Start();
                viewRow0.AddChidren(new Button()
                {
                    Gravity = Gravity.CenterHorizontal,
                    Y = Application.GetRealHeight(54),
                    BackgroundColor = CSS_Color.DividingLineColor,
                    Width = Application.GetRealWidth(343),
                    Height = Application.GetRealHeight(1)
                });
                #endregion
                #region 演示模式
                var viewRow = new FrameLayout()
                {
                    Height = Application.GetRealHeight(55),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(viewRow);
                var btnRowTitle = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(160),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.LaboratoryMode,
                };
                viewRow.AddChidren(btnRowTitle);
                var btnSwtichIcon = new Button()
                {
                    X = Application.GetRealWidth(322),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(36),
                    Height = Application.GetMinRealAverage(36),
                    UnSelectedImagePath = "Public/Switch_2.png",
                    SelectedImagePath = "Public/SwitchOn_2.png",
                    IsSelected = function.extSet.labModel
                };
                viewRow.AddChidren(btnSwtichIcon);
                btnSwtichIcon.MouseUpEventHandler = (sender, e) =>
                {
                    btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected;
                    new System.Threading.Thread(() =>
                    {
                        var result = new HttpServerRequest().DeviceExtSet(function.deviceId, function.extSet);
                        Application.RunOnMainThread(() =>
                        {
                            if (result != null && result.Code == StateCode.SUCCESS)
                            {
                                if (Convert.ToBoolean( result.Data ))
                                {
                                    function.extSet.labModel = btnSwtichIcon.IsSelected;
                                }
                                else
                                {
                                    btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected;
                                }
                            }
                            else
                            {
                                btnSwtichIcon.IsSelected = function.extSet.labModel = !btnSwtichIcon.IsSelected;
                            }
                        });
                    })
                    { IsBackground = true }.Start();
                };
                #endregion
            }
            LoadEventList();
        }
        /// <summary>
        /// 加载选择弹窗
        /// </summary>
        void LoadEditDialog(int min ,int max,int curValue,Action<string> action)
        {
            List<string> pickerItems = new List<string>();
            Dialog dialog = new Dialog();
            var pView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            dialog.AddChidren(pView);
            var optionBaseView = new FrameLayout()
            {
                Y = Application.GetRealHeight(456 - 60),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(260),
                AnimateSpeed = 0.3f,
                Animate = Animate.DownToUp,
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
            };
            pView.AddChidren(optionBaseView);
            var topView = new FrameLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(40),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
            };
            optionBaseView.AddChidren(topView);
            topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
            var btnCancel = new Button()
            {
                X = Application.GetRealWidth(21),
                Width = Application.GetRealWidth(100),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.Cancel,
            };
            topView.AddChidren(btnCancel);
            var btnConfrim = new Button()
            {
                X = Application.GetRealWidth(160),
                Width = Application.GetRealWidth(160),
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextID = StringId.Confirm,
            };
            topView.AddChidren(btnConfrim);
            UIPickerView uIPickerView = new UIPickerView()
            {
                Y = Application.GetRealHeight(40),
                Height = Application.GetRealHeight(210),
                Radius = (uint)Application.GetRealWidth(12),
            };
            for (int i = min; i <= max; i += 1)
            {
                pickerItems.Add(i.ToString());
            }
            uIPickerView.setNPicker(pickerItems, null, null);
            optionBaseView.AddChidren(uIPickerView);
            uIPickerView.setCurrentItems(pickerItems.IndexOf(curValue.ToString()), 4, 5);
            string selectItem = pickerItems[0];
            if (pickerItems.Contains(curValue.ToString()))
            {
                selectItem = curValue.ToString();
            }
            dialog.Show();
            pView.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            btnCancel.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => {
                selectItem = pickerItems[int1];
            };
            btnConfrim.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
                action?.Invoke(selectItem);
            };
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/ObjectClass.cs
@@ -132,6 +132,11 @@
        /// </summary>
        public string deviceName = string.Empty;
        /// <summary>
        /// 区分是狄耐克还是自研
        /// 目前只有自研有值:door.gate
        /// </summary>
        public string spk = string.Empty;
        /// <summary>
        /// 设备id、序列号、uuid
        /// </summary>
        public string deviceId = string.Empty;
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -5,11 +5,14 @@
using HDL_ON.Stan;
using ZXing.QrCode.Internal;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
using HDL_ON.UI.CSS;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class VideoMainView : FrameLayout
    {
        List<Video> xiMoVideoList = new List<Video>();
        /// <summary>
        /// 加载可视对讲UI
        /// </summary>
@@ -17,6 +20,7 @@
        /// <param name="videoList">可视对讲列表</param>
        public void Show(List<CallView> listCall, List<Video> videoList)
        {
            xiMoVideoList = videoList.FindAll((obj) => obj.spk == "door.gate");
            #region 布局界面
            this.BackgroundColor = MusicColor.ViewColor;
            var topView = new TopView();
@@ -198,11 +202,17 @@
            };
            bjFl.AddChidren(vv);
            bool bol = haveFlVideo(videoList);
            bool bol = haveQRCodeVideo(videoList);
            if (bol)
            {
                //门禁二维码固定有的,虚拟一个出来
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" });
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" ,devType = "100" });
            }
            if (xiMoVideoList.Count > 0)
            {
                //徘徊报警
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.WanderingAlarm), interphoneType = "222", devType = "222" });
            }
            //数组个数
            //int value = 15;
@@ -277,16 +287,24 @@
                    var video2 = clickBtn.Tag as Video;
                    if (video2.devType == "100")
                    {
                        //门禁二维码固定有的
                        VideoSend.GetQRcode(this, video2, (tag, paw) =>
                        {
                            if (tag)
                            {
                                //注意:密码有可能延时1分钟生效
                                View.ShowDialog showDialog = new View.ShowDialog();
                                showDialog.QRcode(paw);
                            }
                        });
                        ChooseVideoShowQRCode();
                        ////门禁二维码固定有的
                        //VideoSend.GetQRcode(this, video2, (tag, paw) =>
                        //{
                        //    if (tag)
                        //    {
                        //        //注意:密码有可能延时1分钟生效
                        //        View.ShowDialog showDialog = new View.ShowDialog();
                        //        showDialog.QRcode(paw);
                        //    }
                        //});
                    }
                    else if (video2.devType == "222")
                    {
                        ChooseAlarmShow();
                    }
                    else
                    {
@@ -553,20 +571,273 @@
        //判断是否有 丰林可视对讲
        private bool haveFlVideo(List<Video> videoList)
        private bool haveQRCodeVideo(List<Video> videoList)
        {
            bool bol = false;
            for (int i = 0; i < videoList.Count; i++)
            {
                var _video = videoList[i];
                if (_video.interphoneType == "FLVI")
                if (_video.interphoneType == "FLVI" || _video.spk == "door.gate")
                    return true;
            }
            return bol;
        }
        /// <summary>
        /// 获取门禁二维码
        /// </summary>
        public void ChooseVideoShowQRCode()
        {
            Dialog dialog = new Dialog()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            FrameLayout dialogView = new FrameLayout();
            dialog.AddChidren(dialogView);
            dialogView.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            var contentView = new FrameLayout()
            {
                Gravity = Gravity.Center,
                Width = Application.GetRealWidth(270),
                Height = Application.GetRealHeight(200),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                BorderColor = 0x00000000,
                BorderWidth = 0,
                Radius = (uint)Application.GetMinRealAverage(10),
            };
            dialogView.AddChidren(contentView);
            var btnTitle = new Button()
            {
                Height = Application.GetRealHeight(64),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextID = StringId.menjinerweima,
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            contentView.AddChidren(btnTitle);
            var listView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(70),
                Width = Application.GetRealWidth(230),
                Height = Application.GetRealHeight(200),
            };
            contentView.AddChidren(listView);
            //if (ximoVideoList.Count == 1)
            {
                Loading loading = new Loading();
                contentView.AddChidren(loading);
                loading.Start("");
                new System.Threading.Thread(() =>
                {
                    try
                    {
                        var pack = VideoSend.GetQRcode();
                        var pairs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AccessControlQRode>>(pack.Data.ToString());
                        if (pairs.Count > 0)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                ImageView codeImage = new ImageView()
                                {
                                    Gravity = Gravity.Center,
                                    Height = Application.GetRealWidth(320),
                                    Width = Application.GetRealWidth(320),
                                    ImageBytes = Scan.BytesFromText(pairs[0].qrcode, Application.GetRealWidth(200), Application.GetRealWidth(200)),
                                };
                                dialogView.AddChidren(codeImage);
                            });
                        }
                    }
                    catch (Exception ex)
                    {
                        MainPage.Log($"获取门禁二维码异常:{ex.Message}");
                    }
                    finally
                    {
                        Application.RunOnMainThread(() =>
                        {
                            if (loading != null)
                            {
                                loading.Hide();
                                loading.RemoveFromParent();
                            }
                        });
                    }
                })
                { IsBackground = true }.Start();
            }
            //else
            //{
            //    foreach (var v in ximoVideoList)
            //    {
            //        Button btnMsg = new Button()
            //        {
            //            Gravity = Gravity.CenterHorizontal,
            //            Height = Application.GetRealHeight(50),
            //            Width = Application.GetRealHeight(160),
            //            TextAlignment = TextAlignment.Center,
            //            TextColor = CSS_Color.TextualColor,
            //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //            Text = v.deviceName,
            //            Radius = (uint)Application.GetRealWidth(5),
            //            BackgroundColor = CSS_Color.DividingLineColor,
            //            IsMoreLines = true,
            //        };
            //        listView.AddChidren(btnMsg);
            //        listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
            //        btnMsg.MouseUpEventHandler = (sender, e) =>
            //        {
            //            if (v.spk == "door.gate")
            //            {
            //                return;
            //            }
            //            //门禁二维码固定有的
            //            VideoSend.GetQRcode(this, v, (tag, paw) =>
            //            {
            //                if (tag)
            //                {
            //                //注意:密码有可能延时1分钟生效
            //                View.ShowDialog showDialog = new View.ShowDialog();
            //                    showDialog.QRcode(paw);
            //                }
            //            });
            //            dialog.Close();
            //        };
            //    }
            //}
            dialog.Show();
        }
        /// <summary>
        /// 选择徘徊报警列表显示
        /// </summary>
        public void ChooseAlarmShow()
        {
            if (xiMoVideoList.Count == 1)
            {
                var wanderingAlarmPage = new WanderingAlarmPage(xiMoVideoList[0].deviceId);
                MainPage.BasePageView.AddChidren(wanderingAlarmPage);
                wanderingAlarmPage.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            }
            else
            {
                Dialog dialog = new Dialog()
                {
                    BackgroundColor = CSS_Color.DialogTransparentColor1,
                };
                FrameLayout dialogView = new FrameLayout();
                dialog.AddChidren(dialogView);
                dialogView.MouseUpEventHandler = (sender, e) =>
                {
                    dialog.Close();
                };
                var contentView = new FrameLayout()
                {
                    Gravity = Gravity.Center,
                    Width = Application.GetRealWidth(270),
                    Height = Application.GetRealHeight(280),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                    BorderColor = 0x00000000,
                    BorderWidth = 0,
                    Radius = (uint)Application.GetMinRealAverage(10),
                };
                dialogView.AddChidren(contentView);
                var btnTitle = new Button()
                {
                    Height = Application.GetRealHeight(64),
                    TextAlignment = TextAlignment.Center,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextID = StringId.WanderingAlarm,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                };
                contentView.AddChidren(btnTitle);
                var listView = new VerticalScrolViewLayout()
                {
                    Gravity = Gravity.CenterHorizontal,
                    Y = Application.GetRealHeight(70),
                    Width = Application.GetRealWidth(230),
                    Height = Application.GetRealHeight(200),
                };
                contentView.AddChidren(listView);
                foreach (var v in xiMoVideoList)
                {
                    Button btnMsg = new Button()
                    {
                        Gravity = Gravity.CenterHorizontal,
                        Height = Application.GetRealHeight(50),
                        Width = Application.GetRealHeight(160),
                        TextAlignment = TextAlignment.Center,
                        TextColor = CSS_Color.TextualColor,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                        Text = v.deviceName,
                        Radius = (uint)Application.GetRealWidth(5),
                        BackgroundColor = CSS_Color.DividingLineColor,
                        IsMoreLines = true,
                    };
                    listView.AddChidren(btnMsg);
                    listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
                    btnMsg.MouseUpEventHandler = (sender, e) =>
                    {
                        var wanderingAlarmPage = new WanderingAlarmPage(v.deviceId);
                        MainPage.BasePageView.AddChidren(wanderingAlarmPage);
                        wanderingAlarmPage.LoadPage();
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        dialog.Close();
                    };
                }
                dialog.Show();
            }
        }
    }
    /// <summary>
    /// 门禁二维码数据
    /// </summary>
    public class AccessControlQRode
    {
        public string title = string.Empty;
        public string codeType = string.Empty;
        public string userName = string.Empty;
        public string houseFullName = string.Empty;
        public string communityName = string.Empty;
        public string desc = string.Empty;
        public string businessType = string.Empty;
        public string qrcode = string.Empty;
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
@@ -3,6 +3,7 @@
using System.IO;
using System.Net;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
using Newtonsoft.Json.Linq;
using Shared;
@@ -82,6 +83,22 @@
        }
        /// <summary>
        /// 获取门禁二维码(自研)
        /// </summary>
        /// <returns></returns>
        public static ResponsePackNew GetQRcode()
        {
            var jobject = new JObject();
            jobject.Add("userId", UserInfo.Current.ID);
            jobject.Add("userType", "C");
            jobject.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
            jobject.Add("codeSecond", "60");
            var requestJson = HttpUtil.GetSignRequestJson(jobject);//数据签名
            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_OwnerQRCode, requestJson);
            return revertObj;
        }
        /// <summary>
        /// 上报动态开锁密码(注意:密码有可能延时1分钟生效)
        /// </summary>
        public static void GetQRcode(FrameLayout frame, Video video, Action<bool, string> action)
SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>