/** * Called when the Hardware Description is a Test Adapter. */ private void ProcessTestAdapterPath(TestAdapterDescription testAdapterDescription) { Capabilities capabilities = testAdapterDescription.Capabilities; TestEquipmentTerminalBlocks terminalBlocks = testAdapterDescription.TerminalBlocks; ProcessCapabilitites(capabilities); if (!CapabilitiesOnly) { ProcessTerminalBlocks(terminalBlocks); ProcessHardwareItemSwitching(testAdapterDescription.Switching); } }
protected void ControlsToData() { if (lvList.Items.Count > 0) { if (_terminalBlocks == null) { _terminalBlocks = new TestEquipmentTerminalBlocks(); } _terminalBlocks.TerminalBlock = new List <TestEquipmentTerminalBlocksTerminalBlock>(); foreach (ListViewItem lvi in lvList.Items) { var termBlock = (TestEquipmentTerminalBlocksTerminalBlock)lvi.Tag; _terminalBlocks.TerminalBlock.Add(termBlock); } } else { _terminalBlocks = null; } }
/** * Call to Add Terminal Blocks to the selection list view. Each item * in the list will hold an XPath representation of the Terminal Blocks. */ private void ProcessTerminalBlocks(TestEquipmentTerminalBlocks terminalBlocks) { if (terminalBlocks != null) { var g = new ListViewGroup("Terminal Blocks", "Terminal Blocks"); lvNetworkPaths.Groups.Add(g); foreach (TestEquipmentTerminalBlocksTerminalBlock terminalBlock in terminalBlocks.TerminalBlock) { Interface tbInterface = terminalBlock.Interface; if (tbInterface != null) { List <Port> ports = tbInterface.Ports; if (ports != null) { foreach (Port port in ports) { var xpath = new StringBuilder("//"); xpath.Append(XPathManager.DeterminePathName(_hardwareItemDescription)); xpath.Append("/").Append(XPathManager.DeterminePathName(terminalBlocks)); xpath.Append("/").Append(XPathManager.DeterminePathName(terminalBlock)); xpath.Append("[@name=\"").Append(terminalBlock.name).Append("\"]"); xpath.Append("/").Append(XPathManager.DeterminePathName(tbInterface)); xpath.Append("/").Append(XPathManager.DeterminePathName(ports)); xpath.Append("/").Append(XPathManager.DeterminePathName(port)); xpath.Append("[@name=\"").Append(port.name).Append("\"]"); string pathValues = NetworkNode.ExtractPathValues(xpath.ToString()); var lvi = new ListViewItem(pathValues); lvi.Tag = xpath.ToString(); lvi.Group = g; lvNetworkPaths.Items.Add(lvi); } } } } } }