Merge branch 'DVMProject:main' into main

pull/1/head
Static 11 months ago committed by GitHub
commit d0d8d33b4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,13 +14,14 @@
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="{Binding BackgroundColor}" />
<Setter Property="Foreground" Value="{Binding ForegroundColor}" />
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="Channel" Binding="{Binding Channel}" Width="*" />
<DataGridTextColumn Header="Channel" Binding="{Binding Channel}" Width="150" />
<DataGridTextColumn Header="Radio ID" Binding="{Binding SrcId}" Width="*" />
<DataGridTextColumn Header="Talkgroup" Binding="{Binding DstId}" Width="*" />
<DataGridTextColumn Header="Timestamp" Binding="{Binding Timestamp}" Width="*" />
<DataGridTextColumn Header="Timestamp" Binding="{Binding Timestamp}" Width="150" />
</DataGrid.Columns>
</DataGrid>
</Grid>

@ -8,6 +8,7 @@
* @license AGPLv3 License (https://opensource.org/licenses/AGPL-3.0)
*
* Copyright (C) 2025 Caleb, K4PHP
* Copyright (C) 2025 Bryan Biedenkapp, N2PLL
*
*/
@ -24,6 +25,8 @@ namespace dvmconsole
{
public static readonly DependencyProperty BackgroundColorProperty =
DependencyProperty.Register(nameof(BackgroundColor), typeof(Brush), typeof(CallEntry), new PropertyMetadata(Brushes.Transparent));
public static readonly DependencyProperty ForegroundColorProperty =
DependencyProperty.Register(nameof(ForegroundColor), typeof(Brush), typeof(CallEntry), new PropertyMetadata(Brushes.White));
/*
** Properties
@ -55,6 +58,15 @@ namespace dvmconsole
get { return (Brush)GetValue(BackgroundColorProperty); }
set { SetValue(BackgroundColorProperty, value); }
}
/// <summary>
/// Foreground color for call entry.
/// </summary>
public Brush ForegroundColor
{
get { return (Brush)GetValue(ForegroundColorProperty); }
set { SetValue(ForegroundColorProperty, value); }
}
} // public class CallEntry : DependencyObject
/// <summary>
@ -89,6 +101,9 @@ namespace dvmconsole
/// </summary>
public partial class CallHistoryWindow : Window
{
private const int MAX_CALL_HISTORY = 200;
private SettingsManager settingsManager;
/*
** Properties
*/
@ -105,9 +120,10 @@ namespace dvmconsole
/// <summary>
/// Initializes a new instance of the <see cref="CallHistoryWindow"/> class.
/// </summary>
public CallHistoryWindow()
public CallHistoryWindow(SettingsManager settingsManager)
{
InitializeComponent();
this.settingsManager = settingsManager;
ViewModel = new CallHistoryViewModel();
DataContext = ViewModel;
}
@ -132,6 +148,9 @@ namespace dvmconsole
{
Dispatcher.Invoke(() =>
{
if (ViewModel.CallHistory.Count == MAX_CALL_HISTORY)
ViewModel.CallHistory.RemoveAt(MAX_CALL_HISTORY - 1);
ViewModel.CallHistory.Insert(0, new CallEntry
{
Channel = channel,
@ -155,6 +174,8 @@ namespace dvmconsole
{
foreach (var entry in ViewModel.CallHistory.Where(c => c.Channel == channel && c.SrcId == srcId))
{
entry.ForegroundColor = Brushes.Black;
if (!encrypted)
entry.BackgroundColor = Brushes.LightGreen;
else
@ -174,6 +195,10 @@ namespace dvmconsole
{
foreach (var entry in ViewModel.CallHistory.Where(c => c.Channel == channel && c.SrcId == srcId))
{
if (settingsManager.DarkMode)
entry.ForegroundColor = Brushes.White;
else
entry.ForegroundColor = Brushes.Black;
entry.BackgroundColor = Brushes.Transparent;
}
});

@ -28,7 +28,7 @@
<TextBox HorizontalAlignment="Left" Name="DstIdText" Margin="10,46,0,0" TextWrapping="Wrap" Text="" MaxLength="8" VerticalAlignment="Top" Width="150" Grid.Row="0" Grid.Column="1"/>
<Button x:Name="SendButton" Width="150" Height="24" HorizontalAlignment="Left" Margin="108,20,0,0" VerticalAlignment="Top" Click="SendButton_Click" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Style="{StaticResource MaterialDesignPaperDarkButton}" >
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Style="{StaticResource MaterialDesignPaperDarkButton}">
<TextBlock TextAlignment="Center">Send</TextBlock>
</Button>
</Grid>

@ -514,12 +514,7 @@ namespace dvmconsole
channel.LastSrcId = "Last: " + alias;
if (channel.algId != P25Defines.P25_ALGO_UNENCRYPT)
{
channel.Background = ChannelBox.ORANGE_GRADIENT;
Log.WriteLine($"({system.Name}) P25D: Traffic *CALL ENC PARMS * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} ALGID {channel.algId} KID {channel.kId} [STREAM ID {e.StreamId}]");
}
else
channel.Background = ChannelBox.GREEN_GRADIENT;
}
// is the call over?
@ -534,6 +529,12 @@ namespace dvmconsole
return;
}
// do background updates here -- this catches late entry
if (channel.algId != P25Defines.P25_ALGO_UNENCRYPT)
channel.Background = ChannelBox.ORANGE_GRADIENT;
else
channel.Background = ChannelBox.GREEN_GRADIENT;
byte[] newMI = new byte[P25Defines.P25_MI_LENGTH];
int count = 0;

@ -108,7 +108,7 @@ namespace dvmconsole
private ChannelBox playbackChannelBox;
CallHistoryWindow callHistoryWindow = new CallHistoryWindow();
CallHistoryWindow callHistoryWindow;
public static string PLAYBACKTG = "LOCPLAYBACK";
public static string PLAYBACKSYS = "Local Playback";
@ -150,6 +150,7 @@ namespace dvmconsole
DisableControls();
settingsManager.LoadSettings();
callHistoryWindow = new CallHistoryWindow(settingsManager);
selectedChannelsManager = new SelectedChannelsManager();
flashingManager = new FlashingBackgroundManager(null, channelsCanvas, null, this);

@ -1,12 +1,17 @@
<Window x:Class="dvmconsole.WidgetSelectionWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Icon="/dvmconsole;component/Assets/select.png"
Title="Select Widgets" Height="200" Width="300" WindowStartupLocation="CenterOwner">
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.FontWeight="Regular" TextElement.FontSize="13"
Style="{StaticResource MaterialDesignWindow}" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{DynamicResource MaterialDesignFont}"
Title="Select Widgets" Height="220" Width="300" WindowStartupLocation="CenterOwner">
<StackPanel Margin="20">
<TextBlock Text="Select Widgets to Display:" FontWeight="Bold" Margin="0,0,0,10" />
<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" />
<Button Content="Apply" Width="80" Margin="0,20,0,0" HorizontalAlignment="Center" Click="ApplyButton_Click" />
<Button Content="Apply" Width="80" Margin="0,20,0,0" HorizontalAlignment="Center" Click="ApplyButton_Click"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Style="{StaticResource MaterialDesignPaperDarkButton}"/>
</StackPanel>
</Window>

Loading…
Cancel
Save

Powered by TurnKey Linux.