I'm working on a matrix driver which i used the help of the CreateMatrix Macro to generate the inputs and outputs table. Later in development i saw the need to change the name of the tables and columns from inputs to sources and outputs to destinations. I see now that the driver is not working properly because of this, it looks like the matrix helper class has a reference to the parameters which i can't not edit since it is part of the auto generated code.
I was able to pinpoint one specific column in the outputs table, the last generated column. If i change the original name "RouterControlOutputsConnectedInput" to anything else for example "DestinationsCurrentSourceIndex" i get this following exception.
2020/09/12 21:23:52.584|SLManagedScripting.exe|ManagedInterop|ERR|0|QA2160|101|Run|Exception System.ArgumentException: Could not auto detect outputsTable. Please use the correct parameter name format and don't forget write virtualsets and serializedsets single parameters. at Skyline.DataMiner.Library.Protocol.Matrix.MatrixHelper.ParseProtocolAutoDetectOutputTable(MatrixHelperParameterIds requestParameters, MatrixHelperParameterIds foundParameters, MatrixSearchTableInfo tablesWithLabel, MatrixSearchTableInfo tablesWithEnabled, MatrixSearchTableInfo tablesWithLocked, MatrixSearchTableInfo tablesWithConnected, MatrixSearchSingleSetInfo tablesWithSet) at Skyline.DataMiner.Library.Protocol.Matrix.MatrixHelper.ParseProtocolAutoDetectTables(ParameterInfo[] parameters, MatrixHelperParameterIds requestParameters, MatrixHelperParameterIds foundParameters, IDictionary`2 potentialTables) at Skyline.DataMiner.Library.Protocol.Matrix.MatrixHelper.ParseProtocolInfo(GetElementProtocolResponseMessage response, MatrixHelperParameterIds requestParameters, MatrixHelperParameterIds foundParameters) at Skyline.DataMiner.Library.Protocol.Matrix.MatrixHelper..ctor(SLProtocol protocol, MatrixHelperParameterIds matrixHelperParameters, Int32 maxInputCount, Int32 maxOutputCount) at MatrixStorage.GetMatrix(SLProtocol protocol) at QAction.ProccesListRoutes(SLProtocolExt protocol) at QAction.Run(SLProtocolExt protocol)
Is there a way to generate that code again so it recognizes the name change, or is there a way to edit the reference in the matrix helper class? I tried removing the QA63000 but it just gets re-created with the old reference.
To avoid having to specify every column to be used by the matrix helper class, the choice has been made to let it detect by looking at the parameter names. This way it enables the possibility to work with existing tables where the column order is shifted and parameter descriptions are custom, and still support it with the matrix helper class without needing a driver version range change. It's looking at the table name suffixed with values: "Label", "IsEnabled", "IsLocked", "ConnectedInput", "VirtualSets", or "SerializedSets".
We specially developed the macro so it would create the columns with the correct parameter names for you, so you wouldn't have to care about the needed format.
As the parameter name has been manually modified, it can't find the parameter with name <tablename> + "ConnectedInput", and will throw the exception. It would be impossible for the helper class if there are multiple string parameters in a table to know which one(s) should be used for the router control and which ones are used for other purposes without having anything to rely on (such as an agreed parameter name format).
You will have to use the original intended parameter name. Parameter names are not visible on the UI and you should use the matrixhelper to access the values from a QAction, so I see no need why you still want to change the parameter name as you shouldn't be using the parameter name anywhere in the driver. If you're changing the table name to "Destinations" instead of "RouterControlOutputs" then the parameter name will be "DestinationsConnectedInput".
The parameter description can be anything, so the end user can still see "Current Source Index (Destinations)".
While that is correct that the description can be anything since the helper class uses the name and tries to find like you said those keywords. I think that it could be a little confusing and also sometimes can be marked as a remark during a code review. Like for my case the device uses Destinations and Sources instead of Inputs and Outputs, so having a parameter with the name [Table name]ConnectedInput and a description of Connected Source (Table name) could be a problem since we tried to match the name and description as much as possible.