示例#1
0
        //
        private void button_panright_Click(object sender, EventArgs e)
        {
            double num = (DTrend.GraphPane.XAxis.Scale.Max - DTrend.GraphPane.XAxis.Scale.Min) / 3.0;

            DTrend.GraphPane.XAxis.Scale.Min = DTrend.GraphPane.XAxis.Scale.Min + num;
            DTrend.GraphPane.XAxis.Scale.Max = DTrend.GraphPane.XAxis.Scale.Max + num;
            DTrend.AxisChange();
            DTrend.Refresh();
        }
示例#2
0
 // Event handler for Dropdown MenuItem "show/hide ALL Curves"
 private void toggleAllCurves(object sender, EventArgs e)
 {
     ((ToolStripMenuItem)sender).Checked = !((ToolStripMenuItem)sender).Checked;
     foreach (YAxis yaxis in DTrend.GraphPane.YAxisList)
     {
         yaxis.IsVisible = ((ToolStripMenuItem)sender).Checked;
         DTrend.GraphPane.CurveList[yaxis.Title.Text].IsVisible = ((ToolStripMenuItem)sender).Checked;
     }
     DTrend.AxisChange();
     DTrend.Refresh();
 }
示例#3
0
        //
        private void button_panbottom_Click(object sender, EventArgs e)
        {
            double num = (DTrend.GraphPane.YAxis.Scale.Max - DTrend.GraphPane.YAxis.Scale.Min) / 3.0;

            foreach (YAxis yaxis in DTrend.GraphPane.YAxisList)
            {
                yaxis.Scale.Min = yaxis.Scale.Min - num;
                yaxis.Scale.Max = yaxis.Scale.Max - num;
            }
            DTrend.AxisChange();
            DTrend.Refresh();
        }
示例#4
0
 //
 private void toggleViewCurve(object sender, EventArgs e)
 {
     ((ToolStripMenuItem)sender).Checked = !((ToolStripMenuItem)sender).Checked;
     DTrend.GraphPane.CurveList[((ToolStripMenuItem)sender).OwnerItem.Text].IsVisible = ((ToolStripMenuItem)sender).Checked;
     foreach (YAxis yaxis in DTrend.GraphPane.YAxisList)
     {
         if (yaxis.Title.Text.IndexOf(((ToolStripMenuItem)sender).OwnerItem.Text) != -1)
         {
             yaxis.IsVisible = ((ToolStripMenuItem)sender).Checked;
         }
     }
     DTrend.AxisChange();
     DTrend.Refresh();
 }
示例#5
0
 //
 private void setYminMax(object sender, EventArgs e)
 {
     foreach (YAxis yaxis in DTrend.GraphPane.YAxisList)
     {
         if (yaxis.Title.Text.IndexOf(((ToolStripMenuItem)sender).OwnerItem.Text) != -1)
         {
             YScaleSettings yscaleSettings = new YScaleSettings(yaxis.Scale.Min, yaxis.Scale.Max, ((ToolStripMenuItem)sender).OwnerItem.Text);
             yscaleSettings.ShowDialog();
             if (yscaleSettings.set)
             {
                 yaxis.Scale.MaxAuto = false;
                 yaxis.Scale.MinAuto = false;
                 yaxis.Scale.Max     = yscaleSettings.max;
                 yaxis.Scale.Min     = yscaleSettings.min;
             }
         }
     }
     DTrend.AxisChange();
     DTrend.Refresh();
 }
示例#6
0
 //
 private void button_zoomout_Click(object sender, EventArgs e)
 {
     DTrend.ZoomPane(DTrend.GraphPane, 1.1, default(PointF), false);
 }
示例#7
0
 //
 private void button_resetzoompan_Click(object sender, EventArgs e)
 {
     DTrend.RestoreScale(DTrend.GraphPane);
 }
