public void TestTrim()
        {

            EffectTxSlopeAtReceiver temp = new EffectTxSlopeAtReceiver();

            Assert.AreEqual(5, temp.Trim(2, 5, 10));
        }
 public void testCalcPointEffTxHt3()
 {
     EffectTxSlopeAtReceiver temp = new EffectTxSlopeAtReceiver();
     SectionPathLossCalcParam param = new SectionPathLossCalcParam();
     param.CalcResolution = 0.1f;
     short[] altitudes = new short[] { 10, 11, 12, 13 };
     Assert.AreEqual(26.99f, temp.CalcPointEffTxHt(param, altitudes), 2);
 }
 public void testCalcPointEffTxHt2()
 {
     EffectTxSlopeAtReceiver temp = new EffectTxSlopeAtReceiver();
     SectionPathLossCalcParam param = new SectionPathLossCalcParam();
     param.CalcResolution = 10;
     short[] altitudes = new short[] { 300, 25, 100, 10 };
     Assert.AreEqual(320.0f, temp.CalcPointEffTxHt(param, altitudes));
 }
 public void testGetSlope2()
 {
     EffectTxSlopeAtReceiver temp = new EffectTxSlopeAtReceiver();
     SectionPathLossCalcParam param = new SectionPathLossCalcParam();
     param.CalcResolution = 100;
     short[] altitudes = new short[] { 10, 25, 100, 300 };
     int nIndex = 4;
     Assert.AreEqual(1.0f, temp.GetSlope(param, altitudes, nIndex));
 }
Exemplo n.º 5
0
 public static void InitialCalcMethods()
 {
     EffectTxHeightHtAbsSpot spot = new EffectTxHeightHtAbsSpot();
     EffectTxAboveTheGround ground = new EffectTxAboveTheGround();
     EffectTxAboveTheAverageGround ground2 = new EffectTxAboveTheAverageGround();
     EffectTxSpotHt ht = new EffectTxSpotHt();
     EffectTxSlopeAtReceiver receiver = new EffectTxSlopeAtReceiver();
     EffectTxEnhancedSlope slope = new EffectTxEnhancedSlope();
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[EffectTxHeightCalcuMethod.DefaultEffectTxHeightCalcuMethodName] = null;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[spot.EffectTxHeightMethodName] = spot;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[ground.EffectTxHeightMethodName] = ground;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[ground2.EffectTxHeightMethodName] = ground;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[ht.EffectTxHeightMethodName] = ht;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[receiver.EffectTxHeightMethodName] = receiver;
     EffectTxHeightCalcuMethod.EffectTxHeightCalcuMethodList[slope.EffectTxHeightMethodName] = slope;
 }
        public void testCalcRayEffTxHt()
        {
            EffectTxSlopeAtReceiver temp = new EffectTxSlopeAtReceiver();
            SectionPathLossCalcParam param = new SectionPathLossCalcParam();
            param.CalcResolution = 10;
            short[] altitudes = new short[] { 10, 25, 100, 300, -32768 };
            float[] results = temp.CalcRayEffTxHt(param, altitudes, 0, 4);
            for (int i = 0; i < 5; i++)
            {
                if (altitudes[i] == -32768f)
                {
                    Assert.AreEqual(-32768f, results[i]);
                }
                else
                {
                    Assert.AreEqual(30.0f, results[i]);
                }
            }

        }