예제 #1
0
        private void RefreshList()
        {
            int    plotseparate = 15;
            double plotmult     = plotseparate * plotmultiplier;

            if (plotmult == 0)
            {
                plotmult = plotseparate;
            }

            checkedListBox1.Items.Clear();
            foreach (var item in Plots)
            {
                Plots[item.Key].Points = GraphArithmetic.GetPoints(item.Key, cx / plotmult, (cx + pictureBox1.Width) / plotmult, 0.5 / plotmultiplier);
                checkedListBox1.Items.Add(item.Key);
            }
        }
예제 #2
0
        public void AddPlot(string expression)
        {
            if (Plots == null)
            {
                Plots = new Dictionary <string, PlotParams>();
            }

            if (Plots.Count > 16)
            {
                MessageBox.Show("Нельзя добавлять больше 16 графиков", "Невозможно добавить график", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (expression != "")
                {
                    Plots[expression] = new PlotParams(GraphArithmetic.GetPoints(expression, cx, cx + pictureBox1.Width), Color.AliceBlue);
                }
            }

            RefreshList();
            pictureBox1.Invalidate();
        }