Ejemplo n.º 1
0
        /// <summary>
        /// This method deals with calculating and updating the stats on the GUI
        /// </summary>
        private void Update_Stats()
        {
            //Reset
            stats.ActiveLabels.Clear();

            //# Packet Loss value
            //Displays the lost packets
            stats.ChangeLabelText(Data_PacketsLost, lostPackets.ToString());

            //# Packet Loss percentage
            //Displays the lost packets as a percentage
            int    total_packets = UDPServer.GRID_SIZE * UDPServer.GRID_SIZE;
            int    percent       = lostPackets / total_packets * 100;
            string msg           = percent + "%";

            stats.ChangeLabelText(Data_LostPacketsPercent, msg);

            //# Displays how many packets should be sent
            stats.ChangeLabelText(Data_TotalPackets, total_packets.ToString());
        }