public void UserEventCallbackFunc(eUserEvent evt, double param) { switch (evt) { /* when mouse is moved into a plot and we are in foreground, update focus to hovered plot */ case eUserEvent.MouseEnter: if (WindowActivated) { FocusHovered(); } break; /* bring up popup menu. has to be improved */ case eUserEvent.MouseClickRight: break; } }
public void UserEventCallback(eUserEvent evt, double delta) { switch (evt) { case eUserEvent.MouseDragX: SampleDisplay.ProcessUserAction(eUserAction.XOffset, delta); StrengthDisplay.ProcessUserAction(eUserAction.XOffset, delta); break; case eUserEvent.MouseWheelUpShift: SampleDisplay.ProcessUserAction(eUserAction.XZoomIn, delta); StrengthDisplay.ProcessUserAction(eUserAction.XZoomIn, delta); break; case eUserEvent.MouseWheelDownShift: SampleDisplay.ProcessUserAction(eUserAction.XZoomOut, delta); StrengthDisplay.ProcessUserAction(eUserAction.XZoomOut, delta); break; } }
public void UserEventCallbackFunc(eUserEvent evt, double param) { switch (evt) { /* when mouse is moved into a plot and we are in foreground, update focus to hovered plot */ case eUserEvent.MouseEnter: FocusHovered(); break; /* bring up popup menu. has to be improved */ case eUserEvent.MouseClickRight: { long freq = GetHovered().CursorFrequency; ContextMenu contextMenu = new ContextMenu(); MenuItem menuItem1 = new MenuItem("Frequency: " + FrequencyFormatter.FreqToStringAccurate(freq)); MenuItem menuItem2 = new MenuItem("-"); MenuItem menuItem3 = new MenuItem("FFT 512"); MenuItem menuItem4 = new MenuItem("FFT 1024"); MenuItem menuItem5 = new MenuItem("FFT 2048"); MenuItem menuItem6 = new MenuItem("FFT 4096"); MenuItem menuItem7 = new MenuItem("-"); MenuItem menuItem8 = new MenuItem("Show decimated [Filtered]"); menuItem1.Enabled = false; contextMenu.MenuItems.AddRange(new MenuItem[] { menuItem1, menuItem2, menuItem3, menuItem4, menuItem5, menuItem6, menuItem7, menuItem8 }); switch (FFTSize) { case 512: menuItem3.Checked = true; break; case 1024: menuItem4.Checked = true; break; case 2048: menuItem5.Checked = true; break; case 4096: menuItem6.Checked = true; break; } menuItem3.Click += new EventHandler(delegate(object sender, EventArgs e) { FFTSize = 512; }); menuItem4.Click += new EventHandler(delegate(object sender, EventArgs e) { FFTSize = 1024; }); menuItem5.Click += new EventHandler(delegate(object sender, EventArgs e) { FFTSize = 2048; }); menuItem6.Click += new EventHandler(delegate(object sender, EventArgs e) { FFTSize = 4096; }); menuItem8.Click += new EventHandler(delegate(object sender, EventArgs e) { DecimateFiltered ^= true; }); System.Drawing.Point popupPos = this.PointToClient(MousePosition); popupPos.X -= 20; popupPos.Y -= 20; contextMenu.Show(this, popupPos); } break; } }
public void AddUserEventCallback(eUserEvent evt) { FFTInput.EventActions[evt] = eUserAction.UserCallback; FFTTranslated.EventActions[evt] = eUserAction.UserCallback; FFTFiltered.EventActions[evt] = eUserAction.UserCallback; }
public void AddUserEventCallback(eUserEvent evt) { iqPlot.waveForm.EventActions[evt] = eUserAction.UserCallback; scope.waveForm.EventActions[evt] = eUserAction.UserCallback; }
public void UserEventCallbackFunc(eUserEvent evt, double param) { switch (evt) { case eUserEvent.MouseEnter: FFTDisplay.ShowVerticalCursor = true; WaterfallDisplay.ShowVerticalCursor = true; UserEventCallbackFunc(eUserEvent.StatusUpdated, 0); break; case eUserEvent.MouseLeave: WaterfallDisplay.LevelBarActive = false; FFTDisplay.MainText = ""; WaterfallDisplay.MainText = ""; FFTDisplay.ShowVerticalCursor = false; WaterfallDisplay.ShowVerticalCursor = false; UserEventCallbackFunc(eUserEvent.StatusUpdated, 0); break; /* used to paint waterfall level bars */ case eUserEvent.StatusUpdated: /* level bars toggled off */ if (!WaterfallDisplay.LevelBarActive && LevelBarActive) { FFTDisplay.LabelledHorLines.Remove(LevelBarLower); if (!WaterfallDisplay.DynamicLimits) { FFTDisplay.LabelledHorLines.Remove(LevelBarUpper); } LevelBarActive = false; } /* level bars toggled on */ if (WaterfallDisplay.LevelBarActive && !LevelBarActive) { FFTDisplay.LabelledHorLines.AddLast(LevelBarLower); if (!WaterfallDisplay.DynamicLimits) { FFTDisplay.LabelledHorLines.AddLast(LevelBarUpper); } LevelBarActive = true; } if (!WaterfallDisplay.DynamicLimits) { LevelBarLower.Position = WaterfallDisplay.LeveldBBlack; LevelBarUpper.Position = WaterfallDisplay.LeveldBWhite; } else { LevelBarLower.Position = WaterfallDisplay.LeveldBBlack; } FFTDisplay.UpdateOverlays = true; FFTDisplay.NeedsRender = true; WaterfallDisplay.NeedsRender = true; break; case eUserEvent.MouseWheelUp: FFTDisplay.ProcessUserAction(eUserAction.YZoomIn, param); break; case eUserEvent.MouseWheelDown: FFTDisplay.ProcessUserAction(eUserAction.YZoomOut, param); break; case eUserEvent.MousePosX: FFTDisplay.ProcessUserAction(eUserAction.XPos, param); WaterfallDisplay.ProcessUserAction(eUserAction.XPos, param); break; case eUserEvent.MouseDragXShift: FFTDisplay.ProcessUserAction(eUserAction.XOffsetOverview, param); WaterfallDisplay.ProcessUserAction(eUserAction.XOffsetOverview, param); break; case eUserEvent.MouseDragX: FFTDisplay.ProcessUserAction(eUserAction.XOffset, param); WaterfallDisplay.ProcessUserAction(eUserAction.XOffset, param); break; case eUserEvent.MouseWheelUpShift: FFTDisplay.ProcessUserAction(eUserAction.XZoomIn, param); WaterfallDisplay.ProcessUserAction(eUserAction.XZoomIn, param); break; case eUserEvent.MouseWheelDownShift: FFTDisplay.ProcessUserAction(eUserAction.XZoomOut, param); WaterfallDisplay.ProcessUserAction(eUserAction.XZoomOut, param); break; /* * case eUserEvent.MouseWheelUpAlt: * if (WaterfallDisplay.UpdateRate < 512) * { * FFTDisplay.UpdateRate *= 2; * WaterfallDisplay.UpdateRate *= 2; * } * break; * * case eUserEvent.MouseWheelDownAlt: * if (WaterfallDisplay.UpdateRate > 1) * { * FFTDisplay.UpdateRate /= 2; * WaterfallDisplay.UpdateRate /= 2; * } * break; * */ } /* finally inform master form about the event */ if (UserEventCallback != null) { UserEventCallback(evt, param); } }
public void AddUserEventCallback(eUserEvent evt) { FFTDisplay.EventActions[evt] = eUserAction.UserCallback; WaterfallDisplay.EventActions[evt] = eUserAction.UserCallback; }