Beispiel #1
0
 private void CheckForLength(SCDMASignal other)
 {
     if (Length == other.Length)
     {
         return;
     }
     throw new ArgumentException();
 }
Beispiel #2
0
 public SCDMASignal Add(SCDMASignal other)
 {
     CheckForLength(other);
     sbyte[] result = new sbyte[Length];
     for (var i = 0; i < Length; i++)
     {
         result[i] = (sbyte)(m_Signal[i] + other.m_Signal[i]);
     }
     return(result);
 }
Beispiel #3
0
        public SCDMAResult Combine(SCDMASignal other)
        {
            CheckForLength(other);
            long result = 0;

            for (var i = 0; i < Length; i++)
            {
                result += m_Signal[i] * other.m_Signal[i];
            }

            result /= Length;
            if (!Enum.TryParse(result.ToString(), out SCDMAResult scdmaResult))
            {
                throw new ArgumentException();
            }
            return(scdmaResult);
        }
Beispiel #4
0
 public SCDMAResult CalculateResult(SCDMASignal stationSignal)
 {
     return(m_CurrentSignal.Combine(stationSignal));
 }
Beispiel #5
0
 public void Add(SCDMASignal toAdd)
 {
     m_CurrentSignal += toAdd;
 }
Beispiel #6
0
 public SCDMACalculator(SCDMASignal currentSignal)
 {
     m_CurrentSignal = currentSignal;
 }