Merge branch 'Dev-Branch' of http://59.41.255.150:6688/r/~wxr/OnPro into Dev-Branch
| | |
| | | |
| | | //后台回到前台 |
| | | new HDL_ON.UI.AppUnlockPage().LoadPage(); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=该时间无效 |
| | | 684=长度超出范围 |
| | | 685=注:用户管理仅可对已添加用户进行管理。如需添加新用户,请前往锁端进行相关操作。 |
| | | 686=总计 |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.0.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307261"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.0.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307311"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <uses-permission android:name="android.permission.RECEIVE_SMS" /> |
| | | <!--友盟--> |
| | |
| | | using HDL_ON; |
| | | using Shared; |
| | | using UIKit; |
| | | using UserNotifications; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.DAL.Server; |
| | | using Intents; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace SharedMethod |
| | | { |
| | |
| | | |
| | | public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) |
| | | { |
| | | #region 异常捕获 2023-07-27 17:37:04 |
| | | AppDomain.CurrentDomain.UnhandledException += (sender, e) => { |
| | | if(e.ExceptionObject is Exception exception) |
| | | { |
| | | Console.WriteLine("未处理的异常:" + exception.Message); |
| | | } |
| | | }; |
| | | |
| | | TaskScheduler.UnobservedTaskException += (sender, e) => { |
| | | if (e.Exception is Exception exception) |
| | | { |
| | | Console.WriteLine("未处理的异常:" + exception.Message); |
| | | } |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | | //设置全视通状态 |
| | | //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion; |
| | |
| | | <key>CFBundleName</key> |
| | | <string>On Pro</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.9.0</string> |
| | | <string>2.0.0</string> |
| | | <key>CFBundleURLTypes</key> |
| | | <array> |
| | | <dict> |
| | |
| | | </dict> |
| | | </array> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.9.0</string> |
| | | <string>2.0.0</string> |
| | | <key>LSApplicationQueriesSchemes</key> |
| | | <array> |
| | | <string>weixinULAPI</string> |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=该时间无效 |
| | | 684=长度超出范围 |
| | | 685=注:用户管理仅可对已添加用户进行管理。如需添加新用户,请前往锁端进行相关操作。 |
| | | 686=总计 |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | 683=The time is invalid |
| | | 684=Length out of range |
| | | 685=note: User management can only manage added users. If you need to add a new user, please go to the lock end for relevant operations. |
| | | 686=Total |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | catch { } |
| | | }); |
| | | } |
| | | MainPage.Log($"刷新token失败"); |
| | | return; |
| | |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | catch { } |
| | | }); |
| | | } |
| | | MainPage.Log($"刷新住宅信息失败"); |
| | | return; |
| | |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | catch { } |
| | | }); |
| | | } |
| | | MainPage.Log($"刷新个人信息失败"); |
| | | return; |
| | |
| | | { |
| | | try |
| | | { |
| | | MainPage.Log($"接收到推送.\r\n{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | Console.WriteLine($"接收到推送,,,,.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | |
| | | //Extras为空不处理 |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return; |
| | |
| | | //萤石猫眼 |
| | | eSVideoInfo.Lc_AccessToken = json["subToken"].ToString();//"子账号token |
| | | eSVideoInfo.DeviceSerial = json["devSerial"].ToString();//设备序列号 |
| | | eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); |
| | | eSVideoInfo.spk = json["spk"].ToString(); |
| | | |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | if (json.ContainsKey("msgId") && !string.IsNullOrEmpty(json["msgId"].ToString())) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 总计 |
| | | /// </summary> |
| | | public const int Total = 686; |
| | | /// <summary> |
| | | /// 注:用户管理仅可对已添加用户进行管理。如需添加新用户,请前往锁端进行相关操作。 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public void LoginGateway() |
| | | { |
| | | return;//tcp控制存在问题,但是先不用tcp控制了,要经过测试先 2023-07-29 10:14:32 |
| | | if (loginGatewayThread == null) |
| | | { |
| | | loginGatewayThread = new System.Threading.Thread(() => |
| | |
| | | /// <param name="bytes">需要发送的字节</param> |
| | | public void SendMessage(byte[] bytes) |
| | | { |
| | | return; |
| | | #if __IOS__ |
| | | |
| | | #endif |
| | | if (heartBeatLogIdList.Count > 3) |
| | | { |
| | | try |
| | |
| | | } |
| | | try |
| | | { |
| | | if (_tcpClient == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!_tcpClient.Connected) |
| | | { |
| | | return; |
| | | } |
| | | if (_tcpClient.GetStream().CanWrite&& isConnected) |
| | | { |
| | | _tcpClient.GetStream().Write(bytes, 0, bytes.Length); |
| | |
| | | private DateTime heartBeatTime; |
| | | public void HeartBeat() |
| | | { |
| | | return; |
| | | lock (lockObj) |
| | | { |
| | | if (heartBeatThread == null) |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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 |
| | |
| | | bundle.PutString("HomeId", mESVideoInfo.HomeId); |
| | | bundle.PutString("DeviceSerial", mESVideoInfo.DeviceSerial); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | //获取萤石token,初始化sdk |
| | | var result = new HttpServerRequest().EZGetChildToken(); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | var ezChildAccessToken = result.Data.ToString(); |
| | | |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity, |
| | | mESVideoInfo.Lc_DeviceId, mESVideoInfo.DeviceSerial, mESVideoInfo.spk, mESVideoInfo.msgId); |
| | | } |
| | | |
| | | //intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | //Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | }); |
| | | return; |
| | |
| | | string iconPath = spk.Replace(".", ""); |
| | | switch (spk) |
| | | { |
| | | case SPK.AirSwitchP3: |
| | | iconPath = "electricalbreaker"; |
| | | break; |
| | | case SPK.PanelSocket: |
| | | iconPath = "electricalsocket"; |
| | | break; |
| | |
| | | /// <summary> |
| | | /// 保存房间绑定信息 |
| | | /// </summary> |
| | | public void UpdataRoomIds() |
| | | public async void UpdataRoomIds() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | new System.Threading.Thread( () => |
| | | { |
| | | var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(this); |
| | | //直接保存本地, |
| | |
| | | /// </summary> |
| | | public static class FunctionAttributeKey |
| | | { |
| | | #region 三相空开属性 |
| | | /// <summary> |
| | | /// A相功率 |
| | | /// </summary> |
| | | public const string PowerA = "power_a"; |
| | | /// <summary> |
| | | /// B相功率 |
| | | /// </summary> |
| | | public const string PowerB = "power_b"; |
| | | /// <summary> |
| | | /// C相功率 |
| | | /// </summary> |
| | | public const string PowerC = "power_c"; |
| | | /// <summary> |
| | | /// A相电压 |
| | | /// </summary> |
| | | public const string VoltageA = "voltage_a"; |
| | | /// <summary> |
| | | /// B相电压 |
| | | /// </summary> |
| | | public const string VoltageB = "voltage_b"; |
| | | /// <summary> |
| | | /// C相电压 |
| | | /// </summary> |
| | | public const string VoltageC = "voltage_c"; |
| | | /// <summary> |
| | | /// A相电流 |
| | | /// </summary> |
| | | public const string CurrentA = "current_a"; |
| | | /// <summary> |
| | | /// B相电流 |
| | | /// </summary> |
| | | public const string CurrentB = "current_b"; |
| | | /// <summary> |
| | | /// C相电流 |
| | | /// </summary> |
| | | public const string CurrentC = "current_c"; |
| | | /// <summary> |
| | | /// A相温度 |
| | | /// </summary> |
| | | public const string TempA = "temp_a"; |
| | | /// <summary> |
| | | /// B相温度 |
| | | /// </summary> |
| | | public const string TempB = "temp_b"; |
| | | /// <summary> |
| | | /// C相温度 |
| | | /// </summary> |
| | | public const string TempC = "temp_c"; |
| | | /// <summary> |
| | | /// 过流值 |
| | | /// </summary> |
| | | public const string MaxCurrent = "max_current"; |
| | | /// <summary> |
| | | /// 过温值 |
| | | /// </summary> |
| | | public const string MaxTemp = "max_temp"; |
| | | /// <summary> |
| | | /// A相电量 |
| | | /// </summary> |
| | | public const string ElectricityA = "electricity_a"; |
| | | /// <summary> |
| | | /// B相电量 |
| | | /// </summary> |
| | | public const string ElectricityB = "electricity_b"; |
| | | /// <summary> |
| | | /// C相电量 |
| | | /// </summary> |
| | | public const string ElectricityC = "electricity_c"; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | public const string _null = ""; |
| | | /// <summary> |
| | | /// 安防布防状态 |
| | |
| | | /// 智能空开 |
| | | /// </summary> |
| | | public const string AirSwitch = "electrical.breaker"; |
| | | /// <summary> |
| | | /// 三相智能空开 |
| | | /// </summary> |
| | | public const string AirSwitchP3 = "electrical.breakerP3"; |
| | | |
| | | #region 涂鸦 |
| | | /// <summary> |
| | |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(AirSwitch); |
| | | spkList.Add(AirSwitchP3); |
| | | return spkList; |
| | | } |
| | | |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockAudioSetupPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockBatteryManagementPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\2-Classification\SeriesFunctionListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3Page.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchP3EnergyPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | SPK.PanelSocket,SPK.ElectricSocket, |
| | | SPK.MechanicalArm,SPK.IpCam_Imou, |
| | | SPK.GroupControl, |
| | | SPK.AvMusic,SPK.MusicStandard |
| | | //SPK.AvMusic,SPK.MusicStandard |
| | | }; |
| | | |
| | | |
| | |
| | | //_RoomNotSupportFunctionList.Add(SPK.MusicStandard); |
| | | //_RoomNotSupportFunctionList.Add(SPK.AvMusic); |
| | | _RoomNotSupportFunctionList.Add(SPK.AirSwitch); |
| | | _RoomNotSupportFunctionList.Add(SPK.AirSwitchP3); |
| | | _RoomNotSupportFunctionList.Add(SPK.ElectricEnergy); |
| | | //_RoomNotSupportFunctionList.Add(SPK.OtherCommon); |
| | | _RoomNotSupportFunctionList.Add(SPK.SensorLight); |
| | |
| | | { |
| | | public Button btnTip; |
| | | |
| | | public int entryMaxLength = 40; |
| | | public int entryMaxLength = 20; |
| | | //public Action entrylistener; |
| | | |
| | | void EditParaterEvent(Button btnConfirm, int errorId_IsNullOrEmpty, int errorId_ContainsPar, List<string> list, EditText editText, Action<string> callBackAction, |
| | |
| | | |
| | | etParater.TextChangeEventHandler = (sender, e) => |
| | | { |
| | | if (System.Text.Encoding.Default.GetBytes(etParater.Text).Length > entryMaxLength) |
| | | if (System.Text.Encoding.UTF8.GetBytes(etParater.Text).Length > entryMaxLength) |
| | | { |
| | | etParater.Text = etParater.Text.Remove(etParater.Text.Length-1); |
| | | |
| | |
| | | airSwitchPage.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.AirSwitchP3: |
| | | //var airSwitchP3Page = new AirSwitchP3Page(function); |
| | | //MainPage.BasePageView.AddChidren(airSwitchP3Page); |
| | | //airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.LightSwitch: |
| | | var relayView = new RelayPage(function); |
| | | MainPage.BasePageView.AddChidren(relayView); |
| | |
| | | |
| | | |
| | | #if DEBUG |
| | | |
| | | var airSwitchP3 = new Function() |
| | | { |
| | | sid = "airSwitchP3000000000001", |
| | | deviceId = "airSwitchP3000000000001", |
| | | name = "测试-三相智能空开", |
| | | spk = SPK.AirSwitchP3, |
| | | roomIds = new List<string>() { "1405771024583090178" }, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.PowerA,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.PowerB,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.PowerC,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.VoltageA,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.VoltageB,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.VoltageC,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.CurrentA,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.CurrentB,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.CurrentC,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.TempA,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.TempB,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.TempC,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.MaxCurrent,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.MaxTemp,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.ElectricityA,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.ElectricityB,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.ElectricityC,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | new FunctionAttributes() { key = FunctionAttributeKey.TotalElectricity,value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 1000,min = 0 }, |
| | | }, |
| | | collect=true, |
| | | }; |
| | | airSwitchP3.SaveFunctionFile(); |
| | | |
| | | if (FunctionList.List.groupControls.Count == 0) |
| | | { |
| | |
| | | /// <returns></returns> |
| | | private bool CheckPrivacyPolicy() |
| | | { |
| | | #if DEBUG |
| | | return true; |
| | | #endif |
| | | if(HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com") |
| | | { |
| | | return true; |
| | | } |
| | | if (isAgreePrivacyPolicy == false) |
| | | { |
| | | //请同意《用户协议》和《隐私政策》 |
| | |
| | | //调用验证码登录接口 |
| | | loginResult = pm.LoginValidCode(account, password); |
| | | } |
| | | if(loginResult == null) |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | if (loginResult.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); |
| | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | var status = new Dictionary<string, object> { ["method"] = "weather", ["data"] = MainPage.cityInfo.weather }; |
| | | Inverter.Ins.H5Page.CallJS($"nativeToJs(\'{Newtonsoft.Json.JsonConvert.SerializeObject(status)}\')"); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var status = new Dictionary<string, object> { ["method"] = "weather", ["data"] = MainPage.cityInfo.weather }; |
| | | Inverter.Ins.H5Page.CallJS($"nativeToJs(\'{Newtonsoft.Json.JsonConvert.SerializeObject(status)}\')"); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | Inverter.Ins.H5Page.JSToNativeAction = (dictionary) => |
| | |
| | | |
| | | #endregion |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | bodyView = null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | { |
| | | bodyView.RemoveAll(); |
| | | LoadPage(); |
| | | }catch (Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"RoomPage ReloadPage error :\r\n {ex.Message}"); |
| | | } |
| | |
| | | appPush.frameLayout.Radius = (uint)Application.GetRealHeight(12); |
| | | appPush.btnText.TextID = StringId.apptuisong; |
| | | appPush.btnText.X = Application.GetRealWidth(12); |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | appPush.btnNextIcon.Visible = false; |
| | | } |
| | | viewLayout.AddChidren(appPush.FLayoutView()); |
| | | //定义一个局部账号列表用来记录选中数据; |
| | | List<string> selectedAccountList = new List<string>(); |
| | | appPush.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return; |
| | | } |
| | | var userList = new List<HDL_ON.Entity.ResidenceMemberInfo>(); |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | |
| | | appPush.frameLayout.Radius = (uint)Application.GetRealHeight(12); |
| | | appPush.btnText.TextID = StringId.apptuisong; |
| | | appPush.btnText.X = Application.GetRealWidth(12); |
| | | |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | appPush.btnNextIcon.Visible = false; |
| | | } |
| | | viewLayout.AddChidren(appPush.FLayoutView(false)); |
| | | //定义一个局部账号列表用来记录选中数据; |
| | | List<string> selectedAccountList = new List<string>(); |
| | | appPush.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return; |
| | | } |
| | | var userList = new List<HDL_ON.Entity.ResidenceMemberInfo>(); |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | |
| | | } |
| | | } |
| | | } |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(async() => |
| | | { |
| | | //function.UpdataRoomIds(); |
| | | var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(function); |
| | | //直接保存本地, |
| | | function.SaveFunctionFile(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if (UI.RoomPage.bodyView != null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | UI.RoomPage.bodyView.ReLoadPage(); |
| | | }); |
| | | } |
| | | Entity.SpatialInfo.CurrentSpatial.InitRoomListFunctions(); |
| | | try |
| | | { |
| | | //初始化住宅所有房间功能数据 |
| | | foreach (var r in Entity.SpatialInfo.CurrentSpatial.RoomList) |
| | | { |
| | | Entity.SpatialInfo.CurrentSpatial.InitRoomFuntion(r); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"Init room function error : {ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | |
| | | function.UpdataRoomIds(); |
| | | Entity.SpatialInfo.CurrentSpatial.InitRoomListFunctions(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | } |
| | | |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 三相空开能源界面 |
| | | /// </summary> |
| | | public class AirSwitchP3EnergyPage : FrameLayout |
| | | { |
| | | static AirSwitchP3EnergyPage bodyView; |
| | | |
| | | /// <summary> |
| | | /// 总功耗-饼图 |
| | | /// </summary> |
| | | MyEchartsViewOn myEchartsView_Pie; |
| | | /// <summary> |
| | | /// 曲线图数据string |
| | | /// </summary> |
| | | EchartsOption_BrokenLine brokenLine; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 插查询的能源列表 |
| | | /// </summary> |
| | | List<Function> queryList = new List<Function>(); |
| | | /// <summary> |
| | | /// 查询条件 |
| | | /// hour、week、month |
| | | /// </summary> |
| | | string curQueryType = "hour"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 能源列表区域 |
| | | /// </summary> |
| | | FrameLayout energyListView; |
| | | /// <summary> |
| | | /// 历史数据图表 |
| | | /// </summary> |
| | | MyEchartsViewOn myEchartsView_Line; |
| | | |
| | | //5C62FE |
| | | |
| | | Function device; |
| | | /// <summary> |
| | | /// 主页 |
| | | /// </summary> |
| | | public AirSwitchP3EnergyPage(Function function) |
| | | { |
| | | bodyView = this; |
| | | device = function; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView(0xFFF7F7F7); |
| | | bodyView.BackgroundColor = 0xFFF5F7FA; |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667-64), |
| | | BackgroundColor = 0xFFF5F7FA, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(12), |
| | | }); |
| | | |
| | | |
| | | brokenLine = new EchartsOption_BrokenLine(); |
| | | |
| | | #region 选择数据日期范围 |
| | | var showDataTypeView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(143), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(216), |
| | | Height = Application.GetRealHeight(27), |
| | | //BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", |
| | | }; |
| | | contentView.AddChidren(showDataTypeView); |
| | | |
| | | var btnShowHistroyData_Day = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(54), |
| | | Height = Application.GetRealHeight(27), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | IsSelected = true, |
| | | TextID = StringId.day, |
| | | SelectedBackgroundColor = 0x1F5C62FE, |
| | | BackgroundColor = 0x1F5C62FE, |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 2, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Day); |
| | | btnShowHistroyData_Day.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | |
| | | |
| | | var btnShowHistroyData_Month = new Button() |
| | | { |
| | | X = Application.GetRealWidth(54), |
| | | Width = Application.GetRealWidth(54), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.month, |
| | | SelectedBackgroundColor = 0x1F5C62FE, |
| | | BackgroundColor = 0x00000000, |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Month); |
| | | |
| | | var btnShowHistroyData_Year = new Button() |
| | | { |
| | | X = Application.GetRealWidth(54 * 2), |
| | | Width = Application.GetRealWidth(54), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Years, |
| | | SelectedBackgroundColor = 0x1F5C62FE, |
| | | BackgroundColor = 0x00000000, |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Year); |
| | | |
| | | var btnShowHistroyData_Total = new Button() |
| | | { |
| | | X = Application.GetRealWidth(54 * 3), |
| | | Width = Application.GetRealWidth(54), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.Total, |
| | | SelectedBackgroundColor = 0x1F5C62FE, |
| | | BackgroundColor = 0x00000000, |
| | | IsSelected = false, |
| | | BorderWidth = 1, |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | showDataTypeView.AddChidren(btnShowHistroyData_Total); |
| | | btnShowHistroyData_Total.SetCornerWithSameRadius((uint)Application.GetRealHeight(6), HDLUtils.RectCornerBottomRight | HDLUtils.RectCornerTopRight); |
| | | |
| | | |
| | | btnShowHistroyData_Total.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BorderColor = CSS_Color.MainColor; |
| | | (sender as Button).BorderWidth = 2; |
| | | (sender as Button).IsSelected = true; |
| | | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Month.BorderWidth = 1; |
| | | btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Month.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | btnShowHistroyData_Year.BorderWidth = 1; |
| | | btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Year.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Day.BorderWidth = 1; |
| | | btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Day.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; |
| | | }; |
| | | |
| | | |
| | | btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BorderColor = CSS_Color.MainColor; |
| | | (sender as Button).BorderWidth = 2; |
| | | (sender as Button).IsSelected = true; |
| | | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Month.BorderWidth = 1; |
| | | btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Month.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | btnShowHistroyData_Year.BorderWidth = 1; |
| | | btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Year.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Total.IsSelected = false; |
| | | btnShowHistroyData_Total.BorderWidth = 1; |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | }; |
| | | |
| | | btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BorderColor = CSS_Color.MainColor; |
| | | (sender as Button).BorderWidth = 2; |
| | | (sender as Button).IsSelected = true; |
| | | |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Day.BorderWidth = 1; |
| | | btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Day.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Year.IsSelected = false; |
| | | btnShowHistroyData_Year.BorderWidth = 1; |
| | | btnShowHistroyData_Year.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Year.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Year.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Total.IsSelected = false; |
| | | btnShowHistroyData_Total.BorderWidth = 1; |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | }; |
| | | |
| | | btnShowHistroyData_Year.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | (sender as Button).SelectedBackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BackgroundColor = 0x1F5C62FE; |
| | | (sender as Button).BorderColor = CSS_Color.MainColor; |
| | | (sender as Button).BorderWidth = 2; |
| | | (sender as Button).IsSelected = true; |
| | | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Month.BorderWidth = 1; |
| | | btnShowHistroyData_Month.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Month.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Month.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Day.BorderWidth = 1; |
| | | btnShowHistroyData_Day.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Day.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Day.SelectedBackgroundColor = 0x00000000; |
| | | |
| | | btnShowHistroyData_Total.IsSelected = false; |
| | | btnShowHistroyData_Total.BorderWidth = 1; |
| | | btnShowHistroyData_Total.BorderColor = CSS_Color.PromptingColor1; |
| | | btnShowHistroyData_Total.BackgroundColor = 0x00000000; |
| | | btnShowHistroyData_Total.SelectedBackgroundColor = 0x00000000; |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(12), |
| | | }); |
| | | |
| | | var historyDataView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(330), |
| | | }; |
| | | contentView.AddChidren(historyDataView); |
| | | |
| | | myEchartsView_Line = new MyEchartsViewOn() |
| | | { |
| | | Y = Application.GetRealWidth(10), |
| | | Height = Application.GetRealWidth(280), |
| | | }; |
| | | historyDataView.AddChidren(myEchartsView_Line); |
| | | |
| | | //EnergyRow(energy, energyListView, index); |
| | | |
| | | LoadMothed_GetHistoryData(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取历史数据 |
| | | /// </summary> |
| | | void LoadMothed_GetHistoryData() |
| | | { |
| | | |
| | | var loadPage = new Loading() |
| | | { |
| | | LodingBackgroundColor = 0x88888888, |
| | | }; |
| | | bodyView.AddChidren(loadPage); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loadPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | |
| | | var sensorType = device.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, device.deviceId, "power_a"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | if (revertData == null || revertData.Count == 0) { |
| | | #if DEBUG |
| | | List<string> vs = new List<string>() { |
| | | "813","313","213","123", |
| | | "113","213","183","133", |
| | | "133","513","133","413", |
| | | }; |
| | | brokenLine.InitXdataText(vs); |
| | | revertData = new List<EnvironmentalSensorHistor>() |
| | | { |
| | | new EnvironmentalSensorHistor{ fieldValue = "100"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "200"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "300"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "500"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "100"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "200"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "300"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "500"}, |
| | | new EnvironmentalSensorHistor{ fieldValue = "400"}, |
| | | }; |
| | | if (device.GetAttribute("ydata") == null) |
| | | { |
| | | device.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); |
| | | |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | List<string> vs = new List<string>(); |
| | | if (brokenLine.YvalueText == "") |
| | | { |
| | | foreach (var data in revertData) |
| | | { |
| | | vs.Add(data.fieldName); |
| | | } |
| | | brokenLine.InitXdataText(vs); |
| | | } |
| | | if (device.GetAttribute("ydata") == null) |
| | | { |
| | | device.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | device.SetAttrState("ydata", brokenLine.InitYdataText(device.name, revertData, "#5C62FE") + ", "); |
| | | } |
| | | } |
| | | } |
| | | brokenLine.yTitle = Language.StringByID(StringId.EnergyConsumption) + "(kW)"; |
| | | brokenLine.xTitle = Language.StringByID(StringId.timeMode); |
| | | if (curQueryType != "hour") |
| | | { |
| | | brokenLine.xTitle = Language.StringByID(StringId.Date); |
| | | } |
| | | var opString = brokenLine.InitOption(30); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myEchartsView_Line.ShowWithOption(opString); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"sensor history error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loadPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AirSwitchP3Page : FrameLayout |
| | | { |
| | | |
| | | #region 控件集合 |
| | | static AirSwitchP3Page bodyView; |
| | | /// <summary> |
| | | /// 控制界面加载区域 |
| | | /// </summary> |
| | | FrameLayout controlView; |
| | | /// <summary> |
| | | /// 功能备注 |
| | | /// </summary> |
| | | Button btnFunctionName; |
| | | /// <summary> |
| | | /// 功能所属楼层、房间 |
| | | /// </summary> |
| | | Button btnFromFoorAndRoom; |
| | | /// <summary> |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollection; |
| | | /// <summary> |
| | | /// 继电器状态图标 |
| | | /// </summary> |
| | | Button btnSwitchIcon; |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 运行状态-动态加载 |
| | | /// </summary> |
| | | Button btnRunStatus; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | |
| | | public AirSwitchP3Page(Function func) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | /// <param name="btnCollectionIcon">收藏按钮</param> |
| | | /// <param name="btnFunctionName">功能名称信息按钮</param> |
| | | /// <param name="btnFromFloor">功能楼层信息按钮</param> |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | | { |
| | | if (btnCollectionIcon == null) |
| | | { |
| | | btnCollection_Out = new Button(); |
| | | btnFunctionName_Out = new Button(); |
| | | btnFromFloor_Out = new Button(); |
| | | } |
| | | else |
| | | { |
| | | btnCollection_Out = btnCollectionIcon; |
| | | btnFunctionName_Out = btnFunctionNameOut; |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | } |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | bodyView.AddChidren(controlView); |
| | | |
| | | btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(37), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = function.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | | btnFromFoorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnFunctionName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | | btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(102), |
| | | Width = Application.GetRealWidth(148), |
| | | Height = Application.GetRealWidth(198), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | controlView.AddChidren(btnSwitchIcon); |
| | | |
| | | //运行状态 |
| | | if (function.GetAttribute("run_status") != null) |
| | | { |
| | | |
| | | btnRunStatus = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(300), |
| | | Height = Application.GetRealHeight(58), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | controlView.AddChidren(btnRunStatus); |
| | | UpdataRunStatus(); |
| | | } |
| | | |
| | | //if (function.GetAttribute("power") != null) |
| | | { |
| | | Button btnEnergyIcon = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(377), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/EnergyIcon.png" |
| | | }; |
| | | controlView.AddChidren(btnEnergyIcon); |
| | | |
| | | |
| | | Button btnEnergyText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealWidth(47), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID = StringId.EnergyMonitoring, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnEnergyText); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var skipView = new AirSwitchP3EnergyPage(function); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnEnergyIcon.MouseUpEventHandler = eventHandler; |
| | | btnEnergyText.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | btnSwitch = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(466),// + btnSwitchIcon.Bottom, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh, false); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | LoadEventList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新状态 |
| | | /// </summary> |
| | | public static void UpdataState(Function updataTemp) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | if (bodyView == null) |
| | | return; |
| | | if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid) |
| | | { |
| | | bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on"; |
| | | |
| | | if (updataTemp.GetAttribute("run_status") != null) |
| | | { |
| | | bodyView.UpdataRunStatus(); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"AirSwitch error {ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 更新运行状态 |
| | | /// </summary> |
| | | void UpdataRunStatus() |
| | | { |
| | | if (btnRunStatus == null) |
| | | return; |
| | | var runStatus = function.GetAttrState("run_status"); |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | switch (runStatus) |
| | | { |
| | | //* RUN:正常工作中 |
| | | case "RUN": |
| | | btnRunStatus.Text = "工作中"; |
| | | btnRunStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | //* HV:过压预警 |
| | | case "HV": |
| | | btnRunStatus.Text = "过压预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LV:欠压预警 |
| | | case "LV": |
| | | btnRunStatus.Text = "欠压预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HC:过流预警 |
| | | case "HC": |
| | | btnRunStatus.Text = "过流预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HT:过温预警 |
| | | case "HT": |
| | | btnRunStatus.Text = "过温预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LEAK:漏电预警 |
| | | case "LEAK": |
| | | btnRunStatus.Text = "漏电预警"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* ERR_HV:过压报警 |
| | | case "ERR_HV": |
| | | btnRunStatus.Text = "过压报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LV:欠压报警 |
| | | case "ERR_LV": |
| | | btnRunStatus.Text = "欠压报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HC:过流报警 |
| | | case "ERR_HC": |
| | | btnRunStatus.Text = "过流报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HT:过温报警 |
| | | case "ERR_HT": |
| | | btnRunStatus.Text = "过温报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LEAK:漏电报警 |
| | | case "ERR_LEAK": |
| | | btnRunStatus.Text = "漏电报警"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (runStatus) |
| | | { |
| | | //* RUN:正常工作中 |
| | | case "RUN": |
| | | btnRunStatus.Text = "At work"; |
| | | btnRunStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | //* HV:过压预警 |
| | | case "HV": |
| | | btnRunStatus.Text = "Overvoltage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LV:欠压预警 |
| | | case "LV": |
| | | btnRunStatus.Text = "Undervoltage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HC:过流预警 |
| | | case "HC": |
| | | btnRunStatus.Text = "Overcurrent warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* HT:过温预警 |
| | | case "HT": |
| | | btnRunStatus.Text = "Overtemperature warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* LEAK:漏电预警 |
| | | case "LEAK": |
| | | btnRunStatus.Text = "Leakage warning"; |
| | | btnRunStatus.TextColor = 0xFFFC9C04; |
| | | break; |
| | | //* ERR_HV:过压报警 |
| | | case "ERR_HV": |
| | | btnRunStatus.Text = "Overvoltage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LV:欠压报警 |
| | | case "ERR_LV": |
| | | btnRunStatus.Text = "Undervoltage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HC:过流报警 |
| | | case "ERR_HC": |
| | | btnRunStatus.Text = "Overcurrent alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_HT:过温报警 |
| | | case "ERR_HT": |
| | | btnRunStatus.Text = "Overtemperature alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | //* ERR_LEAK:漏电报警 |
| | | case "ERR_LEAK": |
| | | btnRunStatus.Text = "Leakage alarm"; |
| | | btnRunStatus.TextColor = 0xFFFF8080; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | | /// </summary> |
| | | void LoadEventList() |
| | | { |
| | | LoadSwitchEvent(); |
| | | LoadCollectionEvent(); |
| | | |
| | | //回退刷新信息事件 |
| | | actionRefresh = () => { |
| | | btnFunctionName.Text = btnFunctionName_Out.Text = function.name; |
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName(); |
| | | //function.SaveFunctionData(true); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏功能按钮事件 |
| | | /// </summary> |
| | | void LoadCollectionEvent() |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | function.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载开关事件 |
| | | /// </summary> |
| | | void LoadSwitchEvent() |
| | | { |
| | | btnSwitchIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", function.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="displayScale">显示比例 0-100,比如设置了30,只显示30%,可以左右拖动显示其他</param> |
| | | /// <returns></returns> |
| | | public string InitOption(int displayScale) |
| | | { |
| | | //组装Value |
| | | var newstring = optionString2.Replace("{0}", XvalueText); |
| | | newstring = newstring.Replace("{1}", YvalueText); |
| | | newstring = newstring.Replace("{10}", xTitle); |
| | | newstring = newstring.Replace("{20}", yTitle); |
| | | newstring = newstring.Replace("{30}", displayScale.ToString()); |
| | | newstring = newstring.Replace(",,", ","); |
| | | return newstring; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 组装x轴文本 |
| | | /// </summary> |
| | | /// <param name="xData"></param> |
| | |
| | | }"; |
| | | #endif |
| | | |
| | | |
| | | |
| | | #if __IOS__ |
| | | public string optionString2 = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '10%', |
| | | right: '10%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | name: '{10}', |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}], |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | name: '{20}', |
| | | type: 'value', |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | dataZoom: [{ |
| | | type: 'inside', |
| | | xAxisIndex: 0, |
| | | start: 0, |
| | | end: {30} |
| | | }], |
| | | series: [ |
| | | {1} |
| | | ] |
| | | }"; |
| | | #else |
| | | public string optionString2 = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | top: '15%', |
| | | left: '13%', |
| | | right: '12%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}], |
| | | name: '{10}' |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: '{20}' |
| | | }, |
| | | dataZoom: [{ |
| | | type: 'inside', |
| | | xAxisIndex: 0, |
| | | start: 0, |
| | | end: {30} |
| | | }], |
| | | series: [ |
| | | {1} |
| | | ] |
| | | }"; |
| | | #endif |
| | | |
| | | /// <summary> |
| | | /// 颜色列表 |
| | | /// </summary> |
| | |
| | | EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk, msgId); |
| | | |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk,""); |
| | | HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk,msgId); |
| | | #endif |
| | | |
| | | |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | }); |
| | | } |
| | | #endregion |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | MaxWidth = Application.GetRealWidth(300), |
| | | Text = $"{pack.message}({pack.Code})", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | }); |
| | | } |
| | | #endregion |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | VideoDoorlockUser doorlockUser; |
| | | public Action delCallBackAction; |
| | | |
| | | Loading waitPage; |
| | | |
| | | public VideoDoorlockUserManagerPage(Function function,VideoDoorlockUser user) |
| | | { |
| | |
| | | device = function; |
| | | doorlockUser = user; |
| | | BackgroundColor = CSS_Color.BackgroundColor; |
| | | waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Hide(); |
| | | |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (System.Text.Encoding.Default.GetBytes(str).Length > 20) |
| | | if (System.Text.Encoding.UTF8.GetBytes(str).Length > 20) |
| | | { |
| | | new Tip() |
| | | { |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if(waitPage!= null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | var pa = new PublicAssmebly(); |
| | | pa.entryMaxLength = 30; |
| | | pa.entryMaxLength = 20; |
| | | pa.LoadDialog_EditParater(StringId.ChangeName, "", callBack, StringId.UesrNameCannotBeEmpty, 0, new List<string>()); |
| | | }; |
| | | btnUserName.MouseUpEventHandler = eventHandler; |
| | |
| | | fingerprintView.AddChidren(btnClearFingerprints); |
| | | btnClearFingerprints.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | digitalPasswordView.AddChidren(btnClearDigitalPassword); |
| | | btnClearDigitalPassword.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | }; |
| | | nfcView.AddChidren(btnClearNfc); |
| | | btnClearNfc.MouseUpEventHandler = (sender, e) => { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | }; |
| | | faceView.AddChidren(btnClearFace); |
| | | btnClearFace.MouseUpEventHandler = (sender, e) => { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | bodyView.AddChidren(waitPage); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteDoorlockUserTip, () => |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | //失败提示 |
| | | var tip = new Tip() |
| | | { |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | bodyView = this;//1 |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | ContextView = new FrameLayout() |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </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 |