Merge branch 'Dev-Branch'
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=摄像头 |
| | | 7167=总控开关 |
| | | 7168=PM10 |
| | | 7169=持续时间 |
| | | 7170=人体存在检测 |
| | | 7171=持续 |
| | | |
| | | |
| | | |
| | | 8501=视频门锁 |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.8.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202306011"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.8.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202306051"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_SMS" /> |
| | | <!--友盟--> |
| | |
| | | { |
| | | |
| | | |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] |
| | | public partial class Resource |
| | | { |
| | | |
| | |
| | | public override void DidEnterBackground(UIApplication application) |
| | | { |
| | | //设置全视通状态 |
| | | string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | string errorVersion = "16.2.0"; |
| | | if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | { |
| | | Shared.IOS.HDLFVSDK.Video.FVapplicationDidEnterBackground(application); |
| | | } |
| | | //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | //string errorVersion = "16.2.0"; |
| | | //if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | //{ |
| | | // Shared.IOS.HDLFVSDK.Video.FVapplicationDidEnterBackground(application); |
| | | //} |
| | | //SharedMethod.SharedMethod.IsBackground = true; |
| | | //MainPage.IsEnterBackground = true; |
| | | ////进入后台mqtt正在连接重置状态 |
| | |
| | | public override void OnActivated(UIApplication application) |
| | | { |
| | | //设置全视通状态 |
| | | string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | string errorVersion = "16.2.0"; |
| | | if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | { |
| | | Shared.IOS.HDLFVSDK.Video.FVapplicationDidBecomeActive(application); |
| | | } |
| | | //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | //string errorVersion = "16.2.0"; |
| | | //if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | //{ |
| | | // Shared.IOS.HDLFVSDK.Video.FVapplicationDidBecomeActive(application); |
| | | //} |
| | | Console.WriteLine("OnActivated"); |
| | | base.OnActivated(application); |
| | | //HDL_ON.DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | |
| | | { |
| | | |
| | | //设置全视通状态 |
| | | string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | string errorVersion = "16.2.0"; |
| | | if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | { |
| | | Shared.IOS.HDLFVSDK.Video.FVapplication(application, new NSDictionary()); |
| | | } |
| | | //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | | //string errorVersion = "16.2.0"; |
| | | //if (systemVersion.CompareTo(errorVersion) < 0)///全视通不兼容ios16以上的系统,不要加载这个先 |
| | | //{ |
| | | // Shared.IOS.HDLFVSDK.Video.FVapplication(application, new NSDictionary()); |
| | | //} |
| | | Console.WriteLine("111111111111"); |
| | | SetCurrentLanguage(); |
| | | //Shared.Application.FontSize = 12; |
| | |
| | | <Reference Include="System.Xml" /> |
| | | <Reference Include="System.Core" /> |
| | | <Reference Include="Xamarin.iOS" /> |
| | | <Reference Include="System.Numerics" /> |
| | | <Reference Include="System.Numerics.Vectors" /> |
| | | <Reference Include="System.Web.Services" /> |
| | | <Reference Include="Shared.IOS.TBL"> |
| | | <HintPath>..\DLL\Shared.IOS.TBL.dll</HintPath> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <PackageReference Include="Newtonsoft.Json"> |
| | | <Version>13.0.3</Version> |
| | | <Version>13.0.1</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="MQTTnet"> |
| | | <Version>3.1.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Analytics"> |
| | | <Version>4.4.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Crashes"> |
| | | <Version>4.4.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="ZXing.Net.Mobile"> |
| | | <Version>2.4.1</Version> |
| | |
| | | <ImageAsset Include="Assets.xcassets\wifi_bg.imageset\wifi_bg.png" /> |
| | | <ImageAsset Include="Assets.xcassets\device_bg.imageset\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\device_bg.imageset\device_bg.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\12422688.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\8281792.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\26881242.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792828.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\11252436.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\24361125.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640960.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\6401136.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320480.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640960-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\6401136-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\12422208.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\7501334.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\22081242.png" /> |
| | | <ImageAsset Include="Resources\Assets.xcassets\Contents.json" /> |
| | | <ImageAsset Include="Resources\Assets.xcassets\launchIcon2.imageset\Contents.json" /> |
| | | <ImageAsset Include="Resources\Assets.xcassets\launchIcon2.imageset\launchIcon2.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\securitydoorezviz.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\VideoDoorlockClose1.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\VideoDoorLockOpen1.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\selectlocation.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58x58-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40x40-2.png" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80x80-1.png" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\.DS_Store" /> |
| | | <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <key>CFBundleName</key> |
| | | <string>On Pro</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.7.6</string> |
| | | <string>1.8.0</string> |
| | | <key>CFBundleURLTypes</key> |
| | | <array> |
| | | <dict> |
| | |
| | | </dict> |
| | | </array> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.7.6</string> |
| | | <string>1.8.0</string> |
| | | <key>LSApplicationQueriesSchemes</key> |
| | | <array> |
| | | <string>weixinULAPI</string> |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=摄像头 |
| | | 7167=总控开关 |
| | | 7168=PM10 |
| | | 7169=持续时间 |
| | | 7170=人体存在检测 |
| | | 7171=持续 |
| | | |
| | | |
| | | |
| | | 8501=视频门锁 |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | { |
| | | base.ViewDidLoad(); |
| | | |
| | | HDL_ON.MainPage.ShowAsync(); |
| | | HDL_ON.MainPage.Show(); |
| | | |
| | | try |
| | | { |
| | |
| | | public void DownloadData() |
| | | { |
| | | if (MainPage.InternetStatus == 0 || MainPage.NoLoginMode) |
| | | { |
| | | DownloadDataComplete = true; |
| | | return; |
| | | } |
| | | endTime1 = DateTime.Now.AddSeconds(25); |
| | | complateDevice = complateScene = false; |
| | | |
| | |
| | | /// PM210 |
| | | /// </summary> |
| | | public const int pm10 = 7168; |
| | | /// <summary> |
| | | /// 持续时间 |
| | | /// </summary> |
| | | public const int chixushijian = 7169; |
| | | /// <summary> |
| | | /// 人体存在检测 |
| | | /// </summary> |
| | | public const int rentijiance = 7170; |
| | | /// <summary> |
| | | /// 持续 |
| | | /// </summary> |
| | | public const int chixu = 7171; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 视频门锁 |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Utlis.WriteLine($"error:" + ex.Message); |
| | | Utlis.WriteLine($"mqtt连接异常 error:" + ex.Message); |
| | | //mqtt连接异常,清空本地mqtt信息,可能需要重新获取:wxr |
| | | MqttInfoConfig.Current.Refresh(); |
| | | } |
| | |
| | | /// </summary> |
| | | public const string SensorPir = "sensor.pir"; |
| | | /// <summary> |
| | | /// 人体存在传感器 |
| | | /// </summary> |
| | | public const string SensorPirHold = "sensor.pir_hold"; |
| | | /// <summary> |
| | | /// (门窗传感器) |
| | | /// </summary> |
| | | public const string SensorDoorWindow = "sensor.doorwindow"; |
| | |
| | | var spkList = new List<string>(); |
| | | //spkList.Add(SensorLight); |
| | | spkList.Add(SensorPir); |
| | | spkList.Add(SensorPirHold); |
| | | spkList.Add(SensorHelp); |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | |
| | | } |
| | | break; |
| | | case SPK.SensorPir: |
| | | case SPK.SensorPirHold: |
| | | if (inputValue == "true") |
| | | { |
| | | text += Language.StringByID(StringId.youren) + " "; |
| | |
| | | } |
| | | break; |
| | | case SPK.SensorPir: |
| | | case SPK.SensorPirHold: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | |
| | | var spkList = new List<string>() |
| | | { |
| | | SPK.SensorPir, |
| | | SPK.SensorPirHold, |
| | | SPK.SensorDoorWindow, |
| | | SPK.SensorSmoke, |
| | | SPK.SensorWater, |
| | |
| | | addResidencePage.LoadView(); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(async () => |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.SensorPir: |
| | | case SPK.SensorPirHold: |
| | | var pirPage = new SensorPirPage(); |
| | | pirPage.ShowColltionButton = false; |
| | | pirPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | environmentalView.AddChidren(btnPm25Values); |
| | | #endregion |
| | | |
| | | |
| | | btnSecurityStatus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(329), |
| | |
| | | /// </summary> |
| | | void LoadContentView() |
| | | { |
| | | |
| | | if (!Common.ApiUtlis.Ins.DownloadDataComplete && !MainPage.NoLoginMode) |
| | | { |
| | | var waitPage = new Loading(); |
| | |
| | | /// </summary> |
| | | void GetUnreadPushMessages() |
| | | { |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return; |
| | | } |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | |
| | | /// </summary> |
| | | void RegisterGetPushMessageAction() |
| | | { |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return; |
| | | } |
| | | Action RegisterGetPushMessageAction = () => { |
| | | if (bodyView != null) |
| | | { |
| | |
| | | /// 可视对讲专用 |
| | | /// </summary> |
| | | private string identifier; |
| | | /// <summary> |
| | | /// 人体传感器持续时间专用 |
| | | /// </summary> |
| | | private string hold_time=string.Empty; |
| | | |
| | | |
| | | |
| | | private static ConditionDeviceFunList m_Current = null; |
| | | |
| | |
| | | if (edit) |
| | | { |
| | | GetEditState(device, index, view.btnState, null, null, null); |
| | | } |
| | | } |
| | | break; |
| | | //人体存在传感器 |
| | | case SPK.SensorPirHold: |
| | | { |
| | | |
| | | |
| | | LogicView.FunTypeView view1 = new LogicView.FunTypeView(); |
| | | view1.btnText.TextID = StringId.rentijiance; |
| | | view1.btnText.Name = Language.StringByID(StringId.rentijiance); |
| | | fLayout.AddChidren(view1.FLayoutView()); |
| | | view1.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | DeviceView(device, view1.btnState, StringId.youren, StringId.wuren); |
| | | |
| | | }; |
| | | |
| | | LogicView.FunTypeView view2 = new LogicView.FunTypeView(); |
| | | view2.frameLayout.Y = view1.frameLayout.Bottom; |
| | | view2.btnText.TextID = StringId.chixushijian; |
| | | fLayout.AddChidren(view2.FLayoutView()); |
| | | view2.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //主界面控件 |
| | | FrameLayout fLayout = new FrameLayout |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.viewTrans60lucence, |
| | | }; |
| | | this.AddChidren(fLayout); |
| | | TimeView(fLayout, device, view2.btnState); |
| | | |
| | | }; |
| | | |
| | | |
| | | if (edit) |
| | | { |
| | | try |
| | | { |
| | | Input inputs = Logic.currlogic.input[index]; |
| | | if (!string.IsNullOrEmpty(inputs.hold_time) && int.Parse(inputs.hold_time) > 0) |
| | | { |
| | | int time = int.Parse(inputs.hold_time); |
| | | int h = time / (60 * 60); |
| | | int m = time % (60 * 60) / 60; |
| | | int s = (time % (60 * 60) % 60); |
| | | view2.btnState.Text = inputs.hold_time + "s"; |
| | | view2.btnState.Name = h + ":" + m + ":" + s; |
| | | this.hold_time = inputs.hold_time; |
| | | } |
| | | } |
| | | catch { } |
| | | GetEditState(device, index, view1.btnState, view2.btnState, null, null); |
| | | } |
| | | } |
| | | break; |
| | |
| | | inputDevice.condition_type = "9"; |
| | | inputDevice.identifier = this.identifier; |
| | | } |
| | | else if (device.spk == SPK.SensorPirHold) |
| | | { |
| | | //人体存在传感器 |
| | | inputDevice.hold_time = this.hold_time; |
| | | } |
| | | |
| | | |
| | | if (edit) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设备选择条件界面 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorPirHold: |
| | | case SPK.SensorDuiShe: |
| | | case SPK.SensorShanLan: |
| | | case SPK.SensorPir: |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 时间方法 |
| | | /// </summary> |
| | | /// <param name="fLayout">在哪个界面显示</param> |
| | | /// <param name="edit">(true=编辑;false=新建)</param> |
| | | /// <param name="index">编辑条件的索引</param> |
| | | private void TimeView(FrameLayout fLayout,Function device, Button button) |
| | | { |
| | | |
| | | LogicView.TimeView timePointView = new LogicView.TimeView(); |
| | | timePointView.FLayoutView(fLayout); |
| | | timePointView.Time(fLayout, button.Name, (timeValue) => |
| | | { |
| | | try |
| | | { |
| | | if (timeValue.Contains(":")) |
| | | { |
| | | string[] ary = timeValue.Split(':'); |
| | | |
| | | int h = int.Parse(ary[0]) * 60 * 60; |
| | | int m = int.Parse(ary[1]) * 60; |
| | | int s = int.Parse(ary[2]); |
| | | this.hold_time = (h + m + s).ToString(); |
| | | if (button != null) |
| | | { |
| | | button.Text = this.hold_time + "s"; |
| | | button.Name = timeValue; |
| | | } |
| | | selectedState = device.spk + "_" + timeValue; |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示编辑之前的设备状态 |
| | | /// </summary> |
| | | /// <param name="device">编辑设备</param> |
| | |
| | | { |
| | | string value = this.GetValue(dicList); |
| | | inputView.btnState.Text = Language.StringByID(StringId.wuren); |
| | | if (value == "fall") { |
| | | if (value == "fall") |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.diedao); |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin: |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironmentHailin: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | { |
| | |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.quyuruqingaojing); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorPirHold: |
| | | { |
| | | string value = this.GetKeyValue("people_status", dicList); |
| | | if (string.IsNullOrEmpty(value)) |
| | | { |
| | | inputView.btnState.Text = inputCondition.hold_time + "s"; |
| | | break; |
| | | |
| | | } |
| | | |
| | | inputView.btnState.Text = Language.StringByID(StringId.wuren); |
| | | if (value == "true") |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.youren); |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty(inputCondition.hold_time) && int.Parse(inputCondition.hold_time) > 0) |
| | | { |
| | | |
| | | inputView.btnState.Text += "持续" + inputCondition.hold_time + "s"; |
| | | } |
| | | |
| | | |
| | | } |
| | | break; |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case SPK.SensorGas: |
| | | case SPK.SensorSmoke: |
| | | { |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorPirHold: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "true") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.youren); |
| | | } |
| | | else |
| | | { |
| | | button1.Text = Language.StringByID(StringId.wuren); |
| | | } |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | { |
| | | foreach (var dic in dicList) |
| | |
| | | /// condition_type=9时使用 |
| | | /// </summary> |
| | | public string identifier = ""; |
| | | /// <summary> |
| | | /// 人体移动传感器(带持续时间) |
| | | /// </summary> |
| | | public string hold_time = ""; |
| | | public List<Dictionary<string, string>> condition = new List<Dictionary<string, string>>(); |
| | | /// <summary> |
| | | /// 地理围栏配置 |
| | |
| | | { |
| | | return "MusicIcon/localMusic.png"; |
| | | } |
| | | else if (SPK.SensorPm10 == device.spk) |
| | | else if (SPK.SensorPm10 == device.spk || SPK.SensorPirHold == device.spk) |
| | | { |
| | | return "LogicIcon/sensor.png"; |
| | | } |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorHcho: |
| | | case SPK.SensorHelp: |
| | | case SPK.SensorPirHold: |
| | | |
| | | { |
| | | strPath = "LogicIcon/sensor.png"; |
| | | } |
| | |
| | | || device.spk == SPK.SensorHcho |
| | | || device.spk == SPK.SensorHelp |
| | | || device.spk == SPK.SensorPm10 |
| | | || device.spk == SPK.SensorPirHold |
| | | ); |
| | | if (sensor != null) |
| | | { |
| | |
| | | functionTypeList.Add(SPK.SensorHcho); |
| | | functionTypeList.Add(SPK.SensorHelp); |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.SensorPirHold); |
| | | |
| | | |
| | | } |
| | |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | functionTypeList.Add(SPK.AcIr); |
| | | functionTypeList.Add(SPK.SensorPirHold); |
| | | |
| | | } |
| | | |
| | |
| | | deviceTypeList.Add(SPK.SensorPm10); |
| | | deviceTypeList.Add(SPK.VideoDoorLock); |
| | | deviceTypeList.Add(SPK.AcIr); |
| | | deviceTypeList.Add(SPK.SensorPirHold); |
| | | |
| | | } |
| | | break; |
| | |
| | | // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, |
| | | //new Entity.Function { sid = "12345678933456", name = "门锁", spk = Entity.SPK.DoorLock }, |
| | | // new Entity.Function { sid = "1234567895444", name = "视频门锁", spk = Entity.SPK.VideoDoorLock }, |
| | | new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.LightDimming }, |
| | | new Entity.Function { sid = "12345678968888", name = "人体存在传感器", spk = Entity.SPK.SensorPirHold }, |
| | | // new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 }, |
| | | // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow }, |
| | | // new Entity.Function { sid = "12345678991234", name = "HDL机械手", spk = Entity.SPK.MechanicalArm }, |
| | |
| | | frameLayout.AddChidren(btnLine); |
| | | } |
| | | /// <summary> |
| | | /// 选中时间的方法 |
| | | /// 选中时间的方法(时,分) |
| | | /// </summary> |
| | | /// <param name="fLayout">父控件</param> |
| | | /// <param name="currState">之前状态值</param> |
| | |
| | | string hour = GethStringList()[index1].Split(' ')[0]; |
| | | string minuet = GetmStringList()[index2].Split(' ')[0]; |
| | | timepoint = hour + ":" + minuet; |
| | | }; |
| | | //确定点击事件 |
| | | btnConfirm.MouseUpEventHandler += (sender, e3) => |
| | | { |
| | | action(timepoint); |
| | | //移除fLayout界面 |
| | | fLayout.RemoveFromParent(); |
| | | |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// 选中时间的方法(时,分,秒) |
| | | /// </summary> |
| | | /// <param name="fLayout">父控件</param> |
| | | /// <param name="currState">之前状态值</param> |
| | | /// <param name="action">返回时间值</param> |
| | | public void Time(FrameLayout fLayout, string currState, Action<string> action) |
| | | { |
| | | //取消点击事件 |
| | | btnCancel.MouseUpEventHandler += (sender, e1) => |
| | | { |
| | | //移除fLayout界面 |
| | | fLayout.RemoveFromParent(); |
| | | }; |
| | | //加载数据界面的设置方法(列表互不联动) |
| | | mUIPickerView.setNPicker(GethStringList(), GetmStringList(), GetsStringList()); |
| | | var systemHour = DateTime.Now.Hour; //获取小时 |
| | | var systeMinute = DateTime.Now.Minute;//获取分钟 |
| | | var systeSecond = DateTime.Now.Second;//获取秒 |
| | | |
| | | int systemHourIndex = 0; |
| | | int systeMinuteIndex = 0; |
| | | int systeSecondIndex = 0; |
| | | for (int i = 0; i < GethIntList().Count; i++) |
| | | { |
| | | var currhour = GethIntList()[i]; |
| | | if (systemHour == currhour) |
| | | { |
| | | systemHourIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | for (int i = 0; i < GetmIntList().Count; i++) |
| | | { |
| | | var currminute = GetmIntList()[i]; |
| | | if (systeMinute == currminute) |
| | | { |
| | | systeMinuteIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | for (int i = 0; i < GetsIntList().Count; i++) |
| | | { |
| | | var currsecond= GetsIntList()[i]; |
| | | if (systeSecond == currsecond) |
| | | { |
| | | systeSecondIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //默认初始选中状态 |
| | | mUIPickerView.setCurrentItems(systemHourIndex, systeMinuteIndex, systeSecondIndex); |
| | | string currH = ""; |
| | | string currM = ""; |
| | | string currS = ""; |
| | | if (systemHour < 10) |
| | | { |
| | | currH = "0" + systemHour.ToString(); |
| | | } |
| | | else |
| | | { |
| | | currH = systemHour.ToString(); |
| | | } |
| | | if (systeMinute < 10) |
| | | { |
| | | currM = "0" + systeMinute.ToString(); |
| | | } |
| | | else |
| | | { |
| | | currM = systeMinute.ToString(); |
| | | } |
| | | if (systeSecond < 10) |
| | | { |
| | | currS = "0" + systeMinute.ToString(); |
| | | } |
| | | else |
| | | { |
| | | currS = systeMinute.ToString(); |
| | | } |
| | | //定义一个局部变量记录选中时间 |
| | | string timepoint = currH + ":" + currM + ":" + currS; |
| | | if (!string.IsNullOrEmpty(currState)) |
| | | { |
| | | int hIndex = GetValueIndex(currState, 0, 1, GethIntList()); |
| | | int mIndex = GetValueIndex(currState, 1, 0, GetmIntList()); |
| | | int sIndex = GetValueIndex(currState, 2, 0, GetsIntList()); |
| | | //更新初始状态 |
| | | mUIPickerView.setCurrentItems(hIndex, mIndex, sIndex); |
| | | timepoint = currState; |
| | | } |
| | | |
| | | |
| | | //选中时间回调方法,时间变化一次回调一次 |
| | | mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => |
| | | { |
| | | try |
| | | { |
| | | string hour = GethStringList()[index1].Split(' ')[0]; |
| | | string minuet = GetmStringList()[index2].Split(' ')[0]; |
| | | string second = GetmStringList()[index3].Split(' ')[0]; |
| | | timepoint = hour + ":" + minuet + ":" + second; |
| | | } |
| | | catch { } |
| | | }; |
| | | //确定点击事件 |
| | | btnConfirm.MouseUpEventHandler += (sender, e3) => |
| | |
| | | } |
| | | return mList; |
| | | } |
| | | /// <summary> |
| | | /// 获取60秒列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<int> GetsIntList() |
| | | { |
| | | //初始化列表 |
| | | var mList = new List<int>(); |
| | | for (int i = 0; i < 60; i++) |
| | | { |
| | | //添加数据 |
| | | mList.Add(i); |
| | | } |
| | | return mList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取时间值 |
| | |
| | | /// <returns></returns> |
| | | public int GetValueIndex(string str, int digit, int startIndex, List<int> list) |
| | | { |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | return 0; |
| | | } |
| | | int index = 0; |
| | | int value = 0; |
| | | if (str.Contains(":")) |
| | |
| | | //2-功能图标 |
| | | //3-云端图标 |
| | | //4-场景图标 |
| | | //5-地理围栏 |
| | | for (int i = 0; i < logic.input.Count; i++) |
| | | { |
| | | if (logic.input[i] == null) |
| | |
| | | |
| | | } |
| | | break; |
| | | |
| | | } |
| | | |
| | | if (!iconIntValue.Contains(iconInt)) |
| | |
| | | { |
| | | var inputTypeJOb = new JObject { }; |
| | | inputTypeJOb.Add("sid", dictionary.sid); |
| | | if (!string.IsNullOrEmpty(dictionary.hold_time)) |
| | | { |
| | | inputTypeJOb.Add("hold_time", dictionary.hold_time); |
| | | } |
| | | inputTypeJOb.Add("condition_type", dictionary.condition_type); |
| | | if (dictionary.condition_type=="9") { |
| | | inputTypeJOb.Add("identifier", dictionary.identifier); |
| | |
| | | { |
| | | var inputTypeJOb = new JObject { }; |
| | | inputTypeJOb.Add("sid", dictionary.sid); |
| | | if (!string.IsNullOrEmpty(dictionary.hold_time)) |
| | | { |
| | | inputTypeJOb.Add("hold_time", dictionary.hold_time); |
| | | } |
| | | inputTypeJOb.Add("condition_type", dictionary.condition_type); |
| | | if (dictionary.condition_type == "9") |
| | | { |
| | |
| | | |
| | | public void LoadView() |
| | | { |
| | | //try |
| | | //{ |
| | | // if (MainPage.CurPageIndex == 3) |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // this.RemoveFromParent(); |
| | | // return; |
| | | // }); |
| | | // } |
| | | //} |
| | | //catch (Exception ex) |
| | | //{ |
| | | // MainPage.Log($"界面切换异常:{ex.Message}"); |
| | | //} |
| | | MainPage.CurPageIndex = 3; |
| | | #region 个人信息 |
| | | topbg = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | bodyView = this; |
| | | bodyView = this;//1 |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | ContextView = new FrameLayout() |
| | | { |
| | |
| | | { |
| | | Y = Application.GetRealHeight(607), |
| | | Height = Application.GetMinRealAverage(60), |
| | | //BackgroundColor = CSS_Color.BackgroundColor |
| | | }; |
| | | bodyView.AddChidren(navigationView); |
| | | if (MainPage.Increase) |
| | | { |
| | | //ContextView.Height = Application.GetRealHeight(618 + 20); |
| | | navigationView.Y = Application.GetRealHeight(597 + 5); |
| | | navigationView.Height = Application.GetRealHeight(70 - 5); |
| | | } |
| | |
| | | |
| | | LoadEventList(); |
| | | |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | | homePage.LoadPage(); |
| | | //var homePage = new HomePage(); |
| | | //ContextView.AddChidren(homePage); |
| | | //homePage.LoadPage(); |
| | | |
| | | if (!MainPage.NoLoginMode) |
| | | { |
| | |
| | | void LoadEventList() |
| | | { |
| | | LoadEvent_NavigationSelection(); |
| | | LoadEvent_RefreshData(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新住宅数据 |
| | | /// </summary> |
| | | void LoadEvent_RefreshData() |
| | | { |
| | | //ContextView.BeginHeaderRefreshingAction = () => { |
| | | // if (CurAnimationEffect == 0) |
| | | // { |
| | | // Common.ApiUtlis.Ins.DownloadData(); |
| | | // ContextView.RemoveAll(); |
| | | // var homePage = new HomePage(); |
| | | // ContextView.AddChidren(homePage); |
| | | // homePage.LoadPage(); |
| | | // ContextView.EndHeaderRefreshing(); |
| | | // } |
| | | //}; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载导航栏点击事件 |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |