private void AddIOInfo(FAMemoryBaseDevice device, int deviceIndexValue) { foreach (var item in device.GetInputIOInfoList().Values) { int index = deviceIndexValue + item.Index; _combinedInputIOList.Add(index, new CombinedIOInfo(device, item.Index)); FAIOInfo ioInfo = device.GetInputIOInfo(item.Index); InputIOInfoList.Add(index, new FAIOInfo(ioInfo.Name, index, ioInfo.Description)); } foreach (var item in device.GetOutputIOInfoList().Values) { int index = deviceIndexValue + item.Index; _combinedOutputIOList.Add(deviceIndexValue + item.Index, new CombinedIOInfo(device, item.Index)); FAIOInfo ioInfo = device.GetOutputIOInfo(item.Index); OutputIOInfoList.Add(index, new FAIOInfo(ioInfo.Name, index, ioInfo.Description)); } }
private int GetMaxIndex(FAMemoryBaseDevice device) { int max = 0; bool first = false; foreach (var info in device.GetInputIOInfoList()) { if (first == false) { first = true; max = info.Value.Index; } else { if (max < info.Value.Index) max = info.Value.Index; } } return max; }