43 lines
936 B
C#
43 lines
936 B
C#
using Aurora.Api;
|
|
using Hermes;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AuroraTestDevice.Devices
|
|
{
|
|
public class TestDevice : Device
|
|
{
|
|
bool _IsSimul = false;
|
|
public TestDevice(bool isSimul)
|
|
{
|
|
_IsSimul = isSimul;
|
|
CommType = CommunicationType.Serial;
|
|
Type = DeviceType.Controller;
|
|
}
|
|
|
|
protected override int DoActivate(IDeviceConfig config)
|
|
{
|
|
var testConfig = config as TestDeviceConfig;
|
|
_IsSimul |= testConfig.IsSimul;
|
|
|
|
if(testConfig.IsSimul)
|
|
{
|
|
return E1.OK;
|
|
}
|
|
return E1.OK;
|
|
}
|
|
|
|
protected override int DoDeactivate()
|
|
{
|
|
if(_IsSimul)
|
|
{
|
|
return E1.OK;
|
|
}
|
|
return E1.OK;
|
|
}
|
|
}
|
|
}
|