From 6c26794cefc555b6e695fc9e8ac7a247441ac455 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期三, 16 十二月 2020 19:27:00 +0800 Subject: [PATCH] 2020-12-16 1.bus_Data改成bus。2.成员屏蔽设备和房间的编辑功能。 --- HDL_ON/Entity/Function/Function.cs | 6 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 4 HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs | 4 HDL_ON/DAL/DriverLayer/Packet.cs | 22 ++-- HDL_ON/Entity/Function/TV.cs | 4 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs | 4 .vs/HDL_APP_Project/xs/UserPrefs.xml | 35 +++++++- HDL_ON/DAL/DriverLayer/Control.cs | 3 HDL_ON/DAL/DriverLayer/Control_Udp.cs | 78 +++++++++--------- HDL_ON/Entity/FunctionList.cs | 2 HDL_ON/UI/UI0-Public/TopViewDiv.cs | 19 ++++ 12 files changed, 110 insertions(+), 75 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index e71afa7..74535ac 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,21 +1,42 @@ -锘�<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> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 4c86695..da0c9d2 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -244,10 +244,11 @@ { 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鎺у埗銆丅us鎺у埗浣跨敤鍚屼竴涓帴鍙f帶鍒讹紝鐢变簯绔礋璐hВ鏋� var apiControlData = function.GetApiControlData(commandDictionary); var actionObjs = new List<ApiAlinkControlActionObj>(); diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index e4e770b..b9822a1 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -174,8 +174,8 @@ 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; } } @@ -218,10 +218,10 @@ } 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: @@ -247,8 +247,8 @@ 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; @@ -270,8 +270,8 @@ } } 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) @@ -288,8 +288,8 @@ 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; } } @@ -307,9 +307,9 @@ { 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) { @@ -328,7 +328,7 @@ { 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, @@ -347,13 +347,13 @@ 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; } @@ -376,7 +376,7 @@ { 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: @@ -384,7 +384,7 @@ //{ 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 { @@ -415,20 +415,20 @@ { 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; @@ -450,7 +450,7 @@ 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}"); @@ -489,7 +489,7 @@ 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; } @@ -501,10 +501,10 @@ 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; } @@ -514,7 +514,7 @@ { 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; @@ -539,9 +539,9 @@ { 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) { @@ -553,7 +553,7 @@ 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; @@ -563,7 +563,7 @@ 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; @@ -571,10 +571,10 @@ 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; @@ -583,7 +583,7 @@ { 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; @@ -592,14 +592,14 @@ { 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; } } diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs index b094ea1..53c41fb 100644 --- a/HDL_ON/DAL/DriverLayer/Packet.cs +++ b/HDL_ON/DAL/DriverLayer/Packet.cs @@ -163,12 +163,12 @@ 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]; @@ -191,7 +191,7 @@ } 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; @@ -249,7 +249,7 @@ 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) { @@ -266,7 +266,7 @@ } else { - if (curtain.bus_Data.loopId != receiveBytes[0]) + if (curtain.bus.loopId != receiveBytes[0]) continue; switch (receiveBytes[1]) { @@ -445,10 +445,10 @@ 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) { @@ -478,10 +478,10 @@ 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褰紙浠B憋級 switch (receiveBytes[3]) diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 7611105..e33e5c6 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -119,7 +119,7 @@ /// bus鍗忚鏁版嵁鏍煎紡 /// 浣跨敤A鍗忚鎺у埗鏃讹紝鏀瑰睘鎬т负绌� /// </summary> - public BusData bus_Data; + public BusData bus; /// <summary> /// 鏄惁鏀惰棌 /// </summary> @@ -206,9 +206,9 @@ 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; } diff --git a/HDL_ON/Entity/Function/TV.cs b/HDL_ON/Entity/Function/TV.cs index 0b645a2..485ac6a 100644 --- a/HDL_ON/Entity/Function/TV.cs +++ b/HDL_ON/Entity/Function/TV.cs @@ -14,7 +14,7 @@ { 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) { @@ -24,7 +24,7 @@ { 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); } } } diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index 6d6b3f2..a6a1f17 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -400,7 +400,7 @@ 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);//鎿嶄綔瀹岀殑鏁版嵁娓呯悊鎺夛紝鍓╀笅鐨勫氨鏄柊澧炵殑鍔熻兘 diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs index 31e109f..02b75d2 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs @@ -146,8 +146,12 @@ 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(); @@ -173,7 +177,11 @@ Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/FuncInfoSetIcon.png", }; - contentView.AddChidren(btnSetting); + //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳� + if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) + { + contentView.AddChidren(btnSetting); + } btnSetting.MouseUpEventHandler = (sender, e) => { @@ -201,7 +209,12 @@ Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/FuncInfoSetIcon.png", }; - contentView.AddChidren(btnSetting); + + //濡傛灉鏄垚鍛橀殣钘忕紪杈戝姛鑳� + if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) + { + contentView.AddChidren(btnSetting); + } btnSetting.MouseUpEventHandler += (sender, e) => { diff --git a/HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs b/HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs index caeabf2..0164334 100644 --- a/HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs +++ b/HDL_ON/UI/UI0-Public/UpdataSidDataDialog.cs @@ -40,8 +40,8 @@ { 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); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs index c995824..399351c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs @@ -368,9 +368,9 @@ 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() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs index aaaeae3..2139c22 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs @@ -19,9 +19,9 @@ 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)) diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs index 15307dc..c382507 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs @@ -904,8 +904,8 @@ 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) -- Gitblit v1.8.0