Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added WhackerLinkConsoleV2/Assets/dualpage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added WhackerLinkConsoleV2/Assets/pager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions WhackerLinkConsoleV2/ChannelBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,10 @@ private void PttButton_MouseLeave(object sender, System.Windows.Input.MouseEvent

((Button)sender).Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFDDDDDD"));
}

private void SetPageState(bool state)
{
PageState = state;
}
}
}
7 changes: 5 additions & 2 deletions WhackerLinkConsoleV2/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@
<MenuItem Header="Manual QC2" Click="ManualPage_Click" />
</MenuItem>
</Menu>

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Stretch">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Stretch">
<Canvas x:Name="ToneSetToolbar" Background="#FFF2F2F2" VerticalAlignment="Top"/>
</ScrollViewer>

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Stretch">
<Canvas x:Name="ChannelsCanvas" Background="#FFF2F2F2" VerticalAlignment="Top"/>
</ScrollViewer>

Expand Down
347 changes: 343 additions & 4 deletions WhackerLinkConsoleV2/MainWindow.xaml.cs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions WhackerLinkConsoleV2/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class SettingsManager
public bool ShowSystemStatus { get; set; } = true;
public bool ShowChannels { get; set; } = true;
public bool ShowAlertTones { get; set; } = true;
public bool ShowQCTones { get; set; } = true;

public string LastCodeplugPath { get; set; } = null;

public Dictionary<string, ChannelPosition> ChannelPositions { get; set; } = new Dictionary<string, ChannelPosition>();
public Dictionary<string, ChannelPosition> SystemStatusPositions { get; set; } = new Dictionary<string, ChannelPosition>();
public List<string> AlertToneFilePaths { get; set; } = new List<string>();
public Dictionary<string, ChannelPosition> AlertTonePositions { get; set; } = new Dictionary<string, ChannelPosition>();
public Dictionary<string, ChannelPosition> QCToneSetPositions { get; set; } = new Dictionary<string, ChannelPosition>();
public Dictionary<string, int> ChannelOutputDevices { get; set; } = new Dictionary<string, int>();

public void LoadSettings()
Expand All @@ -53,11 +55,13 @@ public void LoadSettings()
ShowSystemStatus = loadedSettings.ShowSystemStatus;
ShowChannels = loadedSettings.ShowChannels;
ShowAlertTones = loadedSettings.ShowAlertTones;
ShowQCTones = loadedSettings.ShowQCTones;
LastCodeplugPath = loadedSettings.LastCodeplugPath;
ChannelPositions = loadedSettings.ChannelPositions ?? new Dictionary<string, ChannelPosition>();
SystemStatusPositions = loadedSettings.SystemStatusPositions ?? new Dictionary<string, ChannelPosition>();
AlertToneFilePaths = loadedSettings.AlertToneFilePaths ?? new List<string>();
AlertTonePositions = loadedSettings.AlertTonePositions ?? new Dictionary<string, ChannelPosition>();
QCToneSetPositions = loadedSettings.QCToneSetPositions ?? new Dictionary<string, ChannelPosition>();
ChannelOutputDevices = loadedSettings.ChannelOutputDevices ?? new Dictionary<string, int>();
}
}
Expand Down Expand Up @@ -88,6 +92,12 @@ public void UpdateChannelPosition(string channelName, double x, double y)
SaveSettings();
}

public void UpdateQCToneSetPosition(string name, double x, double y)
{
QCToneSetPositions[name] = new ChannelPosition { X = x, Y = y };
SaveSettings();
}

