Merge remote-tracking branch 'origin/newBranch1' into WJC
| | |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget." /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.SiriIntentUI> |
| | | <MonoDevelop.MacDev.AppleDevelopmentTeam /> |
| | | </MonoDevelop.Ide.ItemProperties.SiriIntentUI> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Server/HttpUtil.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs" Line="203" Column="17" IsPinned="True" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="21" Column="79" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="MainPage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True" selected="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | | <Pad Id="MonoDevelop.Debugger.WatchPad"> |
| | | <State> |
| | | <Value>tempFunction.deviceId</Value> |
| | | <Value>updata2.ToString()</Value> |
| | | </State> |
| | | </Pad> |
| | | </Pads> |
| | |
| | | <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>SiriIntent/SiriIntent.csproj</String> |
| | | <String>SceneKit/SceneKit.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.2ffc9a07" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/hdl/Desktop/git/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="1415" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="28" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL-ON_iOS/Other/SkipControl.cs" relfile="HDL-ON_iOS/Other/SkipControl.cs" line="25" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="14" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | | </Properties> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202111031" android:versionName="1.3.202111031" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202111231" android:versionName="1.3.202111231" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| | | <uses-permission android:name="android.permission.READ_LOGS" /> |
| | | <!-- 极光推送结束 --> |
| | | <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="On Pro"> |
| | | <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false"> |
| | | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> |
| | | </provider> |
| | |
| | | using System;
|
| | | using System; |
| | | using Foundation; |
| | | using HDL_ON; |
| | | using Shared; |
| | |
| | | using Microsoft.AppCenter.Crashes; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.DAL.Server; |
| | | using Intents; |
| | | |
| | | namespace SharedMethod |
| | | { |
| | |
| | | //{ |
| | | // //RemoteInfo.Current.ReadMsgList(true); |
| | | //} |
| | | |
| | | #region Siri |
| | | // Request access to Siri |
| | | INPreferences.RequestSiriAuthorization((INSiriAuthorizationStatus status) => { |
| | | // Respond to returned status |
| | | switch (status) |
| | | { |
| | | case INSiriAuthorizationStatus.Authorized: |
| | | break; |
| | | case INSiriAuthorizationStatus.Denied: |
| | | break; |
| | | case INSiriAuthorizationStatus.NotDetermined: |
| | | break; |
| | | case INSiriAuthorizationStatus.Restricted: |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | var language = INPreferences.SiriLanguageCode; |
| | | |
| | | // Take action based on language |
| | | if (language == "en-US") |
| | | { |
| | | // Do something... |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //高德key |
| | | GDMapKit.setGDApiKey("f0635ea15c5d579c6e93d9f07a06da69"); |
| | | Console.WriteLine("FinishedLaunching"); |
| | |
| | | <array> |
| | | <string>applinks:china-gateway.hdlcontrol.com</string> |
| | | </array> |
| | | <key>com.apple.developer.siri</key> |
| | | <true/> |
| | | </dict> |
| | | </plist> |
| | |
| | | <MtouchLink>SdkOnly</MtouchLink> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignProvision>On+Dev-20210913-1</CodesignProvision> |
| | | <CodesignProvision>OnPro211116-1</CodesignProvision> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | |
| | | <MtouchLink>SdkOnly</MtouchLink> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchI18n>cjk</MtouchI18n> |
| | | <CodesignProvision>ComHdlOnProAdHoc20210616-1</CodesignProvision> |
| | | <CodesignProvision>OnPro-Hoc20211117-1</CodesignProvision> |
| | | </PropertyGroup> |
| | | <ItemGroup> |
| | | <Reference Include="System" /> |
| | |
| | | <Project>{2DDF4C3C-6998-432E-9F43-6786D82F0630}</Project> |
| | | <Name>Blufi</Name> |
| | | </ProjectReference> |
| | | <ProjectReference Include="..\SiriIntentUI\SiriIntentUI.csproj"> |
| | | <IsAppExtension>true</IsAppExtension> |
| | | <Project>{B594D3F5-4B93-4988-B45E-150BBFDC8A43}</Project> |
| | | <Name>SiriIntentUI</Name> |
| | | </ProjectReference> |
| | | </ItemGroup> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> |
| | |
| | | <key>XSLaunchImageAssets</key> |
| | | <string>Assets.xcassets/LaunchImage.launchimage</string> |
| | | <key>CFBundleName</key> |
| | | <string>ON +</string> |
| | | <string>On Pro</string> |
| | | <key>XSAppIconAssets</key> |
| | | <string>Assets.xcassets/AppIcon.appiconset</string> |
| | | <key>CFBundleDisplayName</key> |
| | | <string>ON +</string> |
| | | <string>On Pro</string> |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202110281</string> |
| | | <string>1.3.202111231</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.10281</string> |
| | | <string>1.3.11231</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | <string>This application uses Bluetooth to communicate with the device, this application does not collect, store or record any data that communicates via Bluetooth.</string> |
| | | <key>NSVoIPUsageDescription</key> |
| | | <string>Make audio/video calls</string> |
| | | <key>NSSiriUsageDescription</key> |
| | | <string>On Pro data will be send to Siri.</string> |
| | | </dict> |
| | | </plist> |
| | |
| | | |
| | | public override void ViewDidLoad() |
| | | { |
| | | Console.WriteLine("qidong 1111"); |
| | | base.ViewDidLoad(); |
| | | |
| | | HDL_ON.MainPage.Show(); |
| | |
| | | // MainPage.InternetStatus = 2; |
| | | //} |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | var topic = e.ApplicationMessage.Topic; |
| | | MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //一端口主题处理 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | { |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region ■ 可视对讲_________________________ |
| | | #region ■ 可视对讲_________________________ |
| | | /// <summary> |
| | | /// 检查住宅是否绑定丰林 |
| | | /// </summary> |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson); |
| | | return pack; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | | #region ■ 门锁相关____________________________ |
| | | |
| | | /// <summary> |
| | | /// 获取门锁历史记录(按日期降序) |
| | |
| | | return listSortLog; |
| | | } |
| | | |
| | | #endregion |
| | | #region ■ 音箱语言控制相关_________________________ |
| | | #endregion |
| | | #region ■ 音箱语言控制相关_________________________ |
| | | /// <summary> |
| | | /// 获取已授权的音箱列表 |
| | | /// </summary> |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 绑定source面板 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew BindSourcePanel(string qrString) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("content", qrString); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_BindSourcePanel, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 人脸录入 |
| | |
| | | |
| | | #region ■ -- SIP相关接口_______________________________ |
| | | #endregion |
| | | /// <summary> |
| | | /// 绑定source面板 |
| | | /// </summary> |
| | | public const string Api_Post_BindSourcePanel = "/home-wisdom/source/screen/home/bind"; |
| | | |
| | | |
| | | } |
| | |
| | | return "SceneData_" + sid; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 执行倒计时 |
| | | /// </summary> |
| | | int countdownTime = 0; |
| | | /// <summary> |
| | | /// 重置执行倒计时 |
| | | /// </summary> |
| | | public void ResetCountdownTime() |
| | | { |
| | | countdownTime = 0; |
| | | } |
| | | /// <summary> |
| | | /// 场景执行\倒计时 |
| | | /// </summary> |
| | |
| | | //场景正在倒计时执行中 |
| | | if (LastExecutionTime != "" && Convert.ToDouble(LastExecutionTime) + Convert.ToDouble(delay) > Convert.ToDouble(Utlis.GetTimestamp(false))) |
| | | { |
| | | int time = 0; |
| | | int.TryParse(Convert.ToInt32( |
| | | Convert.ToDouble(LastExecutionTime) + Convert.ToDouble(delay) - Convert.ToDouble(Utlis.GetTimestamp(false)) |
| | | ).ToString(), out time); |
| | | if (time > 0) |
| | | ).ToString(), out countdownTime); |
| | | if (countdownTime > 0) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (time > 0) |
| | | if (countdownTime > 0) |
| | | { |
| | | while (time > 0) |
| | | while (countdownTime > 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (time > 60) |
| | | if (countdownTime > 60) |
| | | { |
| | | btnShowDelay.Text = (time / 60).ToString() + "min" + time % 60 + "s"; |
| | | btnShowDelay.Text = (countdownTime / 60).ToString() + "min" + countdownTime % 60 + "s"; |
| | | } |
| | | else |
| | | { |
| | | btnShowDelay.Text = time.ToString() + "s"; |
| | | btnShowDelay.Text = countdownTime.ToString() + "s"; |
| | | } |
| | | }); |
| | | System.Threading.Thread.Sleep(1000); |
| | | time--; |
| | | countdownTime--; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | var revPack = pm.EditScene(this); |
| | | if (revPack.Code == StateCode.SUCCESS) |
| | | { |
| | | //重置执行倒计时 |
| | | this.countdownTime = 0; |
| | | if(MainPage.NoLoginMode) |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | |
| | | var revPack = pm.EditScene(this); |
| | | if (revPack.Code == StateCode.SUCCESS) |
| | | { |
| | | this.countdownTime = 0; |
| | | var scenes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(revPack.Data.ToString()); |
| | | var tempScene = scenes.Find((obj) => obj.sid == sid); |
| | | if (tempScene != null) |
| | |
| | | //public static string ClientType = APIClientType.HDL_ON_PRO.ToString(); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | public static Entity.CityInfo cityInfo = new Entity.CityInfo(); |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public static bool Increase |
| | | { |
| | | get |
| | | { |
| | | |
| | | /// <summary> |
| | | /// BaseView |
| | | /// </summary> |
| | | public static FrameLayout BaseView { get; internal set; } |
| | | /// <summary> |
| | | /// BasePageView |
| | | /// </summary> |
| | | public static PageLayout BasePageView { get; set; } |
| | | /// <summary> |
| | | /// 用户控制父容器 |
| | | /// </summary> |
| | | public static UserPage UserBasePage; |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.3.1123"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | | //public static string ClientType = APIClientType.HDL_ON_PRO.ToString(); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public static Entity.CityInfo cityInfo = new Entity.CityInfo(); |
| | | /// <summary> |
| | | /// 天气刷新action |
| | | /// </summary> |
| | | public static Action RefreshAir; |
| | | /// <summary> |
| | | /// 回退页面action 没有需要可以不用 |
| | | /// </summary> |
| | | public static Action ReturnRefreshAction; |
| | | /// <summary> |
| | | /// 无登录模式 |
| | | /// </summary> |
| | | public static bool NoLoginMode = false; |
| | | /// <summary> |
| | | /// 网络连接状态 |
| | | /// 0:无网络 |
| | | /// </summary> |
| | | public static int InternetStatus = 2; |
| | | /// <summary> |
| | | /// 是否进入后台 |
| | | /// </summary> |
| | | public static bool IsEnterBackground = false; |
| | | /// <summary> |
| | | /// 当前分页索引 |
| | | /// 0:收藏 |
| | | /// 1:分类 |
| | | /// 2:智能 |
| | | /// 3:个人 |
| | | /// </summary> |
| | | public static int CurPageIndex = 9999; |
| | | |
| | | ///// <summary> |
| | | ///// 公司代码 |
| | | ///// 预留第三方定制标记 |
| | | ///// 0:HDL |
| | | ///// </summary> |
| | | //public static int Company = 0; |
| | | |
| | | /// <summary> |
| | | /// 右滑后退提示按钮 |
| | | /// </summary> |
| | | public static Button BtnBackIcon; |
| | | /// <summary> |
| | | /// 后退右滑了多少距离,超过一定距离才触发后退事件 |
| | | /// </summary> |
| | | public static int StartX = 0; |
| | | /// <summary> |
| | | /// 是否全面屏手机 |
| | | /// </summary> |
| | | public static bool Increase |
| | | { |
| | | get |
| | | { |
| | | #if __IOS__ |
| | | if (Application.PhoneType>10) |
| | | { |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载提示弹窗 |
| | | /// </summary> |
| | | /// <param name="titleId"></param> |
| | | /// <param name="msgId"></param> |
| | | public void TipMsg(int titleId, int msgId,Action action = null) |
| | | /// <param name="title"></param> |
| | | /// <param name="msg"></param> |
| | | /// <param name="action"></param> |
| | | public void TipMsg(string title, string msg, Action action = null) |
| | | { |
| | | |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | TextID = titleId, |
| | | Text = title |
| | | }; |
| | | contentView.AddChidren(btnTitle); |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = msgId, |
| | | Text = msg, |
| | | IsMoreLines = true, |
| | | }; |
| | | contentView.AddChidren(btnMsg); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载提示弹窗 |
| | | /// </summary> |
| | | /// <param name="titleId"></param> |
| | | /// <param name="msgId"></param> |
| | | public void TipMsg(int titleId, int msgId, Action action = null) |
| | | { |
| | | TipMsg(Language.StringByID(titleId), Language.StringByID(msgId), action); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载等待界面 |
| | | /// </summary> |
| | |
| | | //etAccount.Text = "13415629083"; |
| | | //etAccount.Text = "13676202754";//巴林服务器 |
| | | //etAccount.Text = "13602944661";//kx |
| | | etAccount.Text = "551775569@qq.com";//wcf |
| | | //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | |
| | | //etAccount.Text = "support5@hdlchina.com.cn"; |
| | | //etAccount.Text = "13375012441"; |
| | | etAccount.Text = "info@smartlife-ks.com"; |
| | | etAccount.Text = "551775569@qq.com";//wcf |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | #endregion |
| | | |
| | | #region 获取支持 |
| | | FrameLayout supView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(44), |
| | | BackgroundColor = 0xFFFF0000, |
| | | }; |
| | | supportView.AddChidren(supView); |
| | | supView.MouseUpEventHandler = (sender, e) => { |
| | | Dialog dialog = new Dialog(); |
| | | //FrameLayout supView = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealWidth(44), |
| | | // BackgroundColor = 0xFFFF0000, |
| | | //}; |
| | | //supportView.AddChidren(supView); |
| | | //supView.MouseUpEventHandler = (sender, e) => { |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | var bodyView = new FrameLayout(); |
| | | dialog.AddChidren(bodyView); |
| | | // var bodyView = new FrameLayout(); |
| | | // dialog.AddChidren(bodyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(600), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | // var contentView = new VerticalScrolViewLayout() |
| | | // { |
| | | // Height = Application.GetRealHeight(600), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // }; |
| | | // bodyView.AddChidren(contentView); |
| | | |
| | | var btnClose = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(600), |
| | | Height = Application.GetRealHeight(67), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | Text = "关 闭", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | btnClose.MouseUpEventHandler = (sender1, e1) => { |
| | | dialog.Close(); |
| | | }; |
| | | bodyView.AddChidren(btnClose); |
| | | // var btnClose = new Button() |
| | | // { |
| | | // Y = Application.GetRealHeight(600), |
| | | // Height = Application.GetRealHeight(67), |
| | | // BackgroundColor = CSS_Color.WarningColor, |
| | | // Text = "关 闭", |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // btnClose.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | // bodyView.AddChidren(btnClose); |
| | | |
| | | foreach (var msg in Control.Ins.MsgInfoList) |
| | | { |
| | | var et = new TextView() |
| | | { |
| | | IsMoreLines = true, |
| | | Height = Application.GetRealHeight(150), |
| | | Width = Application.GetRealWidth(300), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = msg, |
| | | }; |
| | | contentView.AddChidren(et); |
| | | } |
| | | // foreach (var msg in Control.Ins.MsgInfoList) |
| | | // { |
| | | // var et = new TextView() |
| | | // { |
| | | // IsMoreLines = true, |
| | | // Height = Application.GetRealHeight(150), |
| | | // Width = Application.GetRealWidth(300), |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Text = msg, |
| | | // }; |
| | | // contentView.AddChidren(et); |
| | | // } |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | // dialog.Show(); |
| | | //}; |
| | | |
| | | //Button btnSupportIcon = new Button() |
| | | //{ |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.AddResidence, |
| | | TextID = StringId.ScanQRCoden, |
| | | }; |
| | | addResidenceView.AddChidren(btnAddResidenceText); |
| | | |
| | |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | //执行绑定住宅 |
| | | new BindingResidencePage().DoBindResidence(scanString); |
| | | if (scanString.StartsWith("source://bind/")) |
| | | { |
| | | var waitPage = new Loading(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Start("Plaese wait..."); |
| | | }); |
| | | var sendString = scanString.Replace("source://bind/", ""); |
| | | MainPage.Log($"绑定source屏:{sendString}"); |
| | | //绑定source屏 |
| | | var pack = new HttpServerRequest().BindSourcePanel(sendString); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var title = Language.StringByID(StringId.Tip); |
| | | var msg = ""; |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if(Language.CurrentLanguage=="Chinese") |
| | | { |
| | | msg = "Source屏绑定成功."; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding succeeded"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | else |
| | | { |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | msg = $"Source屏绑定失败.({pack.Code})"; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding failed"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | }); |
| | | } |
| | | catch(Exception ex) |
| | | { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | //执行绑定住宅 |
| | | new BindingResidencePage().DoBindResidence(scanString); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | if (Entity.DB_ResidenceData.Instance.SupportFacePass) |
| | | { |
| | | #region 个人选项-人脸通行管理 |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | faceManagementView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | |
| | | AC acFunction = new AC(); |
| | | |
| | | /// <summary> |
| | | /// app自己控制的温度数值记录 |
| | | /// 控制时间 |
| | | /// </summary> |
| | | List<string> seltControlTemp = new List<string>(); |
| | | DateTime controlTime = DateTime.MinValue.AddDays(10); |
| | | /// <summary> |
| | | /// 控制温度 |
| | | /// </summary> |
| | | int temp = 16; |
| | | |
| | | #endregion |
| | | |
| | |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | while (true) |
| | | { |
| | | if(controlTime == DateTime.MinValue) |
| | | { |
| | | |
| | | } |
| | | else if (controlTime.AddSeconds(2)<DateTime.Now) |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | controlTime = DateTime.MinValue; |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | { |
| | | return; |
| | | } |
| | | var temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | |
| | | if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min) |
| | | { |
| | | return; |
| | | } |
| | | temp--; |
| | | seltControlTemp.Add(temp.ToString()); |
| | | --temp; |
| | | Console.WriteLine($"temp == {temp}"); |
| | | controlTime = DateTime.Now; |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString(); |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | |
| | | { |
| | | return; |
| | | } |
| | | var temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) |
| | | { |
| | | return; |
| | | } |
| | | temp++; |
| | | seltControlTemp.Add(temp.ToString()); |
| | | ++temp; |
| | | controlTime = DateTime.Now; |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString(); |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnTemp.Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString(); |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°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)); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode),false); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing),false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed),false); |
| | | var updataTemp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | |
| | | //app自己控制的不用更新,会造成跳动 |
| | | if (seltControlTemp.Contains(updataTemp.ToString())) |
| | | if (controlTime.AddSeconds(2) > DateTime.Now) |
| | | { |
| | | seltControlTemp.Remove(updataTemp.ToString()); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | arcBar.Progress = updataTemp; |
| | | } |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°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)); |
| | | btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false); |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false); |
| | | temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; |
| | | arcBar.IsOffline = false; |
| | | btnSwitch.IsSelected = true; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString() ; |
| | | |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | arcBar.IsClickable = false; |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; |
| | | arcBar.IsOffline = false; |
| | | btnSwitch.IsSelected = true; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | arcBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | arcBar.IsClickable = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | arcBar.IsClickable = true; |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = false; |
| | | arcBar.IsOffline = true; |
| | | btnSwitch.IsSelected = false; |
| | | arcBar.IsClickable = false; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = false; |
| | | arcBar.IsOffline = true; |
| | | btnSwitch.IsSelected = false; |
| | | arcBar.IsClickable = false; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | } |
| | | |
| | | }); |
| | |
| | | Height = Application.GetRealHeight(50), |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = curtainTemp.GetPercent(function).ToString() + "%", |
| | | Text = curtainTemp.GetPercent(function).ToString() + "%", |
| | | }; |
| | | controlView.AddChidren(btnProgress); |
| | | |
| | |
| | | Height = Application.GetRealWidth(210), |
| | | Progress = curtainTemp.GetPercent(function), |
| | | //IsInvertedProgress = true, |
| | | ProgressTextColor = 0x00000000, |
| | | ProgressTextColor = CSS_Color.WarningColor,// 0x00000000, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
| | |
| | | //bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | try |
| | | { |
| | | if (!bodyView.onCurtainAnimation) |
| | | { |
| | | bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent))); |
| | | } |
| | | var progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)); |
| | | bodyView.curtainSeekBar.Progress = progress; |
| | | bodyView.btnProgress.Text = progress + "%"; |
| | | |
| | | //if (!bodyView.onCurtainAnimation) |
| | | //{ |
| | | // bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent))); |
| | | //} |
| | | } |
| | | catch { } |
| | | } |
| | |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | CurtainAnimation(0); |
| | | //CurtainAnimation(100); |
| | | }; |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | CurtainAnimation(100); |
| | | //CurtainAnimation(0); |
| | | }; |
| | | |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | |
| | | /// <summary>
|
| | | /// 渐变时间修改
|
| | | /// </summary>
|
| | | //DiyImageSeekBar barFadeTime;
|
| | | DiyImageSeekBar barFadeTime;
|
| | | /// <summary>
|
| | | /// 色温的滑动控件
|
| | | /// </summary>
|
| | |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
|
| | | Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
|
| | | };
|
| | | controlView.AddChidren(btnBrightnessText);
|
| | | controlView.AddChidren(btnBrightnessText); |
| | | |
| | | |
| | | #region 渐变时间调节
|
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
|
| | | { |
| | | var btnGradualChangeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(306 + 40), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.SpeedOfChange, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeText); |
| | | |
| | | var btnGradualChangeMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5), |
| | | Width = Application.GetRealWidth(22), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMinValuesText); |
| | | |
| | | barFadeTime = new DiyImageSeekBar() |
| | | { |
| | | X = btnGradualChangeMinValuesText.Right, |
| | | Y = Application.GetRealHeight(360), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarUnitSring = "s", |
| | | MaxValue = 10, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | | X = barFadeTime.Right, |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5), |
| | | Width = Application.GetRealWidth(35), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "10s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region 色温
|
| | | var cctAttr = function.GetAttribute(FunctionAttributeKey.CCT);
|
| | |
| | | //色温
|
| | | var btnTempClolor = new Button();
|
| | | btnTempClolor.X = Application.GetRealWidth(35);
|
| | | btnTempClolor.Y = Application.GetRealHeight(306 + 60);
|
| | | btnTempClolor.Y = Application.GetRealHeight(395);
|
| | | btnTempClolor.Width = Application.GetRealWidth(224);
|
| | | btnTempClolor.Height = Application.GetRealHeight(21);
|
| | | btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
|
| | |
| | | btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
|
| | | controlView.AddChidren(btnTempClolorMax);
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 渐变时间调节
|
| | | //var btnGradualChangeText = new Button()
|
| | | //{
|
| | | // X = Application.GetRealWidth(35),
|
| | | // Y = Application.GetRealHeight(385),
|
| | | // Width = Application.GetRealWidth(224),
|
| | | // Height = Application.GetRealHeight(21),
|
| | | // TextAlignment = TextAlignment.CenterLeft,
|
| | | // TextColor = CSS_Color.FirstLevelTitleColor,
|
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
|
| | | // TextID = StringId.SpeedOfChange,
|
| | | //};
|
| | | //controlView.AddChidren(btnGradualChangeText);
|
| | |
|
| | | //var btnGradualChangeMinValuesText = new Button()
|
| | | //{
|
| | | // X = Application.GetRealWidth(35),
|
| | | // Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
|
| | | // Width = Application.GetRealWidth(22),
|
| | | // Height = Application.GetRealHeight(21),
|
| | | // Text = "0s",
|
| | | // TextAlignment = TextAlignment.CenterLeft,
|
| | | // TextColor = CSS_Color.PromptingColor1,
|
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
|
| | | //};
|
| | | //controlView.AddChidren(btnGradualChangeMinValuesText);
|
| | |
|
| | | //barFadeTime = new DiyImageSeekBar()
|
| | | //{
|
| | | // X = btnGradualChangeMinValuesText.Right,
|
| | | // Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
|
| | | // Width = Application.GetRealWidth(210),
|
| | | // Height = Application.GetRealHeight(54),
|
| | | // SeekBarViewHeight = Application.GetRealHeight(8),
|
| | | // ThumbImagePath = "Public/ThumbImage.png",
|
| | | // ThumbImageHeight = Application.GetRealHeight(54),
|
| | | // ProgressBarColor = CSS_Color.MainColor,
|
| | | // ProgressTextColor = CSS_Color.FirstLevelTitleColor,
|
| | | // ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
|
| | | // ProgressBarUnitSring = "s",
|
| | | // MaxValue = 10,
|
| | | // Progress = function.fadeTime,
|
| | | // SeekBarPadding = Application.GetRealWidth(20),
|
| | | //};
|
| | | //controlView.AddChidren(barFadeTime);
|
| | |
|
| | | //var btnGradualChangeMaxValuesText = new Button()
|
| | | //{
|
| | | // X = barFadeTime.Right,
|
| | | // Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
|
| | | // Width = Application.GetRealWidth(35),
|
| | | // Height = Application.GetRealHeight(21),
|
| | | // Text = "10s",
|
| | | // TextAlignment = TextAlignment.CenterLeft,
|
| | | // TextColor = CSS_Color.PromptingColor1,
|
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
|
| | | //};
|
| | | //controlView.AddChidren(btnGradualChangeMaxValuesText);
|
| | | #endregion
|
| | |
|
| | | btnSwitch = new Button()
|
| | |
| | | bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
|
| | | if (!bodyView.onDimmerBar)
|
| | | {
|
| | | bodyView.dimmerBar.Progress = Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness));
|
| | | bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness));
|
| | | } |
| | | bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%"; |
| | | bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80);
|
| | |
| | | LoadEvet_ChangeFadeTime();
|
| | | LoadEvet_ChangeColorTemplatrue();
|
| | | //回退刷新信息事件
|
| | | actionRefresh = () => {
|
| | | actionRefresh = () => |
| | | {
|
| | | btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
|
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
|
| | | //function.SaveFunctionData(true);
|
| | |
| | | /// </summary>
|
| | | void LoadEvet_ChangeFadeTime()
|
| | | {
|
| | | //barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
|
| | | //{
|
| | | // function.fadeTime = e;
|
| | | // function.SaveFunctionData(true);
|
| | | //};
|
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.SaveFunctionFile(); |
| | | }; |
| | | } |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | 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(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); |
| | | if (btnSwitch.IsSelected)
|
| | | {
|
| | | d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
|
| | |
| | | }; |
| | | controlView.AddChidren(btnBrightnessText); |
| | | |
| | | #region 渐变时间调节 |
| | | var btnGradualChangeText = new Button() |
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(385), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.SpeedOfChange, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeText); |
| | | #region 渐变时间调节 |
| | | |
| | | var btnGradualChangeMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnGradualChangeText.Bottom+ Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(22), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMinValuesText); |
| | | var btnGradualChangeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(385), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.SpeedOfChange, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeText); |
| | | |
| | | barFadeTime = new DiyImageSeekBar() |
| | | { |
| | | X = btnGradualChangeMinValuesText.Right, |
| | | Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarUnitSring = "s", |
| | | MaxValue = 10, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | var btnGradualChangeMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(22), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMinValuesText); |
| | | |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | | X = barFadeTime.Right, |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(35), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "10s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | #endregion |
| | | barFadeTime = new DiyImageSeekBar() |
| | | { |
| | | X = btnGradualChangeMinValuesText.Right, |
| | | Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarUnitSring = "s", |
| | | MaxValue = 10, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | | X = barFadeTime.Right, |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(35), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "10s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | #endregion |
| | | } |
| | | btnSwitch = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | /// </summary> |
| | | void LoadEvet_ChangeFadeTime() |
| | | { |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.SaveFunctionFile(); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { |
| | | onDimmerBar = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | |
| | | { |
| | | btnSwitch.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | |
| | | 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(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | | if(function.lastBrightness == 0) |
| | |
| | | controlView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | #region 渐变时间调节 |
| | | var btnGradualChangeText = new Button() |
| | | { |
| | |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | #endregion |
| | | |
| | | } |
| | | btnRestoredPoint = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | |
| | | /// </summary> |
| | | void LoadEvet_ChangeFadeTime() |
| | | { |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | barFadeTime.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); |
| | | function.SaveFunctionFile(); |
| | | }; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | |
| | | 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(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime)); |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | | if(function.lastBrightness == 0) |