Merge branch 'wxr6' into wxr4
| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs"> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <Files> |
| | | <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="5" Column="18" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="2286" Column="63" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs" Line="19" Column="29" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="15" Column="35" /> |
| | | <File FileName="HDL_ON/Common/HDLCommon.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs" /> |
| | | <File FileName="HDL-ON_Android/Application.cs" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="359" Column="40" /> |
| | | <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True" selected="True"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="Server" expanded="True" /> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True" /> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="BindingResidence" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True" /> |
| | | <Node name="Scene" expanded="True" /> |
| | | </Node> |
| | | <Node name="4-PersonalCenter" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True" selected="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.IOS.TBL/Shared.IOS.TBL.csproj</String> |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | <String>../LCOpenSDK_iOS/iOS/Xamarin/Shared.IOS.LCVideoOnSDK/Shared.IOS.LCVideoOnSDK/Shared.IOS.LCVideoOnSDK.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs" line="79" column="1" /> |
| | | </BreakpointStore> |
| | | <BreakpointStore /> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | |
| | | Utlis.WriteLine("PushMes title : " + pushMes.Title); |
| | | Utlis.WriteLine("PushMes message : " + pushMes.Content); |
| | | Utlis.WriteLine("PushMes extras : " + pushMes.Extras); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | HDLCommon.Current.AdjustPushMessage(pushMes); |
| | |
| | | if (jpushExpandData != null && jpushExpandData.messageType != null) |
| | | { |
| | | pushMes.messageType = jpushExpandData.messageType; |
| | | pushMes.expantContent = jpushExpandData.expantContent; |
| | | pushMes.expantContent = jpushExpandData.expantContent; ; |
| | | pushMes.HomeId = jpushExpandData.homeId; |
| | | Utlis.WriteLine("PushMes messageType : " + pushMes.messageType); |
| | | } |
| | | |
| | | Utlis.WriteLine("PushMes title : " + pushMes.Title); |
| | | Utlis.WriteLine("PushMes message : " + pushMes.Content); |
| | | Utlis.WriteLine("PushMes extras : " + pushMes.Extras); |
| | | Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class); |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104131" android:versionName="1.2.202104131" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | | <!--网络访问--> |
| | | <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />--> |
| | | <!--允许程序写入外部存储,如SD卡上写文件,抓图、录制等--> |
| | | <!--<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />--> |
| | | <!--程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,我的文件等--> |
| | | <uses-permission android:name="android.permission.USE_CREDENTIALS" /> |
| | | <!--允许程序请求验证从AccountManager???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />--> |
| | | <!--允许改变WiFi多播状态???--> |
| | | <!--<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />--> |
| | | <!--允许程序显示系统窗口,应该已经不适用了???--> |
| | | <!--<uses-permission android:name="android.permission.RECORD_AUDIO" />--> |
| | | <!--允许程序录制声音通过手机或耳机的麦克,对讲、自定义报警音等--> |
| | | <!--<uses-permission android:name="android.permission.CAMERA" />--> |
| | | <!--允许程序访问摄像头进行拍照,二维码扫描补光、拍照上传图片等--> |
| | | <uses-permission android:name="android.permission.FLASHLIGHT" /> |
| | | <!--允许访问闪光灯,二维码扫描补光--> |
| | | <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> |
| | | <!--允许程序修改声音设置信息,声波配对,自动调大音量。需求变更之后应该不需要了???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />--> |
| | | <!--允许程序获取当前WiFi接入的状态以及WLAN热点的信息,设备添加何种配网流程使用--> |
| | | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| | | <!--允许程序改变WiFi状态,配网等--> |
| | | <!--<uses-feature android:name="android.hardware.camera" />--> |
| | | <!--<uses-feature android:name="android.hardware.camera.autofocus" />--> |
| | | <!-- 硬件加速对X5视频播放非常重要,建议开启 --> |
| | | <uses-permission android:name="android.permission.READ_SETTINGS" /> |
| | | <!--允许程序读取系统设置,声波配对获取当前系统音量等--> |
| | | <!-- Optional for location --> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取粗略的位置,登陆、设备添加等--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取精确的位置,登陆、设备添加等???--> |
| | | <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> |
| | | <!--允许应用程序访问额外的位置提供命令,登陆、设备添加等???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />--> |
| | | <!--允许程序改变网络状态,如是否联网,配网???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />--> |
| | | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> |
| | | <!--允许应用程序请求安装包。针对API大于22必须持有该许可使用ACTION_INSTALL_PACKAGE应用。应该没在用???--> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107023" android:versionName="1.2.202107023" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> |
| | | <!-- 可视对讲权限--> |
| | | <uses-permission android:name="android.permission.CAMERA" /> |
| | | <uses-feature android:name="android.hardware.camera" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202106281</string> |
| | | <string>1.2.202107023</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.06281</string> |
| | | <string>1.2.07023</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | { |
| | | |
| | | }; |
| | | while (MainPage.BasePageView.ChildrenCount > 1) |
| | | { |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 2; |
| | | } |
| | | var skipPage = new MessageCenterPage(); |
| | | MainPage.BasePageView.AddChidren(skipPage); |
| | | skipPage.LoadPage(backAction); |
| | |
| | | alarmPushConfirmDialog = null; |
| | | }; |
| | | |
| | | |
| | | //防止多次弹窗处理 |
| | | if (alarmPushConfirmDialog == null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | ////远程通讯 |
| | | //if (Ins.GatewayOnline_Local == false && Ins.GatewayOnline_Cloud == true) |
| | | //{ |
| | | // DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | // //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | // var apiControlData = function.GetApiControlData(commandDictionary); |
| | | // var actionObjs = new List<ApiAlinkControlActionObj>(); |
| | | // actionObjs.Add(apiControlData); |
| | | // var pack = httpServer.ControlDevice(actionObjs); |
| | | //} |
| | | //本地通讯 |
| | | if (Ins.GatewayOnline_Local) |
| | | { |
| | |
| | | /// </summary> |
| | | public void ControlBytesSend(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, int sendCount = 3) |
| | | { |
| | | #if DEBUG |
| | | string ddd = ""; |
| | | foreach (var bb in gatewayBytes) |
| | | { |
| | | ddd += bb + ","; |
| | | } |
| | | MainPage.Log($"发送bus命令:" + ((int)command).ToString("X").PadLeft(4,'0') + " : 数据:" + ddd); |
| | | #endif |
| | | |
| | | var control = new Control_Udp(); |
| | | control.Send(new Target() |
| | | { |
| | |
| | | { |
| | | case SPK.LightCCT: |
| | | byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0 |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | b0 = 0; |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b0 = 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b0 = Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Brightness)) == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));// == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | var bytes0 = new byte[] { function.bus.LoopId, |
| | | b0, |
| | |
| | | { |
| | | ddd += bb + ","; |
| | | } |
| | | MainPage.Log($"bus命令:"+ ((int)command) + " : 数据:" + ddd); |
| | | MainPage.Log($"bus命令:" + ((int)command).ToString("X").PadLeft(4, '0') + " : 数据:" + ddd); |
| | | //MainPage.Log($"bus命令:"+ ((int)command) + " : 数据:" + ddd); |
| | | #endif |
| | | //处理是否要重发数据 |
| | | ManagerReceive(subnetID, deviceID, command, usefulBytes); |
| | |
| | | break; |
| | | case Command.SetLogicLoopColorACK: |
| | | case Command.ReadLogicLoopColorACK: |
| | | foreach (var rgb in FunctionList.List.GetLightList()) |
| | | foreach (var lightTeme in FunctionList.List.GetLightList()) |
| | | { |
| | | if (rgb.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | if (lightTeme.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | | if (rgb.spk == SPK.LightRGB) |
| | | if (lightTeme.spk == SPK.LightRGB) |
| | | { |
| | | rgb.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; |
| | | lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; |
| | | if (receiveBytes[1] > 0) |
| | | { |
| | | rgb.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); |
| | | rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; |
| | | lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); |
| | | lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; |
| | | } |
| | | new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, rgb); |
| | | new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, lightTeme); |
| | | |
| | | HomePage.UpdataFunctionStates(rgb); |
| | | RoomPage.UpdataStates(rgb); |
| | | FunctionPage.UpdataStates(rgb); |
| | | ClassificationPage.UpdataInfo(rgb); |
| | | RGBPage.UpdataStates(rgb); |
| | | HomePage.UpdataFunctionStates(lightTeme); |
| | | RoomPage.UpdataStates(lightTeme); |
| | | FunctionPage.UpdataStates(lightTeme); |
| | | ClassificationPage.UpdataInfo(lightTeme); |
| | | RGBPage.UpdataStates(lightTeme); |
| | | }else if(lightTeme.spk == SPK.LightCCT) |
| | | { |
| | | lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; |
| | | if (receiveBytes[1] > 0) |
| | | { |
| | | lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); |
| | | lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; |
| | | } |
| | | new Light().SetCCT(new byte[] { receiveBytes[6], receiveBytes[7] }, lightTeme); |
| | | |
| | | HomePage.UpdataFunctionStates(lightTeme); |
| | | RoomPage.UpdataStates(lightTeme); |
| | | FunctionPage.UpdataStates(lightTeme); |
| | | ClassificationPage.UpdataInfo(lightTeme); |
| | | ColorTureLampPage.UpdataStatus(lightTeme); |
| | | } |
| | | } |
| | | } |
| | |
| | | return recolor; |
| | | } |
| | | /// <summary> |
| | | /// 获取rgb颜色数组 |
| | | /// </summary> |
| | | /// <param name="function"></param> |
| | | /// <returns></returns> |
| | | public byte[] GetRGBbytes(Function function) |
| | | { |
| | | var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(","); |
| | | |
| | | if (color.Length != 3) |
| | | { |
| | | color = new string[] { "100", "100", "100" }; |
| | | } |
| | | byte redColor = 0; |
| | | byte greenColor = 0; |
| | | byte blueColor = 0; |
| | | |
| | | byte.TryParse(color[0], out redColor); |
| | | byte.TryParse(color[1], out greenColor); |
| | | byte.TryParse(color[2], out blueColor); |
| | | |
| | | return new byte[] { redColor, greenColor, blueColor }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取rgb 控制字符串 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | function.SetAttrState(FunctionAttributeKey.RGB, color[0] + "," + color[1] + "," + color[2]); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置色温 |
| | | /// </summary> |
| | | /// <param name="cct"></param> |
| | | /// <param name="function"></param> |
| | | public void SetCCT(byte[] cct,Function function) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.CCT, cct[0] * 256 + cct[1]); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0629"; |
| | | public static string VersionString = "1.2.0702"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 场景支持的功能列表 |
| | | /// </summary> |
| | | public static List<string> SceneSupportFunctionList = new List<string> { |
| | | SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.FloorHeatStandard, |
| | | |
| | | }; |
| | | /// <summary> |
| | | /// 房间功能列表不加载的功能列表 |
| | | /// </summary> |
| | | public static List<string> RoomNotSupportFunctionList = new List<string> |
| | | { |
| | | SPK.EnergyStandard, |
| | | }; |
| | | |
| | | |
| | | |
| | | public static void Show() |
| | |
| | | { |
| | | if (downloadData) |
| | | { |
| | | DB_ResidenceData.Instance.EixtAccount(); |
| | | ///初始化app数据 |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | }; |
| | |
| | | //return; |
| | | if (b) |
| | | { |
| | | etAccount.Text = "tf@smarttech.com.ua";//国外账号,有住宅,登录无法显示 |
| | | //etAccount.Text = "tf@smarttech.com.ua";//国外账号,有住宅,登录无法显示 |
| | | //etAccount.Text = "13375012446";//测试服务器 |
| | | etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | |
| | | } |
| | | else |
| | | { |
| | | etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "15626203746"; |
| | | //etAccount.Text = "15018447586";//音乐数量刷新问题 |
| | | //etAccount.Text = "464027401@qq.com";// |
| | | //etAccount.Text = "15217626103";// |
| | | //etAccount.Text = "13682244600";//波哥 |
| | | //etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | //etAccount.Text = "BB01010101@evoyo.com";//可视对讲 |
| | | etAccount.Text = "551775569@.com"; |
| | | //etAccount.Text = "13168123446"; |
| | | //etAccount.Text = "13676202754";//巴林服务器 |
| | | //etAccount.Text = "13602944661";//kx |
| | |
| | | { |
| | | Application.RunOnMainThread((Action)(() => |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (view == null || scrolView == null || updataFunction == null) |
| | |
| | | #endregion |
| | | case FunctionCategory.Curtain: |
| | | #region 窗帘更新 |
| | | var percent = updataFunction.GetAttrState(FunctionAttributeKey.OnOff) == "off" ? 0 : 100; |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | if (onoffString == "stop") |
| | | { |
| | | return; |
| | | } |
| | | var percent = onoffString == "off" ? 0 : 100; |
| | | if(updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) |
| | | { |
| | | string percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); |
| | |
| | | //大图显示 |
| | | if (OnAppConfig.Instance.IsShowBigPicture) |
| | | { |
| | | LoadBigPirtureRoomRow(roomView, roomsShowed[i/2]); |
| | | LoadBigPirtureRoomRow(roomView, roomsShowed[i]); |
| | | } |
| | | else//无图显示 |
| | | { |
| | | LoadSmallPirtureRoomRow(roomView, roomsShowed[i/2]); |
| | | LoadSmallPirtureRoomRow(roomView, roomsShowed[i]); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | //全开全关 |
| | | //if (DB_ResidenceData.Instance.GatewayType == 0 && !Control.Ins.IsRemote) |
| | | //休眠时间(ms) |
| | | int sleepTime = 100; |
| | | if(DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | sleepTime = 200; |
| | | } |
| | | if (Control.Ins.GatewayOnline_Local) |
| | | { |
| | | switch (functionCategory) |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.Light: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.Electric: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(f, d); |
| | | System.Threading.Thread.Sleep(100); |
| | | System.Threading.Thread.Sleep(sleepTime); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | if(temp.roomIds.Contains(catchRoom.roomId)) |
| | | { |
| | | catchFunctionList.Add(temp); |
| | | if (MainPage.SceneSupportFunctionList.Contains(temp.spk)) |
| | | { |
| | | catchFunctionList.Add(temp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | addSceneView.AddChidren(btnAddSceneText); |
| | | #endregion |
| | | |
| | | #region 捕获场景 |
| | | FrameLayout catchSceneView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y =addSceneView.Bottom,//+ Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(361), |
| | | Height = Application.GetRealWidth(202), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | bodyView.AddChidren(catchSceneView); |
| | | |
| | | ImageView catchSceneImageView = new ImageView() |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) { } |
| | | else |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | ImagePath = "Intelligence/CreateScene2Bg.png", |
| | | }; |
| | | catchSceneView.AddChidren(catchSceneImageView); |
| | | #region 捕获场景 |
| | | FrameLayout catchSceneView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = addSceneView.Bottom,//+ Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(361), |
| | | Height = Application.GetRealWidth(202), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | bodyView.AddChidren(catchSceneView); |
| | | |
| | | btnCatchSceneBg = new Button() |
| | | { |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | catchSceneView.AddChidren(btnCatchSceneBg); |
| | | ImageView catchSceneImageView = new ImageView() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | ImagePath = "Intelligence/CreateScene2Bg.png", |
| | | }; |
| | | catchSceneView.AddChidren(catchSceneImageView); |
| | | |
| | | Button btnCatchSceneText = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(126), |
| | | Height = Application.GetRealWidth(68), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.CatchScene, |
| | | }; |
| | | catchSceneView.AddChidren(btnCatchSceneText); |
| | | #endregion |
| | | btnCatchSceneBg = new Button() |
| | | { |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | catchSceneView.AddChidren(btnCatchSceneBg); |
| | | |
| | | Button btnCatchSceneText = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(126), |
| | | Height = Application.GetRealWidth(68), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.CatchScene, |
| | | }; |
| | | catchSceneView.AddChidren(btnCatchSceneText); |
| | | #endregion |
| | | } |
| | | |
| | | /* |
| | | #region 电影场景 |
| | |
| | | void LoadEventList() |
| | | { |
| | | LoadEvent_SkipAddScenePage(); |
| | | LoadEvent_SkipCatchScenePage(); |
| | | if (DB_ResidenceData.Instance.GatewayType != 0) |
| | | { |
| | | LoadEvent_SkipCatchScenePage(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | foreach (var function in FunctionList.List.Functions) |
| | | { |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | | if (function == null) |
| | | { |
| | | continue; |
| | |
| | | } |
| | | btnExit.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | MainPage.NoLoginMode = false; |
| | | UserInfo.Current.ClearUserInfo(); |
| | | HDLCommon.Current.Logout(); |
| | | }; |
| | |
| | | foreach (var function in FunctionList.List.GetDeviceFunctionList()) |
| | | { |
| | | function.roomIds.Remove(null); |
| | | if(MainPage.RoomNotSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | | if (function.roomIds.Count > 0 ) |
| | | { |
| | | allocatedList.Add(function); |
| | |
| | | Button btnFromFloor_Out; |
| | | bool onDimmerBar = false; |
| | | Function function; |
| | | |
| | | /// <summary> |
| | | /// 最后打开的颜色 |
| | | /// </summary> |
| | | byte[] lastColor = new byte[3] { 255, 255, 255 }; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); |
| | | |
| | | colorPicker.ColorChaged += (sender2, e2) => { |
| | | if (function.trait_on_off.curValue.ToString() == "off" |
| | | || pointIsRight == false) |
| | | if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) |
| | | { |
| | | //pointIsRight:点的区域不是圆盘内 |
| | | return; |
| | | } |
| | | if ((DateTime.Now - colorChangeTime).TotalMilliseconds > 200) |
| | | { |
| | | lightTemp.SetRGBcolor(e2,function); |
| | | colorChangeTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | |
| | | lastColor = e2; |
| | | }; |
| | | colorPicker.MouseDownEventHandler += (sender, e) => |
| | | { |
| | |
| | | //显示白点 |
| | | btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; |
| | | btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; |
| | | if (btnWhiteRound.Visible == true) |
| | | { |
| | | btnWhiteRound.Visible = false; |
| | | } |
| | | }; |
| | | colorPicker.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | | pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); |
| | | if (pointIsRight == false) |
| | | { |
| | | //点的区域不是圆盘内 |
| | | return; |
| | | } |
| | | //显示白点 |
| | | btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; |
| | | btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; |
| | | if (btnWhiteRound.Visible == false) |
| | | { |
| | | btnWhiteRound.Visible = true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | colorPicker.MouseMoveEventHandler += (sender, e) => |
| | | { |
| | | //当鼠标点下事件处理 |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | | pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); |
| | | if (pointIsRight == false) |
| | | { |
| | | //点的区域不是圆盘内 |
| | | return; |
| | | } |
| | | //显示白点 |
| | | btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; |
| | | btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; |
| | | if (btnWhiteRound.Visible == false) |
| | | { |
| | | btnWhiteRound.Visible = true; |
| | | } |
| | | btnCurColor.BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function)); |
| | | colorPicker.MouseDownEventHandler(sender, e); |
| | | //if (function.trait_on_off.curValue.ToString() == "off") |
| | | //{ |
| | | // return; |
| | | //} |
| | | //pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); |
| | | //if (pointIsRight == false) |
| | | //{ |
| | | // //点的区域不是圆盘内 |
| | | // return; |
| | | //} |
| | | ////显示白点 |
| | | //btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; |
| | | //btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; |
| | | //if (btnWhiteRound.Visible == false) |
| | | //{ |
| | | // btnWhiteRound.Visible = true; |
| | | //} |
| | | //btnCurColor.BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function)); |
| | | }; |
| | | |
| | | var colorChangeEvent = new System.Threading.Thread(() => { |
| | | while (this.Parent != null) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) |
| | | { |
| | | //pointIsRight:点的区域不是圆盘内 |
| | | continue; |
| | | } |
| | | |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | if (lightTemp.GetRGBbytes(function)[i] != lastColor[i]) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.RGB, lastColor); |
| | | lightTemp.SetRGBcolor(lastColor, function); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | break; |
| | | } |
| | | } |
| | | System.Threading.Thread.Sleep(200); |
| | | } |
| | | }); |
| | | colorChangeEvent.IsBackground = true; |
| | | colorChangeEvent.Start(); |
| | | } |
| | | |
| | | /// <summary> |