private EventClassification Classify(MeterDataSet meterDataSet, DataGroup dataGroup, VIDataGroup viDataGroup = null, FaultGroup faultGroup = null) { if ((object)viDataGroup != null) { if (viDataGroup.DefinedNeutralVoltages == 0 && viDataGroup.DefinedLineVoltages == 0 && HasBreakerChannels(dataGroup)) { return(EventClassification.Breaker); } } if ((object)faultGroup != null) { if (faultGroup.FaultDetectionLogicResult ?? false) { return(EventClassification.Fault); } if (faultGroup.FaultValidationLogicResult && faultGroup.Faults.Any(fault => !fault.IsSuppressed && !fault.IsReclose)) { return(EventClassification.Fault); } if (faultGroup.FaultValidationLogicResult && faultGroup.Faults.Any(fault => !fault.IsSuppressed && fault.IsReclose)) { return(EventClassification.RecloseIntoFault); } } InterruptionDataResource interruptionDataResource = meterDataSet.GetResource <InterruptionDataResource>(); SagDataResource sagDataResource = meterDataSet.GetResource <SagDataResource>(); SwellDataResource swellDataResource = meterDataSet.GetResource <SwellDataResource>(); if (interruptionDataResource.Interruptions.ContainsKey(dataGroup)) { return(EventClassification.Interruption); } if (sagDataResource.Sags.ContainsKey(dataGroup)) { return(EventClassification.Sag); } if (swellDataResource.Swells.ContainsKey(dataGroup)) { return(EventClassification.Swell); } return(EventClassification.Other); }
private EventClassification Classify(MeterDataSet meterDataSet, DataGroup dataGroup, VIDataGroup viDataGroup = null, FaultGroup faultGroup = null) { SnapshotDataResource snapshotDataResource = meterDataSet.GetResource <SnapshotDataResource>(); if (snapshotDataResource.IsSnapshot) { return(EventClassification.Snapshot); } if ((object)viDataGroup != null) { if (viDataGroup.DefinedNeutralVoltages == 0 && viDataGroup.DefinedLineVoltages == 0 && HasBreakerChannels(dataGroup)) { return(EventClassification.Breaker); } } if ((object)faultGroup != null) { if (faultGroup.FaultDetectionLogicResult ?? false) { return(EventClassification.Fault); } if (!faultGroup.FaultDetectionLogicResult.HasValue && m_faultLocationSettings.UseDefaultFaultDetectionLogic) { if (faultGroup.FaultValidationLogicResult && faultGroup.Faults.Any(fault => !fault.IsSuppressed && !fault.IsReclose)) { return(EventClassification.Fault); } if (faultGroup.FaultValidationLogicResult && faultGroup.Faults.Any(fault => !fault.IsSuppressed && fault.IsReclose)) { return(EventClassification.RecloseIntoFault); } } } BreakerDataResource breakerOpenResource = meterDataSet.GetResource <BreakerDataResource>(); if (breakerOpenResource.TripLookup.TryGetValue(dataGroup, out List <BreakerDataResource.Trip> trips)) { return(EventClassification.BreakerOpen); } InterruptionDataResource interruptionDataResource = meterDataSet.GetResource <InterruptionDataResource>(); SagDataResource sagDataResource = meterDataSet.GetResource <SagDataResource>(); SwellDataResource swellDataResource = meterDataSet.GetResource <SwellDataResource>(); TransientDataResource transientDataResource = meterDataSet.GetResource <TransientDataResource>(); if (interruptionDataResource.Interruptions.ContainsKey(dataGroup)) { return(EventClassification.Interruption); } if (sagDataResource.Sags.ContainsKey(dataGroup)) { return(EventClassification.Sag); } if (swellDataResource.Swells.ContainsKey(dataGroup)) { return(EventClassification.Swell); } if (transientDataResource.Transients.ContainsKey(dataGroup)) { return(EventClassification.Transient); } return(EventClassification.Other); }