Example #1
0
		public StaffHistory()
		{
			m_Pages = new PageInfoCollection();
			m_QueueStats = new QueueStatusCollection();

			m_UserInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
			m_StaffInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
		}
Example #2
0
        public StaffHistory()
        {
            m_Pages      = new PageInfoCollection();
            m_QueueStats = new QueueStatusCollection();

            m_UserInfo  = new Hashtable(StringComparer.OrdinalIgnoreCase);
            m_StaffInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
        }
Example #3
0
        public StaffHistory()
        {
            m_Pages      = new PageInfoCollection();
            m_QueueStats = new QueueStatusCollection();

            m_UserInfo  = new Hashtable();
            m_StaffInfo = new Hashtable();
        }
Example #4
0
        public StaffHistory()
        {
            m_Pages = new PageInfoCollection();
            m_QueueStats = new QueueStatusCollection();

            m_UserInfo = new Hashtable();
            m_StaffInfo = new Hashtable();
        }
Example #5
0
        public static int GetPageCount( PageInfoCollection pages, PageResolution res, DateTime min, DateTime max )
        {
            int count = 0;

            for ( int i = 0; i < pages.Count; ++i )
            {
                if ( res != PageResolution.None && pages[i].Resolution != res )
                    continue;

                DateTime ts = pages[i].TimeResolved;

                if ( ts >= min && ts < max )
                    ++count;
            }

            return count;
        }
Example #6
0
        public static int GetPageCount(PageInfoCollection pages, PageResolution res, DateTime min, DateTime max)
        {
            int count = 0;

            for (int i = 0; i < pages.Count; ++i)
            {
                if (res != PageResolution.None && pages[i].Resolution != res)
                {
                    continue;
                }

                DateTime ts = pages[i].TimeResolved;

                if (ts >= min && ts < max)
                {
                    ++count;
                }
            }

            return(count);
        }
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal PageInfoCollectionEnumerator(PageInfoCollection collection)
 {
     this._index      = -1;
     this._collection = collection;
 }
Example #8
0
        private BarGraph GraphHourlyPages(PageInfoCollection pages, PageResolution res, string title, string fname)
        {
            int[] totals = new int[24];
            int[] counts = new int[24];

            DateTime[] dates = new DateTime[24];

            DateTime max = DateTime.UtcNow;
            DateTime min = max - TimeSpan.FromDays(7.0);

            bool sentStamp = (res == PageResolution.None);

            for (int i = 0; i < pages.Count; ++i)
            {
                if (res != PageResolution.None && pages[i].Resolution != res)
                {
                    continue;
                }

                DateTime ts = (sentStamp ? pages[i].TimeSent : pages[i].TimeResolved);

                if (ts >= min && ts < max)
                {
                    DateTime date = ts.Date;
                    TimeSpan time = ts.TimeOfDay;

                    int hour = time.Hours;

                    totals[hour]++;

                    if (dates[hour] != date)
                    {
                        counts[hour]++;
                        dates[hour] = date;
                    }
                }
            }

            BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines)
            {
                FontSize = 6
            };

            for (int i = 7; i <= totals.Length + 7; ++i)
            {
                int val;

                if (counts[i % totals.Length] == 0)
                {
                    val = 0;
                }
                else
                {
                    val = (totals[i % totals.Length] + (counts[i % totals.Length] / 2)) / counts[i % totals.Length];
                }

                int realHours = i % totals.Length;
                int hours;

                if (realHours == 0)
                {
                    hours = 12;
                }
                else if (realHours > 12)
                {
                    hours = realHours - 12;
                }
                else
                {
                    hours = realHours;
                }

                barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val);
            }

            return(barGraph);
        }
Example #9
0
		private BarGraph GraphHourlyPages( PageInfoCollection pages, PageResolution res, string title, string fname )
		{
			int[] totals = new int[24];
			int[] counts = new int[24];
			
			DateTime[] dates = new DateTime[24];

			DateTime max = DateTime.UtcNow;
			DateTime min = max - TimeSpan.FromDays( 7.0 );

			bool sentStamp = ( res == PageResolution.None );

			for ( int i = 0; i < pages.Count; ++i )
			{
				if ( res != PageResolution.None && pages[i].Resolution != res )
					continue;

				DateTime ts = ( sentStamp ? pages[i].TimeSent : pages[i].TimeResolved );

				if ( ts >= min && ts < max )
				{
					DateTime date = ts.Date;
					TimeSpan time = ts.TimeOfDay;

					int hour = time.Hours;

					totals[hour]++;

					if ( dates[hour] != date )
					{
						counts[hour]++;
						dates[hour] = date;
					}
				}
			}

			BarGraph barGraph = new BarGraph( title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines );

			barGraph.FontSize = 6;

			for ( int i = 7; i <= totals.Length+7; ++i )
			{
				int val;

				if ( counts[i%totals.Length] == 0 )
					val = 0;
				else
					val = (totals[i%totals.Length] + (counts[i%totals.Length] / 2)) / counts[i%totals.Length];

				int realHours = i%totals.Length;
				int hours;

				if ( realHours == 0 )
					hours = 12;
				else if ( realHours > 12 )
					hours = realHours - 12;
				else
					hours = realHours;

				barGraph.Items.Add( hours + (realHours >= 12 ? " PM" : " AM"), val );
			}

			return barGraph;
		}
Example #10
0
 public BaseInfo(string account)
 {
     this.m_Account = account;
     this.m_Pages = new PageInfoCollection();
 }
Example #11
0
 public BaseInfo(string account)
 {
     m_Account = account;
     m_Pages   = new PageInfoCollection();
 }
Example #12
0
 /// <summary>
 /// Default constructor for enumerator.
 /// </summary>
 /// <param name="collection">Instance of the collection to enumerate.</param>
 internal PageInfoCollectionEnumerator( PageInfoCollection collection )
 {
     _index = -1;
     _collection = collection;
 }