init
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface INetworkingView : IBaseView { }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
namespace DTS.Common.Enums.DBExport
|
||||
{
|
||||
/// <summary>
|
||||
/// different tags for an ISODll.MMEPhysicalDimension
|
||||
/// </summary>
|
||||
public enum PhysicalDimensionFields
|
||||
{
|
||||
Amount_Of_Substance_EXP,
|
||||
Date,
|
||||
Default_Unit,
|
||||
Electric_Current_EXP,
|
||||
Expired,
|
||||
History,
|
||||
Last_Change,
|
||||
Last_Change_Text,
|
||||
Length_EXP,
|
||||
Luminous_Intensity_Exp,
|
||||
Mass_EXP,
|
||||
Physical_Dimension,
|
||||
RecordType,
|
||||
Remarks,
|
||||
S_GUID,
|
||||
SortKey,
|
||||
Temperature_EXP,
|
||||
Text_L1,
|
||||
Text_L2,
|
||||
Time_EXP,
|
||||
Version
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<Popup x:Class="DTS.Common.Controls.LookupPopup"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:DTS.Common.Controls"
|
||||
xmlns:strings="clr-namespace:DTS.Common.Strings"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Opened="LookupPopup_OnOpenedClosed"
|
||||
Closed="LookupPopup_OnOpenedClosed"
|
||||
x:Name="lookupPopup">
|
||||
<Popup.Resources>
|
||||
<!--<local:BooleanOrMultiConverter x:Key="BooleanOrMultiConverter" />-->
|
||||
</Popup.Resources>
|
||||
<!--<Popup.Style>
|
||||
<Style TargetType="Popup">
|
||||
<Setter Property="IsOpen" Value="False"/>
|
||||
<Style.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding ShowChannelCodeLookupHelper}" Value="True" />
|
||||
<Condition Value="True">
|
||||
<Condition.Binding>
|
||||
<MultiBinding Converter="{StaticResource BooleanOrMultiConverter}">
|
||||
<Binding ElementName="MainEditBox" Path="IsKeyboardFocused" />
|
||||
<Binding ElementName="ISOPopup" Path="IsMouseOver" />
|
||||
<Binding ElementName="ISOPopup" Path="IsKeyboardFocusWithin" />
|
||||
<Binding ElementName="LookupPopup" Path="IsKeyboardFocusWithin"/>
|
||||
</MultiBinding>
|
||||
</Condition.Binding>
|
||||
</Condition>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="IsOpen" Value="True" />
|
||||
</MultiDataTrigger>
|
||||
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Popup.Style>-->
|
||||
<Border Background="#FFEEEEEE" BorderBrush="#FF888888" BorderThickness="1" DataContext="{Binding ElementName=lookupPopup}">
|
||||
<StackPanel>
|
||||
<DataGrid x:Name="possibleChannels"
|
||||
ItemsSource="{Binding PossibleChannels}"
|
||||
VirtualizingPanel.IsVirtualizing="True" EnableRowVirtualization="True"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
SelectionMode="Single"
|
||||
MouseDoubleClick="PossibleChannels_OnMouseDoubleClick"
|
||||
MaxHeight="350"
|
||||
AutomationProperties.AutomationId="CCB_LookupPopupPossibleChannelsDataGrid">
|
||||
<DataGrid.Style>
|
||||
<Style TargetType="{x:Type DataGrid}" BasedOn="{StaticResource {x:Type DataGrid}}">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding PossibleChannels.Count}" Value="0">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Style>
|
||||
</DataGrid>
|
||||
<TextBlock Text="{x:Static strings:Strings.NoChannelCodes}" Padding="5"
|
||||
AutomationProperties.AutomationId="CCB_LookupPopupNoChannelsLabel">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding PossibleChannels.Count}" Value="0">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class GalleryData : ControlData
|
||||
{
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
public ObservableCollection<GalleryCategoryData> CategoryDataCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_controlDataCollection != null) return _controlDataCollection;
|
||||
_controlDataCollection = new ObservableCollection<GalleryCategoryData>();
|
||||
|
||||
var smallImage = new Uri("/Common;component/RibbonControl/Images/Paste_16x16.png", UriKind.Relative);
|
||||
var largeImage = new Uri("/Common;component/RibbonControl/Images/Paste_32x32.png", UriKind.Relative);
|
||||
|
||||
for (var i = 0; i < ViewModelData.GalleryCategoryCount; i++)
|
||||
{
|
||||
_controlDataCollection.Add(new GalleryCategoryData()
|
||||
{
|
||||
Label = "GalleryCategory " + i,
|
||||
SmallImage = smallImage,
|
||||
LargeImage = largeImage,
|
||||
ToolTipTitle = "ToolTip Title",
|
||||
ToolTipDescription = "ToolTip Description",
|
||||
ToolTipImage = smallImage,
|
||||
Command = ViewModelData.DefaultCommand
|
||||
});
|
||||
}
|
||||
return _controlDataCollection;
|
||||
}
|
||||
}
|
||||
private ObservableCollection<GalleryCategoryData> _controlDataCollection;
|
||||
|
||||
public GalleryItemData SelectedItem
|
||||
{
|
||||
get => _selectedItem;
|
||||
set
|
||||
{
|
||||
if (_selectedItem != value)
|
||||
{
|
||||
_selectedItem = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("SelectedItem"));
|
||||
}
|
||||
}
|
||||
}
|
||||
GalleryItemData _selectedItem;
|
||||
|
||||
public bool CanUserFilter
|
||||
{
|
||||
get => _canUserFilter;
|
||||
|
||||
set
|
||||
{
|
||||
if (_canUserFilter == value) return;
|
||||
_canUserFilter = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("CanUserFilter"));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _canUserFilter;
|
||||
}
|
||||
|
||||
public class GalleryData<T> : ControlData
|
||||
{
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
public ObservableCollection<GalleryCategoryData<T>> CategoryDataCollection => _controlDataCollection ?? (_controlDataCollection = new ObservableCollection<GalleryCategoryData<T>>());
|
||||
|
||||
private ObservableCollection<GalleryCategoryData<T>> _controlDataCollection;
|
||||
|
||||
public T SelectedItem
|
||||
{
|
||||
get => _selectedItem;
|
||||
set
|
||||
{
|
||||
if (Equals(value, _selectedItem)) return;
|
||||
_selectedItem = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("SelectedItem"));
|
||||
}
|
||||
}
|
||||
T _selectedItem;
|
||||
|
||||
public bool CanUserFilter
|
||||
{
|
||||
get => _canUserFilter;
|
||||
|
||||
set
|
||||
{
|
||||
if (_canUserFilter == value) return;
|
||||
_canUserFilter = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("CanUserFilter"));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _canUserFilter;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
|
||||
namespace DTS.Common.Classes.ClockSync
|
||||
{
|
||||
/// <summary>
|
||||
/// this converter is used for displaying StreamingFilterCollection/array in property grids
|
||||
/// </summary>
|
||||
public class ClockSyncProfileConverter : ArrayConverter
|
||||
{
|
||||
private ClockSyncProfileCollection _collection = null;
|
||||
private static readonly object MyLock = new object();
|
||||
private ClockSyncProfile[] _values = null;
|
||||
private ClockSyncProfileCollection GetCollection()
|
||||
{
|
||||
lock (MyLock)
|
||||
{
|
||||
if (null == _collection)
|
||||
{
|
||||
_collection = ClockSyncProfileCollection.GetCollection();
|
||||
}
|
||||
return _collection;
|
||||
}
|
||||
}
|
||||
public ClockSyncProfile[] Values
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (MyLock)
|
||||
{
|
||||
if (null == _values)
|
||||
{
|
||||
var collection = GetCollection();
|
||||
|
||||
var list = new List<ClockSyncProfile>();
|
||||
using (var e = collection.GetEnumerator())
|
||||
{
|
||||
while (e.MoveNext())
|
||||
{
|
||||
if( null != e.Current && e.Current.Visible)
|
||||
{
|
||||
list.Add(e.Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
list.Sort((x,y) => { return x.DisplayOrder.CompareTo(y.DisplayOrder); });
|
||||
_values = list.ToArray();
|
||||
}
|
||||
}
|
||||
return _values;
|
||||
}
|
||||
}
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
if (sourceType == typeof(string)) { return true; }
|
||||
return base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
var result = Array.Find(Values, x => x.ProfileName == (string)value);
|
||||
if (result != null) { return result; }
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
var collection = GetCollection();
|
||||
return new StandardValuesCollection(collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
using DTS.Common.Interface.DataRecorders;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data;
|
||||
|
||||
namespace DTS.Common.Classes.Hardware
|
||||
{
|
||||
/// <summary>
|
||||
/// representation of a DASChannel in the db
|
||||
/// <inheritdoc cref="IDASChannelDBRecord"/>
|
||||
/// </summary>
|
||||
public class DASChannelDBRecord : Common.Base.BasePropertyChanged, IDASChannelDBRecord
|
||||
{
|
||||
/// <summary>
|
||||
/// a string id for the hardware the channel belongs to
|
||||
/// (serialnumber_dastype)
|
||||
/// </summary>
|
||||
public string HardwareId { get; set; }
|
||||
[Key]
|
||||
[Column("DASChannelId")]
|
||||
/// <summary>
|
||||
/// the id/key of the DAS channel record in the db
|
||||
/// </summary>
|
||||
public int DaschannelId { get; set; }
|
||||
[Column("DASId")]
|
||||
/// <summary>
|
||||
/// the das db id of the Hardware this channel belongs to
|
||||
/// </summary>
|
||||
public int? Dasid { get; set; }
|
||||
|
||||
private int _channelIdx;
|
||||
/// <summary>
|
||||
/// the physical channel index of the channel among channels on the DAS
|
||||
/// </summary>
|
||||
public int ChannelIdx
|
||||
{
|
||||
get => _channelIdx;
|
||||
set => SetProperty(ref _channelIdx, value, "ChannelIdx");
|
||||
}
|
||||
/// <summary>
|
||||
/// BitMask indicating the supported bridges on a das by default (half (4) + full (8))bridge
|
||||
/// </summary>
|
||||
public const int DEFAULT_SUPPORTED_BRIDGES = 12;
|
||||
private int _supportedBridges = DEFAULT_SUPPORTED_BRIDGES;
|
||||
/// <summary>
|
||||
/// BitMask for bridges supported by the channel
|
||||
/// Bit 0 indicates IEPE
|
||||
/// Bit 1 indicates quarter bridge
|
||||
/// Bit 2 indicates half bridge
|
||||
/// Bit 3 indicates full bridge
|
||||
/// Bit 4 indicates digital input
|
||||
/// Bit 5 indicates squib fire
|
||||
/// Bit 6 indicates digital output
|
||||
/// Bit 7 indicates Half bridge signal plus (G5 signal plus)
|
||||
/// Bit 8 indicates RealTime Clock
|
||||
/// Bit 9 indicates UART
|
||||
/// </summary>
|
||||
public int SupportedBridges
|
||||
{
|
||||
get => _supportedBridges;
|
||||
set => SetProperty(ref _supportedBridges, value, "SupportedBridges");
|
||||
}
|
||||
/// <summary>
|
||||
/// BitMask indicating the supported excitations for a das channel by default
|
||||
/// (5V by default)
|
||||
/// </summary>
|
||||
public const int DEFAULT_SUPPORTED_EXCITATIONS = 16;
|
||||
private int _supporedExcitations = DEFAULT_SUPPORTED_EXCITATIONS;
|
||||
/// <summary>
|
||||
/// BitMask indicating what excitation options the channel supports
|
||||
/// Bit 0 indicates an invalid excitation (undefined)
|
||||
/// Bit 1 indicates 2V
|
||||
/// Bit 2 indicates 2.5V
|
||||
/// Bit 3 indicates 3V
|
||||
/// Bit 4 indicates 5V
|
||||
/// Bit 5 indicates 10V
|
||||
/// Bit 6 indicates 1V
|
||||
/// </summary>
|
||||
public int SupportedExcitations
|
||||
{
|
||||
get => _supporedExcitations;
|
||||
set => SetProperty(ref _supporedExcitations, value, "SupportedExcitations");
|
||||
}
|
||||
[Column("DASDisplayOrder")]
|
||||
private int _dasDisplayOrder;
|
||||
/// <summary>
|
||||
/// The display order of the channel among channels on the DAS
|
||||
/// note that the physical order of channels and the display order may not match for
|
||||
/// some hardware
|
||||
/// </summary>
|
||||
public int DASDisplayOrder
|
||||
{
|
||||
get => _dasDisplayOrder;
|
||||
set => SetProperty(ref _dasDisplayOrder, value, "DASDisplayOrder");
|
||||
}
|
||||
private bool _bLocalOnly;
|
||||
/// <summary>
|
||||
/// Indicates that record should be stored only in the local db and not propagated to a central db
|
||||
/// deprecated
|
||||
/// </summary>
|
||||
public bool LocalOnly
|
||||
{
|
||||
get => _bLocalOnly;
|
||||
set => SetProperty(ref _bLocalOnly, value, "LocalOnly");
|
||||
}
|
||||
/// <summary>
|
||||
/// Bitmask indicating the default supported digital input modes for a channel (CCNC)
|
||||
/// </summary>
|
||||
public const int DEFAULT_SUPPORTED_DI_MODES = 16;
|
||||
private int _supportedDigitalInputModes = DEFAULT_SUPPORTED_DI_MODES;
|
||||
/// <summary>
|
||||
/// BitMask indicating what Digital input modes are supported on the channel (if channel supports digital input bridge type)
|
||||
/// Bit 0 indicates an invalid mode
|
||||
/// Bit 1 indicates Transition low to high (TLH)
|
||||
/// Bit 2 indicates Transition high to low (THL)
|
||||
/// Bit 3 indicates Contact closure normally open (CCNO)
|
||||
/// Bit 4 indicates Contact closure normally closed (CCNC)
|
||||
/// </summary>
|
||||
public int SupportedDigitalInputModes
|
||||
{
|
||||
get => _supportedDigitalInputModes;
|
||||
set => SetProperty(ref _supportedDigitalInputModes, value, "SupportedDigitalInputModes");
|
||||
}
|
||||
/// <summary>
|
||||
/// BitMask indicating the default squib fire modes supported by a channel (note that 16 is invalid, but
|
||||
/// I'm preserving what is in the existing code)
|
||||
/// </summary>
|
||||
public const int DEFAULT_SQUIB_FIRE_MODES = 16;
|
||||
private int _supportedSquibFireModes = DEFAULT_SQUIB_FIRE_MODES;
|
||||
/// <summary>
|
||||
/// BitMask indicating what Squib fire modes are supported on the channel (if the channel supports squib fire bridge type)
|
||||
/// Bit 0 indicates an invalid mode (fire mode not set)
|
||||
/// Bit 1 indicates capacitor discharge
|
||||
/// Bit 2 indicates constant current
|
||||
/// Bit 3 indicates AC discharge
|
||||
/// </summary>
|
||||
public int SupportedSquibFireModes
|
||||
{
|
||||
get => _supportedSquibFireModes;
|
||||
set => SetProperty(ref _supportedSquibFireModes, value, "SupportedSquibFireModes");
|
||||
}
|
||||
/// <summary>
|
||||
/// Default digital output mode for channels 16 doesn't exist, but I'm preserving the existing behavior values
|
||||
/// </summary>
|
||||
public const int DEFAULT_SUPPORTED_DO_MODES = 16;
|
||||
private int _supportedDigitalOutputModes = DEFAULT_SUPPORTED_DO_MODES;
|
||||
|
||||
/// <summary>
|
||||
/// BitMask indicating what digital output modes are supported on the channel (if the channel supports digital output bridge type)
|
||||
/// Bit 0 indicates 5V low to high (FVLH)
|
||||
/// Bit 1 indicates 5V high to low transition (FVHL)
|
||||
/// Bit 2 indicates contact closure normally open (CCNO)
|
||||
/// Bit 3 indicates contact closure normally closed (CCNC)
|
||||
/// </summary>
|
||||
public int SupportedDigitalOutputModes
|
||||
{
|
||||
get => _supportedDigitalOutputModes;
|
||||
set => SetProperty(ref _supportedDigitalOutputModes, value, "SupportedDigitalOutputModes");
|
||||
}
|
||||
[StringLength(16)]
|
||||
protected string _moduleSerialNumber = "";
|
||||
/// <summary>
|
||||
/// Serial number of module channel belongs to
|
||||
/// </summary>
|
||||
public string ModuleSerialNumber
|
||||
{
|
||||
get => _moduleSerialNumber;
|
||||
set => SetProperty(ref _moduleSerialNumber, value, "ModuleSerialNumber");
|
||||
}
|
||||
public int SettingId { get; set; }
|
||||
protected int _moduleArrayIndex;
|
||||
/// <summary>
|
||||
/// Array index of module among modules on a DAS or Rack
|
||||
/// </summary>
|
||||
public int ModuleArrayIndex
|
||||
{
|
||||
get => _moduleArrayIndex;
|
||||
set => _moduleArrayIndex = value;
|
||||
}
|
||||
public DASChannelDBRecord() { }
|
||||
/// <summary>
|
||||
/// constructor using a datareader to retrieve values
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
public DASChannelDBRecord(IDataReader reader)
|
||||
{
|
||||
HardwareId = Utility.GetString(reader, "HardwareId", string.Empty);
|
||||
ChannelIdx = Utility.GetInt(reader, "ChannelIdx", -1);
|
||||
SupportedBridges = Utility.GetInt(reader, "SupportedBridges", DEFAULT_SUPPORTED_BRIDGES);
|
||||
SupportedExcitations = Utility.GetInt(reader, "SupportedExcitations", DEFAULT_SUPPORTED_EXCITATIONS);
|
||||
SupportedDigitalInputModes = Utility.GetInt(reader, "SupportedDigitalInputModes", DEFAULT_SUPPORTED_DI_MODES);
|
||||
SupportedDigitalOutputModes = Utility.GetInt(reader, "SupportedDigitalOutputModes", DEFAULT_SUPPORTED_DO_MODES);
|
||||
SupportedSquibFireModes = Utility.GetInt(reader, "SupportedSquibFireModes", DEFAULT_SQUIB_FIRE_MODES);
|
||||
DASDisplayOrder = Utility.GetInt(reader, "DASDisplayOrder", 0);
|
||||
ModuleSerialNumber = Utility.GetString(reader, "ModuleSerialNumber", string.Empty);
|
||||
LocalOnly = Utility.GetBool(reader, "LocalOnly", false);
|
||||
ModuleArrayIndex = Utility.GetInt(reader, "ModuleArrayIndex", -1);
|
||||
}
|
||||
/// <summary>
|
||||
/// copy constructor
|
||||
/// </summary>
|
||||
/// <param name="copy"></param>
|
||||
public DASChannelDBRecord(IDASChannelDBRecord copy)
|
||||
{
|
||||
HardwareId = copy.HardwareId;
|
||||
ChannelIdx = copy.ChannelIdx;
|
||||
SupportedBridges = copy.SupportedBridges;
|
||||
SupportedExcitations = copy.SupportedExcitations;
|
||||
SupportedDigitalInputModes = copy.SupportedDigitalInputModes;
|
||||
SupportedDigitalOutputModes = copy.SupportedDigitalOutputModes;
|
||||
SupportedSquibFireModes = copy.SupportedSquibFireModes;
|
||||
DASDisplayOrder = copy.DASDisplayOrder;
|
||||
ModuleSerialNumber = copy.ModuleSerialNumber;
|
||||
LocalOnly = copy.LocalOnly;
|
||||
ModuleArrayIndex = copy.ModuleArrayIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user