| | |
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | //修改设备名字的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | public void DeleteMemmoryDevice(CommonDevice device, bool deleteRoom = true)
|
| | | {
|
| | | //删除缓存设备的话,主页需要重新刷新
|
| | | Phone.UserView.UserPage.Instance.RefreshForm = true;
|
| | | Phone.UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | if (deleteRoom == true)
|
| | | {
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 同步设备___________________________
|
| | | /// <summary>
|
| | | /// 同步设备并且刷新缓存(同步失败时,会显示信息)
|
| | | /// </summary>
|
| | | /// <param name="litdevice">设备对象(MAC地址必须要相同)</param>
|
| | | public async Task<bool> SynchronizationDevice(List<CommonDevice> listdevice)
|
| | | {
|
| | | //虚拟住宅的话,不需要删除网关的设备
|
| | | if (Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | //同步
|
| | | var result = await listdevice[0].SyncMsgToBindSource(listdevice[0].DeviceAddr, listdevice[0].DeviceEpoint);
|
| | | if (result == null || result.result != 0)
|
| | | {
|
| | | //同步删除失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.SynchronizationFailed);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
|
| | |
|
| | | this.ShowErrorMsg(msg);
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | |
|
| | | #region ■ 测试设备___________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | //传感器除了Pir都没有定位功能
|
| | | return true;
|
| | | }
|
| | | else if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_SphericalMotion)
|
| | | {
|
| | | //球型移动传感器虽然是电池设备,但是它有定位功能
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测设备是否拥有一键同步功能
|
| | | /// </summary>
|
| | | /// <param name="device"></param>
|
| | | /// <returns></returns>
|
| | | public bool DeviceIsCanSynchronization(CommonDevice device)
|
| | | {
|
| | | //获取设备类型的
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | | if (sort == false)
|
| | | {
|
| | | return list;
|
| | | } |
| | | list.Sort((obj1, obj2) => {
|
| | | }
|
| | | list.Sort((obj1, obj2) =>
|
| | | {
|
| | |
|
| | | if (obj1.DeviceEpoint > obj2.DeviceEpoint)
|
| | | {
|
| | |
| | | public List<string> GetAllDeviceFile()
|
| | | {
|
| | | List<string> listDeviceFile = new List<string>();
|
| | | List<string> listAllFile = Global.FileListByHomeId(); |
| | | List<string> listAllFile = HdlFileLogic.Current.GetRootPathListFile(); |
| | | |
| | | foreach (string file in listAllFile)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | | }
|
| | | //如果是新风面板的新风设备,则不显示
|
| | | else if (i_device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | var myInfoType = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
|
| | | if (myInfoType.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | //2020.03.30追加式样:如果是面板的温度探头,不显示
|
| | | else if (i_device.Type == DeviceType.TemperatureSensor && ((TemperatureSensor)i_device).SensorDiv == 1)
|
| | | {
|
| | |
| | | //新风的湿度传感器不显示
|
| | | return false;
|
| | | }
|
| | |
|
| | | //如果是新风面板或环境面板,则都不显示任何回路
|
| | | var myInfoTypeTemp = LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { i_device });
|
| | | if (myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir || myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | else if (myInfoTypeTemp.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | if (i_device.Type != DeviceType.OnOffOutput)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|