67 lines
1.6 KiB
C#
67 lines
1.6 KiB
C#
using ArchestrA.MxAccess;
|
|
|
|
namespace MxGateway.Worker.MxAccess;
|
|
|
|
public sealed class MxAccessBaseEventSink : IMxAccessEventSink
|
|
{
|
|
private LMXProxyServerClass? server;
|
|
|
|
public void Attach(object mxAccessComObject)
|
|
{
|
|
server = (LMXProxyServerClass)mxAccessComObject;
|
|
server.OnDataChange += OnDataChange;
|
|
server.OnWriteComplete += OnWriteComplete;
|
|
server.OperationComplete += OperationComplete;
|
|
server.OnBufferedDataChange += OnBufferedDataChange;
|
|
}
|
|
|
|
public void Detach()
|
|
{
|
|
if (server is null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
server.OnDataChange -= OnDataChange;
|
|
server.OnWriteComplete -= OnWriteComplete;
|
|
server.OperationComplete -= OperationComplete;
|
|
server.OnBufferedDataChange -= OnBufferedDataChange;
|
|
server = null;
|
|
}
|
|
|
|
private static void OnDataChange(
|
|
int hLMXServerHandle,
|
|
int phItemHandle,
|
|
object pvItemValue,
|
|
int pwItemQuality,
|
|
object pftItemTimeStamp,
|
|
ref MXSTATUS_PROXY[] pVars)
|
|
{
|
|
}
|
|
|
|
private static void OnWriteComplete(
|
|
int hLMXServerHandle,
|
|
int phItemHandle,
|
|
ref MXSTATUS_PROXY[] pVars)
|
|
{
|
|
}
|
|
|
|
private static void OperationComplete(
|
|
int hLMXServerHandle,
|
|
int phItemHandle,
|
|
ref MXSTATUS_PROXY[] pVars)
|
|
{
|
|
}
|
|
|
|
private static void OnBufferedDataChange(
|
|
int hLMXServerHandle,
|
|
int phItemHandle,
|
|
MxDataType dtDataType,
|
|
object pvItemValue,
|
|
object pwItemQuality,
|
|
object pftItemTimeStamp,
|
|
ref MXSTATUS_PROXY[] pVars)
|
|
{
|
|
}
|
|
}
|