From d72ca686a3e262693f8a6e45e747e8e8da43335b Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 06 七月 2021 09:39:03 +0800 Subject: [PATCH] 2021-07-06 1.更新 --- HDL_ON/Entity/Function/TV.cs | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/HDL_ON/Entity/Function/TV.cs b/HDL_ON/Entity/Function/TV.cs index 3d8289c..8dde74a 100644 --- a/HDL_ON/Entity/Function/TV.cs +++ b/HDL_ON/Entity/Function/TV.cs @@ -3,20 +3,19 @@ namespace HDL_ON.Entity { - public class TV : Function + public class TV { public TV() { - trait_on_off.curValue = "off"; } - public void ControlTV(InfraredCode_TV iCode) + public void ControlTV(InfraredCode_TV iCode,Function function) { int RandKey = new Random().Next(0, 255); var textByte = (byte)iCode; - Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); + new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); } - public void ControlTV(int number) + public void ControlTV(int number,Function function) { int RandKey = new Random().Next(0, 255); var textByte = (byte)(number + 7); @@ -24,7 +23,7 @@ { textByte = 18; } - Control.Ins.myUdp.ControlBytesSend(Command.InfraredControl, bus.SubnetID, bus.DeviceID, new byte[] { 1, bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); + new Control_Udp().ControlBytesSend(Command.InfraredControl, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 1, function.bus.LoopId, textByte, 0, 0, (byte)RandKey }, 0); } } } -- Gitblit v1.8.0