| | |
| | | <Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.M7BBB18B19152766" /> |
| | | <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.ItemProperties.GateWay.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.8c0bdb303f25d82c2a42fb8bfca449bfaca00260" /> |
| | | <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Common/Device.cs"> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Room/UnallocatedRoom.cs"> |
| | | <Files> |
| | | <File FileName="Shared/R.cs" Line="761" Column="56" /> |
| | | <File FileName="Shared/R.cs" Line="957" Column="43" /> |
| | | <File FileName="GateWay.Droid/Assets/Language.ini" /> |
| | | <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1672" Column="22" /> |
| | | <File FileName="Shared/Phone/Device/Room/UnallocatedRoom.cs" Line="359" Column="30" /> |
| | | <File FileName="Shared/Phone/UserView/UserHomeView.cs" Line="1" Column="1" /> |
| | | <File FileName="Shared/Phone/Device/CommonForm/SelectFunctionView.cs" Line="41" Column="21" /> |
| | | <File FileName="Shared/Common/Device.cs" Line="2284" Column="33" /> |
| | | <File FileName="Shared/Phone/Device/CommonForm/FunctionButton.cs" Line="87" Column="32" /> |
| | | <File FileName="Shared/Phone/Device/Category/Category.cs" /> |
| | | <File FileName="Shared/Phone/Device/Category/SelectDevice.cs" /> |
| | | <File FileName="Shared/Phone/Device/Room/UnallocatedRoom.cs" Line="697" Column="1" /> |
| | | <File FileName="Shared/Common/Device.cs" /> |
| | | <File FileName="Shared/Phone/UserView/UserHomeView.cs" /> |
| | | <File FileName="Shared/Phone/Device/Category/CategoryAddScene.cs" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | |
| | | <Node name="GateWay.Droid" expanded="True"> |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="Logo" expanded="True" /> |
| | | <Node name="Item" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="Home.IOS" expanded="True" /> |
| | | <Node name="Shared" expanded="True"> |
| | | <Node name="Common" expanded="True"> |
| | | <Node name="Device.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="Device" expanded="True"> |
| | | <Node name="Category" expanded="True" /> |
| | | <Node name="CommonForm" expanded="True" /> |
| | | <Node name="Room" expanded="True" /> |
| | | <Node name="Room" expanded="True"> |
| | | <Node name="UnallocatedRoom.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="UserCenter" expanded="True"> |
| | | <Node name="Password" expanded="True" /> |
| | | </Node> |
| | | <Node name="UserView" expanded="True" /> |
| | | <Node name="ZigBee" expanded="True"> |
| | | <Node name="Device" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <MonoDevelop.Ide.DebuggingService.PinnedWatches /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/guoxuecheng/Desktop/HomeApp/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs" relfile="Shared/Phone/UserView/UserHomeView.cs" line="1603" column="1" /> |
| | | </BreakpointStore> |
| | | <BreakpointStore /> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | |
| | | 11032=选择区域 |
| | | 11033=选择场景图片 |
| | | 11034=确定要移除该功能? |
| | | 11035=添加功能 |
| | | 11036=添加延时 |
| | | |
| | | |
| | | |
| | | 12100=未知设备 |
old mode 100755
new mode 100644
| | |
| | | { |
| | | "images": [ |
| | | { |
| | | "filename": "icon-20@2x.png", |
| | | "size": "20x20", |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-20@3x.png", |
| | | "size": "20x20", |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-29@2x.png", |
| | | "size": "29x29", |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-29@3x.png", |
| | | "size": "29x29", |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-40@2x.png", |
| | | "size": "40x40", |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-40@3x.png", |
| | | "size": "40x40", |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-60@2x.png", |
| | | "size": "60x60", |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-60@3x.png", |
| | | "size": "60x60", |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "filename": "icon-20-ipad.png", |
| | | "size": "20x20", |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-20@2x-ipad.png", |
| | | "size": "20x20", |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-29-ipad.png", |
| | | "size": "29x29", |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-29@2x-ipad.png", |
| | | "size": "29x29", |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-40.png", |
| | | "size": "40x40", |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-40@2x-1.png", |
| | | "size": "40x40", |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-83.5@2x.png", |
| | | "size": "83.5x83.5", |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-76.png", |
| | | "size": "76x76", |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-76@2x.png", |
| | | "size": "76x76", |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "filename": "icon-1024.png", |
| | | "size": "1024x1024", |
| | | "scale": "1x", |
| | | "idiom": "ios-marketing" |
| | | }, |
| | | { |
| | | "size": "60x60", |
| | | "scale": "2x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "size": "60x60", |
| | | "scale": "3x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "role": "notificationCenter", |
| | | "size": "24x24", |
| | | "subtype": "38mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "notificationCenter", |
| | | "size": "27.5x27.5", |
| | | "subtype": "42mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "companionSettings", |
| | | "size": "29x29", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "companionSettings", |
| | | "size": "29x29", |
| | | "scale": "3x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "appLauncher", |
| | | "size": "40x40", |
| | | "subtype": "38mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "appLauncher", |
| | | "size": "44x44", |
| | | "subtype": "40mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "appLauncher", |
| | | "size": "50x50", |
| | | "subtype": "44mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "quickLook", |
| | | "size": "86x86", |
| | | "subtype": "38mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "quickLook", |
| | | "size": "98x98", |
| | | "subtype": "42mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "role": "quickLook", |
| | | "size": "108x108", |
| | | "subtype": "44mm", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "size": "1024x1024", |
| | | "scale": "1x", |
| | | "idiom": "watch-marketing" |
| | | }, |
| | | { |
| | | "size": "16x16", |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "16x16", |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "32x32", |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "32x32", |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "128x128", |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "128x128", |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "256x256", |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "256x256", |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "512x512", |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "size": "512x512", |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | "images": [ |
| | | { |
| | | "size": "20x20", |
| | | "idiom": "iphone", |
| | | "filename": "icon-20@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "20x20", |
| | | "idiom": "iphone", |
| | | "filename": "icon-20@3x.png", |
| | | "scale": "3x" |
| | | }, |
| | | { |
| | | "size": "29x29", |
| | | "idiom": "iphone", |
| | | "filename": "icon-29.png", |
| | | "scale": "1x" |
| | | }, |
| | | { |
| | | "size": "29x29", |
| | | "idiom": "iphone", |
| | | "filename": "icon-29@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "29x29", |
| | | "idiom": "iphone", |
| | | "filename": "icon-29@3x.png", |
| | | "scale": "3x" |
| | | }, |
| | | { |
| | | "size": "40x40", |
| | | "idiom": "iphone", |
| | | "filename": "icon-40@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "40x40", |
| | | "idiom": "iphone", |
| | | "filename": "icon-40@3x.png", |
| | | "scale": "3x" |
| | | }, |
| | | { |
| | | "size": "60x60", |
| | | "idiom": "iphone", |
| | | "filename": "icon-60@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "60x60", |
| | | "idiom": "iphone", |
| | | "filename": "icon-60@3x.png", |
| | | "scale": "3x" |
| | | }, |
| | | { |
| | | "size": "20x20", |
| | | "idiom": "ipad", |
| | | "filename": "icon-20-ipad.png", |
| | | "scale": "1x" |
| | | }, |
| | | { |
| | | "size": "20x20", |
| | | "idiom": "ipad", |
| | | "filename": "icon-20@2x-ipad.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "29x29", |
| | | "idiom": "ipad", |
| | | "filename": "icon-29-ipad.png", |
| | | "scale": "1x" |
| | | }, |
| | | { |
| | | "size": "29x29", |
| | | "idiom": "ipad", |
| | | "filename": "icon-29@2x-ipad.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "40x40", |
| | | "idiom": "ipad", |
| | | "filename": "icon-40.png", |
| | | "scale": "1x" |
| | | }, |
| | | { |
| | | "size": "40x40", |
| | | "idiom": "ipad", |
| | | "filename": "icon-40@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "76x76", |
| | | "idiom": "ipad", |
| | | "filename": "icon-76.png", |
| | | "scale": "1x" |
| | | }, |
| | | { |
| | | "size": "76x76", |
| | | "idiom": "ipad", |
| | | "filename": "icon-76@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "83.5x83.5", |
| | | "idiom": "ipad", |
| | | "filename": "icon-83.5@2x.png", |
| | | "scale": "2x" |
| | | }, |
| | | { |
| | | "size": "1024x1024", |
| | | "idiom": "ios-marketing", |
| | | "filename": "icon-1024.png", |
| | | "scale": "1x" |
| | | } |
| | | ], |
| | | "info": { |
| | | "version": 1, |
| | | "author": "icon.wuruihong.com" |
| | | } |
| | | ], |
| | | "info": { |
| | | "version": 1, |
| | | "author": "xcode" |
| | | }, |
| | | "properties": { |
| | | "pre-rendered": true |
| | | } |
| | | } |
| | |
| | | /// </summary>
|
| | | private Dictionary<string, string> dicDeviceModelIdChanged = null;
|
| | | /// <summary>
|
| | | /// 图片共有(keys:指定设备的具体类型 value:指定共有对象的具体类型)
|
| | | /// </summary>
|
| | | private Dictionary<string, string> dicPictrueShard = null;
|
| | | /// <summary>
|
| | | /// 本地所有设备的缓存(非公开)
|
| | | /// </summary>
|
| | | private Dictionary<string, CommonDevice> dicAllDevice = new Dictionary<string, CommonDevice>();
|
| | |
| | | List<string> listFile = this.GetAllDeviceFile(); |
| | | foreach (string file in listFile)
|
| | | {
|
| | | CommonDevice device = null;
|
| | | //反序列化为指定的类,不然数据会丢失而导致无法强转
|
| | | var device = ZigBee.Device.CommonDevice.CommonDeviceByFilePath(file);
|
| | | try |
| | | {
|
| | | device = CommonDevice.CommonDeviceByFilePath(file);
|
| | | }
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | if (device == null || device.CurrentGateWayId == null)
|
| | | {
|
| | | #if DEBUG
|
| | |
| | | /// <param name="deleteRoom">是否从房间删除</param>
|
| | | public void DeleteMemmoryDevice(CommonDevice device, bool deleteRoom = true)
|
| | | {
|
| | | if (deleteRoom == true && Room.CurrentRoom != null)
|
| | | {
|
| | | //从房间中删除
|
| | | Room.CurrentRoom.DeleteDevice(device);
|
| | | }
|
| | |
|
| | | //删除缓存
|
| | | string mainKeys = this.GetDeviceMainKeys(device);
|
| | | lock (dicAllDevice)
|
| | |
| | | }
|
| | | }
|
| | | this.dicOTADevice.Remove(otaKeys);
|
| | | }
|
| | |
|
| | | if (deleteRoom == true && Room.CurrentRoom != null)
|
| | | {
|
| | | //从房间中删除
|
| | | Room.CurrentRoom.DeleteDevice(device);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据MAC地址,获取全部回路的设备对象(已经排序)
|
| | | /// 根据MAC地址,获取全部回路的设备对象
|
| | | /// </summary>
|
| | | /// <param name="DeviceAddr">Mac地址</param>
|
| | | /// <param name="sort">是否排序</param>
|
| | | /// <returns></returns>
|
| | | public List<CommonDevice> GetDevicesByMac(string DeviceAddr)
|
| | | public List<CommonDevice> GetDevicesByMac(string DeviceAddr, bool sort = true)
|
| | | {
|
| | | var list = new List<CommonDevice>();
|
| | | if (dicDeviceEpoint.ContainsKey(DeviceAddr) == false)
|
| | |
| | | list.Add(device);
|
| | | }
|
| | | }
|
| | | if (sort == false)
|
| | | {
|
| | | return list;
|
| | | }
|
| | |
|
| | | //排序
|
| | | list.Sort((obj1, obj2) =>
|
| | | {
|
| | |
| | | {
|
| | | //获取它属于什么类型的设备
|
| | | var myDeviceType = this.GetMyDeviceEnumInfo(listdevice);
|
| | | string strConcrete = Enum.GetName(typeof(DeviceConcreteType), myDeviceType.ConcreteType);
|
| | | string strConcrete = Enum.GetName(typeof(DeviceConcreteType), myDeviceType.ConcreteType); |
| | | |
| | | //图片共有 |
| | | if (this.dicPictrueShard.ContainsKey(strConcrete) == true)
|
| | | {
|
| | | strConcrete = this.dicPictrueShard[strConcrete];
|
| | | }
|
| | |
|
| | | string strType = strConcrete.Replace("_", string.Empty);
|
| | | //将类型转为图片地址
|
| | | string imageFilePath = "RealDevice/" + strType + ".png";
|
| | |
| | | {
|
| | | //将具体类型转字符串
|
| | | string strSpecific = Enum.GetName(typeof(DeviceConcreteType), specificType);
|
| | | //图片共有
|
| | | if (this.dicPictrueShard.ContainsKey(strSpecific) == true)
|
| | | {
|
| | | strSpecific = this.dicPictrueShard[strSpecific];
|
| | | }
|
| | |
|
| | | string strType = strSpecific.Replace("_", string.Empty);
|
| | | //将类型转为图片地址
|
| | | string imageFilePath = "Device/" + strType + ".png";
|
| | |
| | | return info;
|
| | | }
|
| | | //获取第三方设备的【设备类型】
|
| | | return this.GetNotHdlMyDeviceEnumInfo(listdevice);
|
| | | return this.GetNotHdlMyDeviceEnumInfo(listdevice, false);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | else
|
| | | {
|
| | | //获取第三方设备的【设备类型】
|
| | | var myDeviceType = this.GetNotHdlMyDeviceEnumInfo(listDevice);
|
| | | var myDeviceType = this.GetNotHdlMyDeviceEnumInfo(listDevice, false);
|
| | | strName = Language.StringByID(myDeviceType.ConcreteTextId);
|
| | | }
|
| | | if (ApendFalge == true && listDevice[0].DriveCode > 0)
|
| | |
| | | /// <summary>
|
| | | /// 获取第三方设备的【设备类型】
|
| | | /// </summary>
|
| | | /// <param name="listdevice"></param>
|
| | | /// <param name="device">设备回路</param>
|
| | | /// <param name="margeSensor">
|
| | | /// <para>是否将所有类型的传感器都归为【传感器】,</para> |
| | | /// <para>false的时候:【ConcreteType】和【ConcreteTextId】可能会有不同的值</para> |
| | | /// <para>true的时候:【ConcreteType】统一为Sensor,【ConcreteTextId】统一为传感器</para> |
| | | /// </param>
|
| | | /// <returns></returns>
|
| | | public DeviceEnumInfo GetNotHdlMyDeviceEnumInfo(List<CommonDevice> listdevice)
|
| | | public DeviceEnumInfo GetNotHdlMyDeviceEnumInfo(CommonDevice device, bool margeSensor = true)
|
| | | {
|
| | | return this.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice>() { device }, margeSensor);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获取第三方设备的【设备类型】(不建议使用)
|
| | | /// </summary>
|
| | | /// <param name="listdevice">Mac都一样的设备列表</param>
|
| | | /// <param name="margeSensor">
|
| | | /// <para>是否将所有类型的传感器都归为【传感器】,</para> |
| | | /// <para>false的时候:【ConcreteType】和【ConcreteTextId】可能会有不同的值</para> |
| | | /// <para>true的时候:【ConcreteType】统一为Sensor,【ConcreteTextId】统一为传感器</para> |
| | | /// </param>
|
| | | /// <returns></returns>
|
| | | public DeviceEnumInfo GetNotHdlMyDeviceEnumInfo(List<CommonDevice> listdevice, bool margeSensor = true)
|
| | | {
|
| | | var dicType = new Dictionary<DeviceType, CommonDevice>();
|
| | | foreach (CommonDevice device in listdevice)
|
| | |
| | | //1包含面板的话,当面板处理
|
| | | if (dicType.ContainsKey(DeviceType.OnOffSwitch) == true)
|
| | | {
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId200;
|
| | | info.BeloneType = DeviceBeloneType.A按键面板;
|
| | | info.ConcreteType = DeviceConcreteType.ButtonPanel;
|
| | | if (listdevice.Count > 1)
|
| | | {
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId200;
|
| | | info.BeloneType = DeviceBeloneType.A按键面板;
|
| | | info.ConcreteType = DeviceConcreteType.ButtonPanel;
|
| | | }
|
| | | else
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId16;
|
| | | info.BeloneType = DeviceBeloneType.A干接点;
|
| | | info.ConcreteType = DeviceConcreteType.DryContact;
|
| | | }
|
| | | }
|
| | | //3包含窗帘的话,当窗帘处理
|
| | | else if (dicType.ContainsKey(DeviceType.WindowCoveringDevice) == true)
|
| | |
| | | //4空气开关
|
| | | else if (dicType.ContainsKey(DeviceType.AirSwitch) == true)
|
| | | {
|
| | | //默认值
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId4100;
|
| | | info.BeloneType = DeviceBeloneType.A空气开关;
|
| | | info.BeloneType = DeviceBeloneType.A智能空开;
|
| | | info.ConcreteType = DeviceConcreteType.AirSwitch;
|
| | |
|
| | | if (dicType[DeviceType.AirSwitch].DfunctionType == DeviceFunctionType.A开关)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId13;
|
| | | info.BeloneType = DeviceBeloneType.A开关;
|
| | | info.ConcreteType = DeviceConcreteType.Switch;
|
| | | }
|
| | | else if (dicType[DeviceType.AirSwitch].DfunctionType == DeviceFunctionType.A插座)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId14;
|
| | | info.BeloneType = DeviceBeloneType.A插座;
|
| | | info.ConcreteType = DeviceConcreteType.Socket1;
|
| | | }
|
| | | else if (dicType[DeviceType.AirSwitch].DfunctionType == DeviceFunctionType.A灯光)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId15;
|
| | | info.BeloneType = DeviceBeloneType.A灯光;
|
| | | info.ConcreteType = DeviceConcreteType.Light;
|
| | | }
|
| | | }
|
| | | //5继电器
|
| | | else if (dicType.ContainsKey(DeviceType.OnOffOutput) == true)
|
| | | {
|
| | | //默认值
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId2300;
|
| | | info.BeloneType = DeviceBeloneType.A继电器;
|
| | | info.ConcreteType = DeviceConcreteType.Relay;
|
| | |
|
| | | if (dicType[DeviceType.OnOffOutput].DfunctionType == DeviceFunctionType.A开关)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId13;
|
| | | info.BeloneType = DeviceBeloneType.A开关;
|
| | | info.ConcreteType = DeviceConcreteType.Switch;
|
| | | }
|
| | | else if (dicType[DeviceType.OnOffOutput].DfunctionType == DeviceFunctionType.A插座)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId14;
|
| | | info.BeloneType = DeviceBeloneType.A插座;
|
| | | info.ConcreteType = DeviceConcreteType.Socket1;
|
| | | }
|
| | | else if (dicType[DeviceType.OnOffOutput].DfunctionType == DeviceFunctionType.A灯光)
|
| | | {
|
| | | //info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId15;
|
| | | info.BeloneType = DeviceBeloneType.A灯光;
|
| | | info.ConcreteType = DeviceConcreteType.Light;
|
| | | }
|
| | | }
|
| | | //6调光器
|
| | | else if (dicType.ContainsKey(DeviceType.DimmableLight) == true)
|
| | |
| | | //12包含传感器的话,当传感器处理
|
| | | else if (dicType.ContainsKey(DeviceType.IASZone) == true)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | info.BeloneType = DeviceBeloneType.A传感器;
|
| | | this.SetSensorDeviceSpecificType(ref info, listdevice);
|
| | | info.ConcreteType = DeviceConcreteType.Sensor;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId1200;
|
| | | if (margeSensor == false)
|
| | | {
|
| | | //设置传感器具体的类型
|
| | | this.SetSensorDeviceSpecificType(ref info, listdevice);
|
| | | }
|
| | | }
|
| | | //13包含温度传感器的话
|
| | | else if (dicType.ContainsKey(DeviceType.TemperatureSensor) == true)
|
| | | {
|
| | | bool temperatrue = false;
|
| | | bool humidity = false;
|
| | | foreach (var device in listdevice)
|
| | | //获取全部的回路
|
| | | var listTemp = this.GetDevicesByMac(listdevice[0].DeviceAddr, false);
|
| | | foreach (var device in listTemp)
|
| | | {
|
| | | if (device is TemperatureSensor)
|
| | | {
|
| | |
| | | /// <param name="listdevice">设备对象</param>
|
| | | private void SetSensorDeviceSpecificType(ref DeviceEnumInfo info, List<CommonDevice> listdevice)
|
| | | {
|
| | | //默认名字:传感器
|
| | | info.ConcreteType = DeviceConcreteType.Sensor;
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId1200;
|
| | |
|
| | | //如果这个设备拥有多个回路的话,我也不知道怎么命名,只能给个默认名字
|
| | | if (listdevice.Count > 1)
|
| | | {
|
| | |
| | | /// <returns></returns>
|
| | | public string AppendVersion(int versionValue)
|
| | | {
|
| | | //转为16进制
|
| | | string txt64 = Convert.ToString(versionValue, 16).PadLeft(4, '0');
|
| | | //直接是10进制
|
| | | string txt10 = Convert.ToString(versionValue).PadLeft(4, '0');
|
| | | //这个是小数点前面的值
|
| | | int value1 = Convert.ToInt32(txt64.Substring(0, 2), 16);
|
| | | int value1 = Convert.ToInt32(txt10.Substring(0, txt10.Length - 2));
|
| | | //这个是小数点后面的值
|
| | | int value2 = Convert.ToInt32(txt64.Substring(2, 2), 16);
|
| | | int value2 = Convert.ToInt32(txt10.Substring(txt10.Length - 2, 2));
|
| | |
|
| | | //Ver.
|
| | | string ver = Language.StringByID(R.MyInternationalizationString.uVersionAbbreviation);
|
| | | return ver + value1 + "." + value2.ToString().PadLeft(3, '0');
|
| | | return ver + value1 + "." + value2.ToString().PadLeft(2, '0');
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | int receiveCount = 0;
|
| | | //设备列表
|
| | | var listDevice = new List<CommonDevice>();
|
| | |
|
| | | //网关里面有可能会有重复的回路
|
| | | var listCheck = new HashSet<string>();
|
| | | Action<string, string> getDeviceAction = (topic, message) =>
|
| | | {
|
| | | try
|
| | | if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | {
|
| | | if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | try
|
| | | {
|
| | | TimeOut = 0;
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | | if (totalNum == 0)
|
| | | lock (listDevice)
|
| | | {
|
| | | //这个网关没有设备
|
| | | canBreak = true;
|
| | | return;
|
| | | }
|
| | | if (deviceCount == -1)
|
| | | {
|
| | | //设置需要接收多少个设备
|
| | | deviceCount = totalNum;
|
| | | }
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | |
|
| | | var deviceID = (DeviceType)jobject.Value<int>("Device_ID");
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway);
|
| | | if (device != null)
|
| | | {
|
| | | try
|
| | | TimeOut = 0;
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | | if (totalNum == 0)
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction?.Invoke(device);
|
| | | //这个网关没有设备
|
| | | canBreak = true;
|
| | | return;
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | | if (deviceCount == -1)
|
| | | {
|
| | | //设置需要接收多少个设备
|
| | | deviceCount = totalNum;
|
| | | }
|
| | |
|
| | | listDevice.Add(device);
|
| | | }
|
| | | if (deviceCount == receiveCount)
|
| | | {
|
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | var deviceID = (DeviceType)jobject.Value<int>("Device_ID");
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway);
|
| | | if (device != null)
|
| | | {
|
| | | string mainkeys = this.GetDeviceMainKeys(device);
|
| | | //网关里面有可能会有重复的回路
|
| | | if (listCheck.Contains(mainkeys) == false)
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction?.Invoke(device);
|
| | | listDevice.Add(device);
|
| | |
|
| | | listCheck.Add(mainkeys);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | if (receiveCount == deviceCount && deviceCount != -1)
|
| | | {
|
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | }
|
| | | }
|
| | | catch { }
|
| | | };
|
| | |
|
| | | realWay.Actions += getDeviceAction;
|
| | |
| | | //定义规则:模块ID(已翻译)=设备具体类型值-设备所属类型值(自定义的值,嘛,只要不重复就可以)
|
| | | //第一个值是:DeviceConcreteType 第二个值是:DeviceBeloneType
|
| | |
|
| | | //*********************************************************************
|
| | | //新设备添加方法:
|
| | | //1、在这里填写上模块ID,然后是 DeviceConcreteType ,然后是 DeviceBeloneType
|
| | | //2、然后在最下面添加【设备的具体类型】,【设备的所属类型】
|
| | | //3、已设备的具体类型为名字(去掉【-】)添加设备的【所属图片】,【真实物理图片】。回路图片需要特殊处理
|
| | | //4、添加R文件,添加Language文件
|
| | | //*********************************************************************
|
| | |
|
| | | //=========★★开合帘类(100-199)★★=========
|
| | | this.dicDeviceModelIdEnum["MWM65B-ZB.20"] = "100-100";//智能开合帘电机
|
| | | this.dicDeviceModelIdEnum["MVSM35B-ZB.20"] = "101-100";//智能管状电机
|
| | |
| | | this.dicDeviceModelIdEnum["MPT2/R2-ZB.18"] = "202-200";//2按键触摸面板
|
| | | this.dicDeviceModelIdEnum["MPT1/R1-ZB.18"] = "203-200";//12按键触摸面板
|
| | | this.dicDeviceModelIdEnum["MPT4-ZB.18"] = "210-200";//4按键触摸面板(只带电源底座)
|
| | | this.dicDeviceModelIdEnum["MPT4R4L/S-ZB1.8"] = "220-200";//简约4按键面板
|
| | | this.dicDeviceModelIdEnum["MPT3R3L/S-ZB1.8"] = "221-200";//简约3按键面板
|
| | | this.dicDeviceModelIdEnum["MPT2R2L/S-ZB1.8"] = "222-200";//简约2按键面板
|
| | |
|
| | | //=========★★PIR传感器类(1200-1299)★★=========
|
| | | this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200";//pir传感器220
|
| | |
| | | this.dicDeviceModelIdEnum["MBUS/GW-ZB.10"] = "4200-4200";//zigbee转buspro协议转换器
|
| | | this.dicDeviceModelIdEnum["M485/GW-ZB.10"] = "4201-4200";//zigbee转485协议转换器
|
| | |
|
| | | //需要交换的模块ID
|
| | | //✩✩✩✩✩需要交换的模块ID✩✩✩✩✩
|
| | | this.dicDeviceModelIdChanged = new Dictionary<string, string>();
|
| | | //=========★★安防类传感器类★★=========
|
| | | this.dicDeviceModelIdChanged["MULTI-GASE--EA07"] = "MSG01/M-ZB.10";//燃气传感器
|
| | |
| | | this.dicDeviceModelIdChanged["MULTI-MOTI--EA04"] = "MSPIR01/M-ZB.10";//红外传感器
|
| | | this.dicDeviceModelIdChanged["MULTI-WATE--EA02"] = "MSW01/M-ZB.10";//水浸传感器
|
| | | this.dicDeviceModelIdChanged["MULTI-BURO--EA06"] = "MBU01/M-ZB.10";//紧急按键
|
| | |
|
| | | //✩✩✩✩✩需要共有的图片对象✩✩✩✩✩
|
| | | this.dicPictrueShard = new Dictionary<string, string>();
|
| | | this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//简约4按键面板 沿用 4按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//简约3按键面板 沿用 3按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleTwo"] = "ButtonPanel_Two";//简约2按键面板 沿用 2按键的图标
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// 4按键多功能触摸面板(只带电源底座) 镜像id:210
|
| | | /// </summary>
|
| | | ButtonPanel_FourNotPower = 210,
|
| | | /// <summary>
|
| | | /// 简约4按键面板 镜像id:220
|
| | | /// </summary>
|
| | | ButtonPanel_SimpleFour = 220,
|
| | | /// <summary>
|
| | | /// 简约3按键面板 镜像id:221
|
| | | /// </summary>
|
| | | ButtonPanel_SimpleThree = 221,
|
| | | /// <summary>
|
| | | /// 简约2按键面板 镜像id:222
|
| | | /// </summary>
|
| | | ButtonPanel_SimpleTwo = 222,
|
| | |
|
| | | //=========★★PIR传感器类(1200-1299)★★=========
|
| | | /// <summary>
|
| | |
| | |
|
| | | //=========★★空气开关类(4100-????)★★=========
|
| | | /// <summary>
|
| | | /// 智能空气开关
|
| | | /// 智能空开
|
| | | /// </summary>
|
| | | AirSwitch = -4100,
|
| | | /// <summary>
|
| | | /// 微断云控制器 镜像id:4100
|
| | | /// 智能空开 镜像id:4100
|
| | | /// </summary>
|
| | | AirSwitch_CloudContr = 4100,
|
| | |
|
| | |
| | | /// zigbee转buspro协议转换器
|
| | | /// </summary>
|
| | | Converter_ZbBuspro = 4201,
|
| | |
|
| | | //=========★★其他类(????-????)★★=========
|
| | | /// <summary>
|
| | | /// 干接点
|
| | | /// </summary>
|
| | | DryContact = -10000,
|
| | | /// <summary>
|
| | | /// 灯光(注意,它输入其他类,不是设备类型)
|
| | | /// </summary>
|
| | | Light = -10001,
|
| | | /// <summary>
|
| | | /// 插座
|
| | | /// </summary>
|
| | | Socket1 = -10002,
|
| | | /// <summary>
|
| | | /// 开关
|
| | | /// </summary>
|
| | | Switch = -10003,
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <summary>
|
| | | /// 空调(3600-3899)
|
| | | /// </summary>
|
| | | A空调 = 3600, |
| | | /// <summary>
/// 中继器(3900-3999)
/// </summary>
A中继器 = 3900, |
| | | /// <summary>
/// 智能空开(4100-4199)
/// </summary>
A智能空开 = 4100, |
| | | /// <summary>
/// 转换器(4200-4699)
/// </summary>
A转换器 = 4200, |
| | | /// <summary>
/// 彩灯
/// </summary>
A彩灯 = 9, |
| | | /// <summary>
/// 温湿度传感器
/// </summary>
A温湿度传感器 = 10, |
| | | /// <summary>
/// 温度传感器
/// </summary>
A温度传感器 = 11, |
| | | /// <summary>
/// 湿度传感器
/// </summary>
A湿度传感器 = 12, |
| | | /// <summary>
/// 开关
/// </summary>
A开关 = 13, |
| | | /// <summary>
/// 插座
/// </summary>
A插座 = 14, |
| | | /// <summary>
/// 灯光
/// </summary>
A灯光 = 15, |
| | | /// <summary>
/// 干接点
/// </summary>
A干接点 = 16,
|
| | | A空气开关
|
| | |
|
| | | A空调 = 3600,
|
| | | /// <summary>
|
| | | /// 中继器(3900-3999)
|
| | | /// </summary>
|
| | | A中继器 = 3900,
|
| | | /// <summary>
|
| | | /// 智能空开(4100-4199)
|
| | | /// </summary>
|
| | | A智能空开 = 4100,
|
| | | /// <summary>
|
| | | /// 转换器(4200-4699)
|
| | | /// </summary>
|
| | | A转换器 = 4200,
|
| | | /// <summary>
|
| | | /// 彩灯
|
| | | /// </summary>
|
| | | A彩灯 = 9,
|
| | | /// <summary>
|
| | | /// 温湿度传感器
|
| | | /// </summary>
|
| | | A温湿度传感器 = 10,
|
| | | /// <summary>
|
| | | /// 温度传感器
|
| | | /// </summary>
|
| | | A温度传感器 = 11,
|
| | | /// <summary>
|
| | | /// 湿度传感器
|
| | | /// </summary>
|
| | | A湿度传感器 = 12,
|
| | | /// <summary>
|
| | | /// 开关
|
| | | /// </summary>
|
| | | A开关 = 13,
|
| | | /// <summary>
|
| | | /// 插座
|
| | | /// </summary>
|
| | | A插座 = 14,
|
| | | /// <summary>
|
| | | /// 灯光
|
| | | /// </summary>
|
| | | A灯光 = 15,
|
| | | /// <summary>
|
| | | /// 干接点
|
| | | /// </summary>
|
| | | A干接点 = 16
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = Application.GetRealHeight(35+275), |
| | | Y = Application.GetRealHeight(35+279), |
| | | Width = Application.GetRealWidth(1028), |
| | | Height = Application.GetRealHeight(939), |
| | | Height = Application.GetRealHeight(942), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(deviceListScrolView); |
| | |
| | | roomBtn.IsSelected = true; |
| | | this.curRoom = room; |
| | | curBtn = roomBtn; |
| | | |
| | | if(sceneBtn.IsSelected) |
| | | { |
| | | RefreshScene(room); |
| | |
| | | /// <param name="room"></param> |
| | | public void RefreshScene(Common.Room room) |
| | | { |
| | | RefreshData(room); |
| | | functionSceneBodyView.RemoveAll(); |
| | | var sceneList = room.SceneUIList; |
| | | if (sceneList.Count == 0) |
| | | { |
| | | ShowNoSceneTip(); |
| | |
| | | TextID = R.MyInternationalizationString.EditInfo, |
| | | TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14 |
| | | TextSize = 15, |
| | | IsBold=true |
| | | }; |
| | | infoFL.AddChidren(infoEdit); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.AddScentTargetAction, |
| | | Gravity = Gravity.CenterVertical |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize=15 |
| | | }; |
| | | addTargetFL.AddChidren(target); |
| | | |
| | |
| | | Height = Application.GetRealHeight(450), |
| | | Width = Application.GetRealWidth(selectRow_Width), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | //itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectLocalPicture = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.LocalPicture, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectLocalPicture); |
| | | var selectLocalLine = new Button() |
| | | { |
| | | Y = selectLocalPicture.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | itemFL.AddChidren(selectLocalLine); |
| | | |
| | |
| | | Y = selectLocalLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Photograph, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectPhotographBtn); |
| | | var selectPhotographLine = new Button() |
| | | { |
| | | Y = selectPhotographBtn.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | }; |
| | | itemFL.AddChidren(selectPhotographLine); |
| | | |
| | |
| | | Y = selectPhotographLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.MyAblums, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectAblumsBtn); |
| | | |
| | |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | TextSize=17 |
| | | }; |
| | | selectFL.AddChidren(cancelBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(450), |
| | | Width = Application.GetRealWidth(selectRow_Width), |
| | | Gravity=Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | //itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectedFunctionBtn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Function, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectedFunctionBtn); |
| | | var selectedFunctionLine = new Button() |
| | | { |
| | | Y = selectedFunctionBtn.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | itemFL.AddChidren(selectedFunctionLine); |
| | | |
| | |
| | | Y = selectedFunctionLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Scence, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectedSceneBtn); |
| | | var selectedSceneLine = new Button() |
| | | { |
| | | Y = selectedSceneBtn.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCLineColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2, |
| | | }; |
| | | itemFL.AddChidren(selectedSceneLine); |
| | | |
| | |
| | | Y = selectedSceneLine.Bottom, |
| | | Height = Application.GetRealHeight(selectRow_Height) - 1, |
| | | TextID = R.MyInternationalizationString.Delay, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4 |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | TextSize=17 |
| | | }; |
| | | itemFL.AddChidren(selectedTimerBtn); |
| | | |
| | |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | TextSize=17 |
| | | }; |
| | | selectFL.AddChidren(cancelBtn); |
| | | |
| | |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddScence); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddDelayTime); |
| | | top.backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | |
| | | Height = Application.GetMinRealAverage(124), |
| | | Width = Application.GetMinRealAverage(124), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetRealHeight(124 / 2), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | UnSelectedImagePath = "Item/Timer.png" |
| | | }; |
| | | bg1.AddChidren(timeImg); |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = R.MyInternationalizationString.SelectTimeForAction, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize=15, |
| | | IsMoreLines = true |
| | | }; |
| | | bodyFrameLayout.AddChidren(tip); |
| | |
| | | Y = Application.GetRealHeight(611), |
| | | Height = Application.GetRealHeight(1126), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | }; |
| | | bodyFrameLayout.AddChidren(midFL); |
| | | |
| | |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.UserView; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.Device.Category |
| | | { |
| | |
| | | /// <summary> |
| | | /// 设备类型RowLayout |
| | | /// </summary> |
| | | private FrameLayout typeRowLayout; |
| | | //private FrameLayout typeRowLayout; |
| | | /// <summary> |
| | | /// 功能类型按钮 |
| | | /// </summary> |
| | | private FunctionButton functionTypeIMG; |
| | | //private FunctionButton functionTypeIMG; |
| | | /// <summary> |
| | | /// 温度 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | private int fanid; |
| | | |
| | | /// <summary> |
| | | /// dList |
| | | /// </summary> |
| | | private List<DeviceUI> devList; |
| | | /// <summary> |
| | | /// 相同类型的设备列表 |
| | | /// </summary> |
| | | private Dictionary<int, List<DeviceUI>> typeDeviceDic; |
| | | /// <summary> |
| | | /// 设备类型的图id |
| | | /// </summary> |
| | | private Dictionary<int, DeviceConcreteType> typeIdDic; |
| | | /// <summary> |
| | | /// 当前选中房间 |
| | | /// </summary> |
| | | private Common.Room curRoom; |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// RemoveFromParent |
| | | /// </summary> |
| | | public override void RemoveFromParent() |
| | | { |
| | | HomePage.Instance.ScrollEnabled = true; |
| | |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | InitData(); |
| | | |
| | | if (sceneTargetDevice == null) |
| | | { |
| | | sceneTargetDevice = new SceneTargetDeviceUI { Type = 0 }; |
| | |
| | | RefreshBodyView(Config.Instance.Home.CurrentFloorId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// InitData |
| | | /// </summary> |
| | | private void InitData() |
| | | { |
| | | typeDeviceDic = new Dictionary<int, List<DeviceUI>> { }; |
| | | typeIdDic = new Dictionary<int, DeviceConcreteType> { }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// RefreshData |
| | | /// </summary> |
| | | private void RefreshData(Common.Room room) |
| | | { |
| | | devList = room.DeviceUIList; |
| | | typeDeviceDic.Clear(); |
| | | typeIdDic.Clear(); |
| | | foreach (var device in devList) |
| | | { |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice }); |
| | | if (info.BeloneType == DeviceBeloneType.A开关 || info.BeloneType == DeviceBeloneType.A彩灯 |
| | | || info.BeloneType == DeviceBeloneType.A插座 || info.BeloneType == DeviceBeloneType.A智能空开 |
| | | || info.BeloneType == DeviceBeloneType.A灯光 || info.BeloneType == DeviceBeloneType.A空调 |
| | | || info.BeloneType == DeviceBeloneType.A窗帘 || info.BeloneType == DeviceBeloneType.A继电器) |
| | | { |
| | | if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false) |
| | | { |
| | | var sameDevList = new List<DeviceUI> { }; |
| | | sameDevList.Add(device); |
| | | typeDeviceDic[info.BeloneTextId] = sameDevList; |
| | | } |
| | | else |
| | | { |
| | | typeDeviceDic[info.BeloneTextId].Add(device); |
| | | } |
| | | typeIdDic[info.BeloneTextId] = info.ConcreteType; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region Add____________________________________ |
| | | /// <summary> |
| | |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddScence); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddFunction); |
| | | top.backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize=14, |
| | | IsBold=true |
| | | }; |
| | | |
| | | selectFloorBtn = new Button() |
| | |
| | | functionSceneBodyView = new FrameLayout() |
| | | { |
| | | Y = roomFL.Bottom, |
| | | Height = Application.GetRealHeight(910 + 622), |
| | | Height = Application.GetRealHeight(279+35+1218), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | }; |
| | | bodyFrameLayout.AddChidren(functionSceneBodyView); |
| | |
| | | { |
| | | roomBtn.IsSelected = true; |
| | | curBtn = roomBtn; |
| | | |
| | | this.curRoom = room; |
| | | RefreshFunction(room); |
| | | } |
| | | roomBtn.MouseUpEventHandler += (sender, e) => |
| | |
| | | (sender as Button).IsSelected = true; |
| | | curBtn.IsSelected = false; |
| | | curBtn = sender as Button; |
| | | |
| | | this.curRoom = room; |
| | | RefreshFunction(room); |
| | | }; |
| | | } |
| | |
| | | /// <param name="room"></param> |
| | | private void RefreshFunction(Common.Room room) |
| | | { |
| | | RefreshData(room); |
| | | functionSceneBodyView.RemoveAll(); |
| | | |
| | | if (room.DeviceUIList.Count == 0) |
| | | if (typeDeviceDic.Count == 0) |
| | | { |
| | | ShowNoFunctionTip(); |
| | | } |
| | | else |
| | | { |
| | | var functionTypeView1 = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Height = Application.GetRealHeight(160), |
| | | Width = Application.GetRealWidth(1028), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeView1); |
| | | functionTypeView1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); |
| | | |
| | | var functionTypeView2 = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = Application.GetRealHeight(150), |
| | | Height = Application.GetRealHeight(279 - 150), |
| | | Width = Application.GetRealWidth(1028), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeView2); |
| | | functionTypeView2.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); |
| | | |
| | | functionTypeScrowView = new HorizontalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Height = Application.GetRealHeight(279), |
| | | Width = Application.GetRealWidth(1028), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | Width = Application.GetRealWidth(1028) |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeScrowView); |
| | | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = functionTypeScrowView.Bottom + Application.GetRealHeight(50), |
| | | Y = Application.GetRealHeight(35 + 275), |
| | | Width = Application.GetRealWidth(1028), |
| | | Height = functionSceneBodyView.Height - Application.GetRealHeight(279 + 50) - 1, |
| | | Height = Application.GetRealHeight(1218), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(deviceListScrolView); |
| | | deviceListScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | tempFunctionTypeBtn = new FunctionButton(); |
| | | tempFunctionTypeBtn.Init("",""); |
| | | |
| | | EventHandler<MouseEventArgs> ShowSameTypeFunction = (object typeSender, MouseEventArgs mouseEventArgs) => |
| | | foreach (var deviceType in typeIdDic) |
| | | { |
| | | tempFunctionTypeBtn.IsSelected = false; |
| | | tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton; |
| | | ((typeSender as Button).Parent as FunctionButton).IsSelected = true; |
| | | |
| | | deviceListScrolView.RemoveAll(); |
| | | |
| | | var sameTypeList = new List<DeviceUI> { }; |
| | | foreach (var devieceUI in room.DeviceUIList) |
| | | var typeRowLayout = new FrameLayout() |
| | | { |
| | | if (devieceUI == null || devieceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (devieceUI.CommonDevice.Type.ToString() == (typeSender as Button).Tag.ToString()) |
| | | { |
| | | if (!sameTypeList.Contains(devieceUI)) |
| | | { |
| | | sameTypeList.Add(devieceUI); |
| | | } |
| | | } |
| | | } |
| | | foreach (var device in sameTypeList) |
| | | { |
| | | if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null) |
| | | { |
| | | continue; |
| | | } |
| | | var deviceTypeRowLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(127 + 35), |
| | | Tag = device |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new FunctionRow(0, 35); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | deviceRow.Init(device.IconPath, device.OnlineIconPath,true); |
| | | deviceRow.SetTitle(device.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetStatu(device.CommonDevice.IsOnline == 1); |
| | | deviceRow.HideSwitchBtn(false); |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ShowSelectAction(device, sceneTargetDevice); |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | foreach (var deviceType in Common.Room.GetdeviceTypes(room)) |
| | | { |
| | | typeRowLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(CommonPage.AppRealWidth / 5), |
| | | Tag = deviceType |
| | | Width = Application.GetRealWidth(220), |
| | | }; |
| | | functionTypeScrowView.AddChidren(typeRowLayout); |
| | | |
| | | functionTypeIMG = new FunctionButton() |
| | | var functionTypeIMG = new FunctionButton() |
| | | { |
| | | Tag = deviceType |
| | | Tag = deviceType.Key |
| | | }; |
| | | functionTypeIMG.Init(DeviceUI.GetDeviceTypeUnSelectedImagePath(deviceType), DeviceUI.GetDeviceTypeUnSelectedImagePath(deviceType)); |
| | | functionTypeIMG.SetTitle(DeviceUI.GetDeviceTypeName(deviceType)); |
| | | string imgPath = string.Empty; |
| | | string imgSeletedPath = string.Empty; |
| | | Common.LocalDevice.Current.GetDeviceBeloneIcon(deviceType.Value, ref imgPath, ref imgSeletedPath); |
| | | functionTypeIMG.Init(imgPath, imgSeletedPath); |
| | | functionTypeIMG.SetTitle(deviceType.Key); |
| | | typeRowLayout.AddChidren(functionTypeIMG); |
| | | |
| | | functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction; |
| | | |
| | | |
| | | if (deviceType == room.DeviceUIList[0].CommonDevice.Type) |
| | | if (functionTypeScrowView.ChildrenCount == 1) |
| | | { |
| | | ShowSameTypeFunction(functionTypeIMG.ClickBtn, null); |
| | | ShowSameTypeFunction(functionTypeIMG.ImageBtn, null); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示相同类型的功能 |
| | | /// </summary> |
| | | /// <param name="typeSender">typeSender.</param> |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void ShowSameTypeFunction(object typeSender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | tempFunctionTypeBtn.IsSelected = false; |
| | | tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton; |
| | | ((typeSender as Button).Parent as FunctionButton).IsSelected = true; |
| | | |
| | | deviceListScrolView.RemoveAll(); |
| | | |
| | | var sameTypeList = new List<DeviceUI> { }; |
| | | sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())]; |
| | | |
| | | foreach (var device in sameTypeList) |
| | | { |
| | | if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null) |
| | | { |
| | | continue; |
| | | } |
| | | var deviceTypeRowLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(127 + 35), |
| | | Tag = device |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new FunctionRow(0, 35); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | deviceRow.Init(device.IconPath, device.OnlineIconPath, true); |
| | | deviceRow.SetTitle(device.CommonDevice.DeviceEpointName); |
| | | deviceRow.IsSelected = true; |
| | | deviceRow.HideSwitchBtn(false); |
| | | |
| | | deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ShowSelectAction(device, sceneTargetDevice); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 提示没有功能 |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true |
| | |
| | | Height = Application.GetRealHeight(530), |
| | | }; |
| | | dialog.AddChidren(selectFL); |
| | | selectFL.Animate = Animate.DownToUp; |
| | | //selectFL.Animate = Animate.DownToUp; |
| | | |
| | | var titleBG = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(138 * 2), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | selectFL.AddChidren(titleBG); |
| | |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.Cancel |
| | | }; |
| | |
| | | Width = Application.GetRealWidth(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | Text = device.CommonDevice.DeviceEpointName |
| | | }; |
| | | titleFL.AddChidren(deviceName); |
| | |
| | | X = Application.GetRealWidth(800), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.Complete |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(752), |
| | | }; |
| | | dialog.AddChidren(selectFL); |
| | | selectFL.Animate = Animate.DownToUp; |
| | | //selectFL.Animate = Animate.DownToUp; |
| | | |
| | | var titleBG = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(138 * 2), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | selectFL.AddChidren(titleBG); |
| | |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.Cancel |
| | | }; |
| | |
| | | Width = Application.GetRealWidth(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 16, |
| | | Text = device.CommonDevice.DeviceEpointName |
| | | }; |
| | | titleFL.AddChidren(deviceName); |
| | |
| | | X = Application.GetRealWidth(800), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.Complete |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(752), |
| | | }; |
| | | dialog.AddChidren(selectFL); |
| | | selectFL.Animate = Animate.DownToUp; |
| | | //selectFL.Animate = Animate.DownToUp; |
| | | |
| | | var titleBG = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(138 * 2), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | selectFL.AddChidren(titleBG); |
| | |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.Cancel |
| | | }; |
| | |
| | | Width = Application.GetRealWidth(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15, |
| | | TextSize = 16, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = device.CommonDevice.DeviceEpointName |
| | | }; |
| | |
| | | X = Application.GetRealWidth(800), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.Complete |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(1106), |
| | | }; |
| | | dialog.AddChidren(selectFL); |
| | | selectFL.Animate = Animate.DownToUp; |
| | | //selectFL.Animate = Animate.DownToUp; |
| | | |
| | | var titleBG = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(138 * 2), |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | selectFL.AddChidren(titleBG); |
| | |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.Cancel |
| | | }; |
| | |
| | | Width = Application.GetRealWidth(400), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 15, |
| | | TextSize = 16, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = device.CommonDevice.DeviceEpointName |
| | | }; |
| | |
| | | X = Application.GetRealWidth(800), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | | TextSize = 15, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.Complete |
| | | }; |
| | |
| | | /// <summary> |
| | | /// BeforesceneTargetDeviceUIs |
| | | /// </summary> |
| | | public List<SceneTargetDeviceUI> beforeSceneTargetDeviceUIs=new List<SceneTargetDeviceUI> { }; |
| | | public List<SceneTargetDeviceUI> beforeSceneTargetDeviceUIs = new List<SceneTargetDeviceUI> { }; |
| | | /// <summary> |
| | | /// 楼层 |
| | | /// </summary> |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | |
| | | selectFloorBtn = new Button() |
| | |
| | | confirmBtn.SetTitle(R.MyInternationalizationString.Save); |
| | | confirmBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | sceneTargetDevice.ElseScenesId = sceneUI.Id ; |
| | | sceneTargetDevice.ElseScenesId = sceneUI.Id; |
| | | sceneTargetDevice.SceneUI = sceneUI; |
| | | sceneTargetDevice.SceneName = sceneUI.Name; |
| | | selectedAction?.Invoke(sceneTargetDevice); |
| | |
| | | functionSceneBodyView = new FrameLayout() |
| | | { |
| | | Y = roomFL.Bottom, |
| | | Height = Application.GetRealHeight(910+622), |
| | | Height = Application.GetRealHeight(1080 + 452), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | }; |
| | | bodyFrameLayout.AddChidren(functionSceneBodyView); |
| | |
| | | { |
| | | //Y = Application.GetRealHeight(58) |
| | | }; |
| | | |
| | | functionSceneBodyView.AddChidren(sceneScrolView); |
| | | SelectSceneRow tempSceneRow = new SelectSceneRow(); |
| | | EventHandler<MouseEventArgs> selectScene = (sender, e) => { |
| | | EventHandler<MouseEventArgs> selectScene = (sender, e) => |
| | | { |
| | | tempSceneRow.IsSelected = false; |
| | | tempSceneRow = ((sender as Button).Parent as SelectSceneRow); |
| | | ((sender as Button).Parent as SelectSceneRow).IsSelected = true; |
| | |
| | | sceneRowLayout.IsSelected = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | sceneRowLayout.ClickButton.MouseUpEventHandler += selectScene; |
| | | } |
| | | |
| | | if (sceneList.Count > 8) |
| | | { |
| | | var frame = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(300) |
| | | }; |
| | | sceneScrolView.AddChidren(frame); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 显示没有场景 |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true |
| | |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1022); |
| | | Height = Application.GetRealHeight(127); |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1022); |
| | | Height = Application.GetRealHeight(127); |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | TextID = R.MyInternationalizationString.Complete; |
| | | BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor; |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor; |
| | | IsBold = true; |
| | | TextSize = 16; |
| | | Gravity = Gravity.CenterHorizontal; |
| | | Radius = (uint)Application.GetRealHeight(height / 2); |
| | | } |
| | |
| | | Width = Application.GetMinRealAverage(100), |
| | | Height = Application.GetMinRealAverage(100), |
| | | Gravity = Gravity.CenterVertical, |
| | | SelectedImagePath="Item/Next.png", |
| | | UnSelectedImagePath= "Item/NextSelected.png" |
| | | SelectedImagePath= "Item/NextSelected.png", |
| | | UnSelectedImagePath= "Item/Next.png" |
| | | }; |
| | | AddChidren(NextBtn); |
| | | |
| | |
| | | Y = Application.GetRealHeight(y); |
| | | Width = Application.GetRealWidth(1080); |
| | | Height = Application.GetRealHeight(127); |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Tag = Tag |
| | | Tag = Tag, |
| | | TextSize=14 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | SelectBtn = new Button() |
| | |
| | | Visible = false |
| | | }; |
| | | AddChidren(SelectBtn); |
| | | |
| | | var line1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, |
| | | }; |
| | | AddChidren(line1); |
| | | |
| | | |
| | | ClickButton = new Button |
| | | { |
| | |
| | | line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(81), |
| | | Y = this.Height - 2, |
| | | Y = this.Height - 1, |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 2, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, |
| | | }; |
| | | AddChidren(line); |
| | |
| | | Height = Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = $"{(int)(SeekBar.Progress * 1.0 / MaxLevel * 100)} %", |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextSize=12 |
| | | }; |
| | | AddChidren(SeekBarTitle); |
| | | |
| | | line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(81), |
| | | Y = this.Height - 2, |
| | | Y = this.Height - 1, |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 2, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, |
| | | }; |
| | | AddChidren(line); |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=15 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | |
| | |
| | | Height = Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14 |
| | | }; |
| | | AddChidren(NameBtn); |
| | | |
| | |
| | | line = new Button() |
| | | { |
| | | X = Application.GetRealWidth(81), |
| | | Y = this.Height - 2, |
| | | Y = this.Height - 1, |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 2, |
| | | Height = 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor, |
| | | }; |
| | | AddChidren(line); |
| | |
| | | BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor |
| | | }; |
| | | selectFL.AddChidren(itemFL); |
| | | itemFL.Animate = Animate.DownToUp; |
| | | //itemFL.Animate = Animate.DownToUp; |
| | | |
| | | var selectLocalPicture = new Button() |
| | | { |
| | |
| | | /// bodyFrameLayout |
| | | /// </summary> |
| | | private FrameLayout bodyFrameLayout; |
| | | |
| | | private Button addBtn; |
| | | /// <summary> |
| | | /// top |
| | | /// </summary> |
| | | private TopFrameLayout top; |
| | | private Button selectAllBtn; |
| | | |
| | | private FrameLayout itemView; |
| | | /// <summary> |
| | | /// editStatus |
| | | /// </summary> |
| | | private bool SelectAll; |
| | | |
| | | /// <summary> |
| | | /// low_High |
| | | /// </summary> |
| | |
| | | private void RefreshData() |
| | | { |
| | | devList = Shared.Common.Room.CurrentRoom.GetUnalloctedDeviceUIs(); |
| | | sceneList = Shared.Common.Room.CurrentRoom.GetUnalloctedScenes(); |
| | | //sceneList = Shared.Common.Room.CurrentRoom.GetUnalloctedScenes(); |
| | | sceneList = Shared.Common.Room.CurrentRoom.GetLoveRoom().SceneUIList; |
| | | typeDeviceDic.Clear(); |
| | | typeIdDic.Clear(); |
| | | if (devList == null) |
| | | { |
| | | return; |
| | | } |
| | | foreach (var device in devList) |
| | | { |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice }); |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device?.CommonDevice }); |
| | | if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false) |
| | | { |
| | | var sameDevList = new List<DeviceUI> { }; |
| | |
| | | /// </summary> |
| | | public void AddTop() |
| | | { |
| | | var top = new TopFrameLayout(); |
| | | top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.Unallocated); |
| | |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | addBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1080-150-80), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(80), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = CommonFormResouce.TopTitle_TextSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.AllSelect |
| | | }; |
| | | top.topView.AddChidren(addBtn); |
| | | |
| | | addBtn.MouseUpEventHandler += Edit_MouseUpEventHandler; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | RefreshBodyView(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void Edit_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | SelectAll = !SelectAll; |
| | | if (SelectAll) |
| | | { |
| | | addBtn.TextID = R.MyInternationalizationString.Cancel; |
| | | } |
| | | else |
| | | { |
| | | addBtn.TextID = R.MyInternationalizationString.AllSelect; |
| | | } |
| | | |
| | | if (functionBtn.IsSelected) |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | ShowFunction(SelectAll); |
| | | } |
| | | else if (sceneBtn.IsSelected) |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | ShowScene(SelectAll); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 刷新____________________________ |
| | |
| | | public void RefreshBodyView() |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | SelectAll = false; |
| | | |
| | | if (functionBtn.IsSelected) |
| | | { |
| | | ShowFunction(SelectAll); |
| | | ShowFunction(); |
| | | } |
| | | else if (sceneBtn.IsSelected) |
| | | { |
| | | ShowScene(SelectAll); |
| | | ShowScene(); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 功能 |
| | | /// </summary> |
| | | public void ShowFunction(bool selectAll) |
| | | public void ShowFunction() |
| | | { |
| | | SelectAll = selectAll; |
| | | if (typeIdDic.Count == 0) |
| | | { |
| | | ShowNoFunctionTip(); |
| | |
| | | ShowSameTypeFunction(functionTypeIMG.ImageBtn, null); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | var selectedList = new List<DeviceUI> { }; |
| | | sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())]; |
| | | |
| | | if (SelectAll) |
| | | { |
| | | selectedList.AddRange(sameTypeList); |
| | | } |
| | | foreach (var deviceUI in sameTypeList) |
| | | { |
| | | var deviceTypeRowLayout = new FrameLayout() |
| | |
| | | var deviceRow = new SelectFunctionView(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.IsSelected = SelectAll; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | |
| | | } |
| | | }; |
| | | deviceRow.ClickBtn.MouseUpEventHandler += eventHandler; |
| | | |
| | | var addBackground = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1405), |
| | | Width = Application.GetMinRealAverage(1080), |
| | | Height = Application.GetMinRealAverage(202), |
| | | UnSelectedImagePath = "Room/AddBackground.png" |
| | | }; |
| | | functionSceneBodyView.AddChidren(addBackground); |
| | | var add = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1428), |
| | | Width = Application.GetRealWidth(1034), |
| | | Height = Application.GetRealHeight(156), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | TextID = R.MyInternationalizationString.AddTo, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextSize=17 |
| | | }; |
| | | functionSceneBodyView.AddChidren(add); |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | AddChidren(selectZone); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | { |
| | | foreach (var d in selectedList) |
| | | { |
| | | r.AddDevice(d.CommonDevice,true); |
| | | deviceListScrolView.RemoveViewByTag(d); |
| | | } |
| | | RefreshData(); |
| | | }; |
| | | }; |
| | | } |
| | | |
| | | selectAllBtn?.RemoveFromParent(); |
| | | selectAllBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1080 - 150 - 80), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(80), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = CommonFormResouce.TopTitle_TextSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.AllSelect |
| | | }; |
| | | top.topView.AddChidren(selectAllBtn); |
| | | selectAllBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | try |
| | | { |
| | | (sender as Button).IsSelected = !(sender as Button).IsSelected; |
| | | for (int i = 0; i < deviceListScrolView.ChildrenCount; i++) |
| | | { |
| | | var frame = deviceListScrolView.GetChildren(i) as FrameLayout; |
| | | (frame.GetChildren(0) as SelectFunctionView).IsSelected = (sender as Button).IsSelected; |
| | | } |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.Cancel; |
| | | selectedList.AddRange(sameTypeList); |
| | | } |
| | | else |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.AllSelect; |
| | | selectedList.Clear(); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | }; |
| | | |
| | | var addBackground = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1405), |
| | | Width = Application.GetMinRealAverage(1080), |
| | | Height = Application.GetMinRealAverage(202), |
| | | UnSelectedImagePath = "Room/AddBackground.png" |
| | | }; |
| | | functionSceneBodyView.AddChidren(addBackground); |
| | | var add = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1428), |
| | | Width = Application.GetRealWidth(1034), |
| | | Height = Application.GetRealHeight(156), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor4, |
| | | Radius = (uint)Application.GetRealHeight(35), |
| | | TextID = R.MyInternationalizationString.AddTo, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextSize = 17 |
| | | }; |
| | | functionSceneBodyView.AddChidren(add); |
| | | add.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var selectZone = new SelectZone(); |
| | | AddChidren(selectZone); |
| | | selectZone.Init(); |
| | | selectZone.ZoneAction = (r) => |
| | | { |
| | | foreach (var d in selectedList) |
| | | { |
| | | r.AddDevice(d.CommonDevice, true); |
| | | deviceListScrolView.RemoveViewByTag(d); |
| | | } |
| | | RefreshData(); |
| | | }; |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 选择场景--所有房间的所有场景 |
| | | /// </summary> |
| | | public void ShowScene(bool selectAll) |
| | | public void ShowScene() |
| | | { |
| | | List<SceneUI> selectedList = new List<SceneUI>(); |
| | | if(selectAll) |
| | | { |
| | | selectedList.AddRange(sceneList); |
| | | } |
| | | if (sceneList == null || sceneList.Count == 0) |
| | | { |
| | | ShowNoSceneTip(); |
| | |
| | | Height = Application.GetMinRealAverage(60), |
| | | UnSelectedImagePath = "Room/ItemUnSelected.png", |
| | | SelectedImagePath = "Room/ItemSelected.png", |
| | | IsSelected = selectAll |
| | | }; |
| | | sceneFL.AddChidren(selectedBtn); |
| | | |
| | |
| | | sceneImg.MouseUpEventHandler += eventHandler; |
| | | } |
| | | |
| | | selectAllBtn?.RemoveFromParent(); |
| | | selectAllBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1080 - 150 - 80), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(80), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize = CommonFormResouce.TopTitle_TextSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextID = R.MyInternationalizationString.AllSelect |
| | | }; |
| | | top.topView.AddChidren(selectAllBtn); |
| | | selectAllBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | try |
| | | { |
| | | (sender as Button).IsSelected = !(sender as Button).IsSelected; |
| | | for (int i = 0; i < sceneScrolView.ChildrenCount; i++) |
| | | { |
| | | var frame = sceneScrolView.GetChildren(i) as FrameLayout; |
| | | (frame.GetChildren(1) as Button).IsSelected = (sender as Button).IsSelected; |
| | | } |
| | | |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.Cancel; |
| | | selectedList.AddRange(sceneList); |
| | | } |
| | | else |
| | | { |
| | | (sender as Button).TextID = R.MyInternationalizationString.AllSelect; |
| | | selectedList.Clear(); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | }; |
| | | |
| | | var addBackground = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1405), |
| | |
| | | /// sceneScrolView |
| | | /// </summary> |
| | | private VerticalScrolViewLayout sceneScrolView ; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 接口____________________________ |
| | |
| | | } |
| | | else |
| | | { |
| | | var dList = new List<DeviceUI> { }; |
| | | foreach(var device in deviceList) |
| | | { |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice }); |
| | | if (info.BeloneType == DeviceBeloneType.A干接点 || info.BeloneType == DeviceBeloneType.A中继器) |
| | | { |
| | | continue; |
| | | } |
| | | dList.Add(device); |
| | | } |
| | | |
| | | deviceVerticalScrolViewLayout = new VerticalScrolViewLayout { }; |
| | | functionSceneBodyView.AddChidren(deviceVerticalScrolViewLayout); |
| | | for (int i = 0; i < deviceList.Count; i++) |
| | | for (int i = 0; i < dList.Count; i++) |
| | | { |
| | | var device = deviceList[i]; |
| | | var device = dList[i]; |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | Application.RunOnMainThread(() => |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | |
| | | /// 确定要移除该功能? |
| | | /// </summary> |
| | | public const int DeleteFunction = 11034; |
| | | /// <summary> |
| | | /// 添加功能 |
| | | /// </summary> |
| | | public const int AddFunction = 11035; |
| | | /// <summary> |
| | | /// 添加延时 |
| | | /// </summary> |
| | | public const int AddDelayTime = 11036; |
| | | |
| | | #region 设备类型 |
| | | /// <summary> |