diff --git a/WhackerLinkConsoleV2/AlertTone.xaml b/WhackerLinkConsoleV2/AlertTone.xaml index 6599fb9..865d943 100644 --- a/WhackerLinkConsoleV2/AlertTone.xaml +++ b/WhackerLinkConsoleV2/AlertTone.xaml @@ -1,15 +1,34 @@  - - - - + + + + + diff --git a/WhackerLinkConsoleV2/AlertTone.xaml.cs b/WhackerLinkConsoleV2/AlertTone.xaml.cs index 5d0be21..b0728fa 100644 --- a/WhackerLinkConsoleV2/AlertTone.xaml.cs +++ b/WhackerLinkConsoleV2/AlertTone.xaml.cs @@ -102,5 +102,10 @@ namespace WhackerLinkConsoleV2.Controls ReleaseMouseCapture(); } + + private void TextBox_TextChanged(object sender, TextChangedEventArgs e) + { + + } } } diff --git a/WhackerLinkConsoleV2/Assets/alerttone.png b/WhackerLinkConsoleV2/Assets/alerttone.png new file mode 100644 index 0000000..8350c1d Binary files /dev/null and b/WhackerLinkConsoleV2/Assets/alerttone.png differ diff --git a/WhackerLinkConsoleV2/Assets/channelmarker.png b/WhackerLinkConsoleV2/Assets/channelmarker.png index c23858e..01e84db 100644 Binary files a/WhackerLinkConsoleV2/Assets/channelmarker.png and b/WhackerLinkConsoleV2/Assets/channelmarker.png differ diff --git a/WhackerLinkConsoleV2/Assets/clearemerg.png b/WhackerLinkConsoleV2/Assets/clearemerg.png new file mode 100644 index 0000000..d263dcd Binary files /dev/null and b/WhackerLinkConsoleV2/Assets/clearemerg.png differ diff --git a/WhackerLinkConsoleV2/Assets/connection.png b/WhackerLinkConsoleV2/Assets/connection.png new file mode 100644 index 0000000..765d57c Binary files /dev/null and b/WhackerLinkConsoleV2/Assets/connection.png differ diff --git a/WhackerLinkConsoleV2/Assets/instantptt.png b/WhackerLinkConsoleV2/Assets/instantptt.png index d445831..e10d70a 100644 Binary files a/WhackerLinkConsoleV2/Assets/instantptt.png and b/WhackerLinkConsoleV2/Assets/instantptt.png differ diff --git a/WhackerLinkConsoleV2/Assets/page.png b/WhackerLinkConsoleV2/Assets/page.png new file mode 100644 index 0000000..2adc7c2 Binary files /dev/null and b/WhackerLinkConsoleV2/Assets/page.png differ diff --git a/WhackerLinkConsoleV2/Assets/pageselect.png b/WhackerLinkConsoleV2/Assets/pageselect.png index a9e060f..94969ae 100644 Binary files a/WhackerLinkConsoleV2/Assets/pageselect.png and b/WhackerLinkConsoleV2/Assets/pageselect.png differ diff --git a/WhackerLinkConsoleV2/Assets/whackerlink-logo.png b/WhackerLinkConsoleV2/Assets/whackerlink-logo.png new file mode 100644 index 0000000..c4b0318 Binary files /dev/null and b/WhackerLinkConsoleV2/Assets/whackerlink-logo.png differ diff --git a/WhackerLinkConsoleV2/ChannelBox.xaml b/WhackerLinkConsoleV2/ChannelBox.xaml index 56e9b3f..43c67fb 100644 --- a/WhackerLinkConsoleV2/ChannelBox.xaml +++ b/WhackerLinkConsoleV2/ChannelBox.xaml @@ -1,69 +1,114 @@  + Width="220" Height="100" Background="#FF0B004B"> + + + + + + + + - - - - - - - - - + + + + + + - - - - - + - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + - - - - - - - - - \ No newline at end of file + + + + + + + + + diff --git a/WhackerLinkConsoleV2/ChannelBox.xaml.cs b/WhackerLinkConsoleV2/ChannelBox.xaml.cs index b337bf0..eee864e 100644 --- a/WhackerLinkConsoleV2/ChannelBox.xaml.cs +++ b/WhackerLinkConsoleV2/ChannelBox.xaml.cs @@ -37,6 +37,9 @@ namespace WhackerLinkConsoleV2.Controls private bool _emergency; private string _lastSrcId = "0"; private double _volume = 1.0; + private LinearGradientBrush grayGradient; + private LinearGradientBrush redGradient; + private LinearGradientBrush orangeGradient; public FlashingBackgroundManager _flashingBackgroundManager; @@ -152,6 +155,37 @@ namespace WhackerLinkConsoleV2.Controls LastSrcId = $"Last SRC: {LastSrcId}"; UpdateBackground(); MouseLeftButtonDown += ChannelBox_MouseLeftButtonDown; + + grayGradient = new LinearGradientBrush + { + StartPoint = new Point(0.5, 0), + EndPoint = new Point(0.5, 1) + }; + + grayGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFF0F0F0"), 0.485)); + grayGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFE3E3E3"), 0.517)); + + redGradient = new LinearGradientBrush + { + StartPoint = new Point(0.5, 0), + EndPoint = new Point(0.5, 1) + }; + + redGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFE0000"), 0.485)); + redGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFD50000"), 0.517)); + + orangeGradient = new LinearGradientBrush + { + StartPoint = new Point(0.5, 0), + EndPoint = new Point(0.5, 1) + }; + + orangeGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFFFD200"), 0.485)); + orangeGradient.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FFE2BA00"), 0.517)); + + PttButton.Background = grayGradient; + PageSelectButton.Background = grayGradient; + ChannelMarkerBtn.Background = grayGradient; } private void ChannelBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) @@ -159,7 +193,7 @@ namespace WhackerLinkConsoleV2.Controls if (IsEditMode) return; IsSelected = !IsSelected; - Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF1E90FF") : Brushes.Gray; + Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF0B004B") : Brushes.Gray; if (IsSelected) { @@ -176,9 +210,9 @@ namespace WhackerLinkConsoleV2.Controls if (IsEditMode) return; if (PttState) - PttButton.Background = new SolidColorBrush(Colors.Red); + PttButton.Background = redGradient; else - PttButton.Background = (Brush)new BrushConverter().ConvertFrom("#FF2870AF"); + PttButton.Background = grayGradient; } private void UpdatePageColor() @@ -186,9 +220,9 @@ namespace WhackerLinkConsoleV2.Controls if (IsEditMode) return; if (PageState) - PageSelectButton.Background = new SolidColorBrush(Colors.Orange); + PageSelectButton.Background = orangeGradient; else - PageSelectButton.Background = (Brush)new BrushConverter().ConvertFrom("#FF2870AF"); + PageSelectButton.Background = grayGradient; } private void UpdateHoldColor() @@ -196,18 +230,14 @@ namespace WhackerLinkConsoleV2.Controls if (IsEditMode) return; if (HoldState) - ChannelMarkerBtn.Background = new SolidColorBrush(Colors.Orange); + ChannelMarkerBtn.Background = orangeGradient; else - ChannelMarkerBtn.Background = (Brush)new BrushConverter().ConvertFrom("#FF2870AF"); + ChannelMarkerBtn.Background = grayGradient; } private void UpdateBackground() { - Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF1E90FF") : Brushes.DarkGray; - - ChannelMarkerBtn.Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF2870AF") : new SolidColorBrush(Colors.Gray); - PageSelectButton.Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF2870AF") : new SolidColorBrush(Colors.Gray); - PttButton.Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF2870AF") : new SolidColorBrush(Colors.Gray); + Background = IsSelected ? (Brush)new BrushConverter().ConvertFrom("#FF0B004B") : Brushes.DarkGray; } private void PTTButton_Click(object sender, RoutedEventArgs e) @@ -255,7 +285,7 @@ namespace WhackerLinkConsoleV2.Controls { if (!IsSelected || PttState) return; - ((Button)sender).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF2870AF")); + ((Button)sender).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDDDDDD")); } } } diff --git a/WhackerLinkConsoleV2/MainWindow.xaml b/WhackerLinkConsoleV2/MainWindow.xaml index 80190b2..a1fe802 100644 --- a/WhackerLinkConsoleV2/MainWindow.xaml +++ b/WhackerLinkConsoleV2/MainWindow.xaml @@ -2,14 +2,17 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WhackerLinkConsoleV2.Controls" - Title="WhackerLinkConsoleV2" Height="600" Width="1000" Background="#1e1e1e"> - + Title="WhackerLinkConsoleV2" Height="600" Width="1000" Background="#FFF2F2F2"> + - + + - + + + @@ -29,8 +32,81 @@ - - + + + + + + + + + + + + + + + diff --git a/WhackerLinkConsoleV2/MainWindow.xaml.cs b/WhackerLinkConsoleV2/MainWindow.xaml.cs index 4a96d3a..55f1504 100644 --- a/WhackerLinkConsoleV2/MainWindow.xaml.cs +++ b/WhackerLinkConsoleV2/MainWindow.xaml.cs @@ -15,6 +15,7 @@ * along with this program. If not, see . * * Copyright (C) 2024-2025 Caleb, K4PHP +* Copyright (C) 2025 J. Dean * */ @@ -182,7 +183,7 @@ namespace WhackerLinkConsoleV2 { if (response.Status == (int)ResponseType.GRANT) { - systemStatusBox.Background = new SolidColorBrush(Colors.Green); + systemStatusBox.Background = (Brush)new BrushConverter().ConvertFrom("#FF00BC48"); systemStatusBox.ConnectionState = "Connected"; } else @@ -475,7 +476,6 @@ namespace WhackerLinkConsoleV2 Dispatcher.Invoke(() => { //channel.PageState = false; // TODO: Investigate - channel.PageSelectButton.Background = Brushes.Green; }); } } @@ -564,7 +564,7 @@ namespace WhackerLinkConsoleV2 } } - double totalDurationMs = ((double)pcmData.Length / 16000) * 1000 + 250; + double totalDurationMs = ((double)pcmData.Length / 16000) * 1000 - 6000; await Task.Delay((int)totalDurationMs); GRP_VCH_RLS release = new GRP_VCH_RLS @@ -579,7 +579,7 @@ namespace WhackerLinkConsoleV2 Dispatcher.Invoke(() => { - channel.PageSelectButton.Background = Brushes.Green; + }); } } @@ -700,7 +700,7 @@ namespace WhackerLinkConsoleV2 Dispatcher.Invoke(() => { if (channel.IsSelected) - channel.Background = Brushes.DodgerBlue; + channel.Background = (Brush)new BrushConverter().ConvertFrom("#FF0B004B"); else channel.Background = new SolidColorBrush(Colors.DarkGray); }); @@ -727,7 +727,7 @@ namespace WhackerLinkConsoleV2 channel.LastSrcId = "Last SRC: " + response.SrcId; Dispatcher.Invoke(() => { - channel.Background = new SolidColorBrush(Colors.DarkCyan); + channel.Background = (Brush)new BrushConverter().ConvertFrom("#FF00BC48"); }); } else if (channel.PageState && response.Status == (int)ResponseType.GRANT && response.Channel != null && response.SrcId == system.Rid && response.DstId == cpgChannel.Tgid) { @@ -836,17 +836,27 @@ namespace WhackerLinkConsoleV2 element.CaptureMouse(); } + private const int GridSize = 5; // Set grid size (adjust as needed) + private void ChannelBox_MouseMove(object sender, MouseEventArgs e) { if (!isEditMode || !_isDragging || _draggedElement == null) return; Point currentPosition = e.GetPosition(ChannelsCanvas); - double newLeft = Math.Max(0, Math.Min(currentPosition.X - _offsetX, ChannelsCanvas.ActualWidth - _draggedElement.RenderSize.Width)); - double newTop = Math.Max(0, Math.Min(currentPosition.Y - _offsetY, ChannelsCanvas.ActualHeight - _draggedElement.RenderSize.Height)); + // Calculate the new position with snapping to the grid + double newLeft = Math.Round((currentPosition.X - _offsetX) / GridSize) * GridSize; + double newTop = Math.Round((currentPosition.Y - _offsetY) / GridSize) * GridSize; + + // Ensure the box stays within canvas bounds + newLeft = Math.Max(0, Math.Min(newLeft, ChannelsCanvas.ActualWidth - _draggedElement.RenderSize.Width)); + newTop = Math.Max(0, Math.Min(newTop, ChannelsCanvas.ActualHeight - _draggedElement.RenderSize.Height)); + + // Apply snapped position Canvas.SetLeft(_draggedElement, newLeft); Canvas.SetTop(_draggedElement, newTop); + // Save the new position if it's a ChannelBox if (_draggedElement is ChannelBox channelBox) { _settingsManager.UpdateChannelPosition(channelBox.ChannelName, newLeft, newTop); @@ -855,6 +865,7 @@ namespace WhackerLinkConsoleV2 AdjustCanvasHeight(); } + private void ChannelBox_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { if (!isEditMode || !_isDragging || _draggedElement == null) return; @@ -1003,5 +1014,10 @@ namespace WhackerLinkConsoleV2 channel.Emergency = false; } } + + private void Button_Click(object sender, RoutedEventArgs e) + { + + } } } diff --git a/WhackerLinkConsoleV2/SystemStatusBox.xaml b/WhackerLinkConsoleV2/SystemStatusBox.xaml index f707da3..e6eb493 100644 --- a/WhackerLinkConsoleV2/SystemStatusBox.xaml +++ b/WhackerLinkConsoleV2/SystemStatusBox.xaml @@ -1,13 +1,11 @@  - - - - - - + Width="105" Height="55" Background="#FF0B004B" BorderBrush="Gray" BorderThickness="1"> + + + + \ No newline at end of file diff --git a/WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj b/WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj index e1683a2..d3b3135 100644 --- a/WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj +++ b/WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj @@ -10,10 +10,16 @@ + + + + + + @@ -28,12 +34,18 @@ + Always + + + + + diff --git a/WhackerLinkConsoleV2/alerttone.png b/WhackerLinkConsoleV2/alerttone.png new file mode 100644 index 0000000..8350c1d Binary files /dev/null and b/WhackerLinkConsoleV2/alerttone.png differ diff --git a/WhackerLinkConsoleV2/clearemerg.png b/WhackerLinkConsoleV2/clearemerg.png new file mode 100644 index 0000000..d263dcd Binary files /dev/null and b/WhackerLinkConsoleV2/clearemerg.png differ diff --git a/WhackerLinkConsoleV2/connection.png b/WhackerLinkConsoleV2/connection.png new file mode 100644 index 0000000..765d57c Binary files /dev/null and b/WhackerLinkConsoleV2/connection.png differ diff --git a/WhackerLinkConsoleV2/page.png b/WhackerLinkConsoleV2/page.png new file mode 100644 index 0000000..2adc7c2 Binary files /dev/null and b/WhackerLinkConsoleV2/page.png differ diff --git a/WhackerLinkConsoleV2/whackerlink-logo.png b/WhackerLinkConsoleV2/whackerlink-logo.png new file mode 100644 index 0000000..c4b0318 Binary files /dev/null and b/WhackerLinkConsoleV2/whackerlink-logo.png differ