Files
DP44/Common/DTS.Common/.svn/pristine/d7/d7dd784f96668a5db1c89504e6154fdf4064f693.svn-base

370 lines
14 KiB
Plaintext
Raw Normal View History

2026-04-17 14:55:32 -04:00
using DTS.Common.Interface.DASFactory;
using DTS.Common.Interface.DataRecorders;
using DTS.Common.Interface.Groups.GroupList;
using DTS.Common.Interface.Sensors;
using System;
using System.Collections.Generic;
namespace DTS.Common.Interface.TestSetups.TestSetupsList
{
/// <summary>
/// this is an interface to the Heavy Test Setup class
/// </summary>
public interface ITestTemplate : ITestSetup
{
bool LowgLevelTriggersMixed { get; set; }
double LowgLinearLevelTriggerAggregate { get; set; }
bool HighgLevelTriggersMixed { get; set; }
double HighgLinearLevelTriggerAggregate { get; set; }
bool AngularAccelLevelTriggersMixed { get; set; }
double AngularAccelLevelTriggerAggregate { get; set; }
bool AngularRateLevelTriggersMixed { get; set; }
double AngularRateLevelTriggerAggregate { get; set; }
/// <summary>
/// property used to indicate that the test is destructive or impact and should set the first use date
/// of any relevant sensors or DAS
/// 15524 DAS "First Use Date"
/// 44625 make it optional property , null shows it's not selected
/// note: this property is not serialized with the test setup, it's a run-time set property when
/// running the test
/// </summary>
bool? DestructiveTest { get; set; }
/// <summary>
/// removes the ids for this test template creating a copy without the id associations
/// </summary>
void CreateCopy();
void ClearHardware();
/// <summary>
/// returns true whenever the test template is a quick test setup, false otherwise
/// </summary>
bool QuickSensorCheck { get; set; }
#region Properties
bool ExpressTestSetup { get; set; }
bool PreserveTestId { get; set; }
/// <summary>
/// true if the test objects and other fields have already been loaded from the database, false otherwise
/// </summary>
bool IsLoaded { get; }
void SetIsLoaded(bool bIsLoaded);
bool ArmCheckListStep { get; set; }
bool CheckListBatteryVoltageCheck { get; set; }
bool CheckListInputVoltageCheck { get; set; }
bool CheckListSquibResistanceCheck { get; set; }
bool CheckListSensorIdCheck { get; set; }
bool CheckListRequirePass { get; set; }
bool CheckListTiltSensorCheck { get; set; }
bool CheckListTemperatureCheck { get; set; }
bool CheckListClockSyncCheck { get; set; }
Dictionary<string, double> FilterLookup { get; set; }
/// <summary>
/// excitation warmup time
/// can be defined at test level, test object level, (and maybe at hardware or channel level?)
/// if defined here, we return it right away, otherwise we pass it to the max of the test objets
/// </summary>
int ExcitationWarmupTimeMS { get; set; }
int GraphCount { get; }
string SetupFile { get; set; }
string TestId { get; set; }
string TestIdNode { get; set; }
string TestDirectory { get; set; }
string OriginalTestDirectory { get; set; }
string SampleRateText { get; set; }
List<string> CheckedDASList { get; set; }
bool GroupsStepValid { get; set; }
//assumes list is in order and sets display orders accordingly
void SetGroupsListOrder();
double MaxSampleRate { get; }
double MinSampleRate { get; }
string DownloadFolder { get; set; }
string ExportFolder { get; set; }
DateTime TestTime { get; set; }
int ChannelCount { get; }
int IncludedChannelCount { get; }
#endregion Properties
/// <summary>
/// if you use rename serial number method to create a new test setup, we have to go and recreate the groups.
/// groups are supposed to be unique to a test setup, and we don't want them to unintentionally share groups
/// <param name="bAddedGroups">whether operating on static or dynamic groups</param>
/// </summary>
void Rename(bool bAddedGroups);
int GetMaxDisplayOrder();
#region LEVEL_TRIGGER
/// <summary>
/// replaces any level triggers that have a specific id, with another
/// brand new id
/// </summary>
/// <param name="oldId"></param>
/// <param name="newId"></param>
void ReplaceLevelTriggerChannel(string oldId, string newId);
/// <summary>
/// scans through all level triggers, looks for any level triggers that might be associated with an old group serial number
/// and replaces those references with the new group serial number
/// </summary>
/// <param name="oldGroupSerial"></param>
/// <param name="newGroupSerial"></param>
void ReplaceLevelTriggerChannelGroupMapping(string oldGroupSerial, string newGroupSerial);
/// <summary>
/// updates the channel settings for groups which have changed serial numbers [rename/clone group]
/// 8404 Copy all channel parameters/settings/level triggers/graphs when cloning a test setup
/// </summary>
/// <param name="oldIdToNewIdLookup"></param>
/// <param name="oldGroupSnToNewGroupSn"></param>
void ReplaceChannelSetting(Dictionary<string, string> oldIdToNewIdLookup, Dictionary<string, string> oldGroupSnToNewGroupSn);
void ReplaceLevelTriggerChannel(Dictionary<string, string> oldIdToNewIdLookup, Dictionary<string, string> oldGroupSnToNewGroupSn);
void RenameLevelTriggerChannels(string oldName, string newName);
void RemoveImpossibleLevelTriggers();
#endregion LEVEL_TRIGGER
#region Sensor
/// <summary>
/// get sensor from sensor db again (but preserving custom values such as range/polarity/CFC/etc)
/// note, test objects already get sensors from from db every time. we hold onto them here, I guess for efficiency, but we could get them fresh every time as well
/// </summary>
void RefreshSensorsFromDb();
/// <summary>
/// sets a channel to be disabled
/// disabled channels don't appear in run test
/// </summary>
/// <param name="groupName"></param>
/// <param name="channelName"></param>
/// <param name="disabled"></param>
void SetDisabled(string groupName, string channelName, bool disabled);
//public SensorData GetSensor(IGroupChannel groupChannel)
//SensorData GetSensor(string serialNumber, string testObjectSerial, string channelName)
// FB5438 & FB5023
void RemoveSensor(string sensorserialnumber, string testobjectserial, string channelname);
#endregion Sensor
#region XML
/// <summary>
/// writes a test setup out to xml
/// </summary>
/// <param name="writer"></param>
void WriteXML(ref System.Xml.XmlWriter writer);
#endregion XML
void ReloadGroupsMemoryOnly();
/// <summary>
/// reloads static groups from list
/// </summary>
void ReloadGroups(bool bMemoryOnly);
bool CheckForIEPE();
/// <summary>
/// returns whether there is a TOM in the test setup or not
/// </summary>
/// <returns></returns>
bool CheckForTOM();
/// <summary>
/// returns whether there is a TOM with channels in use in the test setup or not
/// </summary>
/// <returns></returns>
bool CheckForTOMInTest();
/// <summary>
/// returns whether there is an analog channel in the test or not
/// </summary>
/// <returns></returns>
bool CheckForAnalog();
/// <summary>
/// sets the dirty flag
/// does NOT set the flag in the database, so this should only be called when the flag needs to be set in memory
/// (for instance during initialization)
/// </summary>
/// <param name="bDirty"></param>
void SetIsDirty(bool bDirty);
/// <summary>
/// sets the complete flag
/// does not set the flag in the database, so this should only be called when the flag needs to be set in memory
/// (for instance during initialization)
/// </summary>
/// <param name="bComplete"></param>
void SetIsComplete(bool bComplete);
/// <summary>
/// sets the completion error message.
/// does not set the field in the db, so this should only be called when the information nets to be set in memory and not the db
/// (for instance during initialization)
/// </summary>
/// <param name="msg"></param>
void SetCompletionErrorMessage(string msg);
double GetSampleRateForHardware(string h);
float GetAAFForHardware(IDASCommunication das);
float GetAAFForHardware(IDASCommunication das, int sps);
/// <summary>
/// returns the Anti-Alias Filter (AAF) for the DAS in question
/// this is dependent on the sample rate for the hardware and a ratio in the config file
/// (RealtimeSampleRateAAFilterRatio)
/// </summary>
/// <param name="das"></param>
/// <returns></returns>
float GetRealtimeAAFForHardware(IDASCommunication idas, double samplerate);
void SetDefaultSetupFile();
/// <summary>
/// calculates whether the test setup is complete or not
/// will cause the test setup to be loaded if it is not yet
/// does not unload the test setup
/// </summary>
void CalculateIsComplete(bool bSetInDb = true);
void CheckSensorCalDates();
/// <summary>
/// marks a test setup as unchecked by setting the dirty flag, which means the next time completion is checked it will be calculated again
/// this function will change that flag in the database immediately
/// </summary>
void MarkIsCompleteUnchecked(bool skipMemoryCheck = false);
void ClearOverrides();
/// <summary>
/// frees up the memory assigned during Load, this includes channels, groups, meta data, etc
/// various things may cause us to load the information and hold the information for some setups,
/// but in general we want to unload it if we don't need it
/// </summary>
void UnLoad();
/// <summary>
/// signifies if the test setup is being used for a quick checkout
/// quick checkout tests are not stored and are run time only
/// </summary>
bool IsQuickCheckout { get; set; }
void Load(bool fromDB = false);
/// <summary>
/// All items from db are updated in our cache
/// </summary>
void UpdateFromDb();
IDASHardware[] GetHardwareFromDb();
IDASHardware[] GetAllCachedHardware2();
ISensorCalibration[] GetCachedSensorCalibrations();
ISensorData[] GetCachedSensors();
/// <summary>
/// loads all the information for the test setup from tables in the db
/// we do this so that we can keep the minimal information on hand until we need it
/// </summary>
void LoadFromDb();
string GetTestIdNode();
/// <summary>
/// gets a serialized version of the settings table
/// </summary>
/// <returns></returns>
string GetSettings();
/// <summary>
/// loads values from a serialized string into the settings table
/// </summary>
/// <param name="s"></param>
void LoadSettings(string s);
bool CheckListTriggerStartCheck { get; set; }
void FilterTestObjects(string term);
int GetAbsoluteNumber(string serial, int dasChannelNumber);
double GetPreTriggerSeconds(string serial);
double GetPostTriggerSeconds(string serial);
int GetNumberOfRealtimeSupportedChannels();
/// <summary>
/// for some reason it seems custom and lab details are held in two different areas, in meta deta and in the custom/lab detail objects
/// this function merely synchronizes the meta data with the objects
/// </summary>
void SynchronizeTestMetaData();
#region CalculatedChannels
void UpdateCalculatedChannelId(string[] names, int[] newIds);
void UpdateCalculatedChannelId(string name, int newId);
void RemoveImpossibleCalculatedChannels();
void ReplaceCalculatedChannel(Dictionary<string, string> oldIdToNewIdLookup);
void RenameCalculatedChannels(string oldName, string newName);
#endregion CalculatedChannels
void SetHardwareOverride(string hid, bool bAdd);
/// <summary>
/// takes a dynamic group in the test and replaces it with a snapshot of the static group
/// also updates calculated channels and level trigger channels
/// 15400 Group Push/Pull should allow the LT to be preserved in the Test Setup regardless of push/pull
/// </summary>
/// <param name="_updateGroup"></param>
/// <param name="staticGroup"></param>
void UpdateDynamicGroupFromStaticGroup(IGroup _updateGroup, IGroup staticGroup);
#region MetaData
// FB14362 This method will keep the _metaDataLookup dictionary updated to prevent the missing data from database.
void UpdateMetaDataLookupKey(char oldKey, char newKey);
#endregion MetaData
void Rename(string newName);
}
}