Merge branch 'CJL' into NewFilePath
| | |
| | | 9049=密码连续输错次数已达到10次,用户已被锁定,请次日0点后再登陆 |
| | | 9050=验证面容ID |
| | | 9051=保存用户头像失败 |
| | | 9052=推送注册正常 |
| | | 9053=推送注册异常 |
| | | 9054=数字密码验证 |
| | | 9055=绘制手势验证 |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | | 10001=请求服务器失败,请稍后再试! |
| | |
| | | 9049=密码连续输错次数已达到10次,用户已被锁定,请次日0点后再登陆 |
| | | 9050=验证面容ID |
| | | 9051=保存用户头像失败 |
| | | 9052=推送注册正常 |
| | | 9053=推送注册异常 |
| | | 9054=数字密码验证 |
| | | 9055=绘制手势验证 |
| | | |
| | | 10000=无效登录密钥,请重新登录! |
| | | 10001=请求服务器失败,请稍后再试! |
| | |
| | | /// 保存用户头像失败 |
| | | /// </summary> |
| | | public const int FailedToSaveUserImage = 9051; |
| | | /// <summary> |
| | | /// 推送注册正常 |
| | | /// </summary> |
| | | public const int PushNormal = 9052; |
| | | /// <summary> |
| | | /// 推送注册异常 |
| | | /// </summary> |
| | | public const int PushException = 9053; |
| | | /// <summary> |
| | | /// 数字密码验证 |
| | | /// </summary> |
| | | public const int PasswordVerification = 9054; |
| | | /// <summary> |
| | | /// 绘制手势验证 |
| | | /// </summary> |
| | | public const int GestureVerification = 9055; |
| | | |
| | | |
| | | |
| | | #region 网络请求响应错误提示信息 |
| | |
| | | { |
| | | function.usageCount++; |
| | | function.refreshTime = DateTime.Now; |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | |
| | | //远程通讯 |
| | | if (Ins.IsRemote) |
| | | { |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | var apiControlData = function.GetApiControlData(commandDictionary); |
| | | var actionObjs = new List<ApiAlinkControlActionObj>(); |
| | |
| | | curtainState = 2; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, |
| | | new byte[] { f.localFunction.bus_Data.loopId, curtainState }); |
| | | ControlBytesSend(Command.SetCurtainModelStutas, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, |
| | | new byte[] { f.localFunction.bus.loopId, curtainState }); |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, new byte[] { 3, tempAc.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, f.localFunction.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, new byte[] { 6, tempAc.curModeIndex, f.localFunction.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, new byte[] { 5, tempAc.curFanIndex, f.localFunction.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, new byte[] { modeKey, Convert.ToByte(tempAc.trait_temp.curValue), f.localFunction.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 3, tempAc.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, f.localFunction.bus.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 6, tempAc.curModeIndex, f.localFunction.bus.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { 5, tempAc.curFanIndex, f.localFunction.bus.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { modeKey, Convert.ToByte(tempAc.trait_temp.curValue), f.localFunction.bus.loopId }); |
| | | } |
| | | break; |
| | | case FunctionType.Relay: |
| | |
| | | break; |
| | | } |
| | | } |
| | | ControlBytesSend(Command.SetSingleLight, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, |
| | | new byte[] { f.localFunction.bus_Data.loopId, brightness }); |
| | | ControlBytesSend(Command.SetSingleLight, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, |
| | | new byte[] { f.localFunction.bus.loopId, brightness }); |
| | | break; |
| | | case FunctionType.RGB: |
| | | break; |
| | |
| | | } |
| | | } |
| | | byte b1 = tempFh.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0; |
| | | ControlBytesSend(Command.SetFloorHeat, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, new byte[] { |
| | | f. localFunction.bus_Data.loopId, b1, 0, tempFh.curModeIndex, Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), 0, 0 }); |
| | | ControlBytesSend(Command.SetFloorHeat, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, new byte[] { |
| | | f. localFunction.bus.loopId, b1, 0, tempFh.curModeIndex, Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), Convert.ToByte( tempFh.trait_temp.curValue), 0, 0 }); |
| | | break; |
| | | case FunctionType.Socket: |
| | | foreach (var attr in f.status) |
| | |
| | | onOffValue = 2; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.SetSingleLight, f.localFunction.bus_Data.SubnetID, f.localFunction.bus_Data.DeviceID, |
| | | new byte[] { f.localFunction.bus_Data.loopId, onOffValue }); |
| | | ControlBytesSend(Command.SetSingleLight, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID, |
| | | new byte[] { f.localFunction.bus.loopId, onOffValue }); |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | var subnetId = function.bus_Data.SubnetID; |
| | | var deviceId = function.bus_Data.DeviceID; |
| | | var loopId = function.bus_Data.loopId; |
| | | var subnetId = function.bus.SubnetID; |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.loopId; |
| | | |
| | | switch (function.functionCategory) |
| | | { |
| | |
| | | { |
| | | b = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness; |
| | | } |
| | | var bytes = new byte[] { function.bus_Data.loopId, |
| | | var bytes = new byte[] { function.bus.loopId, |
| | | b, |
| | | 254, 0,Convert.ToByte(light.fadeTime) ,3, |
| | | (byte)light.RedColor,(byte)light.GreenColor, |
| | |
| | | b1 = (byte)light.brightness == 0 ? (byte)100 : (byte)light.brightness; |
| | | } |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { |
| | | function.bus_Data.loopId, |
| | | function.bus.loopId, |
| | | b1, |
| | | 0, Convert.ToByte(light.fadeTime) }); |
| | | //DimmerPage.UpdataStates(light); |
| | | break; |
| | | case FunctionType.Relay: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus_Data.loopId, light.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.loopId, light.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); |
| | | //RelayPage.UpdataState(light); |
| | | break; |
| | | } |
| | |
| | | { |
| | | b1 = 2; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus_Data.loopId, b1 }); |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus.loopId, b1 }); |
| | | break; |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | |
| | | //{ |
| | | if (curtain.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus_Data.loopId, 0 }); |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { curtain.bus.loopId, 0 }); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | case FunctionType.AC: |
| | | var aC = function as AC; |
| | | ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus_Data.loopId, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, Convert.ToByte(aC.trait_temp.curValue), 0 }); |
| | | ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { aC.bus.loopId, (byte)aC.curTempType, 32, 32, 32, 32, 32, 0, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.curModeIndex, aC.curFanIndex, Convert.ToByte(aC.trait_temp.curValue), 0 }); |
| | | //ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.on_off == "on" ? (byte)1 : (byte)0, aC.bus_Data.loopId }); |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | switch (dic.Key) |
| | | { |
| | | case "on_off": |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 3, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 3, aC.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, aC.bus.loopId }); |
| | | break; |
| | | case "mode": |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 6, aC.curModeIndex, aC.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 6, aC.curModeIndex, aC.bus.loopId }); |
| | | break; |
| | | case "fan": |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { 5, aC.curFanIndex, aC.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { 5, aC.curFanIndex, aC.bus.loopId }); |
| | | break; |
| | | case "temp": |
| | | byte modeKey = 4; |
| | |
| | | modeKey = 2; |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus_Data.SubnetID, aC.bus_Data.DeviceID, new byte[] { modeKey, Convert.ToByte(aC.trait_temp.curValue), aC.bus_Data.loopId }); |
| | | ControlBytesSend(Command.InstructionPanelKey, aC.bus.SubnetID, aC.bus.DeviceID, new byte[] { modeKey, Convert.ToByte(aC.trait_temp.curValue), aC.bus.loopId }); |
| | | break; |
| | | default: |
| | | MainPage.Log($"功能未支持 : {dic.Key}"); |
| | |
| | | break; |
| | | } |
| | | } |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { fh.bus_Data.loopId, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["normal"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 }); |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { fh.bus.loopId, b1, (byte)fh.curTempType, fh.curModeIndex, fh.modeTemp["normal"], fh.modeTemp["day"], fh.modeTemp["night"], fh.modeTemp["away"], 0, 0 }); |
| | | } |
| | | break; |
| | | } |
| | |
| | | var fan = function as Fan; |
| | | if (fan.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus_Data.loopId, (byte)fan.openLevel }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.loopId, (byte)fan.openLevel }); |
| | | } |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus_Data.loopId, 0 }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.loopId, 0 }); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | case FunctionType.Socket: |
| | | var s = function as SwitchSocket; |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus_Data.loopId, s.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus.loopId, s.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 }); |
| | | break; |
| | | } |
| | | break; |
| | |
| | | { |
| | | try |
| | | { |
| | | var subnetId = function.bus_Data.SubnetID; |
| | | var deviceId = function.bus_Data.DeviceID; |
| | | var loopId = function.bus_Data.loopId; |
| | | var subnetId = function.bus.SubnetID; |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.loopId; |
| | | |
| | | switch (function.functionCategory) |
| | | { |
| | |
| | | ControlBytesSend(Command.ReadLightAllLoopBrightness, subnetId, deviceId, new byte[] { }); |
| | | break; |
| | | case FunctionType.RGB: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus_Data.loopId }); |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.loopId }); |
| | | break; |
| | | } |
| | | break; |
| | |
| | | case FunctionType.Curtain: |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus_Data.loopId }); |
| | | ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus.loopId }); |
| | | break; |
| | | } |
| | | break; |
| | |
| | | switch (function.functionType) |
| | | { |
| | | case FunctionType.AC: |
| | | ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus_Data.loopId }); |
| | | ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus.loopId }); |
| | | break; |
| | | case FunctionType.FloorHeating: |
| | | ControlBytesSend(Command.ReadFloorHeat, subnetId, deviceId, new byte[] { function.bus_Data.loopId }); |
| | | ControlBytesSend(Command.ReadFloorHeat, subnetId, deviceId, new byte[] { function.bus.loopId }); |
| | | break; |
| | | } |
| | | break; |
| | |
| | | { |
| | | case FunctionType.Fan: |
| | | var fan = function as Fan; |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus_Data.loopId }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { fan.bus.loopId }); |
| | | break; |
| | | } |
| | | break; |
| | |
| | | { |
| | | case FunctionType.Socket: |
| | | var s = function as SwitchSocket; |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus_Data.loopId }); |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { s.bus.loopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Sensor: |
| | | var sensor = function as Sensor; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { (byte)5, |
| | | (byte)((int)sensor.functionType % 256), sensor.bus_Data.loopId }); |
| | | (byte)((int)sensor.functionType % 256), sensor.bus.loopId }); |
| | | break; |
| | | } |
| | | } |
| | |
| | | case Command.ReadLightAllLoopBrightnessACK: |
| | | for (int i = 0; i < receiveBytes[0]; i++) |
| | | { |
| | | var light = FunctionList.List.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == (i + 1)); |
| | | var light = FunctionList.List.lights.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == (i + 1)); |
| | | if (light != null) |
| | | { |
| | | if (light.functionType != FunctionType.RGB) |
| | | { |
| | | light.trait_on_off.curValue = receiveBytes[light.bus_Data.loopId] == 0 ? "off" : "on"; |
| | | light.trait_on_off.curValue = receiveBytes[light.bus.loopId] == 0 ? "off" : "on"; |
| | | if (light.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | light.brightness = receiveBytes[2]; |
| | |
| | | } |
| | | else |
| | | { |
| | | var e = FunctionList.List.electricals.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.loopId == i); |
| | | var e = FunctionList.List.electricals.Find((obj) => obj.bus.SubnetID == subnetID && obj.bus.DeviceID == deviceID && obj.bus.loopId == i); |
| | | if (e != null) |
| | | { |
| | | var fan = e as Fan; |
| | |
| | | case Command.ReadCurtainStutasACK: |
| | | foreach (var curtain in FunctionList.List.curtains) |
| | | { |
| | | if (curtain.bus_Data.SubnetID == subnetID && curtain.bus_Data.DeviceID == deviceID) |
| | | if (curtain.bus.SubnetID == subnetID && curtain.bus.DeviceID == deviceID) |
| | | { |
| | | if (receiveBytes[0] == 17) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if (curtain.bus_Data.loopId != receiveBytes[0]) |
| | | if (curtain.bus.loopId != receiveBytes[0]) |
| | | continue; |
| | | switch (receiveBytes[1]) |
| | | { |
| | |
| | | string tag = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2]; |
| | | foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (sensor.bus_Data != null) |
| | | if (sensor.bus != null) |
| | | { |
| | | if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID && |
| | | sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2]) |
| | | if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID && |
| | | sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2]) |
| | | { |
| | | switch (dt) |
| | | { |
| | |
| | | string tag1 = receiveBytes[1] + "_" + subnetID + "_" + deviceID + "_" + receiveBytes[2]; |
| | | foreach (var sensor in FunctionList.List.sensorsEnvironmentalScience) |
| | | { |
| | | if (sensor.bus_Data != null) |
| | | if (sensor.bus != null) |
| | | { |
| | | if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus_Data.SubnetID == subnetID && |
| | | sensor.bus_Data.DeviceID == deviceID && sensor.bus_Data.loopId == receiveBytes[2]) |
| | | if ((int)sensor.functionType % 256 == receiveBytes[1] && sensor.bus.SubnetID == subnetID && |
| | | sensor.bus.DeviceID == deviceID && sensor.bus.loopId == receiveBytes[2]) |
| | | { |
| | | //0保留 1无符号4Byte整形 2有符号4Byte整形 3Float形(代±) |
| | | switch (receiveBytes[3]) |
| | |
| | | homeRegionName = mHome.homeRegionName, |
| | | homeRegionId = mHome.homeRegionId, |
| | | Address = mHome.homeAddress, |
| | | isAllowCreateScene = mHome.isAllowCreateScene, |
| | | }; |
| | | UserInfo.Current.regionList.Add(home); |
| | | } |
| | |
| | | /// bus协议数据格式 |
| | | /// 使用A协议控制时,改属性为空 |
| | | /// </summary> |
| | | public BusData bus_Data; |
| | | public BusData bus; |
| | | /// <summary> |
| | | /// 是否收藏 |
| | | /// </summary> |
| | |
| | | public string GetBusId() |
| | | { |
| | | string busId = ""; |
| | | if (bus_Data != null) |
| | | if (bus != null) |
| | | { |
| | | busId = bus_Data.SubnetID + "_" + bus_Data.DeviceID + "_" + bus_Data.loopId; |
| | | busId = bus.SubnetID + "_" + bus.DeviceID + "_" + bus.loopId; |
| | | } |
| | | return busId; |
| | | } |
| | |
| | | { |
| | | int RandKey = new Random().Next(0, 255); |
| | | var textByte = (byte)iCode; |
| | | Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus_Data.SubnetID, bus_Data.DeviceID, new byte[] { 1, bus_Data.loopId, textByte, 0, 0, (byte)RandKey }, 0); |
| | | Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.loopId, textByte, 0, 0, (byte)RandKey }, 0); |
| | | } |
| | | public void ControlTV(int number) |
| | | { |
| | |
| | | { |
| | | textByte = 18; |
| | | } |
| | | Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus_Data.SubnetID, bus_Data.DeviceID, new byte[] { 1, bus_Data.loopId, textByte, 0, 0, (byte)RandKey }, 0); |
| | | Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.loopId, textByte, 0, 0, (byte)RandKey }, 0); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// 住宅区域名字 |
| | | /// </summary> |
| | | public string homeRegionName; |
| | | /// <summary> |
| | | /// 是否允许创建场景 |
| | | /// </summary> |
| | | public bool isAllowCreateScene; |
| | | ///// <summary> |
| | | ///// 是否绑定网关 |
| | | ///// </summary> |
| | |
| | | /// 住宅地址 |
| | | /// </summary>
|
| | | public string homeAddress; |
| | | /// <summary> |
| | | /// 是否允许创建场景 |
| | | /// </summary> |
| | | public bool isAllowCreateScene; |
| | | }
|
| | | }
|
| | |
| | | UserInfo.Current.unlockTime = DateTime.Now; |
| | | }; |
| | | |
| | | //提示数字密码验证还是绘制手势验证 |
| | | string verificationTitleString = GetVerificationTitleString(); |
| | | |
| | | //弹出指纹验证对话框 |
| | | Action fingerAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | }; |
| | | //加载UI页面 |
| | | LoadGesturePage("7", fingerAction, null); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | |
| | | UserInfo.Current.unlockTime = DateTime.Now; |
| | | }; |
| | | |
| | | //提示数字密码验证还是绘制手势验证 |
| | | string verificationTitleString = GetVerificationTitleString(); |
| | | |
| | | //弹出指纹验证对话框 |
| | | Action faceIDAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); |
| | | }; |
| | | //加载UI页面 |
| | | LoadFaceIDGesturePage("7", faceIDAction, null); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否数字验证、否则绘制手势验证 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | bool CheckIfUnlockPassword() |
| | | { |
| | | return UserInfo.Current.appUnlockType.Contains("1"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否数字验证、否则绘制手势验证 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | string GetVerificationTitleString() |
| | | { |
| | | if (CheckIfUnlockPassword()) |
| | | { |
| | | return Language.StringByID(StringId.PasswordVerification); |
| | | } |
| | | else |
| | | { |
| | | return Language.StringByID(StringId.GestureVerification); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnSetting); |
| | | |
| | | //如果是成员隐藏编辑功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | contentView.AddChidren(btnSetting); |
| | | } |
| | | btnSetting.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | editAction(); |
| | |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnSetting); |
| | | //如果是成员隐藏编辑功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | contentView.AddChidren(btnSetting); |
| | | } |
| | | |
| | | btnSetting.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | Height = Application.GetMinRealAverage(28), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnSetting); |
| | | |
| | | //如果是成员隐藏编辑功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | contentView.AddChidren(btnSetting); |
| | | } |
| | | |
| | | btnSetting.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | { |
| | | var oidNetId = Convert.ToByte(oid.addresses.Substring(0, 2),16); |
| | | var oidDevId = Convert.ToByte(oid.addresses.Substring(2, 2),16); |
| | | sidObj.bus_Data = new BusData(); |
| | | sidObj.bus_Data.loopId = Convert.ToByte(sidObj.sid.Substring(20, 4),16); |
| | | sidObj.bus = new BusData(); |
| | | sidObj.bus.loopId = Convert.ToByte(sidObj.sid.Substring(20, 4),16); |
| | | } |
| | | FunctionList.List.AddDeviceFunction(sidObj); |
| | | } |
| | |
| | | SelectedImagePath = "Collection/CollectionWhiteIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionIcon.png", |
| | | }; |
| | | view.AddChidren(btnCollection); |
| | | //view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | view.AddChidren(btnCollection); |
| | | } |
| | | |
| | | LoadEvent_FunctionCollection(btnCollection, function); |
| | | |
| | | if (function.functionCategory == FunctionCategory.Curtain) |
| | |
| | | SelectedImagePath = "Collection/CollectionWhiteIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionIcon.png", |
| | | }; |
| | | view.AddChidren(btnCollection); |
| | | //view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | view.AddChidren(btnCollection); |
| | | } |
| | | |
| | | LoadEvent_SceneCollection(btnCollection, scene); |
| | | |
| | | LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene); |
| | |
| | | MenuButtonSelect(0); |
| | | }; |
| | | allMenuButton.SelectAction = allAction; |
| | | |
| | | #if DEBUG |
| | | //测试提前当前推送ID |
| | | allMenuButton.ImageButton.MouseLongEventHandler = (sender, e) => |
| | | { |
| | | CopyToClipboard("推送ID:" + OnAppConfig.Instance.PushId); |
| | | }; |
| | | #endif |
| | | #endregion |
| | | #if DEBUG |
| | | |
| | | #region 分享与功能 |
| | | CopyToClipboard("推送ID:" + OnAppConfig.Instance.PushId); |
| | | #else |
| | | //检测是否获取推送ID成功,提示推送注册是否正常 |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.PushException)); |
| | | } |
| | | else |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.PushNormal)); |
| | | } |
| | | #endif |
| | | |
| | | }; |
| | | #endregion |
| | | |
| | | #region 分享与功能 |
| | | shareMenuButton = new MenuButton() |
| | | { |
| | | X = allMenuButton.Right, |
| | |
| | | MenuButtonSelect(1); |
| | | }; |
| | | shareMenuButton.SelectAction = shateAction; |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 报警类 |
| | | #region 报警类 |
| | | alarmMenuButton = new MenuButton() |
| | | { |
| | | X = shareMenuButton.Right, |
| | |
| | | MenuButtonSelect(2); |
| | | }; |
| | | alarmMenuButton.SelectAction = alarmAction; |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 系统信息 |
| | | #region 系统信息 |
| | | systemMenuButton = new MenuButton() |
| | | { |
| | | X = alarmMenuButton.Right, |
| | |
| | | MenuButtonSelect(3); |
| | | }; |
| | | systemMenuButton.SelectAction = systemAction; |
| | | #endregion |
| | | #endregion |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #region 测试 |
| | | #region 测试 |
| | | #if DEBUG |
| | | /// <summary> |
| | | /// |
| | |
| | | |
| | | #endif |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 标记所有推送消息已读 |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | //bodyDiv.AddChidren(btnCollectionIcon); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = scene.collect |
| | | }; |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | //bodyDiv.AddChidren(btnCollectionIcon); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; |
| | | if (scene.sceneType == SceneType.MovieScene) |
| | | { |
| | |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | | |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | //不是A网关或者是成员 只允许添加场景隐藏自动化 |
| | | if (DB_ResidenceData.Instance.GatewayType != 1 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | btnSceneTilte = new Button() |
| | | { |
| | |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | IsSelected = scene.collect, |
| | | }; |
| | | view.AddChidren(btnCollection); |
| | | //view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | view.AddChidren(btnCollection); |
| | | } |
| | | btnCollection.MouseUpEventHandler = (sender, e) => { |
| | | scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected; |
| | | scene.CollectScene(); |
| | |
| | | { |
| | | if (!btnAutomationTitle.IsSelected) |
| | | { |
| | | //如果是成员 |
| | | if (DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | //如果没有场景权限 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isAllowCreateScene) |
| | | { |
| | | //提示没有场景的创建权限 |
| | | Utlis.ShowTip(Language.StringByID(StringId.PermissionDenied)); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | Action action = () => |
| | | { |
| | | LoadSceneFunctionControlZone(); |
| | |
| | | |
| | | }; |
| | | |
| | | |
| | | //加载底部验证按钮 |
| | | if (optionType == "5" || optionType == "6") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(optionType); |
| | | } |
| | | else if (optionType == "7") |
| | | |
| | | if (optionType == "7") |
| | | { |
| | | //使用账户密码登录按钮 提示按钮 |
| | | AddLoginTipButton(); |
| | | } |
| | | else if (optionType != "1") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(optionType); |
| | | } |
| | | |
| | | |
| | | //if (optionType == "5" || optionType == "6" || optionType == "7") |
| | |
| | | |
| | | etPassword.Foucs = true; |
| | | |
| | | //加载底部验证按钮 |
| | | if (optionType == "3" || optionType == "5" || optionType == "6") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(optionType); |
| | | } |
| | | else if (optionType == "7") |
| | | if (optionType == "7") |
| | | { |
| | | //使用账户密码登录按钮 提示按钮 |
| | | AddLoginTipButton(); |
| | | } |
| | | |
| | | else if (optionType != "1") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(optionType); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 面容ID开启和关闭 |
| | | /// 面容ID验证弹窗 |
| | | /// </summary> |
| | | void FaceIDVerification_SwtichOnOff() |
| | | /// <param name="successAction"></param> |
| | | /// <param name="goToVerifyPasswordAction"></param> |
| | | void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) |
| | | { |
| | | //6:面容ID开关 |
| | | string optionType = "6"; |
| | | //4:面容ID |
| | | string faceIDUnlockType = "4"; |
| | | //提示数字密码验证还是绘制手势验证 |
| | | string verificationTitleString = GetVerificationTitleString(); |
| | | |
| | | //成功事件 |
| | | Action successAction = () => |
| | | { |
| | | var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; |
| | | if (result) |
| | | { |
| | | if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | Action fingerAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | }; |
| | | new AppUnlockPage().LoadFaceIDGesturePage(optionType, fingerAction, successAction); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | | { |
| | | successAction?.Invoke(); |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) |
| | | { |
| | | ///将验证面容ID的页面移除 |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | |
| | | GotogoToVerifyPasswordPage(optionType, refreshAction); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// FaceID验证 关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void FaceIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //使用密码验证 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 指纹ID开启和关闭 |
| | | /// 面容ID开启和关闭 |
| | | /// </summary> |
| | | void TouchIDVerification_SwtichOnOff() |
| | | /// <param name="successAction">验证成功事件</param> |
| | | void FaceIDVerification_SwtichOnOff() |
| | | { |
| | | //5:指纹ID开关 |
| | | string optionType = "5"; |
| | | //4:面容ID |
| | | string faceIDUnlockType = "4"; |
| | | //6:面容ID开关 |
| | | string optionType = "6"; |
| | | //成功事件 |
| | | Action successAction = () => |
| | | { |
| | | var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; |
| | | var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; |
| | | if (result) |
| | | { |
| | | if (!UserInfo.Current.appUnlockType.Contains("3")) |
| | | if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add("3"); |
| | | UserInfo.Current.appUnlockType.Add(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (UserInfo.Current.appUnlockType.Contains("3")) |
| | | if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove("3"); |
| | | UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | Action fingerAction = () => |
| | | |
| | | //跳转数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage(optionType, successAction); |
| | | }; |
| | | new AppUnlockPage().LoadGesturePage(optionType, fingerAction, successAction); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | FaceIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | | { |
| | | successAction?.Invoke(); |
| | | |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) |
| | | { |
| | | ///将验证指纹ID的页面移除 |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | |
| | | GotogoToVerifyPasswordPage(optionType, refreshAction); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TouchID验证 关闭解锁设置 |
| | | /// FaceID验证 关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void TouchIDVerification_TurnOffUnlock(Action successAction) |
| | | void FaceIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //使用密码验证 |
| | | //调整数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | FaceIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 指纹ID统一弹出 |
| | | /// </summary> |
| | | /// <param name="optionType"></param> |
| | | /// <param name="successAction"></param> |
| | | /// <param name="goToVerifyPasswordAction"></param> |
| | | void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) |
| | | { |
| | | //提示数字密码验证还是绘制手势验证 |
| | | string verificationTitleString = GetVerificationTitleString(); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.NotSupport) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 指纹ID开启和关闭 5:指纹ID开关 |
| | | /// </summary> |
| | | void TouchIDVerification_SwtichOnOff() |
| | | { |
| | | //指纹关闭成功事件 成功事件 |
| | | Action successAction = () => |
| | | { |
| | | var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; |
| | | if (result) |
| | | { |
| | | if (!UserInfo.Current.appUnlockType.Contains("3")) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add("3"); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (UserInfo.Current.appUnlockType.Contains("3")) |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove("3"); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | //5:指纹ID开关 |
| | | string optionType = "5"; |
| | | //跳转数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //5:指纹ID开关 |
| | | GotogoToVerifyPasswordPage(optionType, successAction); |
| | | }; |
| | | |
| | | |
| | | |
| | | TouchIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TouchID验证 4:关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void TouchIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //跳转数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //4.关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转手势或者密码验证界面 |
| | | /// </summary> |
| | | /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param> |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否数字验证、否则绘制手势验证 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | bool CheckIfUnlockPassword() |
| | | { |
| | | return UserInfo.Current.appUnlockType.Contains("1"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否数字验证、否则绘制手势验证 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | string GetVerificationTitleString() |
| | | { |
| | | if (CheckIfUnlockPassword()) |
| | | { |
| | | return Language.StringByID(StringId.PasswordVerification); |
| | | } |
| | | else |
| | | { |
| | | return Language.StringByID(StringId.GestureVerification); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = aC.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = curtain.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnCurtainBgIcon = new Button() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = curtain.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | curtainSeekBar = new CurtainSeekBarOn() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = curtain.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | curtainSeekBar = new CurtainRollSeekBarOn() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = fan.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = socketFunction.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = tv.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnChangeTVAV = new Button() |
| | | { |
| | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus_Data != null) |
| | | if (sensor.bus != null) |
| | | { |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus_Data.SubnetID + "_" + sensor.bus_Data.DeviceID + "_" + sensor.bus_Data.loopId; |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus.SubnetID + "_" + sensor.bus.DeviceID + "_" + sensor.bus.loopId; |
| | | } |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | if (sensor.bus_Data != null) |
| | | if (sensor.bus != null) |
| | | { |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus_Data.SubnetID + "_" + sensor.bus_Data.DeviceID + "_" + sensor.bus_Data.loopId; |
| | | sensorTag = ((int)sensor.functionType % 256) + "_" + sensor.bus.SubnetID + "_" + sensor.bus.DeviceID + "_" + sensor.bus.loopId; |
| | | } |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | |
| | | i++; |
| | | continue; |
| | | } |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(sr.bus_Data.SubnetID, sr.bus_Data.DeviceID, |
| | | 5, (int)(sr.functionType) % 256, (int)curQueryType, sr.bus_Data.loopId, curMonth, |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(sr.bus.SubnetID, sr.bus.DeviceID, |
| | | 5, (int)(sr.functionType) % 256, (int)curQueryType, sr.bus.loopId, curMonth, |
| | | DB_ResidenceData.Instance.residenceGatewayMAC); |
| | | |
| | | if (revertObj != null) |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = fh.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = light.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | dimmerBar = new WaveSeekBarOn() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = light.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | colorPicker = new ColorPicker() |
| | | { |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = light.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | { |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnSwitchIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |