I'm using the Matrix helper class in my driver to facilitate interactions between Outputs and Inputs.
I ran the Macro CreateMatrix with a value of 3 to only have the tables.
I'm not sure if I'm doing something wrong but I can't disconnect an output if it is connected to the first input. What I mean by this is that if any Output is connected to the first input in my case "1" I can't disconnect it.
In the other hand if an Output is connected to anything else for example "2", "3", or "1000" I'm able to disconnect this output. (This is using the Output Table)
I first thought it was something with my driver but I created a dummy driver with basic code and I'm experiencing the same outcome.
This is the code that that I'm using. I can see the log in the method when doing a connection, for a disconnect I can see the log only when the output is not in my case "1".
protected override void OnCrossPointsSetFromUI(MatrixCrossPointsSetFromUIMessage set)
{
protocol.Log(8, 5, "Execute OnCrossPointsSetFromUI");
HashSet<int> disconnectedOutputs = new HashSet<int>();
HashSet<int> connectedOutputs = new HashSet<int>();
foreach (var crossPointSet in set.CrossPointSets)
{
if (crossPointSet.State == MatrixCrossPointConnectionState.Connected)
{
disconnectedOutputs.Remove(crossPointSet.Output);
connectedOutputs.Add(crossPointSet.Output);// TODO Zero based output number 'crossPointSet.Output' is connected to zero based input number 'crossPointSet.Input' -> this still needs to be set on the device (send command in buffer and perform get after set to fill it in the matrix helper object.
Outputs[crossPointSet.Output].Connect(crossPointSet.Input);
}
else
{
if (!connectedOutputs.Contains(crossPointSet.Output))
{
disconnectedOutputs.Add(crossPointSet.Output);
}
}
}foreach (int disconnectedOutput in disconnectedOutputs)
{
// TODO Zero based output number 'disconnectedOutput' has no connected inputs anymore -> this still needs to be set on the device (send command in buffer and perform get after set to fill it in the matrix helper object).
Outputs[disconnectedOutput].DisconnectAll();
}ApplyChanges(protocol);
}
Fix included in 1.1.2.7 and 1.2.0.4 of class library.