init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using static DTS.Common.Enums.DASFactory.DFConstantsAndEnums;
|
||||
|
||||
namespace DTS.Common.Interface.TestSetups
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface describing records for test setup hardware
|
||||
/// </summary>
|
||||
public interface ITestSetupHardwareRecord
|
||||
{
|
||||
int DASId { get; set; }
|
||||
int TestSetupId { get; set; }
|
||||
bool AddDAS { get; set; }
|
||||
int SamplesPerSecond { get; set; }
|
||||
bool IsClockMaster { get; set; }
|
||||
int AntiAliasFilterRate { get; set; }
|
||||
byte PTPDomainId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Prism.Events;
|
||||
using System;
|
||||
|
||||
namespace DTS.Common.Events.Hardware.HardwareList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The HardwareAddedEvent event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event is used to indicate hardware was added or updated
|
||||
/// integer is database id of hardware, string is serial number of hardware
|
||||
/// </remarks>
|
||||
///
|
||||
public class HardwareSavedEvent : PubSubEvent<Tuple<int, string>> { }
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using DTS.Common.Enums;
|
||||
|
||||
namespace DTS.Common.Constant.DASSpecific
|
||||
{
|
||||
public class TSRAIR
|
||||
{
|
||||
public const uint MaxAAFilterRateHz = 200000;
|
||||
|
||||
public const byte MIN_PROTOCOL_VER = 1;
|
||||
public const int VOLTAGE_INSERTION = 2;
|
||||
public const int START_REC_DELAY_IN_SECONDS = 3;
|
||||
public const int STACK_SENSORS = 5;
|
||||
public const int WAKEUP_MOTION_TIMEOUT = 10;
|
||||
public const int IRIG_GPS_PPSIN_SYNC = 25;
|
||||
public const int DISABLE_STREAMING_FEATURE = 25;
|
||||
public const int TSRAIR_MIN_PRE_TRIGGER_SAMPLES = 256;
|
||||
public const int TSRAIR_MAX_PRE_TRIGGER_SAMPLES = 512;
|
||||
public const int EXTENDED_FAULTS_VER = 27;
|
||||
public const int ADC_SAMPLES_PER_PACKET_VER = 29;
|
||||
public const int PROTOCOL_VERSION_CIRCULAR_UART = 29;
|
||||
public const int PROTOCOL_VERSION_CIRCULAR = int.MaxValue;
|
||||
public const int PROTOCOL_VERSION_RECORDER_UART = 30;
|
||||
public const int PROTOCOL_VERSION_RECORDER = int.MaxValue;
|
||||
public const int PROTOCOL_VERSION_SCHEDULED_EVENTCOUNT = 35;
|
||||
|
||||
public static bool IsRecordingModeSupported(RecordingModes mode, int protocolVersion)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case RecordingModes.CircularBufferPlusUART:
|
||||
case RecordingModes.MultipleEventCircularBufferPlusUART:
|
||||
return protocolVersion >= PROTOCOL_VERSION_CIRCULAR_UART;
|
||||
case RecordingModes.CircularBuffer:
|
||||
case RecordingModes.MultipleEventCircularBuffer:
|
||||
return protocolVersion >= PROTOCOL_VERSION_CIRCULAR;
|
||||
case RecordingModes.Recorder:
|
||||
case RecordingModes.MultipleEventRecorder:
|
||||
return protocolVersion >= PROTOCOL_VERSION_RECORDER;
|
||||
case RecordingModes.MultipleEventRecorderPlusUART:
|
||||
case RecordingModes.RecorderPlusUART:
|
||||
return protocolVersion >= PROTOCOL_VERSION_RECORDER_UART;
|
||||
case RecordingModes.Active:
|
||||
case RecordingModes.MultipleEventActive:
|
||||
case RecordingModes.Streaming:
|
||||
case RecordingModes.S6A_DeviceStreamingOnly:
|
||||
//26783: Since the "Set DAS to Streaming" checkbox is used for both
|
||||
//TSR AIR and SLICE6Air, the recording mode may correspond to the
|
||||
//"other" hardware if the DAS is switched from one to the other
|
||||
case RecordingModes.Scheduled:
|
||||
case RecordingModes.Interval:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsStreamingProfileSupported(UDPStreamProfile profile, int protocolVersion)
|
||||
{
|
||||
var result = false;
|
||||
switch (profile)
|
||||
{
|
||||
case UDPStreamProfile.DTS_UDP:
|
||||
case UDPStreamProfile.CH10_ANALOG_2HDR:
|
||||
//FB 30035 Added other supported profiles for TSRAIR
|
||||
case UDPStreamProfile.CH10_ANALOG:
|
||||
case UDPStreamProfile.CH10_PCM_128BIT_2HDR:
|
||||
case UDPStreamProfile.CH10_PCM128_MM:
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool IsClockSyncProfileSupported(ClockSyncProfile profile, int protocolVersion, bool master)
|
||||
{
|
||||
var result = false;
|
||||
switch (profile)
|
||||
{
|
||||
case ClockSyncProfile.IRIG_EXT_PPS:
|
||||
return false;
|
||||
case ClockSyncProfile.EXT_PPS:
|
||||
//master EXT_PPS not supported at this time for TSR AIR
|
||||
//http://manuscript.dts.local/f/cases/34280/
|
||||
if (protocolVersion >= IRIG_GPS_PPSIN_SYNC && !master)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
case ClockSyncProfile.None:
|
||||
result = true;
|
||||
break;
|
||||
case ClockSyncProfile.Master_E2E:
|
||||
case ClockSyncProfile.Slave_E2E:
|
||||
result = true;
|
||||
break;
|
||||
case ClockSyncProfile.GPS_EXT_PPS:
|
||||
case ClockSyncProfile.Master_E2E_GPS_EXT_PPS:
|
||||
case ClockSyncProfile.Master_E2E_EXT_PPS:
|
||||
case ClockSyncProfile.IRIG:
|
||||
case ClockSyncProfile.Master_E2E_IRIG:
|
||||
case ClockSyncProfile.Master_E2E_IRIG_EXT_PPS:
|
||||
// 30430 per EF and LP / 30704: everything but 1PPS out is legal with protocol 25
|
||||
if (protocolVersion >= IRIG_GPS_PPSIN_SYNC)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
case ClockSyncProfile.GPS:
|
||||
case ClockSyncProfile.Master_E2E_GPS:
|
||||
result = false;
|
||||
// 30487: Leave this alone, GPS only clock sync option should be removed
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 39151 Leaving a note here in TSRAIR for when it inevitably gets UART recording
|
||||
* copy/paste the implemented MaxSampleRateHz_UART dictionary and MaxSampleRateHzForRecordingMode function from SLICE6AIR
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class BooleanToBorderBrushConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return value != null && (bool)value ? BrushesAndColors.Brush_Warning : Brushes.Transparent;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<Window x:Class="DTS.Common.Dialogs.NotificationWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
Title="{Binding Title}" Icon="{Binding ImageUri, ElementName=notificationWindow}" WindowStyle="ToolWindow" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight" MinWidth="300" MaxWidth="500" MinHeight="150" MaxHeight="500"
|
||||
x:Name="notificationWindow">
|
||||
|
||||
<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>
|
||||
<Style x:Key="LinkButton" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<TextBlock TextDecorations="Underline">
|
||||
<ContentPresenter />
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Foreground" Value="Red" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</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="{Binding ImageUri, ElementName=notificationWindow}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,5,0,5"/>
|
||||
|
||||
<ContentControl Grid.Row="0" Grid.Column="1" ContentTemplate="{Binding NotificationTemplate, ElementName=notificationWindow}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,10,10,5">
|
||||
<TextBox Text="{Binding Content.Message, Mode=OneWay}" Style="{StaticResource ReadOnlyTextBox}"/>
|
||||
</ContentControl>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,5,10,5">
|
||||
<Button Style="{StaticResource LinkButton}" Content="Copy to clipboard" Margin="0,5,20,0" HorizontalAlignment="Center" Click="CoppyToClibord_Click"/>
|
||||
<Button x:Name="OKButton" Content="OK" Width="70" Height="25" Cursor="Hand" HorizontalAlignment="Right">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<i:CallMethodAction TargetObject="{Binding ElementName=notificationWindow}" MethodName="Close"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface ICheckTriggerViewModel : IBaseViewModel { }
|
||||
}
|
||||
Reference in New Issue
Block a user