init
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using DTS.Common.Enums;
|
||||
|
||||
namespace DTS.Common.Constant.DASSpecific
|
||||
{
|
||||
public class SLICE6AIRBR
|
||||
{
|
||||
public const int MIN_PROTOCOL_VER = 1;
|
||||
public const int ADC_SAMPLES_PER_PACKET_VER = 47;
|
||||
public const int UDPALIGNONPPS_PROTOCOL = 51;
|
||||
public const uint MaxAAFilterRateHz = 50000;
|
||||
public static bool IsRecordingModeSupported(RecordingModes mode, int protocolVersion)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case RecordingModes.CircularBuffer:
|
||||
case RecordingModes.Recorder:
|
||||
case RecordingModes.MultipleEventCircularBuffer:
|
||||
case RecordingModes.MultipleEventRecorder:
|
||||
case RecordingModes.HybridRecorder:
|
||||
case RecordingModes.MultipleEventHybridRecorder:
|
||||
case RecordingModes.ContinuousRecorder:
|
||||
case RecordingModes.S6A_DeviceStreamingOnly:
|
||||
case RecordingModes.RAMActive:
|
||||
case RecordingModes.MultipleEventRAMActive:
|
||||
case RecordingModes.RecorderAndStreamSubSample:
|
||||
case RecordingModes.MultipleEventRecorderAndStream:
|
||||
case RecordingModes.CircularBufferAndStreamSubSample:
|
||||
case RecordingModes.MultipleEventCircularBufferAndStream:
|
||||
case RecordingModes.RecordOnBoot:
|
||||
case RecordingModes.RecordOnBootPlusUART:
|
||||
case RecordingModes.HybridAndStream:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsStreamingProfileSupported(UDPStreamProfile profile, int protocolVersion)
|
||||
{
|
||||
switch (profile)
|
||||
{
|
||||
case UDPStreamProfile.RTCStreaming:
|
||||
case UDPStreamProfile.DTS_UDP:
|
||||
case UDPStreamProfile.CH10_MANUAL_CONFIG:
|
||||
case UDPStreamProfile.CH10_PCM128_MM:
|
||||
case UDPStreamProfile.CH10_ANALOG:
|
||||
case UDPStreamProfile.CH10_PCM_STANDARD:
|
||||
case UDPStreamProfile.CH10_PCM_SUPERCOM:
|
||||
case UDPStreamProfile.CH10_PCM_128BIT_2HDR:
|
||||
case UDPStreamProfile.CH10_ANALOG_2HDR:
|
||||
case UDPStreamProfile.CH10_PCM_STANDARD_2HDR:
|
||||
case UDPStreamProfile.CH10_PCM_SUPERCOM_2HDR:
|
||||
case UDPStreamProfile.TMNS_PCM_STANDARD:
|
||||
case UDPStreamProfile.TMNS_PCM_SUPERCOM:
|
||||
case UDPStreamProfile.IENA_PTYPE_STREAM:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsClockSyncProfileSupported(ClockSyncProfile profile, int protocolVersion)
|
||||
{
|
||||
switch (profile)
|
||||
{
|
||||
case ClockSyncProfile.None:
|
||||
case ClockSyncProfile.Master_E2E:
|
||||
case ClockSyncProfile.Slave_E2E:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace DTS.Common.Base
|
||||
{
|
||||
public abstract class BasePropertyChanged : IBasePropertyChanged
|
||||
{
|
||||
public virtual event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public bool SetProperty<T>(ref T storage, T value, String propertyName = null)
|
||||
{
|
||||
if (Equals(storage, value)) return false;
|
||||
|
||||
storage = value;
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void OnPropertyChanged(string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface ITabItemViewModel : IBaseViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Tab Item View.
|
||||
/// </summary>
|
||||
ITabItemView View { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Tab View.
|
||||
/// </summary>
|
||||
ITabViewModel Parent { get; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DTS.Common.Controls
|
||||
{
|
||||
public class AutoSizedGridView : GridView
|
||||
{
|
||||
HashSet<int> _allColumns;
|
||||
HashSet<int> _autoWidthColumns;
|
||||
Dictionary<int, BindingExpression> _widthBoundColumns;
|
||||
|
||||
protected override void PrepareItem(ListViewItem item)
|
||||
{
|
||||
if (null == _allColumns || !Columns.Select(col => col.GetHashCode()).SequenceEqual(_allColumns))
|
||||
{
|
||||
_allColumns = new HashSet<int>();
|
||||
_autoWidthColumns = new HashSet<int>();
|
||||
_widthBoundColumns = new Dictionary<int, BindingExpression>();
|
||||
|
||||
foreach (var column in Columns)
|
||||
{
|
||||
_allColumns.Add(column.GetHashCode());
|
||||
if (double.IsNaN(column.Width) && //Width == "Auto"
|
||||
null == BindingOperations.GetBindingExpression(column, GridViewColumn.WidthProperty)) //Width isn't bound
|
||||
{
|
||||
_autoWidthColumns.Add(column.GetHashCode());
|
||||
}
|
||||
else if (null != BindingOperations.GetBindingExpression(column, GridViewColumn.WidthProperty))
|
||||
{
|
||||
_widthBoundColumns.Add(column.GetHashCode(), BindingOperations.GetBindingExpression(column, GridViewColumn.WidthProperty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var column in Columns)
|
||||
{
|
||||
if (_autoWidthColumns.Contains(column.GetHashCode()))
|
||||
{
|
||||
//force remeasure
|
||||
if (double.IsNaN(column.Width))
|
||||
{
|
||||
column.Width = column.ActualWidth;
|
||||
}
|
||||
column.Width = double.NaN;
|
||||
}
|
||||
else if (_widthBoundColumns.ContainsKey(column.GetHashCode()))
|
||||
{
|
||||
//check if binding lost, re-bind
|
||||
if (null == BindingOperations.GetBindingExpression(column, GridViewColumn.WidthProperty))
|
||||
{
|
||||
BindingOperations.SetBinding(column, GridViewColumn.WidthProperty, _widthBoundColumns[column.GetHashCode()].ParentBindingBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.PrepareItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using DTS.Common.Interface.Channels;
|
||||
namespace DTS.Common.Classes.Groups.ChannelSettings
|
||||
{
|
||||
public class ChannelSettingBase : IChannelSetting
|
||||
{
|
||||
//analog parameters
|
||||
public const string RANGE = "Range";
|
||||
public const string CFC = "CFC";
|
||||
//FB 13120 Add FilterClass
|
||||
public const string FilterClass = "FilterClass";
|
||||
public const string POLARITY = "Polarity";
|
||||
public const string POSITION = "Position";
|
||||
public const string ZEROMETHOD = "ZeroMethod";
|
||||
public const string ZEROMETHODSTART = "ZeroMethodStart";
|
||||
public const string ZEROMETHODEND = "ZeroMethodEnd";
|
||||
public const string USERVALUE1 = "UserValue1";
|
||||
public const string USERVALUE2 = "UserValue2";
|
||||
public const string USERVALUE3 = "UserValue3";
|
||||
public const string INITIAL_OFFSET = "InitialOffset";
|
||||
|
||||
/// <summary>
|
||||
/// the string key for the ac coupled enabled channel setting
|
||||
/// http://manuscript.dts.local/f/cases/29760/Implement-ACCoupleEnable-for-TSR-AIR
|
||||
/// </summary>
|
||||
public const string ACCouplingEnabled = "ACCouplingEnabled";
|
||||
//depreciated parameters
|
||||
//public const string LIMIT_DURATION = "LimitDuration";
|
||||
//public const string DURATION = "Duration";
|
||||
//public const string DELAY = "Delay";
|
||||
//33415 Voltage insertion channel should be half bridge
|
||||
public const string BRIDGE_TYPE = "BridgeType";
|
||||
|
||||
//squib parameters
|
||||
public const string SQUIB_CURRENT = "SquibCurrent";
|
||||
public const string SQUIB_LIMIT_DURATION = "SquibLimitDuration";
|
||||
public const string SQUIB_DURATION = "SquibDuration";
|
||||
public const string SQUIB_DELAY = "SquibDelay";
|
||||
public const string SQMODE = "SQMode";
|
||||
|
||||
//digital out parameters
|
||||
public const string DIGITALOUT_LIMIT_DURATION = "DigitalOutLimitDuration";
|
||||
public const string DIGITALOUT_DURATION = "DigitalOutDuration";
|
||||
public const string DIGITALOUT_DELAY = "DigitalOutDelay";
|
||||
public const string OUTPUT_MODE = "OutputMode";
|
||||
|
||||
//digital in parameters
|
||||
public const string DIMODE = "DIMode";
|
||||
public const string DEFAULT_VALUE = "DefaultValue";
|
||||
public const string ACTIVE_VALUE = "ActiveValue";
|
||||
|
||||
//uart parameters 18363
|
||||
public const string BAUD_RATE = "UartBaudRate";
|
||||
public const string DATA_BITS = "UartDataBits";
|
||||
public const string STOP_BITS = "UartStopBits";
|
||||
public const string PARITY = "UartParity";
|
||||
public const string FLOW_CONTROL = "UartFlowControl";
|
||||
public const string DATA_FORMAT = "UartDataFormat";
|
||||
//streamout parameters 18363
|
||||
public const string UDP_PROFILE = "StreamOutUDPProfile";
|
||||
public const string UDP_ADDRESS = "StreamOutUDPAddress";
|
||||
public const string UDP_TIME_CHID = "StreamOutUDPTimeChannelId";
|
||||
public const string UDP_DATA_CHID = "StreamOutUDPDataChannelId";
|
||||
public const string UDP_TMNS_CONFIG = "StreamOutUDPTmNSConfig";
|
||||
public const string IRIG_TDP_INTERVAL_MS = "StreamOutIRIGTimeDataPacketIntervalMs";
|
||||
public const string TMATS_INTERVAL_MS = "StreamOutTMATSIntervalMs";
|
||||
//streamin parameters 26828
|
||||
public const string UDP_ADDRESS_IN = "StreamInUDPAddress";
|
||||
|
||||
//CAN parameters 44881
|
||||
public const string CAN_IS_FD = "CanIsFD";
|
||||
public const string CAN_ARB_BASE_BITRATE = "CanArbBaseBitrate";
|
||||
public const string CAN_ARB_BASE_SJW = "CanArbBaseSJW";
|
||||
public const string CAN_DATA_BITRATE = "CanDataBitrate";
|
||||
public const string CAN_DATA_SJW = "CanDataSJW";
|
||||
public const string CAN_FILE_TYPE = "CanFileType";
|
||||
|
||||
public ChannelSettingBase(int settingType, string name, string defaultValue)
|
||||
{
|
||||
SettingTypeId = settingType;
|
||||
SettingName = name;
|
||||
DefaultValue = defaultValue;
|
||||
}
|
||||
public IChannelSetting Clone()
|
||||
{
|
||||
return new ChannelSettingBase(this);
|
||||
}
|
||||
private ChannelSettingBase(IChannelSetting setting)
|
||||
{
|
||||
ChannelId = setting.ChannelId;
|
||||
SettingTypeId = setting.SettingTypeId;
|
||||
SettingName = setting.SettingName;
|
||||
DefaultValue = setting.DefaultValue;
|
||||
Value = setting.Value;
|
||||
}
|
||||
public long ChannelId { get; set; }
|
||||
public int SettingTypeId { get; protected set; }
|
||||
public string SettingName { get; protected set; }
|
||||
public string DefaultValue { get; protected set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
public double DoubleValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (double.TryParse(Value, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out double d))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
return DoubleDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public double DoubleDefaultValue => double.Parse(DefaultValue, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
public int IntValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (int.TryParse(Value, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out int d))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
return IntDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
public int IntDefaultValue => int.Parse(DefaultValue, System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
public bool BoolValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (bool.TryParse(Value, out bool b))
|
||||
{
|
||||
return b;
|
||||
}
|
||||
return BoolDefaultValue;
|
||||
}
|
||||
set => Value = value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public bool BoolDefaultValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (bool.TryParse(DefaultValue, out var b))
|
||||
{
|
||||
return b;
|
||||
}
|
||||
if (string.IsNullOrEmpty(DefaultValue)) { return false; }
|
||||
return !DefaultValue.Equals(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user