Exemple #1
0
 /// <summary>
 /// Construct with the provided layout manager and graph painter.
 /// </summary>
 public GraphViewportPainter(
     IGraphLayoutScheme layoutScheme,
     GraphPainter graphPainter)
 {
     _layoutScheme = layoutScheme;
     _graphPainter = graphPainter;
 }
Exemple #2
0
        public PhaseHandler(GraphPainter graphPainter)
        {
            this.graphPainter = graphPainter;

            phaseAvg    = new Average();
            phaseDevAvg = new Average();
            // phaseDevAvg.setAlpha(0.1f);
            // phaseDevAvg.setSize(20);
        }
Exemple #3
0
        public void PlotDataRec(GraphPainter gp, DataStruct ds)
        {
            if (gp == GraphBot)
            {
                labelBotL.Text = "";
                labelBotR.Text = "";
            }
            else if (gp == GraphTop)
            {
                labelTopL.Text = "";
                labelTopR.Text = "";
            }

            gp.SetAxisTitles("", "");

            gp.data.Clear();

            gp.SetData(0, ds.elapsed, ds.flow_goal, Color.Blue, 2, DashStyle.Dash);
            gp.SetData(1, ds.elapsed, ds.pressure_goal, Color.LimeGreen, 2, DashStyle.Dash);

            gp.SetData(2, ds.elapsed, ds.flow, Color.Blue, 3, DashStyle.Solid);
            gp.SetData(3, ds.elapsed, ds.pressure, Color.LimeGreen, 3, DashStyle.Solid);

            gp.SetData(4, ds.elapsed, ds.flow_weight, Color.Brown, 3, DashStyle.Solid);

            List <double> temperature_scaled        = new List <double>();
            List <double> temperature_target_scaled = new List <double>();

            foreach (var t in ds.temperature_basket)
            {
                temperature_scaled.Add(t / 10.0);
            }
            foreach (var t in ds.temperature_goal)
            {
                temperature_target_scaled.Add(t / 10.0);
            }

            gp.SetData(5, ds.elapsed, temperature_target_scaled, Color.Red, 2, DashStyle.Dash);
            gp.SetData(6, ds.elapsed, temperature_scaled, Color.Red, 3, DashStyle.Solid);

            var           pi   = ds.getPreinfTime();
            List <double> x_pi = new List <double>(); x_pi.Add(pi); x_pi.Add(pi);
            List <double> y_pi = new List <double>(); y_pi.Add(0); y_pi.Add(1);

            gp.SetData(7, x_pi, y_pi, Color.Brown, 2, DashStyle.Solid);

            gp.SetAutoLimits();

            gp.panel.Refresh();
        }
Exemple #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Text = Revision;

            GraphTop = new GraphPainter(splitContainer2.Panel1, this.Font);
            GraphBot = new GraphPainter(splitContainer2.Panel2, this.Font);

            ApplicationDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
            ApplicationNameNoExt = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            LoadSettings();

            //string data_fname = (Directory.Exists(DataFolder) ? DataFolder : ApplicationDirectory) + "\\" + ApplicationNameNoExt + ".csv";
            //    ReadAllRecords(data_fname, ApplicationDirectory);
        }
Exemple #5
0
        public void graphPrepare()
        {
            graphPainter = new GraphPainter(pictureBox, this);

            Phase_graph = new Graph("Phase", MAX_GRAPH_COUNT, 20);
            Phase_graph.SetPalette(Color.Olive, Color.Gray, Color.Gray, 1, false);
            graphPainter.AddGraph(Phase_graph);

            DAC_graph = new Graph("DAC", MAX_GRAPH_COUNT, 20);
            DAC_graph.SetPalette(Color.Blue, Color.Gray, Color.Gray, 1, true);
            graphPainter.AddGraph(DAC_graph);

            Temper_graph = new Graph("TEMP", MAX_GRAPH_COUNT, 20);
            Temper_graph.SetPalette(Color.Red, Color.Gray, Color.Gray, 1, false);
            graphPainter.AddGraph(Temper_graph);


            Phase_avg_graph = new Graph("Phase_avg", MAX_GRAPH_COUNT, 20);
            Phase_avg_graph.SetPalette(Color.Green, Color.Gray, Color.Gray, 1, false);
            graphPainter.AddGraph(Phase_avg_graph);

            Phase_firstDeriv_graph = new Graph("First_dev", MAX_GRAPH_COUNT, 20);
            Phase_firstDeriv_graph.SetPalette(Color.Brown, Color.Gray, Color.Gray, 1, false);
            graphPainter.AddGraph(Phase_firstDeriv_graph);

            Phase_secDeriv_graph = new Graph("Sec_dev", MAX_GRAPH_COUNT, 20);
            Phase_secDeriv_graph.SetPalette(Color.FromArgb(192, 192, 0), Color.Gray, Color.Gray, 1, false);
            graphPainter.AddGraph(Phase_secDeriv_graph);


            Phase_graph.SetVisible(STW_R_L.Checked);
            DAC_graph.SetVisible(STW_R_T.Checked);
            Temper_graph.SetVisible(checkBox3.Checked);
            Phase_avg_graph.SetVisible(checkBox1.Checked);
            Phase_firstDeriv_graph.SetVisible(checkBox2.Checked);
            Phase_secDeriv_graph.SetVisible(checkBox4.Checked);
            //Phase_graph.SetY_Limit(-200, 200);
            //DAC_graph.SetY_Limit((int)numericUpDown2.Value, (int)numericUpDown1.Value);



            graphPainter.OnRenderXAxisLabel += RenderXLabel;
            // graphPainter.SetRangeY(0, 10);
            pictureBox.MouseWheel += new MouseEventHandler(graphPainter.MouseWheel);
            pictureBox.MouseMove  += new MouseEventHandler(graphPainter.MouseMoved);
            // this.MouseWheel += new MouseEventHandler(graphPainter.MouseWheel);
        }
Exemple #6
0
 /// <summary>
 /// Construct with a default layout manager and graph painter.
 /// </summary>
 public GraphViewportPainter()
 {
     _layoutScheme = new DepthLayoutScheme();
     _graphPainter = new GraphPainter();
 }