This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System.ComponentModel;
using DTS.Common.Converters;
using DTS.Common.Utils;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
// ReSharper disable CheckNamespace
namespace DTS.Common.Enums.Viewer
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum TimeUnitTypeEnum
{
[Description("ms")]
MS = 0,
[Description("Seconds")]
Seconds = 1,
}
public class TimeUnitTypeItemSource : IItemsSource
{
public ItemCollection GetValues()
{
return EnumUtil.GetValuesList<TimeUnitTypeEnum>();
}
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Windows;
using System.Runtime.InteropServices;
using System.Windows.Interop;
namespace DTS.Common.Dialogs
{
/// <summary>
/// Interaction logic for NotificationWindow.xaml
/// </summary>
public partial class NotificationWindow : Window
{
public static readonly DependencyProperty NotificationTemplateProperty = DependencyProperty.Register("NotificationTemplate", typeof(DataTemplate), typeof(NotificationWindow), new PropertyMetadata(null));
public static readonly DependencyProperty ImageUriProperty = DependencyProperty.Register("ImageUri", typeof(Uri), typeof(NotificationWindow), new PropertyMetadata(new Uri("pack://application:,,,/" + System.Reflection.Assembly.GetExecutingAssembly() + ";component/RibbonControl/Images/warning_48.png", UriKind.RelativeOrAbsolute)));
/// <summary>
/// Creates a new instance of <see cref="NotificationWindow"/>
/// </summary>
public NotificationWindow()
{
// Hook the SourceInitialized event and then using the SetWindowLong function to strip off the WS_SYSMENU bit.
SourceInitialized += NotificationWindow_SourceInitialized;
InitializeComponent();
}
/// <summary>
/// The <see cref="DataTemplate"/> to apply when displaying <see cref="Microsoft.Practices.Prism.Interactivity.InteractionRequest.Notification"/> data.
/// </summary>
public DataTemplate NotificationTemplate
{
get => (DataTemplate)GetValue(NotificationTemplateProperty);
set => SetValue(NotificationTemplateProperty, value);
}
/// <summary>
/// Gets or sets the <see cref="Uri"/> for the notification image.
/// </summary>
public Uri ImageUri
{
get => (Uri)GetValue(ImageUriProperty);
set => SetValue(ImageUriProperty, value);
}
void NotificationWindow_SourceInitialized(object sender, EventArgs e)
{
// Removing the Close Button on a WPF window.
// The key here is hooking the SourceInitialized event and then using the SetWindowLong function to strip off the WS_SYSMENU bit.
var wih = new WindowInteropHelper(this);
var style = GetWindowLong(wih.Handle, GWL_STYLE);
SetWindowLong(wih.Handle, GWL_STYLE, style & ~WS_SYSMENU);
}
private const int GWL_STYLE = -16;
private const int WS_SYSMENU = 0x00080000;
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hwnd, int index, int value);
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hwnd, int index);
public void Connect(int connectionId, object target)
{
}
private void CoppyToClibord_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText("Hello, clipboard");
}
}
}

View File

@@ -0,0 +1,64 @@
<Window x:Class="DTS.Common.Dialogs.ConfirmationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
Title="{Binding Title}" Icon="..\Images\question_48.png" WindowStyle="ToolWindow" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" MinWidth="300" MaxWidth="500" MinHeight="150" MaxHeight="500"
x:Name="confirmationWindow">
<Window.Resources>
<Style x:Key="ReadOnlyTextBox" TargetType="TextBox">
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Height" Value="Auto"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
</Style>
</Window.Resources>
<Grid x:Name="LayoutRoot" Margin="2">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Grid.Row="0" Grid.Column="0" Source="..\Images\question_48.png" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,5,0,5"/>
<ContentControl Grid.Row="0" Grid.Column="1" ContentTemplate="{Binding ConfirmationTemplate, ElementName=confirmationWindow}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,10,10,5">
<TextBox Text="{Binding Content}" Style="{StaticResource ReadOnlyTextBox}"/>
</ContentControl>
<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,5,10,5">
<Button x:Name="OKButton" Content="OK" Width="70" Height="25" Cursor="Hand" HorizontalAlignment="Right" Margin="5,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ei:ChangePropertyAction PropertyName="Confirmed" TargetObject="{Binding}" Value="True"/>
<ei:CallMethodAction TargetObject="{Binding ElementName=confirmationWindow}" MethodName="Close"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="CancelButton" Content="Cancel" Width="70" Height="25" Cursor="Hand" HorizontalAlignment="Right">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ei:CallMethodAction TargetObject="{Binding ElementName=confirmationWindow}" MethodName="Close"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DTS.Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<section name="Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<applicationSettings>
<DTS.Common.Properties.Settings>
<setting name="TilesLocation" serializeAs="String">
<value>Assets\Tiles\</value>
</setting>
</DTS.Common.Properties.Settings>
</applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

View File

@@ -0,0 +1,84 @@
using DTS.Common.Enums.DASFactory;
using System;
using System.Collections.Generic;
namespace DTS.Common.Interface.DASFactory.Config
{
public interface IInfoResultModule
{
/// <summary>
/// Serial number of this module
/// </summary>
string SerialNumber { get; set; }
/// <summary>
/// Firmware version in this module
/// </summary>
string FirmwareVersion { get; set; }
/// <summary>
/// who does this module belong to?
/// </summary>
//public InfoResult OwningInfoResult { get; set; }
/// <summary>
/// The number of this Module as it would be indexed in an array of Modules.
/// </summary>
int ModuleArrayIndex { get; set; }
/// <summary>
/// How many channels are connected to this Module.
/// </summary>
uint NumberOfChannels { get; set; }
/// <summary>
/// What sample rates does it support (in samples per second).
/// </summary>
uint[] SupportedSampleRates { get; set; }
/// <summary>
/// An associative list (Dictionary) of sample rates and corresponding
/// Anti-Aliasing filter frequencies.
/// </summary>
Dictionary<uint, float> SampleRate2AAFrequency { get; set; }
/// <summary>
/// How many bytes of sample storage is available in this module? This is null
/// if it's specified per DAS instead.
/// </summary>
ulong? MaxEventStorageSpaceInBytes { get; set; }
/// <summary>
/// How many bytes are stored for all channels at each sample interval? This is
/// null if it's specified per DAS instead.
/// </summary>
uint? NumberOfBytesPerSampleClock { get; set; }
/// <summary>
/// How many samples can you record in this module?
/// </summary>
double MaxRecordingSamples { get; set; }
/// <summary>
/// The <see cref="System.DateTime"/> of this module's last calibration.
/// </summary>
DateTime? CalibrationDate { get; set; }
/// <summary>
/// True if a TDAS rack is armed and doesn't respond to some queries.
/// </summary>
bool RackIsUnreadable { get; set; }
/// <summary>
/// What type of module is this?
/// </summary>
DFConstantsAndEnums.ModuleType TypeOfModule { get; set; }
/// <summary>
/// What recording modes does this Module support.
/// </summary>
DFConstantsAndEnums.RecordingMode[] SupportedModes { get; set; }
bool IsProgrammable { get; set; }
}
}