MoS2/Framework/MECF.Framework.RT.EquipmentLibrary/HardwareUnits/Temps/Strong/StrongTempHandler.cs

43 lines
1.1 KiB
C#
Raw Permalink Normal View History

2026-06-15 10:56:30 +08:00
using MECF.Framework.Common.Communications;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Temps
{
public abstract class StrongTempHandler : HandlerBase
{
public StrongTemp Device { get; }
protected StrongTempHandler(StrongTemp device, byte[] commandvalue) : base(commandvalue)
{
Device = device;
}
}
public class StrongTempQueryHandler : StrongTempHandler
{
public StrongTempQueryHandler(StrongTemp device, string name, byte[] commandvalue)
: base(device, commandvalue)
{
Name = name;//"Query Temp";
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as BinaryMessage;
handled = false;
if (result.IsError)
{
Device.ResponseError();
return false;
}
if (!result.IsComplete)
{
return false;
}
Device.ResponseQuery(Name, result.RawMessage);
return true;
}
}
}