Beispiel #1
0
        /// <summary>
        /// Constructor - Build UI
        /// </summary>		
        public Visualizer(string filename)
        {
            //valueTable = new Dictionary<string,List<decimal>>();
            visFileList = new Dictionary<string,VisFileContainer>();

            grapher = new Grapher(this);

            this.SuspendLayout();

            this.Size = new Size(1100,500);
            this.Text = "DRAMVis     University Of Maryland";

            //
            //menu bar at top of the screen
            //
            menuStrip = new MenuStrip();

            file = new ToolStripMenuItem("File");
            about = new ToolStripMenuItem("About");
            menuStrip.Items.Add(file);
            menuStrip.Items.Add(about);

            fileOpen = new ToolStripMenuItem("Open .vis File");
            fileOpen.Click += new System.EventHandler(this.OpenFileButton_Click);
            file.DropDownItems.Add(fileOpen);

            help = new ToolStripMenuItem("Help");
            about.DropDownItems.Add(help);

            //
            //tool strip stuff
            //
            toolStrip = new ToolStrip();

            pointerButton = new ToolStripButton(new Bitmap("../../pointer.png"));
            pointerButton.Click += new EventHandler(this.PointerButton_Click);
            pointerButton.ToolTipText = "Pointer";
            pointerButton.Size = new Size(32,32);
            zoomButton = new ToolStripButton(new Bitmap("../../zoom.png"));
            zoomButton.Click += new EventHandler(this.ZoomButton_Click);
            zoomButton.ToolTipText = "Zoom";
            handButton = new ToolStripButton(new Bitmap("../../pan.png"));
            handButton.Click += new EventHandler(this.HandButton_Click);
            handButton.ToolTipText = "Pan";

            saveGraphButton = new ToolStripButton(new Bitmap("../../savegraph.png"));
            saveGraphButton.ToolTipText = "Save graphs to file";
            saveGraphButton.Click += new EventHandler(this.SaveGraphButton_Click);
            openFileButton = new ToolStripButton(new Bitmap("../../open.png"));
            openFileButton.Click += new EventHandler(this.OpenFileButton_Click);
            openFileButton.ToolTipText = "Open .vis file";
            playButton = new ToolStripButton(new Bitmap("../../play.png"));
            playButton.Click += new EventHandler(this.PlayButton_Click);
            playButton.ToolTipText = "Run simulation";
            playButton.Name = "Play";
            playPlusButton = new ToolStripButton(new Bitmap("../../playplus.png"));
            playPlusButton.Click += new EventHandler(this.PlayButton_Click);
            playPlusButton.ToolTipText = "Run and Add";
            playPlusButton.Name = "PlayPlus";

            ToolStripItem runFor = new ToolStripLabel("Run For:");
            cycleCount = new ToolStripTextBox();
            cycleCount.Size = new Size(70,0);
            cycleCount.Text = "500000";
            ToolStripItem cyclesLabel = new ToolStripLabel("cycles");

            ToolStripItem displayAsLabel = new ToolStripLabel("Display As:");
            displayAs = new ToolStripComboBox();
            displayAs.Items.AddRange(new string[] {"Total","Total Average", "Per Rank","Per Bank"});
            displayAs.SelectedIndex = 0;
            displayAs.SelectedIndexChanged += new EventHandler(this.DataDisplayCombo_IndexChanged);

            toolStrip.Items.AddRange(new ToolStripItem[]{openFileButton, saveGraphButton,
                new ToolStripSeparator(),pointerButton,zoomButton,handButton,
                new ToolStripSeparator(),playButton, playPlusButton,
                new ToolStripSeparator(), runFor, cycleCount, cyclesLabel,
                new ToolStripSeparator(), displayAsLabel,displayAs});

            //
            //control panel tab page
            //
            controlPanel = new TabControl();
            controlPanel.Dock = DockStyle.Fill;
            controlPanel.Alignment = TabAlignment.Bottom;

            //
            //system property page stuff
            //
            systemPropertyPage = new TabPage("System");
            systemPropertyPage.BorderStyle = BorderStyle.Fixed3D;
            systemPropertyPage.Anchor = AnchorStyles.Top;

            TableLayoutPanel systemtlp = new TableLayoutPanel();
            systemtlp.Margin = new Padding(0,0,0,0);
            systemtlp.RowCount = 3;
            systemtlp.ColumnCount = 2;

            //trace
            Label traceLabel = new Label();
            traceLabel.Text = "Trace File";
            traceLabel.TextAlign = ContentAlignment.MiddleCenter;
            traceLabel.Dock = DockStyle.Fill;
            traceLabel.Font = new Font(traceLabel.Font, FontStyle.Bold);
            systemtlp.Controls.Add(traceLabel,0,0);
            systemtlp.SetColumnSpan(traceLabel,2);

            traceSelectionButton = new Button();
            traceSelectionButton.Image = new Bitmap(new Bitmap("../../open.png"), new Size(16,16));
            traceSelectionButton.Click += new EventHandler(this.TraceSelectionButton_Click);
            systemtlp.Controls.Add(traceSelectionButton,0,1);

            traceNameDisplay = new TextBox();
            traceNameDisplay.BorderStyle = BorderStyle.Fixed3D;
            traceNameDisplay.TextAlign = HorizontalAlignment.Center;
            traceNameDisplay.BackColor = Color.White;
            traceNameDisplay.Dock = DockStyle.Fill;
            traceNameDisplay.ReadOnly = true;
            systemtlp.Controls.Add(traceNameDisplay,1,1);

            systemPropertyGrid = new PropertyGrid();
            systemPropertyGrid.Dock = DockStyle.Fill;
            systemPropertyGrid.SelectedObject = systemParameters;

            systemtlp.Controls.Add(systemPropertyGrid,0,2);
            systemtlp.SetColumnSpan(systemPropertyGrid, 2);

            systemtlp.Dock = DockStyle.Fill;
            systemtlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,35));
            systemtlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,185));

            systemPropertyPage.Controls.Add(systemtlp);
            systemPropertyPage.Resize += delegate(object sender, EventArgs e) {
                TabPage x = (TabPage)sender;
                systemPropertyGrid.Height = x.Height-150;
            };
            //
            //Device Property page stuff
            //
            devicePropertyPage = new TabPage("Device");
            devicePropertyPage.BorderStyle = BorderStyle.Fixed3D;

            TableLayoutPanel devicetlp = new TableLayoutPanel();
            devicetlp.RowCount = 3;
            devicetlp.ColumnCount = 1;

            devicePropertyGrid = new PropertyGrid();
            devicePropertyGrid.Dock = DockStyle.Fill;

            Label deviceComboLabel = new Label();
            deviceComboLabel.Text = "Device Name";
            deviceComboLabel.TextAlign = ContentAlignment.MiddleCenter;
            deviceComboLabel.Font = new Font(deviceComboLabel.Font, FontStyle.Bold);
            deviceComboLabel.Dock = DockStyle.Fill;

            deviceComboBox = new ComboBox();
            deviceComboBox.Dock = DockStyle.Fill;
            FillDeviceComboBox();
            deviceComboBox.SelectedIndexChanged += new EventHandler(this.DeviceComboBox_IndexChanged);
            deviceComboBox.SelectedIndex = 0;

            devicetlp.Controls.Add(deviceComboLabel,0,0);
            devicetlp.Controls.Add(deviceComboBox,0,1);
            devicetlp.Controls.Add(devicePropertyGrid,0,2);
            devicetlp.Dock = DockStyle.Fill;
            devicetlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,35));
            devicetlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,185));

            devicePropertyPage.Resize += delegate(object sender, EventArgs e) {
                TabPage x = (TabPage)sender;
                devicePropertyGrid.Height = x.Height-150;
            };
            devicePropertyPage.Controls.Add(devicetlp);

            //
            //previous results page
            //
            TableLayoutPanel resultstlp = new TableLayoutPanel();
            resultstlp.ColumnCount = 1;
            resultstlp.RowCount = 2;

            resultsPage = new TabPage();
            resultsPage.Text = "Results";

            Label resultsLabel = new Label();
            resultsLabel.Text = "Previous Results";
            resultsLabel.TextAlign = ContentAlignment.MiddleCenter;
            resultsLabel.Font = new Font(resultsLabel.Font, FontStyle.Bold);
            resultsLabel.Dock = DockStyle.Fill;
            resultstlp.Controls.Add(resultsLabel, 0, 0);

            resultstlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,222));
            resultstlp.Dock = DockStyle.Fill;
            resultsPage.Controls.Add(resultstlp);

            previousResults = new TreeView();
            previousResults.Dock = DockStyle.Fill;
            previousResults.AfterCheck += new TreeViewEventHandler(this.PreviousResults_AfterCheck);
            previousResults.AfterSelect += new TreeViewEventHandler(this.PreviousResults_AfterSelect);
            previousResults.CheckBoxes = true;

            resultstlp.Controls.Add(previousResults,0,1);

            //add pages to control panel
            controlPanel.Controls.AddRange(new TabPage[]{systemPropertyPage,devicePropertyPage,resultsPage});
            controlPanel.SelectedIndex = 0;

            //
            //main window stuff
            //
            mainWindow = new TabControl();
            mainWindow.Dock = DockStyle.Fill;

            NPlot.Windows.PlotSurface2D plotBandwidth = new NPlot.Windows.PlotSurface2D();
            NPlot.Windows.PlotSurface2D plotLatency = new NPlot.Windows.PlotSurface2D();

            gBandwidth = new LineGrapher(plotBandwidth, "bandwidth", "Bandwidth (GB/s)", "Time (ms)", "Bandwidth (GB/s)");
            gLatency = new LineGrapher(plotLatency, "latency", "Average Latency", "Time (ms)", "Latency (nanoseconds)");

            //click handlers for right click to zoom out behavior

            /*
            plotBandwidth.MouseClick += new MouseEventHandler(TriggerZoomOut);
            plotLatency.MouseClick += new MouseEventHandler(TriggerZoomOut);
            plotLatencyHistogram.MouseClick += new MouseEventHandler(TriggerZoomOut);
            plotPower.MouseClick += new MouseEventHandler(TriggerZoomOut);
            */
            bandwidthPage = new TabPage("Bandwidth");
            bandwidthPage.BackColor = Color.Transparent;
            /*
            bandwidthPage.MouseEnter += (this.mainWindow_MouseEnter);
            bandwidthPage.MouseLeave += (this.mainWindow_MouseLeave);
            */
            latencyPage = new TabPage("Latency");
            latencyPage.BackColor = Color.Transparent;
            /*
            latencyPage.MouseEnter += (this.mainWindow_MouseEnter);
            latencyPage.MouseLeave += (this.mainWindow_MouseLeave);
            */

            latencyHistogramPage = new TabPage("Histogram");
            latencyHistogramPage.BackColor = Color.Transparent;
            /*
            latencyHistogramPage.MouseEnter += (this.mainWindow_MouseEnter);
            latencyHistogramPage.MouseLeave += (this.mainWindow_MouseLeave);
            */

            powerPage = new TabPage("Power");
            powerPage.BackColor = Color.Transparent;
            /*
            powerPage.MouseEnter += (this.mainWindow_MouseEnter);
            powerPage.MouseLeave += (this.mainWindow_MouseLeave);
            */
            mainWindow.MouseEnter += this.mainWindow_MouseEnter;
            mainWindow.MouseLeave += this.mainWindow_MouseLeave;

            gPower = new BarGrapher(powerPage, "power");
            gHistogram = new BarGrapher(latencyHistogramPage, "histogram");

            latencyPage.Controls.Add(plotLatency);
            bandwidthPage.Controls.Add(plotBandwidth);

            mainWindow.TabPages.AddRange(new TabPage[]{bandwidthPage,latencyPage,latencyHistogramPage,powerPage});

            SplitContainer sc = new SplitContainer();
            sc.Dock = DockStyle.Fill;
            sc.Panel1.Controls.Add(controlPanel);
            sc.Panel1.Padding = new Padding(3,3,3,5);
            sc.Panel1MinSize = 250;
            sc.Panel2.Controls.Add(mainWindow);
            sc.Panel2.Padding = new Padding(3,3,3,3);
            sc.Orientation = Orientation.Vertical;

            //add everythign to window
            Controls.AddRange(new Control[] { sc, toolStrip, menuStrip } );

            this.ResumeLayout();

            sc.SplitterDistance = 250;
        }
