예제 #1
0
파일: MainForm.cs 프로젝트: lsw8724/NCC
        private void AddDockPanel(IPlotControl control, string text, int height = 300)
        {
            if (CurrentReceiver == null)
            {
                return;
            }
            var xtraUC = control as XtraUserControl;

            xtraUC.Dock = DockStyle.Fill;
            var config = new PlotConfig()
            {
                Type         = control.Type,
                ChCount      = (CurrentReceiver as IGetterRcvProperty).ChannelCount,
                FMax         = this.FMax,
                Columns      = Items,
                KeyphasorMap = (CurrentReceiver as IKeyphasorMapper).KpMap
            };

            control.ControlInit(config);
            DockPanel dockPanel = snapDockManager.AddPanel(DockingStyle.Top);

            dockPanel.Text = text + " - " + CurrentReceiver.ToString();
            dockPanel.Controls.Add(xtraUC);
            dockPanel.HandleDestroyed += (s, de) => OpenedPlotControls.Remove(control);
            dockPanel.ClosedPanel     += (s, de) => OpenedPlotControls.Remove(control);
            var heigh = control.GetType().CustomAttributes;

            heigh.GetType();
            dockPanel.Height = height;
            OpenedPlotControls.Add(control);
        }
예제 #2
0
    public static void PanRight(IPlotControl control)
    {
        double     PanFraction = 0.1;
        AxisLimits limits      = control.Plot.GetAxisLimits();
        double     deltaX      = limits.Rect.Width * PanFraction;

        control.Plot.SetAxisLimits(limits.WithPan(deltaX, 0));
        control.Refresh();
    }
예제 #3
0
    public static void DragZoom(IPlotControl control, MouseDrag drag, LockedAxes locked)
    {
        Pixel to2 = new(
            x: locked.X ? drag.From.X : drag.To.X,
            y: locked.Y ? drag.From.Y : drag.To.Y);

        control.Plot.MouseZoom(drag.InitialLimits, drag.From, to2);
        control.Refresh();
    }
예제 #4
0
    public static void PanDown(IPlotControl control)
    {
        double     PanFraction = 0.1;
        AxisLimits limits      = control.Plot.GetAxisLimits();
        double     deltaY      = limits.Rect.Height * PanFraction;

        control.Plot.SetAxisLimits(limits.WithPan(0, -deltaY));
        control.Refresh();
    }
예제 #5
0
    public static void ZoomIn(IPlotControl control, Pixel pixel, LockedAxes locked)
    {
        double zoomInFraction = 1.15;

        double xFrac = locked.X ? 1 : zoomInFraction;
        double yFrac = locked.Y ? 1 : zoomInFraction;

        control.Plot.MouseZoom(xFrac, yFrac, pixel);
        control.Refresh();
    }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomStepManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 /// <param name="step">
 /// The step.
 /// </param>
 /// <param name="fineControl">
 /// The fine Control.
 /// </param>
 public ZoomStepManipulator(IPlotControl plotControl, double step, bool fineControl)
     : base(plotControl)
 {
     this.Step = step;
     this.FineControl = fineControl;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TrackerManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public TrackerManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
     this.Snap       = true;
     this.PointsOnly = false;
 }
 protected MouseAction(IPlotControl pc)
 {
     this.pc = pc;
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomRectangleManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ZoomRectangleManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TrackerManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public TrackerManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
     this.Snap = true;
     this.PointsOnly = false;
 }
 protected MouseAction(IPlotControl pc)
 {
     this.pc = pc;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ZoomManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResetManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ResetManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
 /// <summary>
 /// Attaches this model to the specified plot control.
 /// </summary>
 /// <param name="plotControl">The plot control.</param>
 /// <remarks>
 /// Only one plot control can be attached to the plot model.
 /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot control.
 /// </remarks>
 public void AttachPlotControl(IPlotControl plotControl)
 {
     this.PlotControl = plotControl;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomRectangleManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ZoomRectangleManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #16
0
 public static void AutoScale(IPlotControl control)
 {
     control.Plot.AutoScale();
     control.Refresh();
 }
예제 #17
0
 public static void ToggleBenchmark(IPlotControl control)
 {
     control.Plot.Benchmark.IsVisible = !control.Plot.Benchmark.IsVisible;
     control.Refresh();
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PanManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public PanManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomStepManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 /// <param name="step">
 /// The step.
 /// </param>
 /// <param name="fineControl">
 /// The fine Control.
 /// </param>
 public ZoomStepManipulator(IPlotControl plotControl, double step, bool fineControl)
     : base(plotControl)
 {
     this.Step        = step;
     this.FineControl = fineControl;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PanManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public PanManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #21
0
 public static void ZoomRectangleApply(IPlotControl control)
 {
     control.Plot.MouseZoomRectangleClear(applyZoom: true);
     control.Refresh();
 }
예제 #22
0
 /// <summary>
 /// Attaches this model to the specified plot control.
 /// </summary>
 /// <param name="plotControl">The plot control.</param>
 /// <remarks>
 /// Only one plot control can be attached to the plot model.
 /// The plot model contains data (e.g. axis scaling) that is only relevant to the current plot control.
 /// </remarks>
 public void AttachPlotControl(IPlotControl plotControl)
 {
     this.PlotControl = plotControl;
 }
예제 #23
0
 public static void DragZoomRectangle(IPlotControl control, MouseDrag drag, LockedAxes locked)
 {
     control.Plot.MouseZoomRectangle(drag.From, drag.To, vSpan: locked.Y, hSpan: locked.X);
     control.Refresh();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ZoomManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
예제 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResetManipulator"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 public ResetManipulator(IPlotControl plotControl)
     : base(plotControl)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManipulatorBase"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 protected ManipulatorBase(IPlotControl plotControl)
 {
     this.PlotControl = plotControl;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManipulatorBase"/> class.
 /// </summary>
 /// <param name="plotControl">
 /// The plot control.
 /// </param>
 protected ManipulatorBase(IPlotControl plotControl)
 {
     this.PlotControl = plotControl;
 }