Пример #1
0
        public void PushDataTo(CycleDataSet cycleDataSet)
        {
            CycleData cycleData;

            Cycle[]          cycles;
            CycleDataGroup[] cycleDataGroups;

            cycleDataGroups = new CycleDataGroup[] { VA, VB, VC, IA, IB, IC };
            cycles          = new Cycle[cycleDataGroups.Length];

            for (int i = 0; i < VA.ToDataGroup().Samples; i++)
            {
                cycleData = new CycleData();

                cycles[0] = cycleData.AN.V;
                cycles[1] = cycleData.BN.V;
                cycles[2] = cycleData.CN.V;
                cycles[3] = cycleData.AN.I;
                cycles[4] = cycleData.BN.I;
                cycles[5] = cycleData.CN.I;

                for (int j = 0; j < cycles.Length; j++)
                {
                    cycles[j].RMS   = cycleDataGroups[j].RMS[i].Value;
                    cycles[j].Phase = cycleDataGroups[j].Phase[i].Value;
                    cycles[j].Peak  = cycleDataGroups[j].Peak[i].Value;
                    cycles[j].Error = cycleDataGroups[j].Error[i].Value;
                }

                cycleDataSet[i] = cycleData;
            }
        }
Пример #2
0
 public VICycleDataGroup(CycleDataGroup va, CycleDataGroup vb, CycleDataGroup vc, CycleDataGroup ia, CycleDataGroup ib, CycleDataGroup ic, CycleDataGroup ir)
 {
     m_cycleDataGroups = new List <CycleDataGroup>()
     {
         va, vb, vc, ia, ib, ic, ir
     };
 }
Пример #3
0
        private static bool isCurrent(string phase, CycleDataGroup dataGroup)
        {
            string measurementType = dataGroup.RMS.SeriesInfo.Channel.MeasurementType.Name;
            string seriesPhase     = dataGroup.RMS.SeriesInfo.Channel.Phase.Name;

            if (measurementType != "Current")
            {
                return(false);
            }

            if (seriesPhase != phase)
            {
                return(false);
            }

            return(true);
        }
        public void PushDataTo(CycleDataSet cycleDataSet)
        {
            CycleData cycleData;
            Cycle[] cycles;
            CycleDataGroup[] cycleDataGroups;

            cycleDataGroups = new CycleDataGroup[] { VA, VB, VC, IA, IB, IC };
            cycles = new Cycle[cycleDataGroups.Length];

            for (int i = 0; i < VA.ToDataGroup().Samples; i++)
            {
                cycleData = new CycleData();

                cycles[0] = cycleData.AN.V;
                cycles[1] = cycleData.BN.V;
                cycles[2] = cycleData.CN.V;
                cycles[3] = cycleData.AN.I;
                cycles[4] = cycleData.BN.I;
                cycles[5] = cycleData.CN.I;

                for (int j = 0; j < cycles.Length; j++)
                {
                    cycles[j].RMS = cycleDataGroups[j].RMS[i].Value;
                    cycles[j].Phase = cycleDataGroups[j].Phase[i].Value;
                    cycles[j].Peak = cycleDataGroups[j].Peak[i].Value;
                    cycles[j].Error = cycleDataGroups[j].Error[i].Value;
                }

                cycleDataSet[i] = cycleData;
            }
        }
        private IEnumerable<COMTRADEChannelData> ToAnalogChannelCollection(int cycleDataGroupIndex, string channelKey, CycleDataGroup cycleDataGroup)
        {
            // Get the RMS channel data from the given cycle data group
            COMTRADEChannelData rmsChannelData = new COMTRADEChannelData()
            {
                GroupOrder = 2,
                LoadOrder = cycleDataGroupIndex,
                OriginalChannelIndex = -1,
                Name = channelKey + " RMS",
                Units = GetUnits(channelKey),
                Data = cycleDataGroup.RMS
            };

            // Get the phase angle channel data from the given cycle group
            COMTRADEChannelData phaseChannelData = new COMTRADEChannelData()
            {
                GroupOrder = 3,
                LoadOrder = cycleDataGroupIndex,
                OriginalChannelIndex = -1,
                Name = channelKey + " phase angle",
                Units = string.Empty,
                Data = cycleDataGroup.Phase
            };

            // Return the channel data obtained from the given cycle group
            return new COMTRADEChannelData[] { rmsChannelData, phaseChannelData };
        }
Пример #6
0
 private XElement GetCycleElement(string name, CycleDataGroup cycleDataGroup, int cycleIndex)
 {
     return new XElement(name,
         new XElement("RMSMagnitude", cycleDataGroup.RMS[cycleIndex].Value.ToString(DoubleFormat)),
         new XElement("PhaseAngle", new Angle(cycleDataGroup.Phase[cycleIndex].Value).ToDegrees().ToString(DoubleFormat)));
 }