2020-12-16 1.bus_Data改成bus。2.成员屏蔽设备和房间的编辑功能。
| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs" Line="68" Column="53" IsPinned="True" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="1" Column="1" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | <Node name="ResponseEntity" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="UnlockSetting" expanded="True"> |
| | | <Node name="AppUnlockSettingsPageBLL.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True"> |
| | | <Node name="FunctionControlZone.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="UnlockSetting" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="EnvironmentalScience" expanded="True" /> |
| | | <Node name="Light" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | { |
| | | 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]) |
| | |
| | | /// 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | localFunction.collect = newFunction.collect; |
| | | localFunction.modifyTime = newFunction.modifyTime; |
| | | localFunction.roomIds = newFunction.roomIds; |
| | | localFunction.bus_Data = newFunction.bus_Data; |
| | | localFunction.bus = newFunction.bus; |
| | | localFunction.SaveFunctionData(false); |
| | | } |
| | | deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能 |
| | |
| | | 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); |
| | | } |
| | |
| | | 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) |