Beispiel #2
0
        private void MakeGraphsFromValueTable()
        {
            int    numValues = valueTable["x_axis"].Count;
            string keyName;
            //yes, this is a cheapo way to get unique colors, but who cares

            Color lineColor = Grapher.GetColorRange((uint)filepath.GetHashCode(), 0, 1);;

            // Per Bank Data is in the list from 0 ... NUM_BANKS*NUM_RANKS
            for (int r = 0; r < systemParameters.NUM_RANKS; r++)
            {
                for (int b = 0; b < deviceParameters.NUM_BANKS; b++)
                {
                    if (r == 0 && b == 0)
                    {
                        plotTable.Add("latency", new List <MyLinePlot>());
                        plotTable.Add("bandwidth", new List <MyLinePlot>());
                    }
                    lineColor = Grapher.GetColorRange((uint)filepath.GetHashCode(), (uint)r, systemParameters.NUM_RANKS);
                    keyName   = "l_" + r + "_" + b;
                    MyLinePlot linePlot = LineGrapher.MakeLinePlot(valueTable["x_axis"], valueTable[keyName], lineColor);
                    plotTable["latency"].Add(linePlot);
                    keyName  = "b_" + r + "_" + b;
                    linePlot = LineGrapher.MakeLinePlot(valueTable["x_axis"], valueTable[keyName], lineColor);
                    plotTable["bandwidth"].Add(linePlot);
                }
            }

            // Per Rank data is in BANKS*RANKS ... BANKS*RANKS+RANKS

            List <decimal> bandwidthGrandTotal = Grapher.ZeroList(numValues);
            List <decimal> latencyGrandTotal   = Grapher.ZeroList(numValues);
            List <decimal> totalCounts         = Grapher.ZeroList(numValues);

            // generate per rank and total graphs
            for (int r = 0; r < systemParameters.NUM_RANKS; r++)
            {
                List <decimal> latencyRankTotal   = Grapher.ZeroList(numValues);
                List <decimal> bandwidthRankTotal = Grapher.ZeroList(numValues);
                List <decimal> counts             = Grapher.ZeroList(numValues);
                // sum the latencies and bandwidths into grand totals and per rank totals
                for (int b = 0; b < deviceParameters.NUM_BANKS; b++)
                {
                    keyName = "b_" + r + "_" + b;
                    Grapher.SumLists(bandwidthRankTotal, valueTable[keyName]);
                    Grapher.SumLists(bandwidthGrandTotal, valueTable[keyName]);

                    keyName = "l_" + r + "_" + b;
                    Grapher.CountNonZero(valueTable[keyName], counts);
                    Grapher.CountNonZero(valueTable[keyName], totalCounts);
                    Grapher.SumLists(latencyRankTotal, valueTable[keyName]);
                    Grapher.SumLists(latencyGrandTotal, valueTable[keyName]);
                }
                // take the totals of all the latencies and generate a per-rank average since it doesn't really make sense
                // to sum latencies across banks
                for (int i = 0; i < latencyRankTotal.Count; i++)
                {
/*
 *                  if (counts[i] > deviceParameters.NUM_BANKS)
 *                                      {
 *                                              Console.WriteLine("COUNTS = "+counts[i]);
 *                                      }
 *                                      if (counts[i] == 0)
 *                                      {
 *                                              Console.WriteLine("ZERO COUNT");
 *                                              latencyRankTotal[i] = latencyRankTotal[i];
 *                                      }
 *                                      else
 *                                      {
 *                                              latencyRankTotal[i] = latencyRankTotal[i]/counts[i];
 *                                      }
 */
                    latencyRankTotal[i] = latencyRankTotal[i] / deviceParameters.NUM_BANKS;
                }

                plotTable["latency"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], new List <decimal>(latencyRankTotal), lineColor));
                plotTable["bandwidth"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], new List <decimal>(bandwidthRankTotal), lineColor));

                // clear these lists before the next iteration (to keep from accumulating)
                bandwidthRankTotal.Clear();
                latencyRankTotal.Clear();
                counts.Clear();
            }


            for (int i = 0; i < latencyGrandTotal.Count; i++)
            {
                latencyGrandTotal[i] = latencyGrandTotal[i] / (deviceParameters.NUM_BANKS * systemParameters.NUM_RANKS);
            }

            // last 2 indices are the total/avg
            plotTable["latency"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], latencyGrandTotal, Color.Green));
