コード例 #1
0
        private void AddNewMeasurementToBuffer(PhasorMeasurement phasorMeasurement)
        {
            m_rawMeasurementBuffer.Add(phasorMeasurement.DeepCopy());
            m_assertedMeasurementBuffer.Add(phasorMeasurement.DeepCopy());
            m_z[0, 0] = phasorMeasurement.PerUnitComplexPhasor;

            AssertRawMeasurement();
        }
コード例 #2
0
 private void ReplaceLatestMeasurement(PhasorMeasurement phasorMeasurement)
 {
     if (m_assertedMeasurementBuffer.Count < MAX_BUFFER_SIZE)
     {
         // If the measurement buffer is filling up, overwrite the measurement in the highest position
         m_assertedMeasurementBuffer[m_assertedMeasurementBuffer.Count - 1] = phasorMeasurement.DeepCopy();
         m_z[0, 0] = phasorMeasurement.PerUnitComplexPhasor;
         ReplaceLatestAssertment();
     }
     else if (m_assertedMeasurementBuffer.Count == MAX_BUFFER_SIZE)
     {
         // If the measurement buffer is full, overwrite the measurement in the highest position
         m_assertedMeasurementBuffer[BUFFER_TOP_POSITION] = phasorMeasurement.DeepCopy();
         m_z[0, 0] = phasorMeasurement.PerUnitComplexPhasor;
         ReplaceLatestAssertment();
     }
     else
     {
         throw new Exception("Measurement buffer size exceeded.");
     }
 }