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,12 @@
using DTS.Common.Base;
namespace DTS.Common.Interface
{
public interface IGraphPropertyViewModel : IBaseViewModel
{
/// <summary>
/// Gets the Tab View.
/// </summary>
IGraphPropertyView View { get; }
}
}

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using DTS.Common.Base;
using DTS.Common.Interface.TestSetups.Imports.TTS.HardwareScan;
using DTS.Common.Interface.TestSetups.Imports.TTS.ReadFile;
using DTS.Common.Utils;
namespace DTS.Common.Interface
{
public interface IHardwareScanViewModel : IBaseViewModel
{
IHardwareScanView View { get; set; }
IHardwareSummaryRecord[] HardwareRecords { get; }
void SetStatus(string status);
void SetProgress(double progress);
void HardwareScan();
void SetChannelSummaryList(ITTSChannelRecord[] channelRecords);
}
/// <summary>
/// delegate to scan hardware
/// </summary>
public delegate void HardwareScanDelegate();
}

View File

@@ -0,0 +1,101 @@
<ResourceDictionary
x:Class="DTS.Common.Controls.checkbox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- SimpleStyles: CheckBox -->
<Style x:Key="FlatCheckBoxStyle" TargetType="CheckBox">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Height" Value="20" />
<Setter Property="Width" Value="20" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Border x:Name="Border"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
CornerRadius="0"
Background="{StaticResource Brush_FlatControlWindowBackground}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}">
<!--<Rectangle x:Name="CheckMark" Height="14" Width="14" Fill="{StaticResource GlyphBrush}" />-->
<!--<Path
Width="15" Height="15"
x:Name="CheckMark"
SnapsToDevicePixels="False"
Stroke="{StaticResource GlyphBrush}"
StrokeThickness="2"
Data="M 0 0 L 15 15 M 0 15 L 15 0" />-->
<Path
Width="15" Height="15"
x:Name="CheckMark"
SnapsToDevicePixels="False"
Stroke="{StaticResource GlyphBrush}"
StrokeThickness="2"
Data="M 3 8 L 8 15 M 7 15 L 14 1" />
</Border>
</BulletDecorator.Bullet>
<ContentPresenter Margin="5,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
RecognizesAccessKey="True"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="false">
<Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="CheckMark" Property="Opacity" Value="0"/>
<Setter TargetName="CheckMark" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlMouseOverBackground}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlWindowBackground}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="CheckMark" Property="Opacity" Value="0.3"/>
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlDisabledBackground}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource Brush_FlatControlBorder}" />
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlDisabledForeground}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ToolTipService.ToolTip" Value="" />
<EventSetter Event="ToolTipOpening" Handler="ToolTipEventHandler" />
</Style>
<Style x:Key="{x:Type CheckBox}" TargetType="CheckBox" BasedOn="{StaticResource FlatCheckBoxStyle}" />
<Style x:Key="PageContentCheckBoxStyle" TargetType="CheckBox" BasedOn="{StaticResource FlatCheckBoxStyle}">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="5,2,5,2" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ToolTipService.ToolTip" Value="" />
<EventSetter Event="ToolTipOpening" Handler="ToolTipEventHandler" />
</Style>
<Style x:Key="PageContentCheckBoxErrorStyle" TargetType="CheckBox" BasedOn="{StaticResource PageContentCheckBoxStyle}">
<Setter Property="BorderThickness" Value="2" />
<Setter Property="BorderBrush" Value="Red" />
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,20 @@
using DTS.Common.Base;
using Prism.Events;
// ReSharper disable CheckNamespace
namespace DTS.Common.Events
{
public class FilterParameterArgs
{
/// <summary>
/// Filter requester
/// </summary>
public IBaseViewModel Requester { get; set; }
/// <summary>
/// Filter parameter
/// </summary>
public string Param { get; set; }
}
public class FilterParameterChangedEvent : PubSubEvent<FilterParameterArgs> { }
}

View File