//			plotTable["latency"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], Grapher.GenerateRunningAverage(latencyGrandTotal), lineColor));

            plotTable["bandwidth"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], bandwidthGrandTotal, Color.Green));
//			plotTable["bandwidth"].Add(LineGrapher.MakeLinePlot(valueTable["x_axis"], Grapher.GenerateRunningAverage(bandwidthGrandTotal), lineColor));

            //Console.WriteLine("finished recomputing");

            //Draw the Power and Histogram plots
            barPlotTable.Add("power", BarGrapher.PowerGraph(this));
            barPlotTable.Add("histogram", BarGrapher.HistogramPlot(this));
        }
Beispiel #3
0
        /// <summary>
        /// Constructor - Build UI
        /// </summary>
        public Visualizer(string filename)
        {
            //valueTable = new Dictionary<string,List<decimal>>();
            visFileList = new Dictionary <string, VisFileContainer>();

            grapher = new Grapher(this);

            this.SuspendLayout();

            this.Size = new Size(1100, 500);
            this.Text = "DRAMVis     University Of Maryland";

            //
            //menu bar at top of the screen
            //
            menuStrip = new MenuStrip();

            file  = new ToolStripMenuItem("File");
            about = new ToolStripMenuItem("About");
            menuStrip.Items.Add(file);
            menuStrip.Items.Add(about);

            fileOpen        = new ToolStripMenuItem("Open .vis File");
            fileOpen.Click += new System.EventHandler(this.OpenFileButton_Click);
            file.DropDownItems.Add(fileOpen);

            help = new ToolStripMenuItem("Help");
            about.DropDownItems.Add(help);

            //
            //tool strip stuff
            //
            toolStrip = new ToolStrip();

            pointerButton             = new ToolStripButton(new Bitmap("../../pointer.png"));
            pointerButton.Click      += new EventHandler(this.PointerButton_Click);
            pointerButton.ToolTipText = "Pointer";
            pointerButton.Size        = new Size(32, 32);
            zoomButton             = new ToolStripButton(new Bitmap("../../zoom.png"));
            zoomButton.Click      += new EventHandler(this.ZoomButton_Click);
            zoomButton.ToolTipText = "Zoom";
            handButton             = new ToolStripButton(new Bitmap("../../pan.png"));
            handButton.Click      += new EventHandler(this.HandButton_Click);
            handButton.ToolTipText = "Pan";

            saveGraphButton             = new ToolStripButton(new Bitmap("../../savegraph.png"));
            saveGraphButton.ToolTipText = "Save graphs to file";
            saveGraphButton.Click      += new EventHandler(this.SaveGraphButton_Click);
            openFileButton             = new ToolStripButton(new Bitmap("../../open.png"));
            openFileButton.Click      += new EventHandler(this.OpenFileButton_Click);
            openFileButton.ToolTipText = "Open .vis file";
            playButton                 = new ToolStripButton(new Bitmap("../../play.png"));
            playButton.Click          += new EventHandler(this.PlayButton_Click);
            playButton.ToolTipText     = "Run simulation";
            playButton.Name            = "Play";
            playPlusButton             = new ToolStripButton(new Bitmap("../../playplus.png"));
            playPlusButton.Click      += new EventHandler(this.PlayButton_Click);
            playPlusButton.ToolTipText = "Run and Add";
            playPlusButton.Name        = "PlayPlus";

            ToolStripItem runFor = new ToolStripLabel("Run For:");

            cycleCount      = new ToolStripTextBox();
            cycleCount.Size = new Size(70, 0);
            cycleCount.Text = "500000";
            ToolStripItem cyclesLabel = new ToolStripLabel("cycles");

            ToolStripItem displayAsLabel = new ToolStripLabel("Display As:");

            displayAs = new ToolStripComboBox();
            displayAs.Items.AddRange(new string[] { "Total", "Total Average", "Per Rank", "Per Bank" });
            displayAs.SelectedIndex         = 0;
            displayAs.SelectedIndexChanged += new EventHandler(this.DataDisplayCombo_IndexChanged);

            toolStrip.Items.AddRange(new ToolStripItem[] { openFileButton, saveGraphButton,
                                                           new ToolStripSeparator(), pointerButton, zoomButton, handButton,
                                                           new ToolStripSeparator(), playButton, playPlusButton,
                                                           new ToolStripSeparator(), runFor, cycleCount, cyclesLabel,
                                                           new ToolStripSeparator(), displayAsLabel, displayAs });

            //
            //control panel tab page
            //
            controlPanel           = new TabControl();
            controlPanel.Dock      = DockStyle.Fill;
            controlPanel.Alignment = TabAlignment.Bottom;


            //
            //system property page stuff
            //
            systemPropertyPage             = new TabPage("System");
            systemPropertyPage.BorderStyle = BorderStyle.Fixed3D;
            systemPropertyPage.Anchor      = AnchorStyles.Top;

            TableLayoutPanel systemtlp = new TableLayoutPanel();

            systemtlp.Margin      = new Padding(0, 0, 0, 0);
            systemtlp.RowCount    = 3;
            systemtlp.ColumnCount = 2;

            //trace
            Label traceLabel = new Label();

            traceLabel.Text      = "Trace File";
            traceLabel.TextAlign = ContentAlignment.MiddleCenter;
            traceLabel.Dock      = DockStyle.Fill;
            traceLabel.Font      = new Font(traceLabel.Font, FontStyle.Bold);
            systemtlp.Controls.Add(traceLabel, 0, 0);
            systemtlp.SetColumnSpan(traceLabel, 2);

            traceSelectionButton        = new Button();
            traceSelectionButton.Image  = new Bitmap(new Bitmap("../../open.png"), new Size(16, 16));
            traceSelectionButton.Click += new EventHandler(this.TraceSelectionButton_Click);
            systemtlp.Controls.Add(traceSelectionButton, 0, 1);

            traceNameDisplay             = new TextBox();
            traceNameDisplay.BorderStyle = BorderStyle.Fixed3D;
            traceNameDisplay.TextAlign   = HorizontalAlignment.Center;
            traceNameDisplay.BackColor   = Color.White;
            traceNameDisplay.Dock        = DockStyle.Fill;
            traceNameDisplay.ReadOnly    = true;
            systemtlp.Controls.Add(traceNameDisplay, 1, 1);

            systemPropertyGrid                = new PropertyGrid();
            systemPropertyGrid.Dock           = DockStyle.Fill;
            systemPropertyGrid.SelectedObject = systemParameters;

            systemtlp.Controls.Add(systemPropertyGrid, 0, 2);
            systemtlp.SetColumnSpan(systemPropertyGrid, 2);

            systemtlp.Dock = DockStyle.Fill;
            systemtlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 35));
            systemtlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 185));

            systemPropertyPage.Controls.Add(systemtlp);
            systemPropertyPage.Resize += delegate(object sender, EventArgs e) {
                TabPage x = (TabPage)sender;
                systemPropertyGrid.Height = x.Height - 150;
            };
            //
            //Device Property page stuff
            //
            devicePropertyPage             = new TabPage("Device");
            devicePropertyPage.BorderStyle = BorderStyle.Fixed3D;

            TableLayoutPanel devicetlp = new TableLayoutPanel();

            devicetlp.RowCount    = 3;
            devicetlp.ColumnCount = 1;

            devicePropertyGrid      = new PropertyGrid();
            devicePropertyGrid.Dock = DockStyle.Fill;

            Label deviceComboLabel = new Label();

            deviceComboLabel.Text      = "Device Name";
            deviceComboLabel.TextAlign = ContentAlignment.MiddleCenter;
            deviceComboLabel.Font      = new Font(deviceComboLabel.Font, FontStyle.Bold);
            deviceComboLabel.Dock      = DockStyle.Fill;

            deviceComboBox      = new ComboBox();
            deviceComboBox.Dock = DockStyle.Fill;
            FillDeviceComboBox();
            deviceComboBox.SelectedIndexChanged += new EventHandler(this.DeviceComboBox_IndexChanged);
            deviceComboBox.SelectedIndex         = 0;

            devicetlp.Controls.Add(deviceComboLabel, 0, 0);
            devicetlp.Controls.Add(deviceComboBox, 0, 1);
            devicetlp.Controls.Add(devicePropertyGrid, 0, 2);
            devicetlp.Dock = DockStyle.Fill;
            devicetlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 35));
            devicetlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 185));

            devicePropertyPage.Resize += delegate(object sender, EventArgs e) {
                TabPage x = (TabPage)sender;
                devicePropertyGrid.Height = x.Height - 150;
            };
            devicePropertyPage.Controls.Add(devicetlp);

            //
            //previous results page
            //
            TableLayoutPanel resultstlp = new TableLayoutPanel();

            resultstlp.ColumnCount = 1;
            resultstlp.RowCount    = 2;

            resultsPage      = new TabPage();
            resultsPage.Text = "Results";

            Label resultsLabel = new Label();

            resultsLabel.Text      = "Previous Results";
            resultsLabel.TextAlign = ContentAlignment.MiddleCenter;
            resultsLabel.Font      = new Font(resultsLabel.Font, FontStyle.Bold);
            resultsLabel.Dock      = DockStyle.Fill;
            resultstlp.Controls.Add(resultsLabel, 0, 0);

            resultstlp.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 222));
            resultstlp.Dock = DockStyle.Fill;
            resultsPage.Controls.Add(resultstlp);

            previousResults              = new TreeView();
            previousResults.Dock         = DockStyle.Fill;
            previousResults.AfterCheck  += new TreeViewEventHandler(this.PreviousResults_AfterCheck);
            previousResults.AfterSelect += new TreeViewEventHandler(this.PreviousResults_AfterSelect);
            previousResults.CheckBoxes   = true;

            resultstlp.Controls.Add(previousResults, 0, 1);

            //add pages to control panel
            controlPanel.Controls.AddRange(new TabPage[] { systemPropertyPage, devicePropertyPage, resultsPage });
            controlPanel.SelectedIndex = 0;

            //
            //main window stuff
            //
            mainWindow      = new TabControl();
            mainWindow.Dock = DockStyle.Fill;

            NPlot.Windows.PlotSurface2D plotBandwidth = new NPlot.Windows.PlotSurface2D();
            NPlot.Windows.PlotSurface2D plotLatency   = new NPlot.Windows.PlotSurface2D();

            gBandwidth = new LineGrapher(plotBandwidth, "bandwidth", "Bandwidth (GB/s)", "Time (ms)", "Bandwidth (GB/s)");
            gLatency   = new LineGrapher(plotLatency, "latency", "Average Latency", "Time (ms)", "Latency (nanoseconds)");

            //click handlers for right click to zoom out behavior

