init
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DTS.Common.Enums;
|
||||
|
||||
namespace DTS.Common.Constant.DASSpecific
|
||||
{
|
||||
public class SLICE2_TOM
|
||||
{
|
||||
public static bool IsRecordingModeSupported(RecordingModes mode, int protocolVersion)
|
||||
{
|
||||
var result = false;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case RecordingModes.CircularBuffer:
|
||||
case RecordingModes.MultipleEventCircularBuffer:
|
||||
case RecordingModes.Recorder:
|
||||
case RecordingModes.MultipleEventRecorder:
|
||||
case RecordingModes.HybridRecorder:
|
||||
case RecordingModes.MultipleEventHybridRecorder:
|
||||
case RecordingModes.ContinuousRecorder:
|
||||
result = true;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Microsoft.Windows.Controls.Ribbon;
|
||||
using Microsoft.Xaml.Behaviors;
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class RibbonControlSelectionChangeBehavior : Behavior<Ribbon>
|
||||
{
|
||||
public static readonly DependencyProperty TargetRibbonProperty = DependencyProperty.Register("TargetRibbonControl", typeof(Ribbon), typeof(RibbonControlSelectionChangeBehavior), new PropertyMetadata(null));
|
||||
|
||||
private IEventAggregator _eventAggregator;
|
||||
|
||||
public Ribbon TargetRibbonControl
|
||||
{
|
||||
get => (Ribbon)GetValue(TargetRibbonProperty);
|
||||
set => SetValue(TargetRibbonProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
AssociatedObject.SelectionChanged += Ribbon_SelectionChanged;
|
||||
|
||||
if (_eventAggregator == null)
|
||||
_eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
|
||||
}
|
||||
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
base.OnDetaching();
|
||||
AssociatedObject.SelectionChanged -= Ribbon_SelectionChanged;
|
||||
}
|
||||
|
||||
void Ribbon_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count > 0)
|
||||
_eventAggregator.GetEvent<RibbonControlSelectionChanged>().Publish(new RibbonControlSelectionEventArgs(RibbonControlOperation.AddedItem, e.AddedItems[0]));
|
||||
|
||||
if (e.RemovedItems.Count > 0)
|
||||
_eventAggregator.GetEvent<RibbonControlSelectionChanged>().Publish(new RibbonControlSelectionEventArgs(RibbonControlOperation.RemovedItem, e.RemovedItems[0]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using DTS.Common.Base;
|
||||
using System.Windows.Input;
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface IAddCalculatedChannelViewModel : IBaseViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Search View.
|
||||
/// </summary>
|
||||
IBaseView View { get; set; }
|
||||
IBaseViewModel Parent { get; set; }
|
||||
void PublishChanges();
|
||||
bool IncludeGroupNameInISOExport { get; set; }
|
||||
|
||||
int DefaultDTSEncoding { get; set; }
|
||||
ICommand AddCalculatedChannelCommand { get; }
|
||||
object ContextSearchRegion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
namespace DTS.Common.Constant
|
||||
{
|
||||
public static class EmbeddedSensors
|
||||
{
|
||||
//power management / wake up
|
||||
public const int MotionDetectInactivitySMaximum = 300; //five minutes
|
||||
|
||||
public const int MagnetTimeoutMsMaximum = 300000; //five minutes
|
||||
|
||||
//device triggers
|
||||
public const double EmbeddedLowGLinearAccelerometerRange = 8;
|
||||
public const double EmbeddedHighGLinearAccelerometerRange = 400;
|
||||
public const double EmbeddedAngularAccelerometerRange = 2000;
|
||||
public const double EmbeddedAngularRateSensorRange = 2000;
|
||||
public const double HumidityMinimum = 10;
|
||||
public const double HumidityMaximum = 100;
|
||||
public const double PressureMinimum = 5;
|
||||
public const double PressureMaximum = 15;
|
||||
public const double TemperatureMinimum = 0;
|
||||
public const double TemperatureMaximum = 65;
|
||||
public const double TimedIntervalEventDurationMsMinimum = 30;
|
||||
public const double TimedIntervalEventDurationMsMaximum = 300000; //five minutes
|
||||
public const double TimedIntervalNumberOfEventsMaximum = 100;
|
||||
public const int IntervalBetweenEventStartsMinutesMaximum = 1440; //24 hours
|
||||
|
||||
//embedded sensor sample rates, taken from device IC spec
|
||||
public const double EmbeddedLowGLinearAccelerometerSampleRateMinimum = 1;
|
||||
public const double EmbeddedLowGLinearAccelerometerSampleRateMaximum = 6400;
|
||||
public const double EmbeddedHighGLinearAccelerometerSampleRateMinimum = 1;
|
||||
public const double EmbeddedHighGLinearAccelerometerSampleRateMaximum = 5120;
|
||||
public const double EmbeddedAngularAccelerometerSampleRateMinimum = 1;
|
||||
public const double EmbeddedAngularAccelerometerSampleRateMaximum = 1600;
|
||||
public const double EmbeddedAngularAccelerometerAndRateSensorSampleRateMinimum = 1;
|
||||
public const double EmbeddedAngularAccelerometerAndRateSensorSampleRateMaximum = 5120;
|
||||
public const double EmbeddedAtmosphericSensorSampleRateMinimum = 1;
|
||||
public const double EmbeddedAtmosphericSensorSampleRateMaximum = 157;
|
||||
|
||||
//default values: max SR
|
||||
public const int DefaultEmbeddedLowGLinearAccelerometerSampleRate = 6400;
|
||||
public const int DefaultEmbeddedHighGLinearAccelerometerSampleRate = 5120;
|
||||
public const int DefaultEmbeddedAngularAccelerometerSampleRate = 1600;
|
||||
public const int DefaultEmbeddedAngularAccelerometerAndRateSensorSampleRate = 5120;
|
||||
public const int DefaultEmbeddedAtmosphericSensorSampleRate = 157;
|
||||
|
||||
public const uint BAUD_RATE_MIN = 96;
|
||||
public const uint BAUD_RATE_DEFAULT = 57600;
|
||||
public const uint BAUD_RATE_MAX = 921600;
|
||||
public static readonly uint[] BAUD_RATES = { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 614400, 806400, 921600 };
|
||||
|
||||
//CAN
|
||||
public const bool CANISFD_DEFAULT = true;
|
||||
|
||||
//Arb/Base Bitrate
|
||||
public const int CANFD_ARB_BASE_BITRATE_MIN = 500000;
|
||||
public const int CANFD_ARB_BASE_BITRATE_MAX = 1000000;
|
||||
public const int CANFD_ARB_BASE_BITRATE_DEFAULT = 1000000;
|
||||
public static readonly int[] CANFD_ARBBASEBITRATE_VALUES = { CANFD_ARB_BASE_BITRATE_MIN, CANFD_ARB_BASE_BITRATE_MAX };
|
||||
|
||||
public const int NON_CANFD_ARB_BASE_BITRATE_MIN = 50000;
|
||||
public const int NON_CANFD_ARB_BASE_BITRATE_MAX = 500000;
|
||||
public const int NON_CANFD_ARB_BASE_BITRATE_DEFAULT = 500000;
|
||||
public static readonly int[] NON_CANFD_ARBBASEBITRATE_VALUES = { NON_CANFD_ARB_BASE_BITRATE_MIN, 62000, 83000, 100000, 125000, 250000, NON_CANFD_ARB_BASE_BITRATE_MAX };
|
||||
|
||||
|
||||
//Arb/Base SJW
|
||||
public const int CANFD_500000_ARB_BASE_SJW_DEFAULT = 8;
|
||||
public static readonly int[] CANFD_500000_ARBBASESJW_VALUES = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
|
||||
|
||||
public const int CANFD_1000000_ARB_BASE_SJW_MAX = 8;
|
||||
public const int CANFD_1000000_ARB_BASE_SJW_DEFAULT = 1;
|
||||
public static readonly int[] CANFD_1000000_ARBBASESJW_VALUES = { 1, 2, 3, 4, 5, 6, 7, CANFD_1000000_ARB_BASE_SJW_MAX };
|
||||
|
||||
public const int NON_CANFD_50000_TO_125000_ARB_BASE_SJW_DEFAULT = 1;
|
||||
public static readonly int[] NON_CANFD_50000_TO_125000_ARBBASESJW_VALUES = { 1, 2, 3, 4 };
|
||||
|
||||
public const int NON_CANFD_250000_TO_500000_ARB_BASE_SJW_DEFAULT = 1;
|
||||
public static readonly int[] NON_CANFD_250000_TO_500000_ARBBASESJW_VALUES = { 1, 2 };
|
||||
|
||||
|
||||
//Data Bitrate
|
||||
public const int DATA_BITRATE_DEFAULT = 4000000;
|
||||
public static readonly int[] DATABITRATE_VALUES = { 500000, 1000000, 2000000, 4000000, 8000000 };
|
||||
|
||||
|
||||
//Data SJW
|
||||
public const int DATA_SJW_DEFAULT = 2;
|
||||
public const int DATA_SJW_MIN = 1;
|
||||
public static readonly int[] NON_CANFD_500000_DATASJW_VALUES = { DATA_SJW_MIN, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
|
||||
public static readonly int[] NON_CANFD_1000000_DATASJW_VALUES = { DATA_SJW_MIN, 2, 3, 4, 5, 6, 7, 8 };
|
||||
public static readonly int[] NON_CANFD_2000000_DATASJW_VALUES = { DATA_SJW_MIN, 2, 3, 4 };
|
||||
public static readonly int[] NON_CANFD_4000000_DATASJW_VALUES = { DATA_SJW_MIN, 2 };
|
||||
public static readonly int[] NON_CANFD_8000000_DATASJW_VALUES = { DATA_SJW_MIN };
|
||||
|
||||
|
||||
//Filetype
|
||||
public const string FILETYPE_DEFAULT = "asc";
|
||||
public static readonly string[] FILETYPE_VALUES = { "asc", "blf" };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace DTS.Common.XMLUtils
|
||||
{
|
||||
public class GroupXMLClass
|
||||
{
|
||||
public GroupXMLClass()
|
||||
{
|
||||
HardwareList = new HardwareListXMLClass();
|
||||
Channel = new List<ChannelXMLClass>();
|
||||
}
|
||||
public string Name { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string TestSetupName { get; set; }
|
||||
public string DisplayOrder { get; set; }
|
||||
public string Position { get; set; }
|
||||
public string TestObjectType { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string StaticGroupId { get; set; }
|
||||
|
||||
[XmlElement("HardwareList")]
|
||||
public HardwareListXMLClass HardwareList { get; set; }
|
||||
|
||||
[XmlElement("Channel")]
|
||||
public List<ChannelXMLClass> Channel { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user