2019-12-14 04:14:20 +00:00
|
|
|
|
using HAI_Shared;
|
|
|
|
|
using OmniLinkBridge.OmniLink;
|
2024-05-04 01:33:12 +00:00
|
|
|
|
using Serilog;
|
2019-12-14 04:14:20 +00:00
|
|
|
|
using System;
|
2024-05-04 01:33:12 +00:00
|
|
|
|
using System.Reflection;
|
2019-12-14 04:14:20 +00:00
|
|
|
|
|
|
|
|
|
namespace OmniLinkBridgeTest.Mock
|
|
|
|
|
{
|
|
|
|
|
class MockOmniLinkII : IOmniLinkII
|
|
|
|
|
{
|
2024-05-04 01:33:12 +00:00
|
|
|
|
private static readonly ILogger log = Log.Logger.ForContext(MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
|
|
2019-12-14 04:14:20 +00:00
|
|
|
|
public clsHAC Controller { get; private set; }
|
|
|
|
|
|
|
|
|
|
public event EventHandler<SendCommandEventArgs> OnSendCommand;
|
|
|
|
|
|
|
|
|
|
public MockOmniLinkII()
|
|
|
|
|
{
|
2020-11-06 02:59:30 +00:00
|
|
|
|
Controller = new clsHAC
|
|
|
|
|
{
|
|
|
|
|
Model = enuModel.OMNI_PRO_II,
|
|
|
|
|
TempFormat = enuTempFormat.Fahrenheit
|
|
|
|
|
};
|
2019-12-14 04:14:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool SendCommand(enuUnitCommand Cmd, byte Par, ushort Pr2)
|
|
|
|
|
{
|
2024-05-04 01:33:12 +00:00
|
|
|
|
log.Verbose("Sending: {command}, Par1: {par1}, Par2: {par2}", Cmd, Par, Pr2);
|
2019-12-14 04:14:20 +00:00
|
|
|
|
OnSendCommand?.Invoke(null, new SendCommandEventArgs() { Cmd = Cmd, Par = Par, Pr2 = Pr2 });
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|