/*
 *                      plotBandwidth.MouseClick += new MouseEventHandler(TriggerZoomOut);
 *                      plotLatency.MouseClick += new MouseEventHandler(TriggerZoomOut);
 *                      plotLatencyHistogram.MouseClick += new MouseEventHandler(TriggerZoomOut);
 *                      plotPower.MouseClick += new MouseEventHandler(TriggerZoomOut);
 */
            bandwidthPage           = new TabPage("Bandwidth");
            bandwidthPage.BackColor = Color.Transparent;

            /*
             * bandwidthPage.MouseEnter += (this.mainWindow_MouseEnter);
             * bandwidthPage.MouseLeave += (this.mainWindow_MouseLeave);
             */
            latencyPage           = new TabPage("Latency");
            latencyPage.BackColor = Color.Transparent;

            /*
             * latencyPage.MouseEnter += (this.mainWindow_MouseEnter);
             * latencyPage.MouseLeave += (this.mainWindow_MouseLeave);
             */

            latencyHistogramPage           = new TabPage("Histogram");
            latencyHistogramPage.BackColor = Color.Transparent;

            /*
             * latencyHistogramPage.MouseEnter += (this.mainWindow_MouseEnter);
             * latencyHistogramPage.MouseLeave += (this.mainWindow_MouseLeave);
             */

            powerPage           = new TabPage("Power");
            powerPage.BackColor = Color.Transparent;

            /*
             * powerPage.MouseEnter += (this.mainWindow_MouseEnter);
             * powerPage.MouseLeave += (this.mainWindow_MouseLeave);
             */
            mainWindow.MouseEnter += this.mainWindow_MouseEnter;
            mainWindow.MouseLeave += this.mainWindow_MouseLeave;

            gPower     = new BarGrapher(powerPage, "power");
            gHistogram = new BarGrapher(latencyHistogramPage, "histogram");

            latencyPage.Controls.Add(plotLatency);
            bandwidthPage.Controls.Add(plotBandwidth);

            mainWindow.TabPages.AddRange(new TabPage[] { bandwidthPage, latencyPage, latencyHistogramPage, powerPage });

            SplitContainer sc = new SplitContainer();

            sc.Dock = DockStyle.Fill;
            sc.Panel1.Controls.Add(controlPanel);
            sc.Panel1.Padding = new Padding(3, 3, 3, 5);
            sc.Panel1MinSize  = 250;
            sc.Panel2.Controls.Add(mainWindow);
            sc.Panel2.Padding = new Padding(3, 3, 3, 3);
            sc.Orientation    = Orientation.Vertical;

            //add everythign to window
            Controls.AddRange(new Control[] { sc, toolStrip, menuStrip });

            this.ResumeLayout();

            sc.SplitterDistance = 250;
        }