Skip to content

Instantly share code, notes, and snippets.

@TomW-Skyline
Last active November 27, 2023 07:11
Show Gist options
  • Save TomW-Skyline/42ed7216f0bb9498aea13555b61d4b0f to your computer and use it in GitHub Desktop.
Save TomW-Skyline/42ed7216f0bb9498aea13555b61d4b0f to your computer and use it in GitHub Desktop.
Set disallowed matrix connections
using System;
using System.Collections.Generic;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;
using Skyline.DataMiner.Net.Messages.Advanced;
public static class Helper
{
public static void SetDisallowedConnections(IEngine engine, int dmaId, int elementId, int matrixId, int discrete, IEnumerable<int> disallowedDiscretes)
{
var message = new SetDataMinerInfoMessage
{
What = (int)NotifyType.UpdatePortsXml,
DataMinerID = dmaId,
HostingDataMinerID = dmaId,
Puia1 = new PUIA
{
Puia = new[] { new UIA(new[] { 2, elementId, matrixId, dmaId }) },
},
Psa2 = new PSA
{
Psa = new[]
{
new SA
{
Sa = new[] { Convert.ToString(discrete), "matrix=not allowed," + String.Join(",", disallowedDiscretes) },
},
},
},
};
engine.SendSLNetMessage(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment