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,13 @@
using DTS.Common.Base;
using DTS.Common.Enums;
namespace DTS.Common.Interface.Groups.GroupChannelList
{
/// <summary>
/// view for group channels
/// </summary>
public interface IGroupChannelListView:IBaseView
{
void HandleColumns(IsoViewMode viewMode);
}
}

View File

@@ -0,0 +1,182 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DTS.Common.Base;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Enums.Sensors.SensorsList;
using DTS.Common.Interface.Channels;
using DTS.Common.Interface.Channels.ChannelCodes;
using DTS.Common.Interface.DataRecorders;
using DTS.Common.Interface.Groups.GroupList;
using DTS.Common.Interface.Pagination;
using DTS.Common.Interface.Sensors;
using DTS.Common.Interface.TestSetups.TestSetupsList;
namespace DTS.Common.Interface.Groups.GroupChannelList
{
/// <summary>
/// this class describes the view module for the group import module
/// this handles interaction betweens the views and the application, as well as
/// the logic and intermediate data for the module
/// </summary>
public interface IGroupChannelListViewModel : IBaseViewModel, IFilterableListView
{
IGroupChannelListView View { get; set; }
IGroupChannelSettingsListView SettingsView { get; set; }
/// <summary>
/// populates the channels to be displayed in views
/// </summary>
/// <param name="page"></param>
/// <param name="sensorLookup"></param>
/// <param name="hardwareLookup"></param>
/// <param name="channelDefaults"></param>
/// <returns></returns>
IDictionary<IGroup, Channels.IGroupChannel[]> PopulateChannels(object page,
IDictionary<int, ISensorData> sensorLookup,
IDictionary<int, IDASHardware> hardwareLookup,
IChannelSetting[] channelDefaults,
bool allowChannelDeletionByNonAdminUser = true,
bool userIsAdmin = true,
bool allowSensorPushAndPull = false,
bool keepExistingChannels = false,
bool allowChannelDeletionFromFixedGroup = true);
/// <summary>
/// whether voltage insertion channels should be created when dragging on an analog hardware channel onto
/// a blank channel with no sensor set yet
/// </summary>
bool CreateVoltageInputChannels { get; set; }
/// <summary>
/// Check to see if any of the channel's values that can be modified
/// in the Parameters step are different than the corresponding
/// sensor's values in the sensor database, so that they can be
/// decorated, along with the Parameters step (FB 15245)
/// </summary>
/// <param name="ch"></param>
/// <returns></returns>
bool CompareAndMarkChannelParameters(Channels.IGroupChannel ch);
/// <summary>
/// any work that needs to be done when a view is loaded
/// </summary>
void OnSetActive();
/// <summary>
/// any work that needs to be done when view is unloaded
/// </summary>
void Unset();
/// <summary>
/// filters content on the screen given a string term
/// </summary>
/// <param name="term"></param>
void Filter(string term);
/// <summary>
/// The format of a string double (usually "N2")
/// </summary>
string CapacityFormat { get; set; }
/// <summary>
/// All available channels [prior to filtering/searching/sorting]
/// </summary>
List<Channels.IGroupChannel> AllChannels { get; }
Func<IList<IChannelCode>> ChannelCodesFunc { get; }
/// <summary>
/// channels displayed in channel list view
/// </summary>
ObservableCollection<Channels.IGroupChannel> Channels { get; set; }
/// <summary>
/// channels display in settings view, essentially the same as channels
/// but snap-shot in onsetactive with just the blank channels removed
/// </summary>
ObservableCollection<Channels.IGroupChannel> SettingChannels { get; set; }
/// <summary>
/// indicates that the attached SettingsView has loaded
/// </summary>
bool SettingsViewLoaded { get; set; }
/// <summary>
/// indicates that the SettingChannel UI elements were created
/// </summary>
bool SettingChannelsLoaded { get; set; }
/// <summary>
/// group being viewed (when editing a group)
/// </summary>
IGroup Group { get; set; }
/// <summary>
/// test setup being viewed (when editing a test setup)
/// </summary>
ITestSetup TestSetup { get; set; }
//whether to always match the CFC to the iso code and vice versa
bool UseISOCodeFilterMapping { get; set; }
/// <summary>
/// sets which typeof channels are displayed by sensor type
/// </summary>
/// <param name="bridgeFilter"></param>
void SetFilter(PossibleFilters bridgeFilter);
/// <summary>
/// indicates whether to show isocodes
/// </summary>
bool ShowISOCodes { get; }
/// <summary>
/// indicates whether to show user codes
/// </summary>
bool ShowUserCodes { get; }
/// <summary>
/// indicates whether to show Dallas Id column or not
/// http://manuscript.dts.local/f/cases/31802/Add-Dallas-ID-column-to-quickcheckout
/// </summary>
bool ShowDallasIdColumn { get; set; }
/// <summary>
/// gets/sets what the iso view mode is
/// </summary>
IsoViewMode ISOViewMode { get; set; }
bool ShowISOStringBuilder { get; set; }
/// <summary>
/// gets/sets whether complete and unique isocodes are required
/// </summary>
bool UniqueISOCodesRequired { get; set; }
bool ShowChannelCodeLookupHelper { get; set; }
bool UseTestSetupOrder { get; }
bool ShowSensorChannelUserValues { get; set; }
void MoveDown(Channels.IGroupChannel [] channel);
void MoveBottom(Channels.IGroupChannel [] channel);
void MoveUp(Channels.IGroupChannel [] channel);
void MoveTop(Channels.IGroupChannel [] channel);
void Filter(PossibleFilters filter);
void AddChannels(DTS.Common.Interface.Sensors.SensorsList.IDragAndDropItem[] sensors);
void AddChannels(IHardwareChannel[] hardwareChannels);
void AddChannels(Channels.IGroupChannel[] groupChannels);
void Remove(Channels.IGroupChannel channel, bool notifyChanged = true);
IGroup CreateGroupIfNeeded(ITestSetup testSetup, string groupName);
//used to count channels for the label at the top of the view
void SetIncludedHardware(IDASHardware[] hardwares);
/// <summary>
/// modifies how meta data is handled when sensors are dragged onto channels without sensors
/// </summary>
bool ApplySensorDataToBlankChannels { get; set; }
bool AllowChannelDeletionByNonAdminUser { get; set; }
bool UserIsAdmin { get; set; }
bool AllowSensorPushAndPull { get; set; }
/// <summary>
/// sets the range of all analog sensors according to input
/// </summary>
/// <param name="option"></param>
void SetRange(CACOption option);
/// <summary>
/// sets the view (settings)
/// </summary>
/// <param name="columnTag"></param>
/// <param name="bUserClick"></param>
void Sort(object columnTag, bool bUserClick);
bool ReadOnlyParametersMode { get; set; }
bool ReadOnlyChannelsMode { get; set; }
int UserID { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
using DTS.Common.Base;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
namespace DTS.Common.Interface.Groups.GroupChannelList
{
/// <summary>
/// view for group channels
/// </summary>
public interface IGroupChannelSettingsListView:IBaseView
{
/// <summary>
/// sets whether to use columns for group order or test setup order
/// </summary>
/// <param name="bUseTestSetupOrder"></param>
void SetOrderMode( bool bUseTestSetupOrder );
/// <summary>
/// sets whether to show User Value X columns
/// </summary>
/// <param name="bShowSensorChannelUserValues"></param>
void SetDisplayOptions(bool bShowSensorChannelUserValues);
/// <summary>
/// sets which columns to use given an iso view mode
/// </summary>
/// <param name="viewMode"></param>
void HandleColumns(IsoViewMode viewMode);
/// <summary>
/// sets which columns to use given a sensor type
/// </summary>
/// <param name="filterMode"></param>
void SetFilterMode(PossibleFilters filterMode);
/// <summary>
/// stores the minimum client db version associated with data in the view
/// used to hide or disable properties/features
/// </summary>
int ViewDbVersion { get; set; }
}
}

View File

@@ -0,0 +1,75 @@
using DTS.Common.Interface.Channels;
using DTS.Common.Interface.DataRecorders;
using DTS.Common.Interface.Sensors;
using System;
using System.Collections.Generic;
using DTS.Common.Interface.TestSetups.TestSetupsList;
namespace DTS.Common.Interface.Groups.GroupList
{
public interface IGroup: IComparable<IGroup>
{
IGroupDbRecord GetIGroupDbRecord();
int ChannelCount { get; set; }
int Id { get; set; }
string Name { get; set; }
string DisplayName { get; set; }
int? StaticGroupId { get; set; }
string Description { get; set; }
bool Embedded { get; set; }
DateTime LastModified { get; set; }
string LastModifiedBy { get; set; }
/// <summary>
/// returns true if group matches search term
/// false otherwise
/// </summary>
/// <param name="term"></param>
/// <returns></returns>
bool Filter(string term);
int [] IncludedHardware { get; set; }
//holds a list of hardware identified using the old SerialNumber_type id scheme
//I believe this is primarily for import purposes.
string [] IncludedHardwareStringList { get; set; }
bool Save(Channels.IGroupChannel [] groupChannels, bool canUserCommitChannelCodes);
void ClearGroupChannelSettingCache(long groupId);
Channels.IGroupChannel[] GetAllChannels(bool bEditable, IDictionary<int, ISensorData> sensorLookup,
IDictionary<int, IDASHardware> hardwareLookup, IChannelSetting [] channelDefaults, bool allowSensorPushAndPull = false);
void LoadHardware();
void ConvertToEmbedded(Channels.IGroupChannel [] groupChannels);
void DeterminePositionAndTestObject(Channels.IGroupChannel[] channels);
bool PositionIsMixed { get; set; }
bool PositionIsTextbox { get; set; }
bool PositionIsCombobox { get; set; }
string Position { get; set; }
bool TestObjectIsMixed { get; set; }
string TestObject { get; set; }
int DisplayOrder { get; set; }
ISensorData GetSensor(Channels.IGroupChannel channel, ISensorData sensorData, bool bUseIsoFilter);
void SetSensor(Channels.IGroupChannel channel, ISensorData sensorData);
void WriteXML(ref System.Xml.XmlWriter writer);
IGroup ReadXML(System.Xml.XmlElement node, Dictionary<long, DTS.Common.Interface.Channels.IGroupChannel> channelLookup, List<ISensorData> sensors);
List<Channels.IGroupChannel> GroupChannelList { get; set; }
/// <summary>
/// sets the included hardware property and the _bloaded property
/// </summary>
/// <param name="hardware"></param>
void SetIncludedHardware(int[] hardware);
List<TestSetupParentHelper> AssociatedTestSetups { get; set; }
void SetTestSetupLists();
bool StaticGroupIsEqual();
bool IsDifferentThanStaticGroup { get; set; }
bool TagCompatible(int[] tags);
int[] TagIDs { get; set; }
string GetTagsAsCommaSeparatedString(Classes.Tags.TagsInstance.TagsGetDelegate tagsGet);
string Tags { get; set; }
List<string> AvailableTestObjects { get; set; }
string SelectedTestObjectItem { get; set; }
List<string> AvailablePositions { get; set; }
string SelectedPositionItem { get; set; }
}
}

View File

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

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
using DTS.Common.Base;
using DTS.Common.Interface.Groups.GroupTemplateList;
using DTS.Common.Interface.Pagination;
namespace DTS.Common.Interface.Groups.GroupList
{
public interface IGroupListViewModel : IBaseViewModel, IFilterableListView
{
IGroupListView View { get; set; }
void Unset();
void Sort(object o, bool columnClick);
IGroup [] Groups { get; set; }
void OnSetActive(object page, bool groupTile, object currentUser);
void MouseDoubleClick(int index);
void Filter(string term);
IGroup GetGroup(int? id, bool updateTags = true);
IGroup GetGroup(string displayName);
IGroup [] GetGroups(int[] ids);
IGroup[] GetAllGroups();
void DeleteGroups(int[] ids);
IGroup CreateGroup();
IGroup CreateGroup(List<string> includedHardwareStringList);
IGroup CreateGroup(System.Data.SqlClient.SqlDataReader reader, List<string> includedHardwareStringList, List<int> dasIdList);
IGroup CreateGroup(IGroupDbRecord groupRecord, List<string> includedHardwareStringList, List<int> dasIdList);
}
}

View File

@@ -0,0 +1,13 @@
namespace DTS.Common.Interface.Groups.GroupList
{
public class TestSetupParentHelper
{
public int Id;
public string Name { get; set;}
public bool Modified { get; set;}
public override string ToString()
{
return Name;
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using DTS.Common.Interface.GroupTemplate;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// represents a channel in a group (logical channel)
/// can be associated with a physical hardware channel and/or a sensor
/// [THIS IS FOR THE OLD (PRE 2.0) TESTOBJECT CHANNELS]
/// </summary>
public interface IGroupChannel : IGroupTemplateChannel, IComparable<IGroupChannel>
{
/// <summary>
/// controls whether channel should be used when collecting data or not
/// Disabled channels are not used in run test
/// </summary>
bool Disabled { get; set; }
int ChannelIdx { get; set; }
/// <summary>
/// the serial number of the sensor associated with this channel (if any)
/// </summary>
string SensorSerialNumber { get; set; }
/// <summary>
/// the hardware channel associated with this channel
/// </summary>
string HardwareId { get; set; }
}
}

View File

@@ -0,0 +1,46 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// Interface describing a Group in the Db
/// </summary>
public interface IGroupDbRecord
{
[Key]
[Column("Id")]
/// <summary>
/// The id/key of the Group record in the db
/// </summary>
int Id { get; set; }
[Column("SerialNumber")]
string SerialNumber { get; set; }
[Column("Picture")]
string Picture { get; set; }
[Column("DisplayName")]
string DisplayName { get; set; }
[Column("Description")]
string Description { get; set; }
[Column("Embedded")]
bool Embedded { get; set; }
[Column("LastModified")]
DateTime LastModified { get; set; }
[Column("LastModifiedBy")]
string LastModifiedBy { get; set; }
[Column("StaticGroupId")]
int? StaticGroupId { get; set; }
[Column("ExtraProperties")]
string ExtraProperties { get; set; }
}
}

View File

@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// Interface describing a GroupHardware record in the Db
/// </summary>
public interface IGroupHardwareDbRecord
{
[Key]
[Column("Id")]
/// <summary>
/// The id/key of the GroupHardware record in the db
/// </summary>
int Id { get; set; }
[Column("GroupId")]
int GroupId { get; set; }
[Column("DASId")]
int DASId { get; set; }
[Column("SerialNumber")]
string SerialNumber { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using DTS.Common.Base;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// the importview is responsible for presenting feedback of progress while creating and commiting groups
/// </summary>
public interface IGroupImportImportView:IBaseView
{
}
}

View File

@@ -0,0 +1,19 @@
using System.Collections.Generic;
using DTS.Common.Base;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// the options view controls selecting files and validating the selection
/// </summary>
public interface IGroupImportOptionsView:IBaseView
{
/// <summary>
/// returns true if files have been selected, false if files are not selected
/// </summary>
/// <param name="errors">any errors that were detected during validation</param>
/// <param name="warnings">any warnings that were detected during validation</param>
/// <returns></returns>
bool Validate(out List<string> errors, out List<string> warnings);
}
}

View File

@@ -0,0 +1,21 @@
using System.Collections.Generic;
using DTS.Common.Base;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// controls parsing out channels from .GRP file, displaying results, and allowing selection of groups and renaming of groups
/// </summary>
public interface IGroupImportPreviewView:IBaseView
{
/// <summary>
/// validates currently selected groups, including channels and group names
/// </summary>
/// <param name="errors">any errors that were detected during validation. Errors indicate you can not continue</param>
/// <param name="warnings">any warnings that were detected during validation. Warnings are not fatal and user can continue
/// if they want
/// </param>
/// <returns>true if all groups selected in preview are valid, false if there are invalid groups selected</returns>
bool Validate(bool userIsAdmin, out List<string>errors, out List<string> warnings);
}
}

View File

@@ -0,0 +1,149 @@
using DTS.Common.Base;
using DTS.Common.Enums.Groups;
using DTS.Common.Interface.Channels;
using DTS.Common.Utils;
using System.Windows.Media;
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// this class describes the view module for the group import module
/// this handles iteraction betweens the views and the application, as well as
/// the logic and intermediate data for the module
/// </summary>
public interface IGroupImportViewModel : IBaseViewModel
{
void SetStatus(string message, Color color);
/// <summary>
/// options view controls selecting files
/// </summary>
IGroupImportOptionsView ImportOptionsView { get; set; }
/// <summary>
/// preview view handles selecting groups and viewing channels in a .grp file
/// </summary>
IGroupImportPreviewView ImportPreviewView { get; set; }
/// <summary>
/// handles commiting and displaying progress as commiting groups
/// </summary>
IGroupImportImportView ImportView { get; set; }
/// <summary>
/// reads source files and parses out channels and groups
/// </summary>
void ParseSourceFiles(string userTags);
/// <summary>
/// commits groups and channels to application
/// </summary>
void Import();
/// <summary>
/// resets the view model to initial values
/// we are currently not creating a new viewmodel in the page, but re-using an existing one
/// so everytime we re-visit the page we must re-initialize the vm
/// </summary>
void Reset();
/// <summary>
/// logging facility to log any messages to
/// </summary>
FileUtils.LogDelegate Logger { get; set; }
/// <summary>
/// nav steps exist outside the group import module, and inside
/// the application itself
/// this is the function that allows the module to change nav steps
/// </summary>
SwitchNavStepsDelegate SwitchNavSteps { get; set; }
/// <summary>
/// this provides a function for checking whether a group already exists in the application or not
/// </summary>
CheckGroupExistsDelegate CheckGroupExists { get; set; }
/// <summary>
/// this provides a function for checking whether a sensor already exists in the application or not
/// </summary>
CheckSensorExistsDelegate CheckSensorExists { get; set; }
/// <summary>
/// as groups exist in the application space currently, we need the application to actually create a group
/// this is the function that lets the module invoke creating a group
/// </summary>
CreateGroupDelegate CreateGroup { get; set; }
/// <summary>
/// as groups exist in the application space currently, we need the application to actually create channels in a group
/// this is the function that lets the module invoke adding a channel to a group
/// </summary>
AddChannelToGroupDelegate AddChannel { get; set; }
/// <summary>
/// as groups exist in the application space currently, we need the application to actually commit groups to the database
/// this is the function that lets the module invoke commiting a group to the db
/// </summary>
CommitGroupsDelegate CommitGroups { get; set; }
/// <summary>
/// allows the module to disable the UI
/// </summary>
Disable_UIDelegate DisableUI { get; set; }
/// <summary>
/// allows the module to enable the UI
/// </summary>
Enable_UIDelegate EnableUI { get; set; }
bool BrowseOk { get; set; }
}
/// <summary>
/// delegate describing a method of switching navigation steps
/// </summary>
/// <param name="step">step to switch to</param>
public delegate void SwitchNavStepsDelegate(GroupImportEnums.Steps step);
/// <summary>
/// delegate describing a method of checking if a group exists
/// </summary>
/// <param name="name">group serial number/name to check for</param>
/// <returns></returns>
public delegate bool CheckGroupExistsDelegate(string name);
/// <summary>
/// delegate describing a method of checking if a sensor exists
/// </summary>
/// <param name="serialNumber">serial number of sensor to check for</param>
/// <returns></returns>
public delegate bool CheckSensorExistsDelegate(string serialNumber);
/// <summary>
/// delegate describing a method for creating a group
/// </summary>
/// <param name="serialNumber">serial number of new group</param>
/// <param name="tags">tags that will be added to new group</param>
public delegate void CreateGroupDelegate(string serialNumber, string tags);
/// <summary>
/// adds a channel to a group
/// channels are added to the end of the groups existing channels
/// </summary>
/// <param name="groupSerialNumber">group serial number/name to add channel to</param>
/// <param name="displayName">the display name of the channel</param>
/// <param name="sensorSerialNumber">the sensor serial number of the sensor on the channel</param>
/// <param name="capacity">null if the sensor capacity should be used, otherwise the desired range for the channel</param>
/// <param name="invert">null if the sensor invert setting should be used, otherwise the desired invert settings for the channel</param>
public delegate void AddChannelToGroupDelegate(string groupSerialNumber, string displayName,
string sensorSerialNumber, double? capacity, bool? invert, string isoCode, IChannelSetting [] channelDefaults);
/// <summary>
/// delegate describing a method for commiting a group to the database
/// </summary>
/// <param name="serialNumber"></param>
public delegate void CommitGroupsDelegate(string [] serialNumbers);
public delegate void Disable_UIDelegate();
public delegate void Enable_UIDelegate();
}

View File

@@ -0,0 +1,37 @@
using System;
using DTS.Common.Interface.GroupTemplate;
namespace DTS.Common.Interface.Groups
{
public interface ITestObject
{
void SortChannels();
string DisplaySerialNumber { get; }
string SerialNumberConverted { get; set; }
string SerialNumber { get; set; }
string SerialNumberOrOriginalSerialNumber { get; }
string TestObjectType { get; set; }
string ParentObject { get; set; }
bool SysBuilt { get; set; }
string TextL1 { get; set; }
string[] HardwareIds
{
get; set;
}
string Template { get; set; }
void SetTemplateOnly(string value);
bool LocalOnly { get; set; }
string LastModifiedBy { get; set; }
DateTime LastModified { get; set; }
bool Embedded { get; set; }
string OriginalSerialNumber { get; set; }
/// <summary>
/// the original template for this group (the template is also changed once it's embedded in a test setup)
/// </summary>
string OriginalTemplate { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
namespace DTS.Common.Interface.Groups
{
/// <summary>
/// describes a record in the database for a test setup group
/// </summary>
public interface ITestSetupGroupRecord
{
/// <summary>
/// database id of group
/// </summary>
int GroupId { get; set; }
/// <summary>
/// display order of group
/// </summary>
int DisplayOrder { get; set; }
/// <summary>
/// Position field (ISO 13499) for group, if available
/// [groups can be made of mixed position fields]
/// </summary>
string Position { get; set; }
/// <summary>
/// Test Object field (ISO 13499) for group, if available
/// [groups can be made of mixed test object fields]
/// </summary>
string TestObjectType { get; set; }
/// <summary>
/// database id of test setup group belongs to
/// </summary>
int TestSetupId { get; set; }
}
}