public InstrumenationChartView (InstrumentationViewerDialog parent)
		{
			Build ();
			
			this.parent = parent;
			
			// The list for the List Mode
			
			listViewStore = new ListStore (typeof(ListViewValueInfo), typeof(Gdk.Pixbuf), typeof (string), typeof(string), typeof(string), typeof (string), typeof (string));
			listView = new TreeView ();
			listView.Model = listViewStore;
			
			CellRendererText crx = new CellRendererText ();
			listView.AppendColumn ("Timestamp", crx, "text", 3);
			
			TreeViewColumn col = new TreeViewColumn ();
			col.Title = "Counter";
			CellRendererPixbuf crp = new CellRendererPixbuf ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "pixbuf", 1);
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 2);
			listView.AppendColumn (col);
			
			listView.AppendColumn ("Count", crx, "text", 4);
			listView.AppendColumn ("Total Count", crx, "text", 5);
			listView.AppendColumn ("Time", crx, "text", 6);
			
			listView.RowActivated += HandleListViewRowActivated;
			
			listViewScrolled = new ScrolledWindow ();
			listViewScrolled.Add (listView);
			listViewScrolled.ShadowType = ShadowType.In;
			listViewScrolled.HscrollbarPolicy = PolicyType.Automatic;
			listViewScrolled.VscrollbarPolicy = PolicyType.Automatic;
			listViewScrolled.ShowAll ();
			boxCharts.PackStart (listViewScrolled, true, true, 0);
			
			// The series list
			
			seriesStore = new ListStore (typeof(bool), typeof(Gdk.Pixbuf), typeof (string), typeof(ChartSerieInfo), typeof(String), typeof(String), typeof (String));
			listSeries.Model = seriesStore;
			
			col = new TreeViewColumn ();
			col.Title = "Counter";
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			
			crp = new CellRendererPixbuf ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "pixbuf", 1);
			
			crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 2);
			listSeries.AppendColumn (col);
			
			listSeries.AppendColumn ("Last", crx, "text", 4);
			listSeries.AppendColumn ("Sel", crx, "text", 5);
			listSeries.AppendColumn ("Diff", crx, "text", 6);
			
			crt.Toggled += SerieToggled;
			
			countChart = new BasicChart ();
			countAxisY = new IntegerAxis (true);
			countAxisX = new DateTimeAxis (true);
			countChart.AddAxis (countAxisX, AxisPosition.Bottom);
			countChart.AddAxis (countAxisY, AxisPosition.Right);
			countChart.OriginY = 0;
			countChart.StartY = 0;
//			countChart.EndY = 100;
			countChart.AllowSelection = true;
			countChart.SetAutoScale (AxisDimension.Y, false, true);
			countChart.SelectionStart.LabelAxis = countAxisX;
			countChart.SelectionEnd.LabelAxis = countAxisX;
			countChart.SelectionChanged += CountChartSelectionChanged;
			
			timeChart = new BasicChart ();
			timeAxisY = new IntegerAxis (true);
			timeAxisX = new DateTimeAxis (true);
			timeChart.AddAxis (timeAxisX, AxisPosition.Bottom);
			timeChart.AddAxis (timeAxisY, AxisPosition.Right);
			timeChart.OriginY = 0;
			timeChart.StartY = 0;
			timeChart.EndY = 100;
			timeChart.AllowSelection = true;
//			timeChart.SetAutoScale (AxisDimension.Y, true, true);
			timeChart.SelectionStart.LabelAxis = timeAxisX;
			timeChart.SelectionEnd.LabelAxis = timeAxisX;
			
			frameCharts.PackStart (countChart, true, true, 0);
			frameCharts.PackStart (timeChart, true, true, 0);
			frameCharts.ShowAll ();
			
			if (App.FromFile) {
				if (visibleTime > App.Service.EndTime - App.Service.StartTime)
					visibleTime = App.Service.EndTime - App.Service.StartTime;
				startTime = App.Service.StartTime;
				endTime = startTime + visibleTime;
			}
			else {
				endTime = DateTime.Now;
				startTime = endTime - visibleTime;
			}
			
			DateTime st = App.Service.StartTime;
			if (st > startTime) st = startTime;
			
			chartScroller.Adjustment.Lower = st.Ticks;
			
			UpdateCharts ();
			chartScroller.Value = chartScroller.Adjustment.Upper;
			
			if (!App.FromFile)
				StartAutoscroll ();
			
			toggleTimeView.Active = true;
		}
Example #2
0
		void UpdateMode ()
		{
			AllowSelection = false;
			
			Reset ();

			if (type == TestChartType.Results) {
				AddSerie (serieIgnored);
				AddSerie (serieFailed);
				AddSerie (serieSuccess);
			} else {
				AddSerie (serieTime);
			}
			
			if (timeScale) {
				ReverseXAxis = false;
				Axis ax = new DateTimeAxis (true);
				AddAxis (new DateTimeAxis (false), AxisPosition.Top);
				AddAxis (ax, AxisPosition.Bottom);
				SelectionEnd.Value = SelectionStart.Value = DateTime.Now.Ticks;
				SelectionStart.LabelAxis = ax;
				SelectionEnd.LabelAxis = ax;
			} else {
				ReverseXAxis = true;
				AddAxis (new TestRunAxis (false), AxisPosition.Top);
				testRunAxis = new TestRunAxis (true);
				AddAxis (testRunAxis, AxisPosition.Bottom);
				SelectionEnd.Value = SelectionStart.Value = 0;
				SelectionStart.LabelAxis = testRunAxis;
				SelectionEnd.LabelAxis = testRunAxis;
			}
			showLastTest = true;
			resetCursors = true;
			
			AddAxis (new IntegerAxis (true), AxisPosition.Left);
			AddAxis (new IntegerAxis (true), AxisPosition.Right);
			
			if (test != null)
				Fill (test);
			
			AllowSelection = true;
		}