|
|
|
@ -131,6 +131,10 @@ namespace IEC61850
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
static extern void ClientReportControlBlock_setPurgeBuf(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool purgeBuf);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
static extern bool ClientReportControlBlock_hasResvTms(IntPtr self);
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
static extern Int16 ClientReportControlBlock_getResvTms(IntPtr self);
|
|
|
|
|
|
|
|
|
@ -194,7 +198,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
private void internalReportHandler(IntPtr parameter, IntPtr report)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (this.report == null)
|
|
|
|
|
this.report = new Report(report);
|
|
|
|
@ -202,7 +207,8 @@ namespace IEC61850
|
|
|
|
|
if (reportHandler != null)
|
|
|
|
|
reportHandler(this.report, reportHandlerParameter);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e)
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
// older versions of mono 2.10 (for linux?) cause this exception
|
|
|
|
|
Console.WriteLine(e.Message);
|
|
|
|
@ -213,7 +219,8 @@ namespace IEC61850
|
|
|
|
|
{
|
|
|
|
|
self = ClientReportControlBlock_create(objectReference);
|
|
|
|
|
|
|
|
|
|
if (self != IntPtr.Zero) {
|
|
|
|
|
if (self != IntPtr.Zero)
|
|
|
|
|
{
|
|
|
|
|
this.iedConnection = iedConnection;
|
|
|
|
|
this.objectReference = objectReference;
|
|
|
|
|
}
|
|
|
|
@ -229,8 +236,10 @@ namespace IEC61850
|
|
|
|
|
/// <see cref="IEC61850.Client.ReportControlBlock"/> was occupying.</remarks>
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
lock (this) {
|
|
|
|
|
if (self != IntPtr.Zero) {
|
|
|
|
|
lock (this)
|
|
|
|
|
{
|
|
|
|
|
if (self != IntPtr.Zero)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
iedConnection.UninstallReportHandler(objectReference);
|
|
|
|
|
|
|
|
|
@ -273,7 +282,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
this.reportHandlerParameter = parameter;
|
|
|
|
|
|
|
|
|
|
if (reportHandlerInstalled == false) {
|
|
|
|
|
if (reportHandlerInstalled == false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string reportId = this.GetRptId();
|
|
|
|
|
|
|
|
|
@ -380,9 +390,11 @@ namespace IEC61850
|
|
|
|
|
if (error != 0)
|
|
|
|
|
throw new IedConnectionException("setRCBValues service failed", error);
|
|
|
|
|
|
|
|
|
|
if (flagRptId) {
|
|
|
|
|
if (flagRptId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (reportHandlerInstalled) {
|
|
|
|
|
if (reportHandlerInstalled)
|
|
|
|
|
{
|
|
|
|
|
reportHandlerInstalled = false;
|
|
|
|
|
InstallReportHandler(this.reportHandler, this.reportHandlerParameter);
|
|
|
|
|
}
|
|
|
|
@ -445,7 +457,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
if (entryIdRef == IntPtr.Zero)
|
|
|
|
|
return null;
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MmsValue entryId = new MmsValue(entryIdRef);
|
|
|
|
|
|
|
|
|
|
return entryId.getOctetString();
|
|
|
|
@ -714,6 +727,15 @@ namespace IEC61850
|
|
|
|
|
flagOptFlds = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Check if the report control block has the "ResvTms" attribute.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns><c>true</c>, if ResvTms is available, <c>false</c> otherwise.</returns>
|
|
|
|
|
public bool HasResvTms()
|
|
|
|
|
{
|
|
|
|
|
return ClientReportControlBlock_hasResvTms(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the ResvTms (reservation time) value
|
|
|
|
|
/// </summary>
|
|
|
|
@ -759,6 +781,5 @@ namespace IEC61850
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|