/// <summary> /// Get a hot needle command based on the user input /// </summary> /// <returns></returns> private DisplayMode GetHotNeedle() { ushort?fadeTime = ViewUtility.GetUShort(FadeDurationTextBox); if (!fadeTime.HasValue) { return(null); } float highlight = 2.0f; bool useHighlight = UseHighlight.IsChecked.HasValue && UseHighlight.IsChecked.Value; if (!float.TryParse(HighlightMultiplierTextBox.Text, out highlight) && useHighlight) { HighlightMultiplierTextBox.BorderBrush = new SolidColorBrush(Colors.Red); return(null); } return(new HotNeedleDisplayMode { HotColor = (Color)HotColorComboBox.SelectedValue, FadeTime = fadeTime.Value, UseHighlight = useHighlight, HighlightMultiplier = highlight }); }
private DisplayMode GetBackgroundRotate() { ushort?offset = ViewUtility.GetUShort(PixelOffsetTextBox); if (!offset.HasValue) { return(null); } return(new BackgroundRotateDisplayMode { Offset = offset.Value }); }
private DisplayMode GetMinMax() { ushort?fadeTime = ViewUtility.GetUShort(FadeDurationTextBox); if (!fadeTime.HasValue) { return(null); } return(new MinMaxDisplayMode { NeedleColor = (Color)HotColorComboBox.SelectedValue, ResetTime = fadeTime.Value }); }
/**************************************************************** * UI Callbacks * ****************************************************************/ /// <summary> /// Generate and send a manual needle position command to FizViz /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NeedlePositionButton_Click(object sender, RoutedEventArgs e) { ViewUtility.ResetControlBorders(ControlGrid); ushort?position = ViewUtility.GetUShort(NeedlePositionTextBox); if (!position.HasValue) { return; } NeedlePosition positionCommand = new NeedlePosition { Position = position.Value, Direction = (NeedlePosition.NeedleDirectionValue)NeedleDirectionComboBox.SelectedValue }; App.FizViz.SendCommand(positionCommand); }
/**************************************************************** * UI Callbacks * ****************************************************************/ /// <summary> /// Generate and send a min max configuration message to FizViz /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MinMaxButton_Click(object sender, RoutedEventArgs e) { ViewUtility.ResetControlBorders(ControlGrid); ushort?reset = ViewUtility.GetUShort(ResetTextBox); if (!reset.HasValue) { return; } MinMaxCommand command = new MinMaxCommand { MinColor = (Color)MinColorComboBox.SelectedValue, MaxColor = (Color)MaxColorComboBox.SelectedValue, DisplayMin = DisplayMin.IsChecked.HasValue && DisplayMin.IsChecked.Value, DisplayMax = DisplayMax.IsChecked.HasValue && DisplayMax.IsChecked.Value, ResetDelay = reset.Value }; App.FizViz.SendCommand(command); }