@@ -0,0 +1,528 @@
using DTS.Common.Converters;
using DTS.Common.Enums.DASFactory;
using System.ComponentModel;
using DTS.Common.Constant.DASSpecific;
using System.Windows.Media;
using DTS.Common.Interface.DataRecorders;
namespace DTS.Common.Enums.Hardware
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum HardwareTypes
{
SLICE_Base = 0,
SLICE_Bridge = 1,
[Description("SLICE_Distributor_Description")]
SLICE_Distributor = 2,
[Description("TDAS_Pro_Rack_Description")]
TDAS_Pro_Rack = 3,
SLICE2_IEPE_Hi = 4,
SLICE2_IEPE_Lo = 5,
SLICE2_Bridge_Hi = 6,
SLICE2_Bridge_Lo = 7,
SLICE2_Base = 8,
TOM = 9,
SIM = 10,
DIM = 11,
[Description("G5_VDS_Description")]
G5VDS = 12,
Ribeye = 13,
RibeyeLED = 14,
SLICE_IEPE = 15,
[Description("SLICE1_5Nano_Description")]
SLICE1_5_Nano_Base = 16,
[Description("SLICE_Micro_Description")]
SLICE_Micro_Base = 17,
[Description("SLICE_Nano_Description")]
SLICE_NANO_Base = 18,
[Description("SLICE2_SIM_Description")]
SLICE2_SIM = 19,
[Description("SLICE2_DIM_Description")]
SLICE2_DIM = 20,
[Description("SLICE2_TOM_Description")]
SLICE2_TOM = 21,
//G5IPORT=22,
[Description("G5InDummy_Description")]
G5INDUMMY = 23,
[Description("SLICE_EthernetController_Description")]
SLICE_EthernetController = 24,
[Description("SLICE_15Micro_Description")]
SLICE1_5_Micro_Base = 25,
[Description("SLICE_Lab_Ethernet_Description")]
SLICE_LabEthernet = 26,
[Description("SLICE2_SLS_Description")]
SLICE2_SLS = 27,
[Description("SLICE1_G5Stack_Description")]
SLICE1_G5Stack = 28,
[Description("SLICE2_SLT_Description")]
SLICE2_SLT = 29,
[Description("SLICE2_SLD_Description")]
SLICE2_SLD = 30,
[Description("TDAS_LabRack_Description")]
TDAS_LabRack = 31,
[Description("SLICE6_Base_Description")]
SLICE6_Base = 32,
[Description("SLICE6_DB_Description")]
SLICE6DB = 33,
[Description("SLICE6_DBInDummy_Description")]
SLICE6DB_InDummy = 34,
//doesn't exist
//[Description("SLICE6_DBAir_Description")]
//SLICE6DB_AIR = 35,
[Description("SLICE6_AIR_Description")]
SLICE6_AIR = 36,
[Description("PowerPRO_Description")]
PowerPro = 37,
[Description("HardwareType_EMPTY")]
UNDEFINED = 38,
[Description("SLICE_Mini_Distributor_Description")]
SLICE_Mini_Distributor = 39,
[Description("TSR_AIR_Description")]
TSR_AIR = 40, // TSR Air "Rev A"
[Description("TSR_AIR_RevB_Description")]
TSR_AIR_RevB = 41, // TSR Air "Rev B"
[Description("DKR_Description")]
DKR = 42, // NGTSR - NASA SBIR
[Description("DIR_Description")]
DIR = 43, // NGTSR - USAF SBIR
[Description("Embedded_LowG_Module_Description")]
EMB_LIN_ACC_LO = 44,
[Description("Embedded_HighG_Module_Description")]
EMB_LIN_ACC_HI = 45,
[Description("Embedded_Angular_Module_Description")]
EMB_ANG_ACC = 46,
[Description("Embedded_ARS_Module_Description")]
EMB_ANG_ARS = 47,
[Description("Embedded_Atmosphere_Module_Description")]
EMB_ATM = 48,
[Description("Embedded_Magnetometer_Module_Description")]
EMB_MAG = 49,
[Description("Embedded_MagnetSwitch_Module_Description")]
EMB_MAG_SWITCH = 50,
[Description("Embedded_Microphone_Module_Description")]
EMB_MIC = 51,
[Description("Embedded_Optical_Module_Description")]
EMB_OPT = 52,
[Description("Embedded_Clock_Seconds_Module_Description")]
EMB_RTC_S_MARK = 53,
[Description("Embedded_Clock_Nanos_Module_Description")]
EMB_RTC_NS_PAD = 54,
[Description("SLICE6DB3_Description")]
SLICE6DB3 = 55,
[Description("SLICE6ER_Description")]
S6A_EthernetRecorder = 56,
//(25460 Placeholder)
[Description("SLICE_Pro_Distributor_Description")]
SLICE_Pro_Distributor = 57,
//28283 SLICE6AIR-BR (falcon-id) infrastructure
[Description("SLICE6_AIR_BR_Description")]
SLICE6_AIR_BR = 58,
//43955 SLICE-TC infrastructure
[Description("SLICE_TC_Description")]
SLICE6_AIR_TC = 59,
//44870 SPFD
[Description("SLICE_PRO_CAN_FD_Description")]
SLICE_PRO_CAN_FD = 60,
}
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum SLICEBridgeTypes
{
[Description("BRIDGETYPE_BRIDGE_DESCRIPTION")]
Bridge,
[Description("BRIDGETYPE_IEPE_DESCRIPTION")]
IEPE,
[Description("BRIDGETYPE_ARS_DESCRIPTION")]
ARS,
[Description("BRIDGETYPE_ACC_DESCRIPTION")]
ACC,
[Description("BRIDGETYPE_RTC_DESCRIPTION")]
RTC,
[Description("BRIDGETYPE_UART_DESCRIPTION")]
UART,
[Description("BRIDGETYPE_STREAM_OUT_DESCRIPTION")]
StreamOut,
[Description("BRIDGETYPE_THERMOCOUPLER_DESCRIPTION")]
Thermocoupler,
[Description("BRIDGETYPE_CAN_DESCRIPTION")]
CAN
}
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum RackSizes
{
[Description("RACK_SIZE_4M")]
FOUR,
[Description("RACK_SIZE_8M")]
EIGHT
}
public abstract class HardwareConstants
{
//http://manuscript.dts.local/f/cases/37929/Implement-TSRAIR-module-on-off-selection-via-Max-Slice-Enable-system-attribute
public const int TSRAIR_MAXSLICENABLE_VERSION = 28;
//this is the max modules according to firmware (18 channels)
// it does not consider the streaming module nor the UART module which are SW only concepts and not
// part of the module count in firmware
public const int TSRAIR_MAX_MODULES = 6;
public const string TSR_AIR_PREPEND = "TA";
public static bool IsTSRAIRSerialNumber(string serialNumber)
{
if (string.IsNullOrEmpty(serialNumber)) { return false; }
return serialNumber.StartsWith(TSR_AIR_PREPEND);
}
public static SolidColorBrush GetBrushForVoltageStatus(DFConstantsAndEnums.VoltageStatusColor status)
{
switch (status)
{
case DFConstantsAndEnums.VoltageStatusColor.Green:
return BrushesAndColors.BrushApplicationStatusPowerGreen;
case DFConstantsAndEnums.VoltageStatusColor.Red:
return BrushesAndColors.BrushApplicationStatusPowerRed;
case DFConstantsAndEnums.VoltageStatusColor.Yellow:
return BrushesAndColors.BrushApplicationStatusPowerYellow;
case DFConstantsAndEnums.VoltageStatusColor.Off:
default:
return BrushesAndColors.BrushApplicationStatusPowerClear;
}
}
/// <summary>
/// returns whether the device supports trigger inversion or not
/// currently only SLICE1, SLICE1.5, SLICE2 support it and only when connected via USB?
/// protocol version could be a deciding factor for whether a device supports trigger inversion
/// </summary>
/// <param name="type">type of DAS</param>
/// <param name="protocolVersion">protocol version of das</param>
/// <returns>true if the device supports trigger inversion, false otherwise</returns>
public static bool SupportsTriggerInversion(HardwareTypes type, int protocolVersion)
{
switch (type)
{
case HardwareTypes.SLICE1_5_Micro_Base:
case HardwareTypes.SLICE_Base:
case HardwareTypes.SLICE2_Base:
case HardwareTypes.SLICE_IEPE:
case HardwareTypes.SLICE1_5_Nano_Base:
case HardwareTypes.SLICE_Micro_Base:
case HardwareTypes.SLICE_NANO_Base:
case HardwareTypes.SLICE2_SIM:
case HardwareTypes.SLICE2_DIM:
case HardwareTypes.SLICE2_TOM:
case HardwareTypes.SLICE2_SLS:
case HardwareTypes.SLICE1_G5Stack:
case HardwareTypes.SLICE2_SLT:
case HardwareTypes.SLICE2_SLD:
return true;
default: return false;
}
}
/// <summary>
/// returns whether the device supports start inversion or not
/// currently only SLICE1, SLICE1.5, SLICE2 support it and only when connected via USB?
/// protocol version could be a deciding factor for whether a device supports start inversion
/// </summary>
/// <param name="type">type of DAS</param>
/// <param name="protocolVersion">protocol version of das</param>
/// <returns>true if the device supports start inversion, false otherwise</returns>
public static bool SupportsStartInversion(HardwareTypes type, int protocolVersion)
{
switch (type)
{
case HardwareTypes.SLICE1_5_Micro_Base:
case HardwareTypes.SLICE_Base:
case HardwareTypes.SLICE2_Base:
case HardwareTypes.SLICE_IEPE:
case HardwareTypes.SLICE1_5_Nano_Base:
case HardwareTypes.SLICE_Micro_Base:
case HardwareTypes.SLICE_NANO_Base:
case HardwareTypes.SLICE2_SIM:
case HardwareTypes.SLICE2_DIM:
case HardwareTypes.SLICE2_TOM:
case HardwareTypes.SLICE2_SLS:
case HardwareTypes.SLICE1_G5Stack:
case HardwareTypes.SLICE2_SLT:
case HardwareTypes.SLICE2_SLD:
case HardwareTypes.SLICE6_AIR:
return true;
default: return false;
}
}
/// <summary>
/// returns true if the hardware type is a type of ethernet recorder
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public static bool IsEthernetRecorder(HardwareTypes type)
{
return type == HardwareTypes.S6A_EthernetRecorder;
}
public const int INVALID_IDASCOMMUNICATION_RECORD_ID = -1;
/// <summary>
/// this is just a global variable for whether to allow soft disconnects or not
/// and provide access to the variable across modules
/// must be set by the application.
/// </summary>
public static bool AllowSoftDisconnects { get; set; } = false;
public const int DEFAULTMEMORYSIZE_PRO = 16000000;
public const int DEFAULTMEMORYSIZE_DIM = 2000000;
public const int DEFAULTMEMORYSIZE_TOM = 2000000;
/// <summary>
/// returns true if the hardware in question uses embedded sensors
/// </summary>
/// <param name="hardware"></param>
/// <returns></returns>
public static bool HasEmbeddedSensors(HardwareTypes hardware)
{
switch (hardware)
{
case HardwareTypes.EMB_ANG_ACC:
case HardwareTypes.EMB_ANG_ARS:
case HardwareTypes.EMB_ATM:
case HardwareTypes.EMB_LIN_ACC_HI:
case HardwareTypes.EMB_LIN_ACC_LO:
case HardwareTypes.EMB_MAG:
case HardwareTypes.EMB_MAG_SWITCH:
case HardwareTypes.EMB_MIC:
case HardwareTypes.EMB_OPT:
case HardwareTypes.EMB_RTC_NS_PAD:
case HardwareTypes.EMB_RTC_S_MARK:
case HardwareTypes.TSR_AIR:
case HardwareTypes.TSR_AIR_RevB:
case HardwareTypes.DIR:
case HardwareTypes.DKR:
case HardwareTypes.SLICE6_AIR_TC:
return true;
default: return false;
}
}
/// <summary>
/// returns whether the given channel type is supported by the given das for TSR AIR variants
/// 18284 DKR device should only populate channels that are embedded in the device
/// </summary>
/// <param name="hardware"></param>
/// <param name="channelType"></param>
/// <returns></returns>
public static bool HasEmbeddedChannelType(HardwareTypes hardware, string channelType)
{
if (hardware == HardwareTypes.TSR_AIR || hardware == HardwareTypes.TSR_AIR_RevB) { return true; }
switch (channelType)
{
case DFConstantsAndEnums.LOWG_SERIAL_APPEND: return true;
case DFConstantsAndEnums.HIGHG_SERIAL_APPEND: return hardware == HardwareTypes.DIR;
case DFConstantsAndEnums.ARS_SERIAL_APPEND: return false;
case DFConstantsAndEnums.ANGACCEL_SERIAL_APPEND: return true;
case DFConstantsAndEnums.ATMOSPHERIC_SERIAL_APPEND: return false;
case DFConstantsAndEnums.OPTICAL_SERIAL_APPEND: return false;
case DFConstantsAndEnums.MAGNETIC_SERIAL_APPEND: return false;
case DFConstantsAndEnums.MAGNETICSWITCH_SERIAL_APPEND: return false;
case DFConstantsAndEnums.MICROPHONE_SERIAL_APPEND: return hardware != HardwareTypes.DKR;
case DFConstantsAndEnums.RTCSECONDANDMARKER_SERIAL_APPEND:
case DFConstantsAndEnums.RTCCLOCKNANOPAD_SERIAL_APPEND:
return false;
default: return false;
}
}
/// <summary>
/// returns true if the recording mode is supported on the given hardware and protocol version
/// </summary>
/// <param name="mode">recording mode to check</param>
/// <param name="dasType">hardware type</param>
/// <param name="protocolVersion">protocol version of hardware</param>
/// <param name="includeNativeSupportOnly">Use false (default) to find out if hardware supports given recording mode
/// or an equivalent recording mode (example Circ Buffer, Circ Buffer + UART, use true to only consider the recording
/// mode explicitly and not any related modes</param>
/// <returns>true if the mode is supported, false otherwise</returns>
public static bool IsRecordingModeSupported(RecordingModes mode, HardwareTypes dasType,
int protocolVersion, bool includeNativeSupportOnly = false)
{
if (dasType != HardwareTypes.TSR_AIR && dasType != HardwareTypes.TSR_AIR_RevB)
{
switch (mode)
{
//All non-TSRAIR DAS support Recorder and CircularBuffer
case RecordingModes.CircularBuffer:
case RecordingModes.Recorder:
return true;
case RecordingModes.CircularBufferPlusUART:
case RecordingModes.RecorderPlusUART:
if (!includeNativeSupportOnly)
{
return true;
}
break;
}
}
if ((dasType == HardwareTypes.SLICE6DB_InDummy || dasType == HardwareTypes.SLICE6DB3 || dasType == HardwareTypes.SLICE6DB) &&
mode == RecordingModes.RAMActive)
{
return true;
}
bool result;
switch (dasType)
{
case HardwareTypes.SLICE1_5_Micro_Base:
case HardwareTypes.SLICE1_5_Nano_Base:
result = SLICE1_5.IsRecordingModeSupported(mode, protocolVersion);
break;
case HardwareTypes.SLICE6_Base:
result = SLICE6.IsRecordingModeSupported(mode, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR:
result = SLICE6AIR.IsRecordingModeSupported_S6AIR(mode, protocolVersion);
break;
case HardwareTypes.S6A_EthernetRecorder:
//43626 Since S6A_EthernetRecorder is really a SLICE6_AIR with different firmware
//we use the SLICE6AIR class to avoid creating a new class for only a few features.
result = SLICE6AIR.IsRecordingModeSupported_S6EDR(mode, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR_BR:
result = SLICE6AIRBR.IsRecordingModeSupported(mode, protocolVersion);
break;
case HardwareTypes.SLICE2_TOM:
result = SLICE2_TOM.IsRecordingModeSupported(mode, protocolVersion);
break;
case HardwareTypes.TSR_AIR:
case HardwareTypes.TSR_AIR_RevB:
result = TSRAIR.IsRecordingModeSupported(mode, protocolVersion);
break;
//TDAS hardware only supports Recorder and CircularBuffer, so if we get here the mode is not supported
case HardwareTypes.DIM:
case HardwareTypes.G5INDUMMY:
case HardwareTypes.G5VDS:
case HardwareTypes.Ribeye:
case HardwareTypes.RibeyeLED:
case HardwareTypes.SIM:
case HardwareTypes.TDAS_Pro_Rack:
case HardwareTypes.TDAS_LabRack:
case HardwareTypes.TOM:
result = false;
break;
case HardwareTypes.SLICE6_AIR_TC:
result = SLICE6AIRTC.IsRecordingModeSupported(mode);
break;
//All other hardware types support the same modes
default:
switch (mode)
{
case RecordingModes.MultipleEventCircularBuffer:
case RecordingModes.MultipleEventRecorder:
case RecordingModes.HybridRecorder:
case RecordingModes.ContinuousRecorder:
result = true;
break;
default:
result = false;
break;
}
break;
}
return result;
}
/// <summary>
/// Gets the Maximum sample rate for a particular recording mode, first implemented because the maximum sample rate
/// can vary depending on model and the baud rate set for UART recording (39151)
/// </summary>
/// <param name="h"></param>
/// <param name="mode"></param>
/// <param name="protocolVersion"></param>
/// <param name="baudRate"></param>
/// <returns></returns>
public static double MaxSampleRateForRecordingMode(IDASHardware h, RecordingModes mode, int protocolVersion = 1, uint baudRate = 0)
{
switch (h.DASTypeEnum)
{
case HardwareTypes.SLICE6_AIR:
return SLICE6AIR.MaxSampleRateHzForRecordingMode(mode, false, protocolVersion, baudRate);
case HardwareTypes.S6A_EthernetRecorder:
return SLICE6AIR.MaxSampleRateHz_OBRDDR;
default:
return h.GetMaxSampleRateDouble();
}
}
/// <summary>
/// returns true if the streaming profile is supported on the given hardware and protocol version
/// </summary>
/// <param name="profile">streaming profile to check</param>
/// <param name="dasType">hardware type</param>
/// <param name="protocolVersion">protocol version of hardware</param>
/// <returns>true if the profile is supported, false otherwise</returns>
public static bool IsStreamingProfileSupported(UDPStreamProfile profile, HardwareTypes dasType,
int protocolVersion, bool includeNativeSupportOnly = false)
{
bool result;
switch (dasType)
{
case HardwareTypes.SLICE6_Base:
result = SLICE6.IsStreamingProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR:
result = SLICE6AIR.IsStreamingProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR_BR:
result = SLICE6AIRBR.IsStreamingProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.TSR_AIR:
case HardwareTypes.TSR_AIR_RevB:
result = TSRAIR.IsStreamingProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR_TC:
result = SLICE6AIRTC.IsStreamingProfileSupported(profile, protocolVersion);
break;
//All other hardware types can't stream out
default:
result = false;
break;
}
return result;
}
/// <summary>
/// returns true if the clock sync profile is supported on the given hardware and protocol version
/// </summary>
/// <param name="profile">clock sync profile to check</param>
/// <param name="dasType">hardware type</param>
/// <param name="protocolVersion">protocol version of hardware</param>
/// <returns>true if the profile is supported, false otherwise</returns>
public static bool IsClockSyncProfileSupported(ClockSyncProfile profile, HardwareTypes dasType,
int protocolVersion, bool includeNativeSupportOnly, bool master)
{
bool result;
switch (dasType)
{
case HardwareTypes.SLICE6_Base:
result = SLICE6.IsClockSyncProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR:
result = SLICE6AIR.IsClockSyncProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6_AIR_BR:
result = SLICE6AIRBR.IsClockSyncProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.SLICE6DB:
case HardwareTypes.SLICE6DB_InDummy:
result = SLICE6DB.IsClockSyncProfileSupported(profile, protocolVersion);
break;
case HardwareTypes.TSR_AIR:
case HardwareTypes.TSR_AIR_RevB:
result = TSRAIR.IsClockSyncProfileSupported(profile, protocolVersion, master);
break;
//All other hardware types can't sync
default:
result = false;
break;
}
return result;
}
}
}

View File

@@ -0,0 +1,39 @@
using DTS.Common.Interface.Hardware;
using System;
using System.Windows;
using System.Windows.Data;
// ReSharper disable PossibleNullReferenceException
namespace DTS.Common.Converters
{
public class DASStatusArmTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is DASStatuses status)
{
switch (status)
{
case DASStatuses.MissingNotBooted:
return Strings.Strings.Table_NA;
case DASStatuses.BootedNotArmedYet:
return Strings.Strings.NotArmed;
case DASStatuses.BootedNeverArmed:
return Strings.Strings.NotArmed;
case DASStatuses.ArmedReady:
return Strings.Strings.Armed;
case DASStatuses.ArmedButFailedDiag:
return Strings.Strings.Armed;
case DASStatuses.ReadyForDownload:
return Strings.Strings.NotArmed;
}
}
return Strings.Strings.Table_NA;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value.Equals(true) ? parameter : Binding.DoNothing;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,40 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace DTS.Common.Converters
{
/// <summary>
/// Converter which converts percentage to String.
/// </summary>
public class PercentConverter : IValueConverter
{
/// <summary>
///
/// </summary>
/// <param name="value">The decimal value to convert. This value can be a standard decimal value or a nullable decimal value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">This parameter is not used.</param>
/// <param name="culture">The culture to use in the format operation.</param>
/// <returns>The value to be passed to the target dependency property.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var result = value as decimal? ?? 0;
return String.Format(CultureInfo.CurrentUICulture, "{0:F1}%", result);
}
/// <summary>
/// Conversion back is not supported.
/// </summary>
/// <param name="value">A currency value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">This parameter is not used.</param>
/// <param name="culture">This parameter is not used.</param>
/// <returns>The value to be passed to the source object.</returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,6 @@
using DTS.Common.Base;
namespace DTS.Common.Interface
{
public interface IPSDReportMainViewGrid : IBaseView { }
}