init
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.Windows.Input;
|
||||
using DTS.Common.Enums;
|
||||
using DTS.Common.Enums.Channels;
|
||||
|
||||
namespace DTS.Common.Interface.Channels.ChannelCodes
|
||||
{
|
||||
/// <summary>
|
||||
/// used to describe the behavior of channelcodes for the UI
|
||||
/// </summary>
|
||||
public interface IChannelCode
|
||||
{
|
||||
/// <summary>
|
||||
/// id of the channel code in the database
|
||||
/// </summary>
|
||||
int Id { get; }
|
||||
/// <summary>
|
||||
/// codevalue (either user code or isocode depending on codetype)
|
||||
/// </summary>
|
||||
string Code { get; set; }
|
||||
/// <summary>
|
||||
/// name associated with code (either user channel name or iso channel name)
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
/// <summary>
|
||||
/// the type of code (iso or user)
|
||||
/// </summary>
|
||||
ChannelEnumsAndConstants.ChannelCodeType CodeType { get; }
|
||||
/// <summary>
|
||||
/// handler for paste command
|
||||
/// this is used for when data is pasted into either a channel code or name
|
||||
/// it's needed because you can paste many rows, a CSV for example, into one field
|
||||
/// </summary>
|
||||
ICommand PasteCommand { get; set; }
|
||||
/// <summary>
|
||||
/// the status of the item in the UI
|
||||
/// (failed/success/etc)
|
||||
/// </summary>
|
||||
UIItemStatus ItemStatus { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface.Channels.ChannelCodes
|
||||
{
|
||||
public interface IChannelCodesListView : IBaseView { }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Enums;
|
||||
|
||||
namespace DTS.Common.Interface.Channels.ChannelCodes
|
||||
{
|
||||
public interface IChannelCodesListViewModel : IBaseViewModel
|
||||
{
|
||||
IChannelCodesListView View { get; set; }
|
||||
void Unset();
|
||||
void SetPage(object page);
|
||||
void OnSetActive();
|
||||
bool Save();
|
||||
ObservableCollection<IChannelCode> ISOChannelCodes { get; set; }
|
||||
ObservableCollection<IChannelCode> UserChannelCodes { get; set; }
|
||||
bool Validate(bool bDisplayWindow);
|
||||
void CopySelected();
|
||||
void DeleteSelected();
|
||||
void Filter(object columnTag, string searchTerm);
|
||||
void Sort(object columnTag, bool bColumnClick);
|
||||
Func<IList<IChannelCode>> ChannelCodesFunc { get; }
|
||||
bool ShowISOStringBuilder { get; set; }
|
||||
bool UniqueISOCodesRequired { get; set; }
|
||||
bool ShowChannelCodeLookupHelper { get; set; }
|
||||
bool IsReadOnly { get; set; }
|
||||
IChannelCode [] SelectedCodes { get; }
|
||||
}
|
||||
}
|
||||
12
Common/DTS.CommonCore/Interface/Channels/IChannelCode.cs
Normal file
12
Common/DTS.CommonCore/Interface/Channels/IChannelCode.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using DTS.Common.Enums.Channels;
|
||||
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IChannelCode
|
||||
{
|
||||
int Id { get; }
|
||||
string Code { get; }
|
||||
string Name { get; }
|
||||
ChannelEnumsAndConstants.ChannelCodeType CodeType { get; }
|
||||
}
|
||||
}
|
||||
60
Common/DTS.CommonCore/Interface/Channels/IChannelDbRecord.cs
Normal file
60
Common/DTS.CommonCore/Interface/Channels/IChannelDbRecord.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System;
|
||||
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface describing a Channel in the Db
|
||||
/// </summary>
|
||||
public interface IChannelDbRecord
|
||||
{
|
||||
[Key]
|
||||
[Column("Id")]
|
||||
/// <summary>
|
||||
/// The id/key of the Channel record in the db
|
||||
/// </summary>
|
||||
long Id { get; set; }
|
||||
|
||||
[Column("GroupId")]
|
||||
int GroupId { get; set; }
|
||||
|
||||
[Column("IsoCode")]
|
||||
string IsoCode { get; set; }
|
||||
|
||||
[Column("IsoChannelName")]
|
||||
string IsoChannelName { get; set; }
|
||||
|
||||
[Column("UserCode")]
|
||||
string UserCode { get; set; }
|
||||
|
||||
[Column("UserChannelName")]
|
||||
string UserChannelName { get; set; }
|
||||
|
||||
[Column("DASId")]
|
||||
int DASId { get; set; }
|
||||
|
||||
[Column("DASChannelIndex")]
|
||||
/// <summary>
|
||||
/// The physical channel index of the channel among channels on the DAS
|
||||
/// </summary>
|
||||
int DASChannelIndex { get; set; }
|
||||
|
||||
[Column("GroupChannelOrder")]
|
||||
int GroupChannelOrder { get; set; }
|
||||
|
||||
[Column("TestSetupOrder")]
|
||||
int TestSetupOrder { get; set; }
|
||||
|
||||
int SensorId { get; set; }
|
||||
|
||||
[Column("Disabled")]
|
||||
bool Disabled { get; set; }
|
||||
|
||||
[Column("LastModified")]
|
||||
DateTime LastModified { get; set; }
|
||||
|
||||
[Column("LastModifiedBy")]
|
||||
string LastModifiedBy { get; set; }
|
||||
}
|
||||
}
|
||||
15
Common/DTS.CommonCore/Interface/Channels/IChannelSetting.cs
Normal file
15
Common/DTS.CommonCore/Interface/Channels/IChannelSetting.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IChannelSetting
|
||||
{
|
||||
long ChannelId { get; set; }
|
||||
int SettingTypeId { get; }
|
||||
string SettingName { get; }
|
||||
string DefaultValue { get; }
|
||||
string Value { get; set; }
|
||||
int IntValue { get; set; }
|
||||
double DoubleValue { get; set; }
|
||||
bool BoolValue { get; set; }
|
||||
IChannelSetting Clone();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IChannelSettingRecord
|
||||
{
|
||||
int Id { get; set; }
|
||||
string SettingName { get; set; }
|
||||
string DefaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
372
Common/DTS.CommonCore/Interface/Channels/IGroupChannel.cs
Normal file
372
Common/DTS.CommonCore/Interface/Channels/IGroupChannel.cs
Normal file
@@ -0,0 +1,372 @@
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using DTS.Common.Interface.Sensors.SensorsList;
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
using DTS.Common.Interface.Groups.GroupList;
|
||||
using DTS.Common.Enums;
|
||||
using DTS.Common.Interface.Sensors;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Enums.Sensors.SensorsList;
|
||||
using DTS.Common.Classes.ChannelCodes;
|
||||
using DTS.Common.Classes.Sensors;
|
||||
using DTS.Common.Interface.Sensors.SoftwareFilters;
|
||||
using System.IO.Ports;
|
||||
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IGroupChannel : IComparable<IGroupChannel>, IChannelDbRecord
|
||||
{
|
||||
SensorConstants.AvailableRangesLowG RangeLowG { get; set; }
|
||||
/// <summary>
|
||||
/// whether the channel has a calibration less voltage measurement channel
|
||||
/// </summary>
|
||||
bool VoltageInsertionSensor { get; }
|
||||
/// <summary>
|
||||
/// Whether the channel has an embedded range modifiable low g sensor
|
||||
/// </summary>
|
||||
bool RangeModifiableSensorLowG { get; }
|
||||
/// <summary>
|
||||
/// whether the channel has an embedded range modifiable ars sensor
|
||||
/// </summary>
|
||||
bool RangeModifiableSensorARS { get; }
|
||||
/// <summary>
|
||||
/// available initial offsets for this channel
|
||||
/// dependent on a sensor w/ a sensor calibration being assigned
|
||||
/// </summary>
|
||||
InitialOffset [] AvailableInitialOffsets { get; set; }
|
||||
/// <summary>
|
||||
/// current support for IEPE by channel
|
||||
/// if there is a sensor assigned, value is depedent on sensor bridge
|
||||
/// if there is no sensor but hardware is assigned, is dependent on hardwarechannel support
|
||||
/// if neither is assigned, IEPE Is available to be assigned to the channel
|
||||
/// </summary>
|
||||
string IEPESupport { get; }
|
||||
/// <summary>
|
||||
/// the group the channel belongs to
|
||||
/// </summary>
|
||||
IGroup Group { get; set; }
|
||||
/// <summary>
|
||||
/// the name of the group (DisplayName) the channel belongs to
|
||||
/// </summary>
|
||||
string GroupName { get; set; }
|
||||
/// <summary>
|
||||
/// whether the group name is valid or not
|
||||
/// </summary>
|
||||
bool GroupNameValid{ get; set; }
|
||||
/// <summary>
|
||||
/// whether the isocode is set or not [does not examine iso code validity]
|
||||
/// </summary>
|
||||
bool IsoCodeValid { get; set; }
|
||||
/// <summary>
|
||||
/// whether the iso channel name is set or not
|
||||
/// </summary>
|
||||
bool IsoChannelNameValid { get; set; }
|
||||
/// <summary>
|
||||
/// whether the user code is set or not
|
||||
/// </summary>
|
||||
bool UserCodeValid { get; set; }
|
||||
/// <summary>
|
||||
/// whether the user channel name is set or not
|
||||
/// </summary>
|
||||
bool UserChannelNameValid { get; set; }
|
||||
/// <summary>
|
||||
/// whether the hardware has been set or not
|
||||
/// </summary>
|
||||
bool HardwareValid { get; }
|
||||
/// <summary>
|
||||
/// this is the old identifier for the hardware channel assigned
|
||||
/// it's something in the form of [das serial]:[channel index]
|
||||
/// I'm not sure why we have two hardware ids around and why this one is still around...
|
||||
/// </summary>
|
||||
string HardwareId { get; set; }
|
||||
/// <summary>
|
||||
/// stores the sample rate of the DAS associated with this channel
|
||||
/// </summary>
|
||||
double TestSampleRate { get; set; }
|
||||
/// <summary>
|
||||
/// whether the sensor has been set or not
|
||||
/// </summary>
|
||||
bool SensorValid { get; }
|
||||
/// <summary>
|
||||
/// whether the channel should be used for collecting data or not
|
||||
/// </summary>
|
||||
bool IsDisabled { get; set; }
|
||||
void SetHardwareChannel(IHardwareChannel hardwareChannel);
|
||||
void SetSensor(IDragAndDropItem sensor, IChannelSetting [] channelDefaults, bool applySensorDataToBlankChannels);
|
||||
bool CompareValue(string property);
|
||||
bool SetDifferent(string property);
|
||||
void SetNotDifferent();
|
||||
void SetRange(CACOption option);
|
||||
bool CanMoveUp { get; set; }
|
||||
bool CanMoveDown { get; set; }
|
||||
bool DeleteShouldBeEnabled { get; set; }
|
||||
System.Windows.Visibility RemoveSensorVisibility { get; set; }
|
||||
/// <summary>
|
||||
/// indicates whether the channel is a new non edited channel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool IsBlank();
|
||||
/// <summary>
|
||||
/// clears hardware and sensor assignments for channel
|
||||
/// </summary>
|
||||
void Clear();
|
||||
/// <summary>
|
||||
/// return true if channel contains the given term
|
||||
/// </summary>
|
||||
/// <param name="term"></param>
|
||||
/// <returns></returns>
|
||||
bool Filter(string term);
|
||||
/// <summary>
|
||||
/// what to do when something is pasted to the channel
|
||||
/// </summary>
|
||||
ICommand PasteCommand { get; set; }
|
||||
/// <summary>
|
||||
/// settings (range/polarity/ etc) for channel
|
||||
/// </summary>
|
||||
IChannelSetting [] ChannelSettings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// returns a channel name for channel based on view mode
|
||||
/// </summary>
|
||||
/// <param name="isoViewMode"></param>
|
||||
/// <returns></returns>
|
||||
string GetChannelName(IsoViewMode isoViewMode);
|
||||
/// <summary>
|
||||
/// returns a code for channel based on view mode
|
||||
/// </summary>
|
||||
/// <param name="isoViewMode"></param>
|
||||
/// <returns></returns>
|
||||
string GetChannelCode(IsoViewMode isoViewMode);
|
||||
/// <summary>
|
||||
/// creates a memory copy of channel
|
||||
/// </summary>
|
||||
/// <param name="groupChannel"></param>
|
||||
void Copy(IGroupChannel groupChannel);
|
||||
|
||||
/// <summary>
|
||||
/// string to display in UI for hardware
|
||||
/// </summary>
|
||||
string Hardware { get; set; }
|
||||
/// <summary>
|
||||
/// string to display in UI for sensor
|
||||
/// </summary>
|
||||
string Sensor { get; }
|
||||
ISensorData SensorData{ get; }
|
||||
IHardwareChannel HardwareChannel{ get; }
|
||||
IDragAndDropItem DragAndDropItem { get; }
|
||||
ISensorCalibration SensorCalibration{ get; }
|
||||
void SetSensorCalibration(ISensorCalibration calibration);
|
||||
void SetSensorData(ISensorData sensorData, IDragAndDropItem dragAndDropItem, bool decideSettings=false);
|
||||
|
||||
bool HasEID { get; }
|
||||
/// <summary>
|
||||
/// whether channel has an analog sensor assigned
|
||||
/// if no sensor is assigned but the channel is not blank, returns true
|
||||
/// returns false if channel is blank
|
||||
/// </summary>
|
||||
bool IsAnalog { get; }
|
||||
/// <summary>
|
||||
/// whether the channel has a squib sensor assigned
|
||||
/// if no sensor is assigned but the channel is not blank, returns true
|
||||
/// returns false if channel is blank
|
||||
/// </summary>
|
||||
bool IsSquib { get; }
|
||||
/// <summary>
|
||||
/// whether the channel has a digital input sensor assigned
|
||||
/// if no sensor is assigned but the channel is not blank, returns true
|
||||
/// returns false if channel is blank
|
||||
/// </summary>
|
||||
bool IsDigitalIn { get; }
|
||||
/// <summary>
|
||||
/// whether the channel has a digital output sensor assigned
|
||||
/// if no sensor is assigned but the channel is not blank, returns true
|
||||
/// returns false if channel is blank
|
||||
/// </summary>
|
||||
bool IsDigitalOut { get; }
|
||||
/// <summary>
|
||||
/// whether the channel is from a RTC module
|
||||
/// returns false if channel is a normal phyiscal measurement channel
|
||||
/// </summary>
|
||||
bool IsClock { get; }
|
||||
/// <summary>
|
||||
/// whether the channel is from a UART module
|
||||
/// returns false if channel is a normal phyiscal measurement channel
|
||||
/// </summary>
|
||||
bool IsUart { get; }
|
||||
/// <summary>
|
||||
/// whether the channel is from a stream in module
|
||||
/// returns false if channel is a normal phyiscal measurement channel
|
||||
/// </summary>
|
||||
bool IsStreamIn { get; }
|
||||
/// <summary>
|
||||
/// whether the channel is from a stream out module
|
||||
/// returns false if channel is a normal phyiscal measurement channel
|
||||
/// </summary>
|
||||
bool IsStreamOut { get; }
|
||||
/// <summary>
|
||||
/// range setting value for the channel
|
||||
/// </summary>
|
||||
double Range { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// the capacity of the sensor on the channel
|
||||
/// </summary>
|
||||
double Capacity { get; }
|
||||
/// <summary>
|
||||
/// FB 13120 filter class setting value for the channel
|
||||
/// </summary>
|
||||
IFilterClass FilterClass { get; set; }
|
||||
/// <summary>
|
||||
/// polarity setting value for the channel
|
||||
/// </summary>
|
||||
string Polarity { get; set; }
|
||||
string Units { get; }
|
||||
|
||||
ZeroMethodType ZeroMethod { get; set; }
|
||||
double ZeroMethodStart { get; set; }
|
||||
double ZeroMethodEnd { get; set; }
|
||||
string Sensitivity { get; }
|
||||
|
||||
InitialOffset InitialOffset { get; set; }
|
||||
|
||||
bool SquibLimitDuration { get; set; }
|
||||
double SquibDuration { get; set; }
|
||||
//14623 SquibDelay is nullable for UI perpose
|
||||
double? SquibDelay { get; set; }
|
||||
|
||||
double SquibCurrent { get; set; }
|
||||
|
||||
bool DigitalOutLimitDuration { get; set; }
|
||||
double DigitalOutDuration { get; set; }
|
||||
//FB 28107 Define max value allowed for digital out duration
|
||||
double DigitalOutDurationMax { get; set; }
|
||||
double DigitalOutDelay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// output mode setting value for the channel
|
||||
/// </summary>
|
||||
DigitalOutputModes DigitalOutputMode { get; set; }
|
||||
/// <summary>
|
||||
/// fire mode setting value for the channel
|
||||
/// </summary>
|
||||
SquibFireMode SquibFireMode { get; set; }
|
||||
/// <summary>
|
||||
/// digital input mode setting value for the channel
|
||||
/// </summary>
|
||||
DigitalInputModes DigitalInputMode { get; set; }
|
||||
/// <summary>
|
||||
/// active value setting value for the channel
|
||||
/// </summary>
|
||||
string ActiveValue { get; set; }
|
||||
/// <summary>
|
||||
/// default value setting value for the channel
|
||||
/// </summary>
|
||||
string DefaultValue { get; set; }
|
||||
///<summary>
|
||||
/// baud rate setting value for the channel
|
||||
///</summary>
|
||||
uint UartBaudRate { get; set; }
|
||||
///<summary>
|
||||
/// data bits setting value for the channel
|
||||
///</summary>
|
||||
uint UartDataBits { get; set; }
|
||||
///<summary>
|
||||
/// stop bits setting value for the channel
|
||||
///</summary>
|
||||
StopBits UartStopBits { get; set; }
|
||||
///<summary>
|
||||
/// parity setting value for the channel
|
||||
///</summary>
|
||||
Parity UartParity { get; set; }
|
||||
///<summary>
|
||||
/// flow control setting value for the channel FB 30486 removed set, it's always NONE
|
||||
///</summary>
|
||||
Handshake UartFlowControl { get; }
|
||||
///<summary>
|
||||
/// data format setting value for the channel
|
||||
///</summary>
|
||||
UartDataFormat UartDataFormat { get; set; }
|
||||
///<summary>
|
||||
/// udp address setting value for the channel
|
||||
///</summary>
|
||||
string StreamInUDPAddress { get; set; }
|
||||
///<summary>
|
||||
/// udp profile setting value for the channel
|
||||
///</summary>
|
||||
UDPStreamProfile StreamOutUDPProfile { get; set; }
|
||||
///<summary>
|
||||
/// udp address setting value for the channel
|
||||
///</summary>
|
||||
string StreamOutUDPAddress { get; set; }
|
||||
///<summary>
|
||||
/// time channel id setting value for the channel
|
||||
///</summary>
|
||||
ushort StreamOutUDPTimeChannelId { get; set; }
|
||||
///<summary>
|
||||
/// data channel id setting value for the channel
|
||||
///</summary>
|
||||
ushort StreamOutUDPDataChannelId { get; set; }
|
||||
///<summary>
|
||||
/// tmns config setting value for the channel
|
||||
///</summary>
|
||||
string StreamOutUDPTmNSConfig { get; set; }
|
||||
///<summary>
|
||||
/// irig data packet interval setting value for the channel
|
||||
///</summary>
|
||||
ushort StreamOutIRIGTimeDataPacketIntervalMs { get; set; }
|
||||
/// <summary>
|
||||
/// time in ms between sending out TMATS information while streaming
|
||||
/// http://manuscript.dts.local/f/cases/29987/Add-CG-DP-TMATS-interval-UI-support
|
||||
/// </summary>
|
||||
ushort StreamOutTMATSIntervalMs { get; set; }
|
||||
/// <summary>
|
||||
/// FB 15574 FB 13120
|
||||
/// get the current FilterClass from the current isocode
|
||||
/// </summary>
|
||||
/// <param name="filters"></param>
|
||||
/// <param name="isoCode"></param>
|
||||
/// <returns></returns>
|
||||
IFilterClass GetFilterClassFromISOCode(ISoftwareFilter[] filters, string isoCode);
|
||||
/// <summary>
|
||||
/// gets a function that will perform coercion on isocodes if needed
|
||||
/// </summary>
|
||||
CoerceISOCodeDelegate CoerceISOCodeFunc { get; }
|
||||
/// <summary>
|
||||
/// returns the status of the channel considering IsComplete and sensor cal status
|
||||
/// </summary>
|
||||
UIItemStatus ChannelStatus { get; }
|
||||
/// <summary>
|
||||
/// sets the channel settings based on a sensor's settings
|
||||
/// </summary>
|
||||
/// <param name="sd"></param>
|
||||
void SetSettingsFromSensor(ISensorData sd);
|
||||
|
||||
/// <summary>
|
||||
/// returns a list of sensor parameter differences from sensor vs channel
|
||||
/// returns empty string if there aren't any
|
||||
/// </summary>
|
||||
/// <param name="sensor"></param>
|
||||
/// <returns></returns>
|
||||
string GetChangeList(ISensorData sensor);
|
||||
bool IsRangeDifferent { get; set; }
|
||||
bool IsFilterClassDifferent { get; set; }
|
||||
bool IsPolarityDifferent { get; set; }
|
||||
bool IsZeroMethodDifferent { get; set; }
|
||||
bool IsZeroMethodStartDifferent { get; set; }
|
||||
bool IsZeroMethodEndDifferent { get; set; }
|
||||
bool IsInitialOffsetDifferent { get; set; }
|
||||
bool IsSquibFireModeDifferent { get; set; }
|
||||
bool IsSquibDelayDifferent { get; set; }
|
||||
bool IsSquibLimitDurationDifferent { get; set; }
|
||||
bool IsSquibDurationDifferent { get; set; }
|
||||
bool IsSquibCurrentDifferent { get; set; }
|
||||
bool IsDigitalOutputModeDifferent { get; set; }
|
||||
bool IsDigitalOutDelayDifferent { get; set; }
|
||||
bool IsDigitalOutLimitDurationDifferent { get; set; }
|
||||
bool IsDigitalOutDurationDifferent { get; set; }
|
||||
bool IsDigitalInputModeDifferent { get; set; }
|
||||
bool IsDefaultValueDifferent { get; set; }
|
||||
bool IsActiveValueDifferent { get; set; }
|
||||
bool BorderShouldShowOutOfDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IGroupChannelSettingRecord
|
||||
{
|
||||
long ChannelId { get; set; }
|
||||
int SettingId { get; set; }
|
||||
string SettingValue { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user