| | |
| | | /// <returns></returns>
|
| | | public bool DeviceIsCanFixedPosition(CommonDevice device)
|
| | | {
|
| | | if (device.Type == DeviceType.DoorLock)
|
| | | {
|
| | | //门锁没有定位功能
|
| | | return false;
|
| | | }
|
| | | if (device.Type == DeviceType.IASZone)
|
| | | {
|
| | | var myTypeInfo = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_Pir)
|
| | | {
|
| | | //传感器除了Pir都没有定位功能
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | foreach (var data in device.InClusterList)
|
| | | {
|
| | | //拥有on/off功能的,才支持测试
|
| | |
| | | return this.GetDeviceMacName(device);
|
| | | }
|
| | |
|
| | | //同一设备里面,不同类型的回路,它的命名都从1开始
|
| | | int epointNo = 0;
|
| | | var listSort = this.GetDevicesByMac(device.DeviceAddr);
|
| | | foreach (var myDevice in listSort)
|
| | | {
|
| | | if (myDevice.Type == device.Type)
|
| | | {
|
| | | //同一类型编号+1
|
| | | epointNo++;
|
| | | if (myDevice.DeviceEpoint == device.DeviceEpoint)
|
| | | {
|
| | | //已经到达它自己
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (device.Type == DeviceType.OnOffOutput
|
| | | || device.Type == DeviceType.DimmableLight || device.Type == DeviceType.ColorDimmableLight)
|
| | | {
|
| | | //继电器,掉光器都叫回路
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + epointNo;
|
| | | }
|
| | | else if (device.Type == DeviceType.Thermostat)
|
| | | if (device.Type == DeviceType.Thermostat)
|
| | | {
|
| | | //空调都叫室内机
|
| | | return Language.StringByID(R.MyInternationalizationString.uIndoorUnit) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uIndoorUnit) + epointNo;
|
| | | }
|
| | | else if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | //新风面板中的按键叫新风
|
| | | return Language.StringByID(R.MyInternationalizationString.FreshAir);
|
| | | }
|
| | | else if (device.Type == DeviceType.FreshAirHumiditySensor)
|
| | | {
|
| | | //新风面板湿度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.HumiditySensor);
|
| | | }
|
| | |
|
| | | //获取设备类型
|
| | | var deviceInfoType = this.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (device.Type == DeviceType.OnOffSwitch)
|
| | |
| | | //面板的干接点叫按键
|
| | | if (deviceInfoType.BeloneType == DeviceBeloneType.A按键面板)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uPanelButton) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uPanelButton) + epointNo;
|
| | | }
|
| | | //其他的干接点叫干接点
|
| | | else
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceBelongId16) + device.DeviceEpoint;
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceBelongId16) + epointNo;
|
| | | }
|
| | | }
|
| | | else if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | if (deviceInfoType.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | | //新风面板中的Thermostat为温度传感器
|
| | | return Language.StringByID(R.MyInternationalizationString.TemperatureSensor);
|
| | | }
|
| | | else if (deviceInfoType.BeloneType == DeviceBeloneType.A按键面板)
|
| | | {
|
| | | //面板的温度探头叫 面板名字+温度
|
| | | return Language.StringByID(deviceInfoType.DefultNameId) + Language.StringByID(R.MyInternationalizationString.uTemperature);
|
| | | }
|
| | | }
|
| | | //其他情况,使用它的默认名称
|
| | | return Language.StringByID(deviceInfoType.DefultNameId) + device.DeviceEpoint;
|
| | | return Language.StringByID(deviceInfoType.DefultNameId) + epointNo;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | //默认值
|
| | | info.ConcreteTextId = R.MyInternationalizationString.uDeviceBelongId4100;
|
| | | info.BeloneType = DeviceBeloneType.A智能空开;
|
| | | info.BeloneType = DeviceBeloneType.A开关;
|
| | | info.ConcreteType = DeviceConcreteType.AirSwitch;
|
| | | info.ObjectTypeNameId = 60001;//开关模块
|
| | |
|
| | |
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom);
|
| | | }
|
| | | var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[device.DeviceAddr]);
|
| | | if (room != null)
|
| | | {
|
| | | return room.Name;
|
| | | }
|
| | | //未分配区域
|
| | | return Language.StringByID(R.MyInternationalizationString.uDeviceNotAssignedRoom);
|
| | | return HdlRoomLogic.Current.GetFloorRoomName(room);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | //这个设备不见了
|
| | | return false;
|
| | | }
|
| | | if (i_device.Type == DeviceType.OnOffOutput && i_device.DfunctionType == DeviceFunctionType.A未定义)
|
| | | if (i_device.Type == DeviceType.OnOffOutput || i_device.Type == DeviceType.AirSwitch)
|
| | | {
|
| | | //2020.03.23追加式样:未指定类型的继电器,不显示
|
| | | return false;
|
| | | if (i_device.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | | 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)
|
| | |
| | | var listCheck = new HashSet<string>();
|
| | | Action<string, string> getDeviceAction = (topic, message) =>
|
| | | {
|
| | | if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | if (topic == gatewayID + "/DeviceInfoRespon")
|
| | | {
|
| | | try
|
| | | {
|
| | |
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | }
|
| | | }
|
| | | else if (topic == gatewayID + "/DeviceInfoResponEnd")
|
| | | {
|
| | | }
|
| | | };
|
| | |
|
| | |
| | | mainDevice.IconPath = "Device/Light.png";
|
| | | }
|
| | | }
|
| | | //如果是三路继电器的回路的话,默认为灯光
|
| | | else if (mainDevice.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | var myType = this.GetHdlMyDeviceEnumInfo(mainDevice);
|
| | | if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad)
|
| | | {
|
| | | if (mainDevice.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A灯光;
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/Light.png";
|
| | | }
|
| | | }
|
| | | }
|
| | | //如果是空气开关的话
|
| | | else if (mainDevice.Type == DeviceType.AirSwitch)
|
| | | {
|
| | |
| | | if (mainDevice.DfunctionType == DeviceFunctionType.A未定义)
|
| | | {
|
| | | mainDevice.DfunctionType = DeviceFunctionType.A开关;
|
| | | }
|
| | | if (mainDevice.IsCustomizeImage == false)
|
| | | {
|
| | | mainDevice.IconPath = "Device/Switch.png";
|
| | | }
|
| | | }
|
| | | //如果是彩灯的话
|
| | |
| | | else if (deviceType == DeviceType.IASZone) { device = new IASZone(); }
|
| | | else if (deviceType == DeviceType.Repeater) { device = new Repeater(); }
|
| | | else if (deviceType == DeviceType.Thermostat) { device = new AC(); }
|
| | | else if (deviceType == DeviceType.FreshAir) { device = new FreshAir(); }
|
| | | else if (deviceType == DeviceType.DoorLock) { device = new DoorLock(); }
|
| | | else if (deviceType == DeviceType.TemperatureSensor) { device = new TemperatureSensor(); }
|
| | | else if (deviceType == DeviceType.FreshAirHumiditySensor) { device = new HumiditySensor(); }
|
| | | else if (deviceType == DeviceType.OtaDevice || deviceType == DeviceType.OtaPanelDevice) { device = new OTADevice(); }
|
| | | else { return null; }
|
| | |
|
| | |
| | |
|
| | | //前言:因为zigbeehome的设备拥有四种名字:
|
| | | //1、设备官方名称 ----它由DeviceConcreteType的数值所决定(个人中心专用)
|
| | | //2、设备入网后的默认名称 ----它不需要再代码里面定义,它直接在Language文件里面定义
|
| | | //2、设备入网后的默认名称 ----它不需要在代码里面定义,它直接在Language文件里面定义
|
| | | // 范围:50000开始,它的规则是DeviceConcreteType对应的R文件里面的ID的数值+20000,
|
| | | //3、设备所属名称 ----它有DeviceBeloneType的数值所决定
|
| | | //4、设备类型名称 ----它由【设备类型的翻译ID】所决定,这个值是个人中心专用,
|
| | |
| | | this.dicDeviceModelIdEnum["MSPIR01-ZB.10"] = "1200-1200-60000";//pir传感器220
|
| | |
|
| | | //=========★★安防类传感器类(1300-2299)★★=========
|
| | | //这里是麦乐克的
|
| | | this.dicDeviceModelIdEnum["MULTI-GASE--EA07"] = "1300-1300-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MECI--EA01"] = "1301-1300-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-FIRE--EA05"] = "1302-1300-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MOTI--EA04"] = "1303-1300-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-WATE--EA02"] = "1304-1300-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-BURO--EA06"] = "1305-1300-60000";//紧急按键
|
| | | //这里是河东的
|
| | | this.dicDeviceModelIdEnum["MSG01/M-ZB.10"] = "1300-1300-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MSDC01/M-ZB.10"] = "1301-1300-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MSS01/M-ZB.10"] = "1302-1300-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1300-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1300-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1300-60000";//紧急按键
|
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3路继电器小模块
|
| | | this.dicDeviceModelIdEnum["MFA01-ZB1.0"] = "2310-2300-60001";//方悦新风小模块
|
| | | this.dicDeviceModelIdEnum["MFA01-ZB.10"] = "2310-2300-60011";//方悦新风小模块
|
| | |
|
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | this.dicDeviceModelIdEnum["MPD0101-ZB.10"] = "2500-2500-60007";//1路调光器小模块
|
| | |
| | | this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//简约3按键面板 沿用 3按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleTwo"] = "ButtonPanel_Two";//简约2按键面板 沿用 2按键的图标
|
| | | this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-one的门锁图片沿用H06C的图标
|
| | | this.dicPictrueShard["Relay_FangyueFreshAirModul"] = "Relay_ThreeLoad";//方悦新风小模块图片沿用3路继电器的图标
|
| | |
|
| | | }
|
| | |
|