Пример #1
0
 /**********************************************************************
  *********************************************************************/
 void CreateTopHalf(Grid grid)
 {
     skiaview = new SKCanvasView();
     skiaview = CongestionControlDraw.ReturnCanvas();
     skiaview.BackgroundColor = App._viewBackground;
     grid.Children.Add(skiaview, 0, 0);
 }
Пример #2
0
 /**********************************************************************
  *********************************************************************/
 void UpdateDrawing()
 {
     //update background
     CongestionControlDraw.stateR = stateR;
     CongestionControlDraw.stateT = stateT;
     CongestionControlDraw.Paint();
 }
Пример #3
0
        //CONSTRUCTOR
        public CongestionControl(int th, bool r, bool t)
        {
            ToolbarItem info = new ToolbarItem();

            info.Text = App._sHelpInfoHint;
            this.ToolbarItems.Add(info);
            info.Clicked += B_Info_Clicked;

            initial_thresh          = th;
            thresholdR              = th;
            thresholdT              = th;
            renoOn                  = r;
            tahoeOn                 = t;
            flag1                   = false;
            flagDupAckAndNoNewRound = false;
            stateT                  = 0;
            stateR                  = 0;
            dupAckCountR            = 0;
            dupAckCountT            = 0;
            cwndR                   = 1;
            cwndT                   = 1;
            currentRoundR           = 0;
            currentRoundT           = 0;
            currentIndex            = 0;
            maxCwnd                 = 14;
            doubleTimeout           = false;

            //note: numberOfRounds*4 is kinda arbitrary. Since there can be no arrays of unknown length, but it has to be long enough
            reno        = new int[2, numberOfRounds *4];
            tahoe       = new int[2, numberOfRounds *4];
            reno[1, 0]  = 0;
            reno[0, 0]  = cwndR;
            tahoe[1, 0] = 0;
            tahoe[0, 0] = cwndT;

            ssthreshR       = new int[2, numberOfRounds *4];
            ssthreshT       = new int[2, numberOfRounds *4];
            ssthreshR[1, 0] = 0;
            ssthreshR[0, 0] = thresholdR;
            ssthreshT[1, 0] = 0;
            ssthreshT[0, 0] = thresholdT;

            if (tahoeOn && !renoOn)
            {
                strategy = "Tahoe";
            }
            else if (renoOn && !tahoeOn)
            {
                strategy = "Reno";
            }
            else
            {
                strategy = "Reno & Tahoe";
            }
            Title = "Congestion Control: " + strategy;

            draw = new CongestionControlDraw();

            // content starts only after notch
            On <iOS>().SetUseSafeArea(true);

            CreateContent();
        }