Skyline.DataMiner.Utils.GetAfterSet.Protocol 1.0.0.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Skyline.DataMiner.Utils.GetAfterSet.Protocol --version 1.0.0.1
NuGet\Install-Package Skyline.DataMiner.Utils.GetAfterSet.Protocol -Version 1.0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Skyline.DataMiner.Utils.GetAfterSet.Protocol" Version="1.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Skyline.DataMiner.Utils.GetAfterSet.Protocol --version 1.0.0.1
#r "nuget: Skyline.DataMiner.Utils.GetAfterSet.Protocol, 1.0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Skyline.DataMiner.Utils.GetAfterSet.Protocol as a Cake Addin
#addin nuget:?package=Skyline.DataMiner.Utils.GetAfterSet.Protocol&version=1.0.0.1

// Install Skyline.DataMiner.Utils.GetAfterSet.Protocol as a Cake Tool
#tool nuget:?package=Skyline.DataMiner.Utils.GetAfterSet.Protocol&version=1.0.0.1

Skyline.DataMiner.Utils.GetAfterSet.Protocol

About

A library used to re-poll certain parameter. This is usefull when a device takes a while to handle a set.

You can define how many times you want a parameter to be re-polled until it is the desired value. If after the defined retries the parameter is still not it's desired value it logs it.

This library requires a bit of setup to use.

Table of Content

About DataMiner

DataMiner is a transformational platform that provides vendor-independent control and monitoring of devices and services. Out of the box and by design, it addresses key challenges such as security, complexity, multi-cloud, and much more. It has a pronounced open architecture and powerful capabilities enabling users to evolve easily and continuously.

The foundation of DataMiner is its powerful and versatile data acquisition and control layer. With DataMiner, there are no restrictions to what data users can access. Data sources may reside on premises, in the cloud, or in a hybrid setup.

A unique catalog of 7000+ connectors already exist. In addition, you can leverage DataMiner Development Packages to build you own connectors (also known as "protocols" or "drivers").

Note See also: About DataMiner.

About Skyline Communications

At Skyline Communications, we deal in world-class solutions that are deployed by leading companies around the globe. Check out our proven track record and see how we make our customers' lives easier by empowering them to take their operations to the next level.

Installation

Add the nuget package to your QAction with the "Manage Nuget Packges..."

Setup

Note You will need a Trigger for everything you want to re-poll so the QAction can use it. Most of the time this will already be there.

Step 1.

Add 2 parameters to the xml code. You can pick whatever id, name and description you want.

<Param id="99">
    <Name>AddToRetryBuffer</Name>
    <Description>Add to the Retry Buffer</Description>
    <Type>read</Type>
    <Interprete>
        <RawType>other</RawType>
        <Type>string</Type>
        <LengthType>next param</LengthType>
    </Interprete>
</Param>
<Param id="100">
    <Name>CheckRetryBuffer</Name>
    <Description>Check Request Buffer Dequeue</Description>
    <Type>dummy</Type>
</Param>
Step 2.

Add a new QAction and make sure the triggers are the id's of the 2 parameters you defines in Step 1.

<QAction id="100" name="Check Retry Buffer" encoding="csharp" triggers="99;100"></QAction>	
Step 3.

Add an action, that will trigger the dummy parameter from Step 1.

<Action id="100">
    <Name>Check Request Buffer</Name>
    <On id="100">parameter</On>
    <Type>run actions</Type>
</Action>
Step 4.

Add a group, that will trigger the Action defines in Step 3.

<Group id="100">
    <Name>Get After Set Check</Name>
    <Description>Get After Set Check</Description>
    <Type>poll action</Type>
    <Content>
        <Action>100</Action>
    </Content>
</Group>
Step 5.

Add a 1 second timer, that will trigger the group. If there is already a small timer you can use that one instead and just add the group created in Step 4.

<Timer id="3">
    <Name>1 sec timer</Name>
    <Time initial="true">1000</Time>
    <Interval>75</Interval>
    <Content>
        <Group>100</Group>
    </Content>
</Timer>
Step 6.

Open the QAction created in Step 2. Add the below code and fill in the parameter ids from Step 1.

using System;

using Skyline.DataMiner.Scripting;
using Skyline.DataMiner.Utils.GetAfterSet;

/// <summary>
/// DataMiner QAction Class.
/// </summary>
public class QAction
{
	private readonly RetryBuffer parameterBuffer = new RetryBuffer(/* The id of the add parameter from Step 1 */, /* The id of the dummy parameter of step 1. */);

	/// <summary>
	/// Check if there are requests queued.
	/// </summary>
	/// <param name="protocol">Link with SLProtocol process.</param>
	public void Run(SLProtocol protocol)
	{
		try
		{
			parameterBuffer.Process(protocol);
		}
		catch (Exception ex)
		{
			protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
		}
	}
}

Usage/Examples

With a standalone parameter.
  • StandAloneParameter: The id of the parameter that needs to update after the set is done.
  • TriggerId: The id of the trigger that will re-poll "StandAloneParameter".
  • desiredValue: The value "StandAloneParameter" needs to be.
using System;

using Skyline.DataMiner.Scripting;
using Skyline.DataMiner.Utils.GetAfterSet;

/// <summary>
/// DataMiner QAction Class.
/// </summary>
public static class QAction
{
	/// <summary>
	/// Check if there are requests queued.
	/// </summary>
	/// <param name="protocol">Link with SLProtocol process.</param>
	public void Run(SLProtocol protocol)
	{
		try
		{
			protocol.SetParameter(StandaloneParameter, "Set");

			var retryRequest = new GetAfterSetConfig(
					StandaloneParameter
					TriggerId,
					desiredValue);

			protocol.SetParameter(Parameter.addrequestbuffer, Convert.ToString(new RequestQueue(retryRequest, 5)));
		}
		catch (Exception ex)
		{
			protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
		}
	}
}

With a table cell.
  • TablePid: The id of the table that holds the cell that needs to update after the set is done.
  • RowKey: The primary key the row that holds the cell of that needs to update after the set is done.
  • ColumnIdx: The column idx of the column that holds the cell of that needs to update after the set is done.
  • TriggerId: The id of the trigger that will re-poll the table, row or cell.
  • desiredValue: The value cell needs to be.
using System;

using Skyline.DataMiner.Scripting;
using Skyline.DataMiner.Utils.GetAfterSet;

/// <summary>
/// DataMiner QAction Class.
/// </summary>
public static class QAction
{
	/// <summary>
	/// Check if there are requests queued.
	/// </summary>
	/// <param name="protocol">Link with SLProtocol process.</param>
	public void Run(SLProtocol protocol)
	{
		try
		{
			protocol.SetParameter(StandaloneParameter, "Set");

			var retryRequest = new GetAfterSetConfig(
					TablePid,
					RowKey,
					ColumnIdx,
					TriggerId,
					desiredValue);

			protocol.SetParameter(Parameter.addrequestbuffer, Convert.ToString(new RequestQueue(retryRequest, 5)));
		}
		catch (Exception ex)
		{
			protocol.Log("QA" + protocol.QActionID + "|" + protocol.GetTriggerParameter() + "|Run|Exception thrown:" + Environment.NewLine + ex, LogType.Error, LogLevel.NoLogging);
		}
	}
}

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.1 168 3/13/2023