This commit is contained in:
luosheng
2023-07-12 06:42:28 +08:00
parent 25555cad18
commit db591e0367
188 changed files with 56088 additions and 9 deletions

View File

@@ -0,0 +1,35 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// Maintains the state of a browse operation
/// </summary>
public interface IOpcBrowsePosition : IDisposable, ICloneable
{
}
}

View File

@@ -0,0 +1,57 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// This interface is used to discover OPC servers on the network.
/// </summary>
public interface IOpcDiscovery : IDisposable
{
/// <summary>
/// Returns a list of host names which could contain OPC servers.
/// </summary>
/// <returns>A array of strings that are valid network host names.</returns>
string[] EnumerateHosts();
/// <summary>
/// Returns a list of servers that support an OPC specification.
/// </summary>
/// <param name="specification">A unique identifier for an OPC specification.</param>
/// <returns>An array of unconnected OPC server obejcts on the local machine.</returns>
OpcServer[] GetAvailableServers(OpcSpecification specification);
/// <summary>
/// Returns a list of servers that support an OPC specification on remote machine.
/// </summary>
/// <param name="specification">A unique identifier for an OPC specification.</param>
/// <param name="host">The network host name of the machine to search for servers.</param>
/// <param name="connectData">Any necessary user authentication or protocol configuration information.</param>
/// <returns>An array of unconnected OPC server objects.</returns>
OpcServer[] GetAvailableServers(OpcSpecification specification, string host, OpcConnectData connectData);
}
}

View File

@@ -0,0 +1,44 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// A interface to a factory used to instantiate servers.
/// </summary>
public interface IOpcFactory : IDisposable
{
/// <summary>
/// Can be used to force OPC DA 2.0 even if OPC DA 3.0 server features are available
/// </summary>
bool ForceDa20Usage { get; set; }
/// <summary>
/// Creates a new instance of the server at the specified URL.
/// </summary>
IOpcServer CreateInstance(OpcUrl url, OpcConnectData connectData);
}
}

View File

@@ -0,0 +1,39 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// Maintains the state of an asynchronous request.
/// </summary>
public interface IOpcRequest
{
/// <summary>
/// An unique identifier, assigned by the client, for the request.
/// </summary>
object Handle { get; }
}
}

View File

@@ -0,0 +1,44 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// A interface used to access result information associated with a single item/value.
/// </summary>
public interface IOpcResult
{
/// <summary>
/// The error id for the result of an operation on an item.
/// </summary>
OpcResult Result { get; set; }
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
string DiagnosticInfo { get; set; }
}
}

View File

@@ -0,0 +1,94 @@
#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
//-----------------------------------------------------------------------------
// Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
// Web: https://www.technosoftware.com
//
// The source code in this file is covered under a dual-license scenario:
// - Owner of a purchased license: SCLA 1.0
// - GPL V3: everybody else
//
// SCLA license terms accompanied with this source code.
// See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf
//
// GNU General Public License as published by the Free Software Foundation;
// version 3 of the License are accompanied with this source code.
// See https://technosoftware.com/license/GPLv3License.txt
//
// This source code is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.
//-----------------------------------------------------------------------------
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
#endregion
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// Defines functionality that is common to all OPC servers.
/// </summary>
public interface IOpcServer : IDisposable
{
/// <summary>
/// An event to receive server shutdown notifications. This event can be used by the
/// client so that the server can request that the client should disconnect from the
/// server.
/// </summary>
/// <remarks>
/// The OpcServerShutdownEvent event will be called when the server needs to
/// shutdown. The client should release all connections and interfaces for this
/// server.<br/>
/// A client which is connected to multiple OPCServers (for example Data access and/or
/// other servers such as Alarms and events servers from one or more vendors) should
/// maintain separate shutdown callbacks for each server since any server can shut down
/// independently of the others.
/// </remarks>
event OpcServerShutdownEventHandler ServerShutdownEvent;
/// <summary>
/// The locale used in any error messages or results returned to the client.
/// </summary>
/// <returns>The locale name in the format "[languagecode]-[country/regioncode]".</returns>
string GetLocale();
/// <summary>
/// Sets the locale used in any error messages or results returned to the client.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <returns>A locale that the server supports and is the best match for the requested locale.</returns>
string SetLocale(string locale);
/// <summary>
/// Allows the client to optionally register a client name with the server. This is included primarily for debugging purposes. The recommended behavior is that the client set his Node name and EXE name here.
/// </summary>
void SetClientName(string clientName);
/// <summary>
/// Returns the locales supported by the server
/// </summary>
/// <remarks>The first element in the array must be the default locale for the server.</remarks>
/// <returns>An array of locales with the format "[languagecode]-[country/regioncode]".</returns>
string[] GetSupportedLocales();
/// <summary>
/// Returns the localized text for the specified result code.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <param name="resultId">The result code identifier.</param>
/// <returns>A message localized for the best match for the requested locale.</returns>
string GetErrorText(string locale, OpcResult resultId);
}
/// <summary>
/// A delegate to receive shutdown notifications from the server. This delegate can
/// be used by the client so that the server can request that the client should disconnect
/// from the server.
/// </summary>
/// <param name="reason">
/// A text string provided by the server indicating the reason for the shutdown. The
/// server may pass a null or empty string if no reason is provided.
/// </param>
public delegate void OpcServerShutdownEventHandler(string reason);
}