private void Execute_setMarker(object sender, ExecutedRoutedEventArgs e) { using (new WaitCursor()) { double timeCursor; ObservableCollection <RenderSlice> selectedRsList; string markerSymbol = "M"; if (e.Parameter != null && e.Parameter.Equals("ContextMenu")) { // Informationen vom Contextmenu timeCursor = this.signalviewercontrol.stackercontrol.PluginContextMenuTimeCursor; selectedRsList = this.signalviewercontrol.stackercontrol.PluginContextMenuSelectedRsList; } else { // Informationen von der aktuellen Mausposition HoverStackEventArgs currentHoverStackEventArgs = hoverStackEventArgs; if (currentHoverStackEventArgs == null) { return; } Point point = Mouse.GetPosition(currentHoverStackEventArgs.ItemsControl); timeCursor = RendererManager.Time + (RendererManager.TimeStretch * point.X / currentHoverStackEventArgs.ItemsControl.ActualWidth); markerSymbol = (e.Parameter == null || e.Parameter.Equals(string.Empty)) ? "M" : e.Parameter.ToString(); selectedRsList = currentHoverStackEventArgs.Stack; } IEnumerable <XElement> retsigs = Marker.setMarker(RendererManager.GetSevEntries(selectedRsList), timeCursor, markerSymbol); // Neues signal hinzufuegen if (retsigs != null) { foreach (XElement xe in retsigs) { if (StackerControl.IsSignalEventValueEntry(xe)) { signalviewercontrol.stackercontrol.DropSignalEventValueEntry(xe, selectedRsList); } } } // Deselect all and Render again signalviewercontrol.Deselect(); if (RendererManager.TimeMax < RendererManager.Time) { RendererManager.Scroll(0.0); } else { RendererManager.Render(); } // Save Unisens file after Plugin execution Executed_Save(null, null); } }
private void Execute_truncateMarker(object sender, ExecutedRoutedEventArgs e) { using (new WaitCursor()) { double timeCursor; ObservableCollection <RenderSlice> selectedRsList; if (e.Parameter != null && e.Parameter.Equals("ContextMenu")) { // Informationen vom Contextmenu timeCursor = this.signalviewercontrol.stackercontrol.PluginContextMenuTimeCursor; selectedRsList = this.signalviewercontrol.stackercontrol.PluginContextMenuSelectedRsList; } else { // Informationen von der aktuellen Mausposition HoverStackEventArgs currentHoverStackEventArgs = hoverStackEventArgs; if (currentHoverStackEventArgs == null) { return; } Point point = Mouse.GetPosition(currentHoverStackEventArgs.ItemsControl); timeCursor = RendererManager.Time + (RendererManager.TimeStretch * point.X / currentHoverStackEventArgs.ItemsControl.ActualWidth); selectedRsList = currentHoverStackEventArgs.Stack; } Marker.truncateMarker(RendererManager.GetSevEntries(selectedRsList), timeCursor); // Deselect all and Render again signalviewercontrol.Deselect(); if (RendererManager.TimeMax < RendererManager.Time) { RendererManager.Scroll(0.0); } else { RendererManager.Render(); } // Save Unisens file after Plugin execution Executed_Save(null, null); } }
// wird vom stapel-kontextmenü ausgelöst private void ExecPlugin_Executed(object sender, ExecutedRoutedEventArgs e) { ExecPluginCommandParameter exec = (ExecPluginCommandParameter)e.Parameter; IEnumerable <XElement> sev_entries = RendererManager.GetSevEntries(exec.Stack); IEnumerable <XElement> retsigs = this.ExecutePlugin(exec.Plugin, sev_entries, exec.TimeCursor, exec.Parameter); if (retsigs != null) { foreach (XElement xe in retsigs) { if (StackerControl.IsSignalEventValueEntry(xe)) { signalviewercontrol.stackercontrol.DropSignalEventValueEntry(xe, exec.Stack); } } } }
private void Execute_deleteMarker(object sender, ExecutedRoutedEventArgs e) { using (new WaitCursor()) { ObservableCollection <RenderSlice> selectedRsList; if (e.Parameter != null && e.Parameter.Equals("ContextMenu")) { // Informationen vom Contextmenu selectedRsList = this.signalviewercontrol.stackercontrol.PluginContextMenuSelectedRsList; } else { // Informationen von der aktuellen Mausposition HoverStackEventArgs currentHoverStackEventArgs = hoverStackEventArgs; if (currentHoverStackEventArgs == null) { return; } selectedRsList = currentHoverStackEventArgs.Stack; } Marker.deleteMarker(RendererManager.GetSevEntries(selectedRsList), signalviewercontrol.SelectionStart, signalviewercontrol.SelectionEnd); // Deselect all and Render again signalviewercontrol.Deselect(); if (RendererManager.TimeMax < RendererManager.Time) { RendererManager.Scroll(0.0); } else { RendererManager.Render(); } // Save Unisens file after Plugin execution Executed_Save(null, null); } }