示例#8
0
        //
        private void dataparsing_complete(object sender, RunWorkerCompletedEventArgs e)
        {
            if (goodRecCounter == 0)
            {
                MessageBox.Show("LogFile contains no data");
                panel1.Hide();
                progress_timer.Enabled = false;
                return;
            }
            dataGridView_data.DataSource          = table;
            dataGridView_data.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            int numColor = 0;

            foreach (string text in channel_names)
            {
                PointPairList pointPairList = new PointPairList();
                int           num2          = 0;
                foreach (DataRow dataRow in table.Rows)
                {
                    if (dataRow[text].ToString() != "")
                    {
                        pointPairList.Add((double)num2, double.Parse(string.Concat(dataRow[text])));
                    }
                    else if (num2 > 0)
                    {
                        pointPairList.Add((double)num2, pointPairList[num2 - 1].Y);
                    }
                    else
                    {
                        pointPairList.Add((double)num2, double.NaN);
                    }
                    num2++;
                }
                Color color = ColorTranslator.FromHtml(colors[numColor]);
                YAxis yaxis = new YAxis(text);
                DTrend.GraphPane.YAxisList.Add(yaxis);
                yaxis.Title.IsVisible          = true;
                yaxis.Type                     = AxisType.Linear;
                yaxis.Color                    = Color.Black; //color;
                yaxis.Scale.FontSpec.Size      = 10f;
                yaxis.Scale.FontSpec.FontColor = color;
                yaxis.IsVisible                = true;
                yaxis.Scale.MaxAuto            = true;
                yaxis.Scale.MinAuto            = true;
                yaxis.MajorGrid.IsZeroLine     = false;
                yaxis.MajorGrid.IsVisible      = true;
                yaxis.MajorTic.IsInside        = false;
                yaxis.MinorTic.IsInside        = false;
                yaxis.MajorTic.IsOpposite      = false;
                yaxis.MinorTic.IsOpposite      = false;
                yaxis.Scale.Align              = AlignP.Inside;
                yaxis.Title.FontSpec.Size      = 10f;
                yaxis.Title.FontSpec.FontColor = color;

                LineItem lineItem = DTrend.GraphPane.AddCurve(text, pointPairList, color, SymbolType.None);
                lineItem.Line.IsOptimizedDraw = true;
                lineItem.Line.Width           = 1f;
                lineItem.YAxisIndex           = DTrend.GraphPane.YAxisList.IndexOf(text);
                dataGridView_data.Columns[text].DefaultCellStyle.ForeColor = color;
                ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(text);
                toolStripMenuItem.ForeColor = ColorTranslator.FromHtml(colors[numColor]);
                ToolStripMenuItem toolStripMenuItem2 = new ToolStripMenuItem("hide/show");
                toolStripMenuItem2.Checked   = true;
                toolStripMenuItem2.ForeColor = ColorTranslator.FromHtml(colors[numColor]);
                toolStripMenuItem2.Click    += toggleViewCurve;
                toolStripMenuItem2.Paint    += toolMnuItemChSta;
                ToolStripMenuItem toolStripMenuItem3 = new ToolStripMenuItem("change Y scale min/max");
                toolStripMenuItem3.Click += setYminMax;
                toolStripMenuItem.DropDownItems.Add(toolStripMenuItem2);
                toolStripMenuItem.DropDownItems.Add(toolStripMenuItem3);
                hideshowcurveMenuItem.DropDownItems.Add(toolStripMenuItem);
                numColor++;
            }  //EndOfForeach
            ToolStripMenuItem toolStripMnuItem = new ToolStripMenuItem("Show All/Hide All");

            toolStripMnuItem.Checked = true;
            hideshowcurveMenuItem.DropDownItems.Add(toolStripMnuItem);
            toolStripMnuItem.Click += toggleAllCurves;
            string[] array = new string[timeList.Count];

            int num3 = 0;

            foreach (DateTime dateTime in timeList)
            {
                array[num3] = dateTime.ToString().Replace(" ", "\n");
                num3++;
            }
            DTrend.GraphPane.XAxis.Scale.Max        = (double)num3;
            DTrend.GraphPane.XAxis.Scale.TextLabels = array;
            DTrend.GraphPane.XAxis.Type             = AxisType.Text;
            DTrend.GraphPane.Title.IsVisible        = false;
            DTrend.GraphPane.Legend.IsVisible       = false;
            DTrend.GraphPane.AxisChange();
            DTrend.Refresh();
            panel1.Hide();
            loadingpanel.Visible   = false;
            progress_timer.Enabled = false;
            Text = Application.ProductName + " v" + Application.ProductVersion + "   rec. " + goodRecCounter.ToString();
        }
