首次上传
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user