60 lines
2.4 KiB
C#
60 lines
2.4 KiB
C#
using RobotNet10.Script.IO;
|
|
|
|
namespace RobotNet10.ScriptEngine.Shared;
|
|
|
|
public interface IScriptGlobals
|
|
{
|
|
RobotNet10.Script.ILogger Logger { get; }
|
|
|
|
Guid CreateMission(string name, params object[] args);
|
|
|
|
bool CancelMission(Guid id, string reason);
|
|
|
|
void DisableTask(string name);
|
|
|
|
void EnableTask(string name);
|
|
|
|
// IO Connection Factory Methods
|
|
|
|
/// <summary>
|
|
/// Creates an HTTP connection.
|
|
/// </summary>
|
|
/// <param name="baseUrl">The base URL (e.g., "http://localhost:8080").</param>
|
|
/// <param name="timeoutSeconds">Optional timeout in seconds (default: 30).</param>
|
|
/// <returns>An HTTP connection instance.</returns>
|
|
IHttpConnection CreateHttpConnection(string baseUrl, int timeoutSeconds = 30);
|
|
|
|
/// <summary>
|
|
/// Creates a ModbusTCP connection.
|
|
/// </summary>
|
|
/// <param name="ipAddress">The IP address of the ModbusTCP server.</param>
|
|
/// <param name="port">The port number (default: 502).</param>
|
|
/// <param name="slaveId">The slave ID/unit identifier (default: 1).</param>
|
|
/// <returns>A ModbusTCP connection instance.</returns>
|
|
IModbusTcpConnection CreateModbusTcpConnection(string ipAddress, int port = 502, byte slaveId = 1);
|
|
|
|
/// <summary>
|
|
/// Creates a ProfiNet connection.
|
|
/// </summary>
|
|
/// <param name="ipAddress">The IP address of the ProfiNet device.</param>
|
|
/// <param name="slot">The slot number (default: 1).</param>
|
|
/// <param name="subslot">The subslot number (default: 1).</param>
|
|
/// <returns>A ProfiNet connection instance.</returns>
|
|
IProfiNetConnection CreateProfiNetConnection(string ipAddress, int slot = 1, int subslot = 1);
|
|
|
|
/// <summary>
|
|
/// Creates a CC-Link IE connection.
|
|
/// </summary>
|
|
/// <param name="ipAddress">The IP address of the CC-Link IE device.</param>
|
|
/// <param name="stationNumber">The station number (default: 1).</param>
|
|
/// <returns>A CC-Link IE connection instance.</returns>
|
|
ICcLinkIeConnection CreateCcLinkIeConnection(string ipAddress, int stationNumber = 1);
|
|
|
|
/// <summary>
|
|
/// Creates an OPC UA connection.
|
|
/// </summary>
|
|
/// <param name="endpointUrl">The OPC UA server endpoint URL (e.g., "opc.tcp://localhost:4840").</param>
|
|
/// <returns>An OPC UA connection instance.</returns>
|
|
IOpcUaConnection CreateOpcUaConnection(string endpointUrl);
|
|
}
|