public override List <Signal> Process(List <Signal> e) { List <Signal> filteredSignal = new List <Signal>(); //do some parameter process //according to the input channels that is selected, call the actual function and process each signal. var groupbyPMU = e.GroupBy(x => x.PMUName).ToDictionary(y => y.Key, y => y.ToList()); foreach (var gr in groupbyPMU) { if (InputSignals.Contains(gr.Key)) { for (int i = 0; i < gr.Value.Count(); i++) { if (i == 0) { Filters.PMUflagFilt(gr.Value[i]); } else { gr.Value[i].Flags = new List <bool>(gr.Value[0].Flags); } filteredSignal.Add(gr.Value[i]); } } } return(filteredSignal); }
public override List <Signal> Process(List <Signal> e) { List <Signal> filteredSignal = new List <Signal>(); //do some parameter process //according to the input channels that is selected, call the actual function and process each signal. foreach (var signal in e) { var name = signal.PMUName + "_" + signal.SignalName; if (InputSignals.Contains(name)) { Filters.DropOutMissingFilt(signal); filteredSignal.Add(signal); } } return(filteredSignal); }
public override List <Signal> Process(List <Signal> e) { List <Signal> filteredSignal = new List <Signal>(); //do some parameter process //according to the input channels that is selected, call the actual function and process each signal. foreach (var signal in e) { var type = signal.TypeAbbreviation; if (type.Length == 1 && type == "F") { var name = signal.PMUName + "_" + signal.SignalName; if (InputSignals.Contains(name)) { Filters.WrappingFailureDQFilt(signal, AngleThresh); filteredSignal.Add(signal); } } } return(filteredSignal); }
public override List <Signal> Process(List <Signal> e) { List <Signal> filteredSignal = new List <Signal>(); //do some parameter process //according to the input channels that is selected, call the actual function and process each signal. var groupbyPMU = e.GroupBy(x => x.TypeAbbreviation).ToDictionary(y => y.Key.Length < 3 ? y.Key : y.Key.Substring(0, 2), y => y.ToList()); List <Signal> vms = null; if (groupbyPMU.ContainsKey("VM")) { vms = groupbyPMU["VM"]; foreach (var signal in vms) { var name = signal.PMUName + "_" + signal.SignalName; if (InputSignals.Contains(name)) { Filters.VoltPhasorFilt(signal, "VM", VoltMax, VoltMin, NomVoltage); filteredSignal.Add(signal); } } } if (groupbyPMU.ContainsKey("VP")) { var vps = groupbyPMU["VP"]; foreach (var signal in vps) { var name = signal.PMUName + "_" + signal.SignalName; if (InputSignals.Contains(name)) { Filters.VoltPhasorFilt(signal, "VP", VoltMax, VoltMin, NomVoltage); filteredSignal.Add(signal); } } } if (groupbyPMU.ContainsKey("VA")) { if (vms != null) { var vas = groupbyPMU["VA"]; //var vpsNames = vps.Select(x => x.SignalName.Substring(0, x.SignalName.LastIndexOf('.'))); foreach (var signal in vas) { var name = signal.PMUName + "_" + signal.SignalName; if (InputSignals.Contains(name)) { var vpFound = false; foreach (var vm in vms) { if (signal.SignalName.Substring(0, signal.SignalName.LastIndexOf('.')) == vm.SignalName.Substring(0, vm.SignalName.LastIndexOf('.'))) { signal.Flags = new List <bool>(vm.Flags); vpFound = true; break; } } //how to find the corresponding magnitude? if (vpFound) { filteredSignal.Add(signal); } else { throw new Exception("Cannot pass voltage angle signal: " + signal.SignalName + " through VoltPhasorFilt as corresponding voltage magnitude signal was not found."); } } } } else { throw new Exception("Cannot pass voltage angle signal through VoltPhasorFilt as corresponding voltage magnitude signal was not found."); } } //foreach (var signal in e) //{ // var type = signal.TypeAbbreviation; // if (type.Length > 1) // { // var tp = type.Substring(0, 2); // var name = signal.PMUName + "_" + signal.SignalName; // if (InputSignals.Contains(name)) // { // if (tp == "VM" || tp == "VP") // { // Filters.VoltPhasorFilt(signal, tp, VoltMax, VoltMin, NomVoltage); // filteredSignal.Add(signal); // } // else if (tp == "VA") // { // } // } // } //} return(filteredSignal); }