2020-07-01 1.去掉读电能操作,去掉kwh状态显示。 2.当前是分享住宅,不允许删除备份。 3.进入搜索网关页面,切换到本地模式。 4.Alexa页面 增加添加设备失败提示。 5.子账号页面,底部增加文字提示。6.Android 默认隐藏底部虚拟按键。
| | |
| | | <Properties StartupConfiguration="{1D83BF28-BA88-4152-BA41-D7EFE90A5437}|Default"> |
| | | <Properties StartupConfiguration="{9D9EF20B-6E65-4A65-92BF-567EBF1E1443}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.Android_Accelerated_Oreo" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs"> |
| | | <Files> |
| | | <File FileName="ON/Properties/AndroidManifest.xml" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/CommonPage.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/MqttCommon.cs" Line="420" Column="27" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" Line="417" Column="31" /> |
| | | <File FileName="ON.Ios/Info.plist" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" Line="478" Column="23" /> |
| | | <File FileName="SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs" /> |
| | | <File FileName="ON/Application.cs" /> |
| | | <File FileName="SmartHome/Net/HttpListener.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/EquipmentPublicClass.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs" /> |
| | | <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" /> |
| | | <File FileName="ON/Properties/AndroidManifest.xml" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="SmartHome" expanded="True"> |
| | | <Node name="ON.Droid" selected="True" /> |
| | | <Node name="ON.Droid" expanded="True" selected="True"> |
| | | <Node name="Properties" expanded="True" /> |
| | | </Node> |
| | | <Node name="ON.Ios" expanded="True" /> |
| | | <Node name="Shared" expanded="True"> |
| | | <Node name="HDL" expanded="True"> |
| | | <Node name="Operation" expanded="True" /> |
| | | <Node name="Operation" expanded="True"> |
| | | <Node name="ResponseEntity" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="Net" expanded="True" /> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="SimpleControl" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="AC" expanded="True" /> |
| | | <Node name="Alexa" expanded="True" /> |
| | | <Node name="Fan" expanded="True" /> |
| | | <Node name="FoolHeat" expanded="True" /> |
| | | <Node name="Light" expanded="True" /> |
| | | <Node name="Register" expanded="True" /> |
| | | <Node name="Schedule" expanded="True" /> |
| | | <Node name="UniversalDevice" expanded="True" /> |
| | | <Node name="Room" expanded="True" /> |
| | | <Node name="User" expanded="True" /> |
| | | <Node name="Warning" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | using Android.Content; |
| | | using Android.Net; |
| | | using Android.OS; |
| | | using Android.Views; |
| | | //using CN.Jpush.Android.Api; |
| | | //using CN.Jpush.Android.Service; |
| | | using Java.Lang; |
| | |
| | | }; |
| | | |
| | | Shared.Application.FontSize = 16; |
| | | BaseActivity.IsHideVirualButtons = false; |
| | | BaseActivity.IsHideVirualButtons = true; |
| | | ZXing.Mobile.MobileBarcodeScanner.Initialize (this); |
| | | init (); |
| | | BaseActivity.OnCreateActoin += (activity, application) => { |
| | |
| | | Shared.BusSocket.Start (6000); |
| | | } |
| | | |
| | | void Hide () { |
| | | // Window _window; |
| | | // _window = this.GetWindow (); |
| | | // WindowManager.LayoutParams params = _window.getAttributes (); |
| | | //params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; |
| | | // _window.setAttributes (params); |
| | | } |
| | | } |
| | | } |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.506221" android:versionCode="202006221"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.507011" android:versionCode="202007011"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 在安卓P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 --> |
| | | <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> |
| | |
| | | <item name="android:windowFullscreen">false</item> |
| | | <!-- 隐藏标题栏 --> |
| | | <item name="android:windowNoTitle">true</item> |
| | | <item name="android:windowLightStatusBar">true</item> |
| | | <item name="android:windowLightStatusBar">true</item> |
| | | <item name="android:windowTranslucentStatus">true</item> |
| | | </style> |
| | | </resources> |
| | |
| | | { |
| | | add (); |
| | | if (CommonPage.IsRemote && !isLocal) { |
| | | if (!SmartHome.MqttCommon.IsGatewayOnline) { |
| | | System.Threading.Thread.Sleep (500); |
| | | Utlis.WriteLine ($"网关不在线 取消发送:" + SendFlag); |
| | | Packet.HaveSendCount = 3; |
| | | allDone.Set (); |
| | | return; |
| | | } |
| | | //if (!SmartHome.MqttCommon.IsGatewayOnline) { |
| | | // System.Threading.Thread.Sleep (500); |
| | | // Utlis.WriteLine ($"网关不在线 取消发送:" + SendFlag); |
| | | // Packet.HaveSendCount = 3; |
| | | // allDone.Set (); |
| | | // return; |
| | | //} |
| | | if (IsEnterBackground) { |
| | | System.Threading.Thread.Sleep (500); |
| | | Utlis.WriteLine ("已进入后台 取消发送"); |
| | |
| | | UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 + usefullBytes [3]); |
| | | UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 + usefullBytes [3]); |
| | | break; |
| | | } else if (usefullBytes [0] == 11) { |
| | | UserDeviceToSocket.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | break; |
| | | } |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //else if (usefullBytes [0] == 11) { |
| | | // UserDeviceToSocket.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | // UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | // UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]); |
| | | // break; |
| | | //} |
| | | } |
| | | |
| | | |
| | |
| | | //public static Button LogoButton = new Button (); |
| | | |
| | | |
| | | public static string RequestVersion = "2.506221"; |
| | | public static string RequestVersion = "2.507011"; |
| | | public static UserInfo LoginUser; |
| | | /// <summary> |
| | | /// 是否是管理员权限(变更了,成员的时候,这个也为ture。为什么会声明这样变量,因为有些接口必须使用原来的Token) |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 增加rjfi |
| | | /// 弹出错误提示 |
| | | /// </summary> |
| | | /// <param name="tip">Tip.</param> |
| | | /// <param name="time">Time.</param> |
| | |
| | | if (common != null) { |
| | | var oldDevice = alexaDeviceLista.Find ((obj) => obj.SubnetID == common.SubnetID && obj.DeviceID == common.DeviceID && obj.LoopID == common.LoopID && obj.DeviceType == common.Type.ToString ()); |
| | | if (oldDevice == null) { |
| | | AddDevice (common); |
| | | var isSuccess = AddDevice (common); |
| | | if (!isSuccess) { |
| | | //跳出循环 |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | AddScene (uploadScene); |
| | | var isSuccess = AddScene (uploadScene); |
| | | if (!isSuccess) { |
| | | //跳出循环 |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | var requestObj = new GetDeviceListObj () { RegionID = UserConfig.Instance.CurrentRegion.Id }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); |
| | | var revertObj = MainPage.RequestHttps (API.GetDeviceList, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UpdateDeviceObj>> (revertObj.ResponseData.ToString()); |
| | | if (revertObj.StateCode.ToUpper () == "SUCCESS") { |
| | | deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UpdateDeviceObj>> (revertObj.ResponseData.ToString ()); |
| | | } else { |
| | | //2020-06-29 弹窗提示错误 |
| | | |
| | | |
| | | } |
| | | return deviceList; |
| | | } |
| | |
| | | var revertObj = MainPage.RequestHttps (API.UploadDevices, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | return true; |
| | | }else if (revertObj.StateCode == "Exist") { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.AddTip (ErrorCode.AddFailed + " " + ErrorCode.NameExist + " ( " + device.Name + " )"); |
| | | }); |
| | | return true; |
| | | } else { |
| | | //2020-06-29 弹出提示错误 |
| | | ShowUploadDevicesInfo (revertObj.StateCode); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上传设备 错误提示 |
| | | /// </summary> |
| | | /// <param name="stateCodeStr"></param> |
| | | void ShowUploadDevicesInfo (string stateCodeStr) |
| | | { |
| | | string mes = ""; |
| | | if (stateCodeStr == "NoRecord") { |
| | | //住宅未绑定网关! |
| | | mes = ErrorCode.HomeNoRecord; |
| | | } else if (stateCodeStr == "NoExist") { |
| | | //住宅不存在! |
| | | mes = ErrorCode.HomeNoExist; |
| | | } else if (stateCodeStr == "Exist") { |
| | | //设备名称已存在 |
| | | mes = ErrorCode.NameExist; |
| | | } else if (stateCodeStr == ErrorCode.NetworkError) { |
| | | mes = ErrorCode.NetworkError; |
| | | } else { |
| | | mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr; |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty (mes)) { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.AddTip (ErrorCode.AddFailed + " " + mes); |
| | | |
| | | //new Alert ("", ErrorCode.AddFailed + " " + mes, Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var revertObj = MainPage.RequestHttps (API.DeleteDevice, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | return true; |
| | | } else { |
| | | //2020-06-29 弹窗提示错误 |
| | | |
| | | } |
| | | return false; |
| | | } |
| | |
| | | var revertObj = MainPage.RequestHttps (API.GetSceneList, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SceneByRegion>> (revertObj.ResponseData.ToString ()); |
| | | } else { |
| | | //2020-06-29 弹窗提示错误 |
| | | } |
| | | return sceneList; |
| | | } |
| | |
| | | //if (revertAddDeviceObj.StateCode.ToUpper() == "SUCCESS") { |
| | | return true; |
| | | //} |
| | | } else if (revertObj.StateCode == "Exist") { |
| | | Application.RunOnMainThread (() => { |
| | | MainPage.AddTip (ErrorCode.AddFailed + " " + ErrorCode.NameExist + " ( " + sceneMark.SceneName + " )"); |
| | | }); |
| | | return true; |
| | | } else { |
| | | //2020-06-29 弹出提示错误 |
| | | ShowUploadDevicesInfo (revertObj.StateCode); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | var revertObj = MainPage.RequestHttps (API.DeleteScene, requestJson); |
| | | if (revertObj.StateCode.ToUpper() == "SUCCESS") { |
| | | return true; |
| | | } else { |
| | | //2020-06-29 弹窗提示错误 |
| | | |
| | | } |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 启动本地模式 |
| | | /// </summary> |
| | | void EnableLocalMode () { |
| | | MainPage.AddTip ("Enable local mode."); |
| | | Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline); |
| | | CommonPage.IsRemote = false; |
| | | SmartHome.MqttCommon.DisConnectRemoteMqttClient ("EnableLocalMode"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 启动远程模式 |
| | | /// </summary> |
| | | void EnableRemoteMode () |
| | | { |
| | | MainPage.AddTip ("Restore remote mode."); |
| | | Utlis.ShowAppLinkStatus (AppLinkStatus.CloudUnlink); |
| | | CommonPage.IsRemote = true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转网关搜索页面 |
| | | /// </summary> |
| | | /// <param name="home"></param> |
| | |
| | | try { |
| | | //远程连接的时候禁止 搜索网关和添加设备 |
| | | if (CommonPage.IsRemote) { |
| | | //当前处于远程连接模式,无法进入搜索网关页面。请先切换回本地连接模式。 |
| | | new Alert ("", "Currently in remote connection mode, unable to enter the search gateway page. Please switch back to local connection mode first.", Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | return; |
| | | ////当前处于远程连接模式,无法进入搜索网关页面。请先切换回本地连接模式。 |
| | | //new Alert ("", "Currently in remote connection mode, unable to enter the search gateway page. Please switch back to local connection mode first.", Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | //return; |
| | | |
| | | //2020-06-29 启动本地通信模式 |
| | | EnableLocalMode (); |
| | | } |
| | | |
| | | |
| | |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") { |
| | | btn.Text = energy.ToString () + " W"; |
| | | } |
| | | } else if (updataType == 11) { |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | } |
| | | } |
| | | ////2020-07-01 客户提出隐藏kwh |
| | | //else if (updataType == 11) { |
| | | // if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | // btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | lightView.AddChidren (btnEnergy); |
| | | EnergtLightList.Add (common); |
| | | |
| | | if (common.Type == DeviceType.LightEnergySwitch) { |
| | | Button btnElectric = new Button () { |
| | | Width = Application.GetRealWidth (200), |
| | | Height = Application.GetRealHeight (35), |
| | | X = Application.GetRealWidth (320), |
| | | Y = tempSwitch.Bottom, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | Tag = common.Type.ToString () + "_Electric", |
| | | Text = "0 kw.h" |
| | | }; |
| | | lightView.AddChidren (btnElectric); |
| | | } |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //if (common.Type == DeviceType.LightEnergySwitch) { |
| | | // Button btnElectric = new Button () { |
| | | // Width = Application.GetRealWidth (200), |
| | | // Height = Application.GetRealHeight (35), |
| | | // X = Application.GetRealWidth (320), |
| | | // Y = tempSwitch.Bottom, |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | // Tag = common.Type.ToString () + "_Electric", |
| | | // Text = "0 kw.h" |
| | | // }; |
| | | // lightView.AddChidren (btnElectric); |
| | | //} |
| | | } |
| | | |
| | | tempSwitch.MouseUpEventHandler += (sender3, e3) => { |
| | |
| | | if (common.Type == DeviceType.LightEnergySwitch) { |
| | | new System.Threading.Thread (() => { |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 10, light.LoopID }, SendCount.Zero); |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 11, light.LoopID }, SendCount.Zero); |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 11, light.LoopID }, SendCount.Zero); |
| | | }) { IsBackground = true }.Start (); |
| | | } |
| | | }; |
| | |
| | | for (int i = 0; i < EnergtLightList.Count; i++) { |
| | | var c = EnergtLightList [i]; |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero); |
| | | //if (c.Type == DeviceType.LightEnergySwitch) { |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | //} |
| | | ////if (c.Type == DeviceType.LightEnergySwitch) { |
| | | ////2020-07-01 客户提出隐藏kwh |
| | | //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | ////} |
| | | System.Threading.Thread.Sleep (200); |
| | | } |
| | | System.Threading.Thread.Sleep (10000); |
| | |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Voltage" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") { |
| | | btn.Text = energy.ToString () + " W"; |
| | | } |
| | | } else if (updataType == 11) { |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | } |
| | | } |
| | | ////2020-07-01 客户提出隐藏kwh |
| | | //else if (updataType == 11) { |
| | | // if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | // btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | lightView.AddChidren (btnEnergy); |
| | | EnergtLightList.Add (common); |
| | | |
| | | //if (common.Type == DeviceType.LightEnergySwitch) { |
| | | Button btnElectric = new Button () { |
| | | Width = Application.GetRealWidth (200), |
| | | Height = Application.GetRealHeight (35), |
| | | X = Application.GetRealWidth (320), |
| | | Y = tempSwitch.Bottom, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Tag = common.Type.ToString () + "_Electric", |
| | | Text = "0 kw.h" |
| | | }; |
| | | lightView.AddChidren (btnElectric); |
| | | //} |
| | | //2020-07-01 客户提出隐藏kwh |
| | | ////if (common.Type == DeviceType.LightEnergySwitch) { |
| | | //Button btnElectric = new Button () { |
| | | // Width = Application.GetRealWidth (200), |
| | | // Height = Application.GetRealHeight (35), |
| | | // X = Application.GetRealWidth (320), |
| | | // Y = tempSwitch.Bottom, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // Tag = common.Type.ToString () + "_Electric", |
| | | // Text = "0 kw.h" |
| | | // }; |
| | | // lightView.AddChidren (btnElectric); |
| | | ////} |
| | | |
| | | Button btnEnergyNull = new Button () { |
| | | Y = Application.GetRealHeight (127), |
| | |
| | | while (readEnergy) { |
| | | foreach (var c in EnergtLightList) { |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero); |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | System.Threading.Thread.Sleep (200); |
| | | } |
| | | Thread.Sleep (10000); |
| | |
| | | |
| | | }; |
| | | #if DEBUG |
| | | etAccount.Text = "18926269190@189.cn"; |
| | | //etAccount.Text = "18926269190@189.cn"; |
| | | //etAccount.Text = "721343314@qq.com"; |
| | | //etAccount.Text = "crabtreel12019@gmail.com"; |
| | | //etAccount.Text = "2791308028@qq.com"; |
| | | etAccount.Text = "2791308028@qq.com"; |
| | | #endif |
| | | |
| | | accountView.AddChidren (etAccount); |
| | |
| | | alert.Show (); |
| | | }; |
| | | |
| | | if (MainPage.LoginUser.AccountType != 1) { |
| | | //if (MainPage.LoginUser.AccountType != 1) { |
| | | // rowView.AddRightView (btnDelFile); |
| | | //} |
| | | |
| | | //2020-07-01 当前住宅属于自己的 允许删除备份 |
| | | if (!MainPage.IsAdministrator) { |
| | | rowView.AddRightView (btnDelFile); |
| | | } |
| | | |
| | |
| | | topView.AddChidren (ItemButton); |
| | | #endregion |
| | | |
| | | //2020-07-01 |
| | | if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) { |
| | | NameButton.Text = UserConfig.Instance.CurrentRegion.Name; |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> addSubaccountHandler = (sender, e) => { |
| | | modifySubaccount (null); |
| | | }; |
| | |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout () { |
| | | Y = topUserMsgView.Bottom, |
| | | Height = Application.GetRealHeight (1136) - topUserMsgView.Bottom, |
| | | Height = Application.GetRealHeight (1136-80) - topUserMsgView.Bottom, |
| | | BackgroundColor = SkinStyle.Current.ViewColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | | AddChidren (contentView); |
| | | |
| | | |
| | | //#region |
| | | ////当前住宅 |
| | | //FrameLayout homeView = new FrameLayout () { |
| | | // Height = Application.GetRealHeight (100), |
| | | // BackgroundColor = SkinStyle.Current.Transparent |
| | | //}; |
| | | //contentView.AddChidren (homeView); |
| | | |
| | | //Button btnHomeText = new Button () { |
| | | // X = Application.GetRealWidth (40), |
| | | // Width = Application.GetRealWidth (600), |
| | | // //TextID = R.MyInternationalizationString.Subaccount, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | //}; |
| | | //homeView.AddChidren (btnHomeText); |
| | | |
| | | //if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) { |
| | | // btnHomeText.Text = "Current residence: " + UserConfig.Instance.CurrentRegion.Name; |
| | | //} |
| | | //#endregion |
| | | |
| | | FrameLayout subaccountView = new FrameLayout () { |
| | | Height = Application.GetRealHeight (50), |
| | | BackgroundColor = SkinStyle.Current.MainColor |
| | |
| | | |
| | | addSubaccountList (); |
| | | |
| | | addTipView (); |
| | | } |
| | | |
| | | void addTipView () { |
| | | var TipView = new Button () { |
| | | Width = LayoutParams.MatchParent, |
| | | Y = Application.GetRealHeight (Application.DesignHeight - 80), |
| | | Height = Application.GetRealHeight (80), |
| | | BackgroundColor = 0xFFFFFFE0, |
| | | TextSize = 11, |
| | | TextColor = 0xFF1F1F1F, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true, |
| | | Text = "Manage the member list of the current residence and share it to other accounts. \n Tips: You need to add the registered member account.", |
| | | |
| | | }; |
| | | AddChidren (TipView); |
| | | } |
| | | |
| | | void addSubaccountList () |
| | |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Voltage" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") { |
| | | btn.Text = energy.ToString () + " W"; |
| | | } |
| | | } else if (updataType == 11) { |
| | | if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | } |
| | | } |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //else if (updataType == 11) { |
| | | // if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") { |
| | | // btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h"; |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | DeviceRowView.AddChidren (btnEnergy); |
| | | EnergtLightList.Add (devcieCommon); |
| | | |
| | | Button btnElectric = new Button () { |
| | | Width = Application.GetRealWidth (200), |
| | | Height = Application.GetRealHeight (35), |
| | | X = Application.GetRealWidth (320), |
| | | Y = tempSwitch.Bottom, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | Tag = devcieCommon.Type.ToString () + "_Electric", |
| | | Text = "0 kw.h" |
| | | }; |
| | | DeviceRowView.AddChidren (btnElectric); |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //Button btnElectric = new Button () { |
| | | // Width = Application.GetRealWidth (200), |
| | | // Height = Application.GetRealHeight (35), |
| | | // X = Application.GetRealWidth (320), |
| | | // Y = tempSwitch.Bottom, |
| | | // TextColor = SkinStyle.Current.TextColor1, |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // SelectedTextColor = SkinStyle.Current.TextColor1, |
| | | // Tag = devcieCommon.Type.ToString () + "_Electric", |
| | | // Text = "0 kw.h" |
| | | //}; |
| | | //DeviceRowView.AddChidren (btnElectric); |
| | | } |
| | | tempSwitch.MouseUpEventHandler += (sender3, e3) => { |
| | | //tempSwitch.IsSelected = !tempSwitch.IsSelected; |
| | |
| | | if (devcieCommon.Type == DeviceType.LightEnergySocket || devcieCommon.Type == DeviceType.LightEnergySwitch) { |
| | | new System.Threading.Thread (() => { |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 10, switchLight.LoopID }, SendCount.Zero); |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero); |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero); |
| | | }) { IsBackground = true }.Start (); |
| | | } |
| | | }; |
| | |
| | | |
| | | var c = EnergtLightList [i]; |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero); |
| | | Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | //2020-07-01 客户提出隐藏kwh |
| | | //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero); |
| | | #if DEBUG |
| | | Application.RunOnMainThread (() => { |
| | | Utlis.WriteLine ($"读取 { c.Name } 电能"); |
| | |
| | | |
| | | //public static Button LinkStatusTip = new Button () { |
| | | // Height = Application.GetRealHeight (36), |
| | | // Width = Application.GetRealWidth (640), |
| | | // Width = Application.GetRealWidth (Application.DesignWidth), |
| | | // BackgroundColor = SkinStyle.Current.LinkStatusTipColor |
| | | //}; |
| | | |
| | |
| | | IsShowPoint = false, |
| | | }; |
| | | public static FrameLayout FavoriteBodyView = new FrameLayout () { |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136) |
| | | //Width = Application.GetRealWidth (Application.DesignWidth), |
| | | //Height = Application.GetRealHeight (Application.DesignHeight) |
| | | }; |
| | | public static UserRoom FavoriteRoom = new UserRoom () { |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136 - 90) |
| | | //Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight) |
| | | }; |
| | | |
| | | public static PageLayout DevicePageView = new PageLayout () { |
| | | IsShowPoint = false, |
| | | }; |
| | | public static FrameLayout DeviceBodyView = new FrameLayout () { |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136) |
| | | //Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (Application.DesignHeight) |
| | | }; |
| | | public static VerticalScrolViewLayout DeviceView = new VerticalScrolViewLayout () { |
| | | Y = Application.GetRealHeight (126), |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136 - 126 - 90), |
| | | //Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (Application.DesignHeight - 126 - userMenuItemHeight), |
| | | }; |
| | | |
| | | public static PageLayout RoomPageView = new PageLayout () { |
| | | IsShowPoint = false, |
| | | }; |
| | | public static FrameLayout RoomBodyView = new FrameLayout () { |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136) |
| | | Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (Application.DesignHeight) |
| | | }; |
| | | |
| | | public static PageLayout SettingPageView = new PageLayout () { |
| | |
| | | }; |
| | | public static FrameLayout SettingBodyView = new FrameLayout () { |
| | | BackgroundColor = SkinStyle.Current.MainColor, |
| | | Height = Application.GetRealHeight (1136) |
| | | Height = Application.GetRealHeight (Application.DesignHeight) |
| | | }; |
| | | public static VerticalScrolViewLayout SettingView = new VerticalScrolViewLayout () { |
| | | Y = Application.GetRealHeight (126), |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (1136 - 126 - 90 - 90), |
| | | Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (Application.DesignHeight - 126 - userMenuItemHeight - 90), |
| | | BackgroundColor = SkinStyle.Current.ViewColor, |
| | | //ScrollEnabled = true |
| | | }; |
| | | public static Button btnVersion = new Button () { |
| | | Y = Application.GetRealHeight (1136 - 90 - 90), |
| | | Width = Application.GetRealWidth (640), |
| | | Y = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight - 90), |
| | | Width = Application.GetRealWidth (Application.DesignWidth), |
| | | Height = Application.GetRealHeight (90), |
| | | Text = Language.StringByID (R.MyInternationalizationString.Version) + " : " + MainPage.RequestVersion, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | |
| | | }; |
| | | |
| | | public static FrameLayout UserMenuItem = new FrameLayout () { |
| | | Y = Application.GetRealHeight (Application.DesignHeight - 90), |
| | | Height = Application.GetRealHeight (95), |
| | | Y = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight), |
| | | Height = Application.GetRealHeight (userMenuItemHeight+5), |
| | | BackgroundColor = SkinStyle.Current.MainColor |
| | | }; |
| | | |
| | |
| | | //2020-01-14 登录成功后,刷新一次当前住宅网关 |
| | | GetNowHomeGatewayAfterLoginSuccess (); |
| | | } else if (!string.IsNullOrEmpty (revertObj.StateCode)) { |
| | | MainPage.LoginUser.LastTime = DateTime.Now.AddDays (-30); |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | | new AccountLogin ().Show (); |
| | | if (revertObj.StateCode != ErrorCode.NetworkError && revertObj.StateCode != "Data Exception") { |
| | | MainPage.LoginUser.LastTime = DateTime.Now.AddDays (-30); |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | | new AccountLogin ().Show (); |
| | | } |
| | | } |
| | | }); |
| | | } |