コード例 #1
0
 private ChannelEditor Ds_GetEditorRequest(TimeSeries sender)
 {
     return(ChannelEditors[sender.ID]);
 }
コード例 #2
0
 // this is called when a time series visual is changed (Context Menu Strip).
 // We need to do two things,
 // update individual channel editors, change editor layouts.
 private void CompleteLogControl_OnVisualsChanged(TimeSeries ts)
 {
     ChannelEditors[ts.ID].Adapt(ts);
     resetChannelEditorTops();
 }
コード例 #3
0
 public HoverPoint(int arrayIndex, PointF value, TimeSeries series)
 {
     ArrayIndex = arrayIndex;
     Value      = value;
     Series     = series;
 }
コード例 #4
0
 private void ContextMenuStrip_Closed(object sender, ToolStripDropDownClosedEventArgs e)
 {
     MenuStripIsShowing = null;
 }
コード例 #5
0
 public void ForceHighlight(TimeSeries series)
 {
     HoverOver          = series;
     TentativeOp        = series == null ? MoveOp.None : MoveOp.selectSeries;
     MenuStripIsShowing = series;
 }
コード例 #6
0
        private void TimePlot_MouseMove(object sender, MouseEventArgs e)
        {
            CursorG = e.Location;
            Point eLocForSaving = e.Location;
            Point eLoc          = new Point(e.Location.X + (int)ScreenLoopOffset.X, e.Location.Y + (int)ScreenLoopOffset.Y);

            showCursorX = false;
            showCursorY = false;
            if (CurrentMoveOp == MoveOp.None)
            {
                if (
                    (MaxValueOvershootInDisplay() && UpLimitImage.Contains(eLoc)) ||
                    (MinValueOvershootInDisplay() && DownLimitImage.Contains(eLoc))
                    )
                {
                    Cursor       = Cursors.Hand;
                    TentativeOp  = MoveOp.resetScale;
                    needsRefresh = true;
                    HoverOver    = null;
                }
                else if (TimeUndershootInDisplay() && RightLimitImage.Contains(eLoc))
                {
                    Cursor       = Cursors.Hand;
                    TentativeOp  = MoveOp.goToZero;
                    needsRefresh = true;
                    HoverOver    = null;
                }
                else if (eLoc.Y > DrawPlotArea.Height)
                {
                    Cursor       = Cursors.SizeWE;
                    TentativeOp  = MoveOp.xZoom;
                    needsRefresh = true;
                    showCursorX  = true;
                    HoverOver    = null;
                }
                else if (eLoc.X > DrawPlotArea.Width)
                {
                    Cursor       = Cursors.SizeNS;
                    TentativeOp  = MoveOp.yZoom;
                    needsRefresh = true;
                    showCursorY  = true;
                    HoverOver    = null;
                }
                else
                {
                    Cursor      = Cursors.Default;
                    TentativeOp = MoveOp.xyPan;
                    var bkp = HoverOver;
                    HoverOver = CheckHover(GtoV(eLoc, xOffsetG, XPPU, yOffsetG, YPPU, Height - XLabelHeight), 10 / XPPU, 10 / YPPU);
                    if (HoverOver != null)
                    {
                        TentativeOp = MoveOp.selectSeries;
                    }
                    if (HoverOver != bkp)
                    {
                        needsRefresh = true;
                        if (HoverOver != null)
                        {
                            Cursor = Cursors.Help;
                        }
                    }
                }
            }
            else if (CurrentMoveOp == MoveOp.xZoom)
            {
                float totalShownV = Width / XPPU;
                float changeV     = -(eLoc.X - LastMouse.X) / XPPU;
                float newTotalV   = totalShownV + changeV;
                if (newTotalV < 0)
                {
                    return;
                }
                XPPU         = Width / newTotalV;
                xOffsetG     = GAtMouseDown.X - VAtMouseDown.X * XPPU;
                needsRefresh = true;
            }
            else if (CurrentMoveOp == MoveOp.yZoom)
            {
                float totalShownV = (Height - XLabelHeight) / YPPU;
                float changeV     = (eLoc.Y - LastMouse.Y) / YPPU;
                float newTotalV   = totalShownV + changeV;
                YPPU         = (Height - XLabelHeight) / newTotalV;
                yOffsetG     = ((Height - XLabelHeight) - GAtMouseDown.Y) - VAtMouseDown.Y * YPPU;
                needsRefresh = true;
            }
            else if (CurrentMoveOp == MoveOp.xyPan || CurrentMoveOp == MoveOp.selectSeries)
            {
                xOffsetG += (eLoc.X - LastMouse.X);
                yOffsetG += -(eLoc.Y - LastMouse.Y);

                needsRefresh = true;
            }

            if (CurrentMoveOp == MoveOp.xyPan || CurrentMoveOp == MoveOp.yZoom || CurrentMoveOp == MoveOp.xZoom || CurrentMoveOp == MoveOp.selectSeries)
            {
                int x = Cursor.Position.X;
                if (x + 1 >= Screen.PrimaryScreen.Bounds.Width)
                {
                    Cursor.Position  = new Point(1, MousePosition.Y);
                    ScreenLoopOffset = new PointF(ScreenLoopOffset.X + Screen.PrimaryScreen.Bounds.Width, ScreenLoopOffset.Y);
                    eLocForSaving.X -= Screen.PrimaryScreen.Bounds.Width;
                }
                else if (x == 0)
                {
                    Cursor.Position  = new Point(Screen.PrimaryScreen.Bounds.Width - 2, MousePosition.Y);
                    ScreenLoopOffset = new PointF(ScreenLoopOffset.X - Screen.PrimaryScreen.Bounds.Width, ScreenLoopOffset.Y);
                    eLocForSaving.X += Screen.PrimaryScreen.Bounds.Width;
                }
                int y = Cursor.Position.Y;
                if (y + 1 >= Screen.PrimaryScreen.Bounds.Height)
                {
                    Cursor.Position  = new Point(MousePosition.X, 1);
                    ScreenLoopOffset = new PointF(ScreenLoopOffset.X, ScreenLoopOffset.Y + Screen.PrimaryScreen.Bounds.Height);
                    eLocForSaving.Y -= Screen.PrimaryScreen.Bounds.Height;
                }
                else if (y == 0)
                {
                    Cursor.Position  = new Point(MousePosition.X, Screen.PrimaryScreen.Bounds.Height - 2);
                    ScreenLoopOffset = new PointF(ScreenLoopOffset.Y, ScreenLoopOffset.Y - Screen.PrimaryScreen.Bounds.Height);
                    eLocForSaving.Y += Screen.PrimaryScreen.Bounds.Height;
                }
            }
            LastMouse = new Point(eLocForSaving.X + (int)ScreenLoopOffset.X, eLocForSaving.Y + (int)ScreenLoopOffset.Y);
        }