private bool ExecutingLevelFourAdjacencyResolution() { foreach (VertexAdjacencyRow row in m_adjacencyList.Rows) { foreach (VertexCluster adjacency in row.Adjacencies) { SwitchingDeviceBase connectingEdge = ConnectingEdgeBetween(row.Header, adjacency); if (!connectingEdge.CrossDevicePhasors.MeasurementPairWasReported) { if (connectingEdge is CircuitBreaker) { CircuitBreaker circuitBreaker = (CircuitBreaker)connectingEdge; if (circuitBreaker.IsMeasuredClosed) { ConnectionEstablished(row.Header, adjacency); return(true); } } else if (connectingEdge is Switch) { Switch circuitSwitch = (Switch)connectingEdge; if (circuitSwitch.IsClosed) { ConnectionEstablished(row.Header, adjacency); return(true); } } } } } return(false); }
/// <summary> /// Intneded to function as a recursive function for use with <see cref="LinearStateEstimator.Graphs.SubstationGraph.ResolveDirectlyConnectedAdjacencies"/> which calls this method as the parameter of a while loop. This method will be called over and over again until all of the adjacencies which have direct electrical connections are resolved into clusters of directly connected nodes. /// </summary> /// <returns></returns> public bool ResolvingDirectlyConnectedAdjacencies() { foreach (VertexAdjacencyRow row in m_adjacencyList.Rows) { foreach (VertexCluster adjacency in row.Adjacencies) { SwitchingDeviceBase connectingEdge = ConnectingEdgeBetween(row.Header, adjacency); if (connectingEdge is CircuitBreaker) { CircuitBreaker circuitBreaker = (CircuitBreaker)connectingEdge; if (circuitBreaker.IsClosed) { ConnectionEstablished(row.Header, adjacency); return(true); } } else if (connectingEdge is Switch) { Switch circuitSwitch = (Switch)connectingEdge; if (circuitSwitch.IsClosed) { ConnectionEstablished(row.Header, adjacency); return(true); } } } } return(false); }
private bool CheckForEdgeConnectionError(SwitchingDeviceBase edge) { foreach (VertexAdjacencyRow row in m_adjacencyList.Rows) { int fromVertex = edge.FromNodeID; int toVertex = edge.ToNodeID; if (row.Header.Vertices.Contains(fromVertex) && !row.Header.Vertices.Contains(toVertex)) { return(true); } else if (!row.Header.Vertices.Contains(fromVertex) && row.Header.Vertices.Contains(toVertex)) { return(true); } } return(false); }