public void UpdateSystemStatusPosition(string systemName, double x, double y)
{
SystemStatusPositions[systemName] = new ChannelPosition { X = x, Y = y };
Expand Down
30 changes: 30 additions & 0 deletions WhackerLinkConsoleV2/ToneSet.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<UserControl x:Class="WhackerLinkConsoleV2.Controls.ToneSet"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="220" Height="100" Background="#FF0B004B">
<Border BorderBrush="Gray" BorderThickness="1,1,1,1" CornerRadius="0" Padding="10" Background="LightGray" Margin="0,0,0,0" >
<StackPanel Orientation="Vertical" Margin="0,0,0,0">
<TextBlock Text="{Binding ToneName}" FontWeight="Bold" FontSize="24" Uid="toneName"/>
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" Margin="148,6,0,0" Grid.RowSpan="2" Grid.ColumnSpan="2" Width="50">
<Button Width="53" Height="40" x:Name="ToneSetPlayBtn" Click="ToneSetPlayBtn_Click" BorderThickness="0,0,0,0">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Image Source="pack://application:,,,/WhackerLinkConsoleV2;component/Assets/pager.png" Width="40" Height="42"/>
</Button>
<!-- <Button Width="40" Height="40" x:Name="ToneSetSelectBtn" Click="ToneSetSelectBtn_Click" BorderThickness="0,0,0,0" Margin="5,0,0,0">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="2"/>
</Style>
</Button.Resources>
<Image Source="pack://application:,,,/WhackerLinkConsoleV2;component/Assets/dualpage.png" Width="20" Height="42"/>

</Button>-->
</StackPanel>

</StackPanel>
</Border>
</UserControl>
72 changes: 72 additions & 0 deletions WhackerLinkConsoleV2/ToneSet.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace WhackerLinkConsoleV2.Controls
{
public partial class ToneSet : UserControl, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

public string ToneName { get; set; }
public double ToneA { get; set; }
public double ToneB { get; set; }

public bool IsEditMode { get; set; }

public event EventHandler PlayClicked;
public event EventHandler SelectToggled;

private bool _isSelected = false;

public ToneSet(string toneName, double toneA, double toneB)
{
InitializeComponent();
ToneName = toneName;
ToneA = toneA;
ToneB = toneB;

MouseLeftButtonDown += ToneSet_MouseLeftButtonDown;

DataContext = this;
}

private void ToneSet_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (IsEditMode) return;
}


private void ToneSetPlayBtn_Click(object sender, RoutedEventArgs e)
{
PlayClicked?.Invoke(this, EventArgs.Empty);
}

private void ToneSetSelectBtn_Click(object sender, RoutedEventArgs e)
{
SelectToggled?.Invoke(this, EventArgs.Empty);
}

public void SetSelected(bool selected)
{
_isSelected = selected;
UpdateSelectButton();
if (selected)
this.Background = System.Windows.Media.Brushes.LightBlue;
else
this.Background = System.Windows.Media.Brushes.Transparent;
}

private void UpdateSelectButton()
{
//if (ToneSetSelectBtn != null)
{
//ToneSetSelectBtn.Content = _isSelected ? "Deselect" : "Select";
//ToneSetSelectBtn.Background = _isSelected ? Brushes.LightGreen : Brushes.LightGray;
}
}
}
}
4 changes: 4 additions & 0 deletions WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

<ItemGroup>
<None Remove="alerttone.png" />
<None Remove="Assets\dualpage.png" />
<None Remove="Assets\pager.png" />
<None Remove="Assets\alerttone.png" />
<None Remove="Assets\alerttone2.png" />
<None Remove="Assets\audio.png" />
Expand Down Expand Up @@ -71,6 +73,8 @@
<Resource Include="Assets\whackerlink-logo.png" />
<Resource Include="Assets\WhackerLinkLogoV2.png" />
<Resource Include="Assets\WhackerLinkLogoV4.png" />
<Resource Include="Assets\dualpage.png" />
<Resource Include="Assets\pager.png" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions WhackerLinkConsoleV2/WhackerLinkConsoleV2.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
1 change: 1 addition & 0 deletions WhackerLinkConsoleV2/WidgetSelectionWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<CheckBox x:Name="SystemStatusCheckBox" Content="System Status" IsChecked="True" />
<CheckBox x:Name="ChannelCheckBox" Content="Channels" IsChecked="True" />
<CheckBox x:Name="AlertToneCheckBox" Content="Alert Tones" IsChecked="True" />
<CheckBox x:Name="QCTonesCheckBox" Content="QC2 Tones" IsChecked="True" />
<Button Content="Apply" Width="80" Margin="0,20,0,0" HorizontalAlignment="Center" Click="ApplyButton_Click" />
</StackPanel>
</Window>
3 changes: 3 additions & 0 deletions WhackerLinkConsoleV2/WidgetSelectionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public partial class WidgetSelectionWindow : Window
public bool ShowSystemStatus { get; private set; } = true;
public bool ShowChannels { get; private set; } = true;
public bool ShowAlertTones { get; private set; } = true;
public bool ShowQCTones { get; private set; } = true;

public WidgetSelectionWindow()
{
Expand All @@ -38,6 +39,8 @@ private void ApplyButton_Click(object sender, RoutedEventArgs e)
ShowSystemStatus = SystemStatusCheckBox.IsChecked ?? false;
ShowChannels = ChannelCheckBox.IsChecked ?? false;
ShowAlertTones = AlertToneCheckBox.IsChecked ?? false;
ShowQCTones = QCTonesCheckBox.IsChecked ?? false;

DialogResult = true;
Close();
}
Expand Down
13 changes: 12 additions & 1 deletion WhackerLinkConsoleV2/codeplugs/codeplug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ systems:
systemID: 1
siteID: 1
range: 1.5
tones:
- name: "Station 1"
toneA: 855.5
toneB: 349
zones:
- "Zone 1"
- name: "Station 2"
toneA: 1006.9
toneB: 500.9
zones:
- "Zone 1"

zones:
- name: "Zone 1"
Expand Down Expand Up @@ -71,4 +82,4 @@ zones:
tgid: "16002"
- name: "Channel C"
system: "System 1"
tgid: "16002"
tgid: "16002"