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 { /// /// this is an interface to the Heavy Test Setup class /// 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; } bool StartWithEvent { get; set; } /// /// 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" /// note: this property is not serialized with the test setup, it's a run-time set property when /// running the test /// bool DestructiveTest { get; set; } /// /// removes the ids for this test template creating a copy without the id associations /// void CreateCopy(); void ClearHardware(); /// /// returns true whenever the test template is a quick test setup, false otherwise /// bool QuickSensorCheck { get; set; } #region Properties bool ExpressTestSetup { get; set; } bool PreserveTestId { get; set; } /// /// true if the test objects and other fields have already been loaded from the database, false otherwise /// 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 FilterLookup { get; set; } /// /// 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 /// 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 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 /// /// 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 /// whether operating on static or dynamic groups /// void Rename(bool bAddedGroups); int GetMaxDisplayOrder(); #region LEVEL_TRIGGER /// /// replaces any level triggers that have a specific id, with another /// brand new id /// /// /// void ReplaceLevelTriggerChannel(string oldId, string newId); /// /// 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 /// /// /// void ReplaceLevelTriggerChannelGroupMapping(string oldGroupSerial, string newGroupSerial); /// /// 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 /// /// /// void ReplaceChannelSetting(Dictionary oldIdToNewIdLookup, Dictionary oldGroupSnToNewGroupSn); void ReplaceLevelTriggerChannel(Dictionary oldIdToNewIdLookup, Dictionary oldGroupSnToNewGroupSn); void RenameLevelTriggerChannels(string oldName, string newName); void RemoveImpossibleLevelTriggers(); #endregion LEVEL_TRIGGER #region Sensor /// /// 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 /// void RefreshSensorsFromDb(); /// /// sets a channel to be disabled /// disabled channels don't appear in run test /// /// /// /// 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 /// /// writes a test setup out to xml /// /// void WriteXML(ref System.Xml.XmlWriter writer); #endregion XML void ReloadGroupsMemoryOnly(); /// /// reloads static groups from list /// void ReloadGroups(bool bMemoryOnly); bool CheckForIEPE(); /// /// returns whether there is a TOM in the test setup or not /// /// bool CheckForTOM(); /// /// returns whether there is a TOM with channels in use in the test setup or not /// /// bool CheckForTOMInTest(); /// /// returns whether there is an analog channel in the test or not /// /// bool CheckForAnalog(); /// /// 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) /// /// void SetIsDirty(bool bDirty); /// /// 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) /// /// void SetIsComplete(bool bComplete); /// /// 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) /// /// void SetCompletionErrorMessage(string msg); double GetSampleRateForHardware(string h); float GetAAFForHardware(IDASCommunication das); float GetAAFForHardware(IDASCommunication das, int sps); /// /// 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) /// /// /// float GetRealtimeAAFForHardware(IDASCommunication idas, double samplerate); void SetDefaultSetupFile(); /// /// 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 /// void CalculateIsComplete(bool bSetInDb = true); void CheckSensorCalDates(); /// /// 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 /// void MarkIsCompleteUnchecked(bool skipMemoryCheck = false); void ClearOverrides(); /// /// 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 /// void UnLoad(); /// /// signifies if the test setup is being used for a quick checkout /// quick checkout tests are not stored and are run time only /// bool IsQuickCheckout { get; set; } void Load(bool fromDB = false); /// /// All items from db are updated in our cache /// void UpdateFromDb(); IDASHardware[] GetHardwareFromDb(); IDASHardware[] GetAllCachedHardware2(); ISensorCalibration[] GetCachedSensorCalibrations(); ISensorData[] GetCachedSensors(); /// /// 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 /// void LoadFromDb(); string GetTestIdNode(); /// /// gets a serialized version of the settings table /// /// string GetSettings(); /// /// loads values from a serialized string into the settings table /// /// 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(); /// /// 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 /// void SynchronizeTestMetaData(); #region CalculatedChannels void UpdateCalculatedChannelId(string[] names, int[] newIds); void UpdateCalculatedChannelId(string name, int newId); void RemoveImpossibleCalculatedChannels(); void ReplaceCalculatedChannel(Dictionary oldIdToNewIdLookup); void RenameCalculatedChannels(string oldName, string newName); #endregion CalculatedChannels void SetHardwareOverride(string hid, bool bAdd); /// /// 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 /// /// /// 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); } }