1.5.9打包
1.适配bus协议194A控制
2.温控器二期
3.毫米波传感器
4.可视对讲功能,门禁二维码,徘徊报警
| | |
| | | 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 |
| | |
| | | 543=获取更多 |
| | | 544=角度 |
| | | 545=报警数据统计 |
| | | 546=实验室模式 |
| | | 547=报警功能 |
| | | 548=室内 |
| | | 549=表面温度 |
| | | 550=温度校准 |
| | | 551=湿度校准 |
| | | 552=毛细阀 |
| | | 553=地暖阀 |
| | | 554=*为保障最佳延时效果,建议人数在4人一下。 |
| | | 555=退出实验室模式 |
| | | 556=有人在跑 |
| | | 557=有人站着 |
| | | 558=有人坐着 |
| | | |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | <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" /> |
| | |
| | | <?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>--> |
| | |
| | | <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" /> |
| | |
| | | <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> |
| | |
| | | 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 |
| | |
| | | 543=获取更多 |
| | | 544=角度 |
| | | 545=报警数据统计 |
| | | 546=实验室模式 |
| | | 547=报警功能 |
| | | 548=室内 |
| | | 549=表面温度 |
| | | 550=温度校准 |
| | | 551=湿度校准 |
| | | 552=毛细阀 |
| | | 553=地暖阀 |
| | | 554=*为保障最佳延时效果,建议人数在4人一下。 |
| | | 555=退出实验室模式 |
| | | 556=有人在跑 |
| | | 557=有人站着 |
| | | 558=有人坐着 |
| | | |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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; |
| | |
| | | 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 |
| | | { |
| | |
| | | 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: |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | /// </summary> |
| | | public virtual void Manager() |
| | | { |
| | | #if DEBUG |
| | | #else |
| | | try |
| | | { |
| | | { |
| | | #endif |
| | | //对于操作数据库的时间比较长的,可以创建另一个线程处理 |
| | | if (!"HDLMIRACLE".Equals(Encoding.ASCII.GetString(Bytes, 4, 10))) |
| | | { |
| | |
| | | #endif |
| | | //处理是否要重发数据 |
| | | ManagerReceive(subnetID, deviceID, command, usefulBytes); |
| | | } |
| | | |
| | | #if DEBUG |
| | | #else |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"packet {ex.Message} "); |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <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: |
| | |
| | | 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"); |
| | |
| | | FunctionPage.UpdataStates(function); |
| | | HomePage.UpdataFunctionStates(function); |
| | | ClassificationPage.UpdataInfo(function); |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function.sid, function.status); |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(function); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | 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); |
| | |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | #if DEBUG |
| | | #else |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Bus Rev Erorr : {ex.Message}"); |
| | | } |
| | | #endif |
| | | |
| | | } |
| | | /// <summary> |
| | | /// byte转16进制字符串 |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (busSocket == null) |
| | | { |
| | | return; |
| | | } |
| | | asyncBeginReceive(); |
| | | Packet packet = (Packet)iar.AsyncState; |
| | | int len = busSocket.EndReceiveFrom(iar, ref packet.RemoteEndPoint); |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | /// <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 = "") |
| | | { |
| | |
| | | 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 |
| | | |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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> |
| | |
| | | /// 读取最近一个月的数据 |
| | | /// </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 -- 场景接口____________________________ |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设备推送消息规则 |
| | | /// </summary> |
| | | [Serializable] |
| | | public class DeviceMessageRules |
| | | { |
| | | public string homeId; |
| | | public string deviceId; |
| | | public string conditionIdentify; |
| | | public bool push; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [System.Serializable] |
| | |
| | | /// </summary> |
| | | public string modifyTime = ""; |
| | | |
| | | /// <summary> |
| | | /// 扩展信息 |
| | | /// </summary> |
| | | public ExtSet extSet = new ExtSet(); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //public void |
| | | |
| | | |
| | | /// <summary> |
| | | /// 延时 |
| | | /// </summary> |
| | |
| | | /// </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"; |
| | |
| | | /// 打开等级(风扇) |
| | | /// </summary> |
| | | public const string OpenLevel = "openLevel"; |
| | | public const string fan_speed_percent = "fan_speed_percent"; |
| | | /// <summary> |
| | | /// 红外按键 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public string desc = string.Empty; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 扩展信息设置 |
| | | /// </summary> |
| | | public class ExtSet |
| | | { |
| | | /// <summary> |
| | | /// 是否开启实验室模式 |
| | | /// </summary> |
| | | public bool labModel = false; |
| | | } |
| | | } |
| | |
| | | <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\" />
|
| | |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthPage(); |
| | | smPage.ShowColltionButton = false; |
| | | smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SensorGas: |
| | |
| | | /// <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)
|
| | |
| | | HdlFormLogic.Current.DeviceStatuPush(localDevice);
|
| | | }
|
| | | return localDevice;
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 设备状态更新
|
| | | /// </summary>
|
| | | public Function UpdateDeviceStatu(Function function)
|
| | | { |
| | | //全部界面推送 |
| | | HdlFormLogic.Current.DeviceStatuPush(function);
|
| | | return function;
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | //etAccount.Text = "13450425807";//黄竹溪 knx项目 |
| | | etAccount.Text = "18244942707"; |
| | | etAccount.Text = "tf@smarttech.com.ua"; |
| | | etAccount.Text = "13418062953"; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | 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; |
| | |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | //case SPK.LightSwitch: |
| | | case SPK.LightSwitch: |
| | | //窗帘 |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainRoller: |
| | |
| | | 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) |
| | |
| | | temp = 16; |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | Text = Convert.ToDouble(temp).ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); |
| | | FrameWhiteCentet1.AddChidren(btnTemp); |
| | | |
| | | |
| | | btnTempUint = new Button() |
| | | { |
| | |
| | | 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, |
| | | }; |
| | |
| | | if (this.device.sid != i_LocalDevice.sid) { return; } |
| | | |
| | | //刷新当前设备的状态缓存 |
| | | this.RefreshNowDeviceStatuMemory(i_LocalDevice); |
| | | //this.RefreshNowDeviceStatuMemory(i_LocalDevice); |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | } |
| | |
| | | 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()); |
| | |
| | | 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()); |
| | |
| | | { |
| | | 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"); |
| | |
| | | } |
| | | 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)); |
| | |
| | | |
| | | |
| | | 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") |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 一般方法___________________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新当前设备的状态缓存 |
| | | /// </summary> |
| | | private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) |
| | | { |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | /// 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; |
| | |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | /// 文本控件 |
| | | /// </summary> |
| | | private NormalViewControl btnSuctionView = null; |
| | | /// <summary> |
| | | /// 退出实验室模式控制区域 |
| | | /// </summary> |
| | | FrameLayout exitLabView; |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | |
| | | |
| | | //加载瞬时值 |
| | | |
| | | var btnInstantaneousValue = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | 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> |
| | | /// 初始化第二个索引页的内容 |
| | |
| | | else if (temp.state == "uninhabited")//无人 |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; |
| | | btnSuctionView.TextID = StringId.UnderProtection; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | else//有人 |
| | |
| | | { |
| | | 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | 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(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | 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) |
| | | { |
| | |
| | | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | |
| | | else if (function.spk == SPK.HvacCac) |
| | | { |
| | | |
| | | |
| | | #region 露点温度 |
| | | if (function.GetAttribute(FunctionAttributeKey.dew_point_temp) != null) |
| | | { |
| | |
| | | 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, |
| | |
| | | #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); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string deviceName = string.Empty; |
| | | /// <summary> |
| | | /// 区分是狄耐克还是自研 |
| | | /// 目前只有自研有值:door.gate |
| | | /// </summary> |
| | | public string spk = string.Empty; |
| | | /// <summary> |
| | | /// 设备id、序列号、uuid |
| | | /// </summary> |
| | | public string deviceId = string.Empty; |
| | |
| | | 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> |
| | |
| | | /// <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(); |
| | |
| | | }; |
| | | 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; |
| | |
| | | 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 |
| | | { |
| | |
| | | |
| | | |
| | | //判断是否有 丰林可视对讲 |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | /// <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) |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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> |