示例#9
0
        public Main()
        {
            InitializeComponent();
            Icon = Resources.logo1;
            Text = Application.ProductName + " v" + Application.ProductVersion;
            DTrend.GraphPane.Title.IsVisible            = false;
            DTrend.MasterPane[0].IsFontsScaled          = false;
            DTrend.GraphPane.Legend.IsVisible           = false;
            DTrend.GraphPane.Border.IsVisible           = false;
            DTrend.GraphPane.Chart.Border.IsVisible     = false;
            DTrend.MasterPane.Margin.Left               = 0f;
            DTrend.MasterPane.Margin.Right              = 0f;
            DTrend.MasterPane.Margin.Top                = 0f;
            DTrend.MasterPane.Margin.Bottom             = 0f;
            DTrend.MasterPane.InnerPaneGap              = 0f;
            DTrend.GraphPane.Margin.Left                = 0f;
            DTrend.GraphPane.Margin.Right               = 2f;
            DTrend.GraphPane.Margin.Top                 = 5f;
            DTrend.GraphPane.Margin.Bottom              = 0f;
            DTrend.GraphPane.XAxis.Type                 = AxisType.Text;
            DTrend.GraphPane.XAxis.IsVisible            = true;
            DTrend.GraphPane.XAxis.Title.IsVisible      = false;
            DTrend.GraphPane.XAxis.IsAxisSegmentVisible = false;
            DTrend.GraphPane.XAxis.Scale.FontSpec.Size  = 10f;
            DTrend.GraphPane.XAxis.Scale.Min            = 0.0;
            DTrend.GraphPane.XAxis.MajorGrid.PenWidth   = 0.5f;
            DTrend.GraphPane.XAxis.MajorGrid.IsVisible  = true;
            DTrend.GraphPane.XAxis.MinorTic.IsOpposite  = false;
            DTrend.GraphPane.XAxis.MajorTic.IsOpposite  = false;
            DTrend.GraphPane.YAxis.IsVisible            = false;
            DTrend.GraphPane.YAxis.Scale.MinAuto        = false;
            DTrend.GraphPane.YAxis.Scale.MaxAuto        = false;
            DTrend.GraphPane.YAxis.Scale.Min            = -100.0;
            DTrend.GraphPane.YAxis.Scale.Max            = 5000.0;
            DTrend.GraphPane.Y2Axis.MajorTic.IsOpposite = false;
            DTrend.GraphPane.Y2Axis.MinorTic.IsOpposite = false;
            DTrend.GraphPane.Y2Axis.IsVisible           = false;
            DTrend.GraphPane.X2Axis.IsVisible           = false;
            DTrend.Selection.SelectionChangedEvent     += new EventHandler(Selection_SelectionChangedEvent);
            DTrend.GraphPane.AxisChange();
            DTrend.Refresh();
            string[] commandLineArgs = Environment.GetCommandLineArgs();

            for (int i = 0; i < commandLineArgs.Length; i++)                //  Парсинг аргументов командной строки
            {
                string path = "";
                string a    = commandLineArgs[i];
                if (a == "-f")
                {
                    if (i < commandLineArgs.Length - 1)
                    {
                        path = commandLineArgs[i + 1];
                        if (File.Exists(path))
                        {
                            loadingpanel.Visible = true;
                            log_file             = path;
                            startparsing();
                        }
                    }
                }
                else if (a == "-fullscreen")
                {
                    FormBorderStyle = FormBorderStyle.None;
                    WindowState     = FormWindowState.Maximized;
                }
                else if (a == "-nofilebutton")
                {
                    fileToolStripMenuItem.Visible = false;
                }
                else if (a == "-noprintbutton")
                {
                    printMenuItem.Visible = button_print.Visible = false;
                }
            }
        }