Esempio n. 1
0
        /// <summary>
        /// Constructors.
        /// </summary>
        /// <param name="isDefault">the flag whether this setting is default</param>
        /// <param name="setting">the setting object</param>
        public SetGraphSizeDialog(bool isDefault, YAxisSettings setting)
        {
            InitializeComponent();
            m_isDefault = isDefault;
            m_setting = setting;

            defaultCheckBox.Checked = m_isDefault;
            yMaxAutoCheckBox.Checked = m_setting.IsAutoMaxY;
            yMinAutoCheckBox.Checked = m_setting.IsAutoMinY;
            yMaxTextBox.Text = m_setting.YMax.ToString();
            yMinTextBox.Text = m_setting.YMin.ToString();
            y2MaxAutoCheckBox.Checked = m_setting.IsAutoMaxY2;
            y2MinAutoCheckBox.Checked = m_setting.IsAutoMinY2;
            y2MaxTextBox.Text = m_setting.Y2Max.ToString();
            y2MinTextBox.Text = m_setting.Y2Min.ToString();

            yMaxAutoCheckBox.Enabled = !m_isDefault;
            yMinAutoCheckBox.Enabled = !m_isDefault;
            yMaxTextBox.Enabled = !m_isDefault && !m_setting.IsAutoMaxY;
            yMinTextBox.Enabled = !m_isDefault && !m_setting.IsAutoMinY;
            y2MaxAutoCheckBox.Enabled = !m_isDefault;
            y2MinAutoCheckBox.Enabled = !m_isDefault;
            y2MaxTextBox.Enabled = !m_isDefault && !m_setting.IsAutoMaxY2;
            y2MinTextBox.Enabled = !m_isDefault && !m_setting.IsAutoMinY2;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="owner">The owner object.</param>
        /// <param name="plotNum">The number of plot on this window.</param>
        /// <param name="redrawInt">The time span to redraw.</param>
        /// <param name="setting">the setting object.</param>
        public TracerConfigurationPage(TracerWindow owner, int plotNum, double redrawInt, YAxisSettings setting)
        {
            InitializeComponent();
            m_owner = owner;
            m_plotNum = plotNum;
            m_redrawInterval = redrawInt;
            m_settings = setting;

            numberTextBox.Text = plotNum.ToString();
            intervalTextBox.Text = redrawInt.ToString();

            YMaxCheckBox.Checked = setting.IsAutoMaxY;
            YMinCheckBox.Checked = setting.IsAutoMinY;
            Y2MaxCheckBox.Checked = setting.IsAutoMaxY2;
            Y2MinCheckBox.Checked = setting.IsAutoMinY2;

            YMaxTextBox.Text = setting.YMax.ToString();
            YMinTextBox.Text = setting.YMin.ToString();
            Y2MaxTextBox.Text = setting.Y2Max.ToString();
            Y2MinTextBox.Text = setting.Y2Min.ToString();

            YMaxTextBox.Enabled = !setting.IsAutoMaxY;
            YMinTextBox.Enabled = !setting.IsAutoMinY;
            Y2MaxTextBox.Enabled = !setting.IsAutoMaxY2;
            Y2MinTextBox.Enabled = !setting.IsAutoMinY2;
        }
Esempio n. 3
0
 /// <summary>
 /// Click the menu to set Y axis.
 /// </summary>
 /// <param name="sender">ToolStripMenuItem</param>
 /// <param name="e">EventArgs</param>
 private void SetAxisSize(object sender, EventArgs e)
 {
     YAxisSettings settings = new YAxisSettings(
         m_zCnt.GraphPane.YAxis.Scale.MaxAuto,
         m_zCnt.GraphPane.YAxis.Scale.MinAuto,
         m_zCnt.GraphPane.Y2Axis.Scale.MaxAuto,
         m_zCnt.GraphPane.Y2Axis.Scale.MinAuto,
         m_zCnt.GraphPane.YAxis.Scale.Max,
         m_zCnt.GraphPane.YAxis.Scale.Min,
         m_zCnt.GraphPane.Y2Axis.Scale.Max,
         m_zCnt.GraphPane.Y2Axis.Scale.Min);
     SetGraphSizeDialog dlg = new SetGraphSizeDialog(
         m_isDefault, settings);
     using (dlg)
     {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             m_isDefault = dlg.IsDefault;
             if (m_isDefault)
             {
                 m_AxisSetting = m_owner.Settings;
             }
             else
             {
                 m_AxisSetting = dlg.Settings;
             }
             ResetWindow();
         }
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Set the default setting of Y axis.
 /// </summary>
 /// <param name="setting">the setting object.</param>
 public void SetDefaultSetting(YAxisSettings setting)
 {
     if (m_isDefault)
     {
         m_AxisSetting = setting;
         ResetWindow();
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Constructor for TraceWindow.
        /// </summary>
        public TraceWindow(TracerWindow control)
        {
            m_owner = control;
            this.HideOnClose = false;
            InitializeComponent();

            m_zCnt = new ZedGraphControl();
            m_zCnt.Dock = DockStyle.Fill;
            m_zCnt.GraphPane.Title.Text = "";
            m_zCnt.GraphPane.XAxis.Title.Text = "Time(sec)";
            m_zCnt.GraphPane.YAxis.Scale.Format = m_owner.DataManager.DisplayStringFormat;
            m_zCnt.GraphPane.Y2Axis.Scale.Format = m_owner.DataManager.DisplayStringFormat;
            m_zCnt.GraphPane.YAxis.Title.Text = "";
            m_zCnt.GraphPane.Legend.IsVisible = false;
            m_zCnt.GraphPane.XAxis.Scale.Max = 10;
            m_zCnt.GraphPane.XAxis.Scale.MaxAuto = false;
            m_zCnt.GraphPane.XAxis.Scale.Min = 0;
            m_zCnt.IsEnableWheelZoom = false;
            m_zCnt.IsEnableHPan = false;
            m_zCnt.IsEnableVPan = false;
            m_zCnt.ZoomEvent += new ZedGraphControl.ZoomEventHandler(ZcntZoomEvent);
            m_zCnt.ContextMenuBuilder += new ZedGraphControl.ContextMenuBuilderEventHandler(ZedControlContextMenuBuilder);
            m_zCnt.GraphPane.Margin.Top = 35.0f;
            m_zCnt.GraphPane.YAxis.MajorGrid.IsVisible = true;
            m_zCnt.GraphPane.XAxis.MinorTic.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.XAxis.MajorTic.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.YAxis.MinorTic.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.YAxis.MajorTic.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.Chart.Border.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.YAxis.MajorGrid.Color = Color.FromArgb(200, 200, 200);
            m_zCnt.GraphPane.Fill = new Fill(Color.White, Color.LightGray, 90.0f);

            this.m_AxisSetting = new YAxisSettings();

            tableLayoutPanel1.Controls.Add(m_zCnt, 0, 0);
            m_zCnt.AxisChange();
            m_zCnt.Refresh();

            this.ContentType = DockContentType.GRAPH;
            this.HideOnClose = false;
        }