Hi all, a general question: One of the more common and repetitive actions that I find myself doing is to have to refer to a parameter's name and PID (table, column as well as standalone param). It becomes tedious when there are a number of these to report on and typos creep in. Is there a little-known shortcut to quickly copy these details?
Hi Bing,
If you have access to the connector in Visual Studio you could create a macro to go over all parameters and extract that information with a snippet like the following
var parameters = engine.Input?.ProtocolModel?.Protocol?.Params;
if (parameters == null)
{
engine.LogToOutputWindow("Unable to fetch parameters", true);
return;
}StringBuilder sb = new StringBuilder();
foreach (var param in parameters)
{
string newParam = $"{param.Id?.RawValue};{param.Name?.RawValue};{param.Description?.RawValue}";
sb.AppendLine(newParam);
}string output = sb.ToString();
engine.LogToOutputWindow(output, true);
Clipboard.SetText(output);
Where you could then log to the output window, copy to the clipboard, or even write to a CSV file.
If you do not have it locally and want to do it in DataMiner you could create an automation script that does a similar thing.
var protocolName = engine.GetScriptParam("ProtocolName").Value;
var protocolVersion = engine.GetScriptParam("ProtocolVersion").Value;var protocolContent = engine.SendSLNetSingleResponseMessage(new GetProtocolMessage(protocolName, protocolVersion)) as
GetProtocolInfoResponseMessage;if (protocolContent == null)
{
return;
}StringBuilder sb = new StringBuilder();
foreach (var parameter in protocolContent.Parameters)
{
string paramDescription = $"{parameter.ID};{parameter.Name};{parameter.Description}";
sb.AppendLine(paramDescription);
}// TODO write to desired location
Do note that each option will give you slightly different results as Visual Studio will give you all parameters defined in the XML while SLNet will return what DataMiner sees which includes the General Parameters
Hope this helps.
if you have mib file, you can use mib browser in dis for generate param