From a8983f5a7a1bff05017b592a6e8b23208f2aac3c Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 14 Jan 2025 09:11:13 +0100 Subject: [PATCH] thing constuction registration --- Participant.cs | 6 +++--- Sensors/TemperatureSensor.cs | 2 +- Thing.cs | 2 +- test/UnitTest1.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Participant.cs b/Participant.cs index b237fa4..d04c2a9 100644 --- a/Participant.cs +++ b/Participant.cs @@ -234,16 +234,16 @@ namespace Passer.Control.Core { Console.WriteLine($"received name {msg.url}"); } - protected virtual void ProcessPoseMsg(PoseMsg msg) { } + protected virtual void Process(PoseMsg msg) { } protected virtual void Process(CustomMsg msg) { Thing thing = Thing.Get(msg.networkId, msg.thingId); thing?.ProcessBytes(msg.bytes); } - protected virtual void ProcessTextMsg(TextMsg temsgxt) { } + protected virtual void Process(TextMsg temsgxt) { } - protected virtual void ProcessDestroyMsg(DestroyMsg msg) { } + protected virtual void Process(DestroyMsg msg) { } private void ForwardMessage(IMessage msg) { foreach (Participant client in others) { diff --git a/Sensors/TemperatureSensor.cs b/Sensors/TemperatureSensor.cs index 7a54051..2699e2a 100644 --- a/Sensors/TemperatureSensor.cs +++ b/Sensors/TemperatureSensor.cs @@ -7,7 +7,7 @@ namespace Passer.Control.Core { public override void ProcessBytes(byte[] bytes) { byte ix = 0; float temp = LowLevelMessages.ReceiveFloat16(bytes, ref ix); - UnityEngine.Debug.Log($"temperature {this.name} = {temp} C"); + Console.WriteLine($"temperature {this.name} = {temp} C"); } } diff --git a/Thing.cs b/Thing.cs index 1b3de79..a5dd1b3 100644 --- a/Thing.cs +++ b/Thing.cs @@ -193,7 +193,7 @@ namespace Passer.Control.Core { allThings.Add(thing); if (invokeEvent) OnNewThing?.Invoke(thing); - UnityEngine.Debug.Log($"Add thing [{thing.networkId}/{thing.id}] {thing.name}"); + //UnityEngine.Debug.Log($"Add thing [{thing.networkId}/{thing.id}] {thing.name}"); } } diff --git a/test/UnitTest1.cs b/test/UnitTest1.cs index d41d268..859f9e6 100644 --- a/test/UnitTest1.cs +++ b/test/UnitTest1.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using NUnit.Framework;