205 lines
11 KiB
C#
205 lines
11 KiB
C#
|
|
using DbAPI.Connections;
|
|||
|
|
using DTS.Common.Interface.Database;
|
|||
|
|
using DTS.Common.Interface.Groups;
|
|||
|
|
using DTS.Common.Interface.TestSetups;
|
|||
|
|
using DTS.Common.Interface.TestSetups.TestSetupsList;
|
|||
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace DbAPI.TestSetups
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// defines functions to create, retrieve, update, delete test setups
|
|||
|
|
/// </summary>
|
|||
|
|
public interface ITestSetups
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// deletes matching test setup hardware record
|
|||
|
|
/// at least one parameter (id/dasid/testsetupid) must be specified
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user making request</param>
|
|||
|
|
/// <param name="connection">connection request is being made on</param>
|
|||
|
|
/// <param name="Id">id of test setup hardware record (null for all)</param>
|
|||
|
|
/// <param name="dasId">id of das (null for all)</param>
|
|||
|
|
/// <param name="testSetupId">id of test setup (null for all)</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupHardwareDelete(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int? Id,
|
|||
|
|
int? dasId,
|
|||
|
|
int? testSetupId
|
|||
|
|
);
|
|||
|
|
/// <summary>
|
|||
|
|
/// updates a test setup hardware record
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user committing update</param>
|
|||
|
|
/// <param name="connection">connection update is being made on</param>
|
|||
|
|
/// <param name="record">updated record</param>
|
|||
|
|
/// <returns>0 on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupHardwareUpdate(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
ITestSetupHardwareRecord record);
|
|||
|
|
/// <summary>
|
|||
|
|
/// inserts a new record
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user inserting record</param>
|
|||
|
|
/// <param name="connection">connection being inserted on</param>
|
|||
|
|
/// <param name="record">record being inserted</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupHardwareInsert(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
ITestSetupHardwareRecord record);
|
|||
|
|
/// <summary>
|
|||
|
|
/// retrieves all hardware meta data associated with test
|
|||
|
|
/// [sample rate, aaf, etc]
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user retrieving hardware</param>
|
|||
|
|
/// <param name="connection">connecting hardware is retrieved on</param>
|
|||
|
|
/// <param name="testSetupId">id of test setup (use null for all)</param>
|
|||
|
|
/// <param name="records">all matching records</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupHardwareGet(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int clientDbVersion,
|
|||
|
|
int? testSetupId,
|
|||
|
|
out ITestSetupHardwareRecord[] records);
|
|||
|
|
/// <summary>
|
|||
|
|
/// inserts a new group/test setup association into db
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user making request</param>
|
|||
|
|
/// <param name="connection">connection request is being made on</param>
|
|||
|
|
/// <param name="record">record to insert</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupGroupsInsert(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
ITestSetupGroupRecord record);
|
|||
|
|
/// <summary>
|
|||
|
|
/// updates a group/test setup association in db
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user making request</param>
|
|||
|
|
/// <param name="connection">connection is being made on</param>
|
|||
|
|
/// <param name="record">updated record</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupGroupsUpdate(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
ITestSetupGroupRecord record);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// retrieves all group records matching search criteria
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user making request</param>
|
|||
|
|
/// <param name="connection">connection request is being made on</param>
|
|||
|
|
/// <param name="groupId">database id of group (use null for all)</param>
|
|||
|
|
/// <param name="testSetupId">database id of test setup (use null for all)</param>
|
|||
|
|
/// <param name="testSetupName">test setup name for test setup (use null for all)</param>
|
|||
|
|
/// <param name="groups">matching groups</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupGroupsGet(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int? groupId,
|
|||
|
|
int? testSetupId,
|
|||
|
|
string testSetupName,
|
|||
|
|
out ITestSetupGroupRecord[] groups
|
|||
|
|
);
|
|||
|
|
/// <summary>
|
|||
|
|
/// Commits a change to the IsDirty or IsComplete flags in the db for a test
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user committing change</param>
|
|||
|
|
/// <param name="connection">connection change is being committed on</param>
|
|||
|
|
/// <param name="name">name of test setup to modify</param>
|
|||
|
|
/// <param name="dirty">whether to set dirty flag or not. Dirty flag indicates
|
|||
|
|
/// whether the test setup has been checked for completeness and readiness to run</param>
|
|||
|
|
/// <param name="complete">whether the test setup is ready to run or not</param>
|
|||
|
|
/// <param name="error">error message(s) associated with test setup, if any</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupsMarkIsDirtyIsComplete(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
string name,
|
|||
|
|
bool dirty,
|
|||
|
|
bool complete,
|
|||
|
|
string error);
|
|||
|
|
/// <summary>
|
|||
|
|
/// deletes all test setups matching criteria
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user deleting test setups</param>
|
|||
|
|
/// <param name="connection">connection tests are being deleted on</param>
|
|||
|
|
/// <param name="date">date of oldest allowed test setup</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success. All other values are error codes.</returns>
|
|||
|
|
ulong TestSetupsDeleteByDate(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
DateTime date);
|
|||
|
|
/// <summary>
|
|||
|
|
/// deletes all test setups and groups
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user requesting deletes</param>
|
|||
|
|
/// <param name="connection">connection to delete on</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success. All other values are error codes</returns>
|
|||
|
|
ulong TestSetupsAndGroupsDeleteAll(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection);
|
|||
|
|
/// <summary>
|
|||
|
|
/// Deletes all test setups that match the search criteria
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user deleting test setups</param>
|
|||
|
|
/// <param name="connection">connection to delete test setups on</param>
|
|||
|
|
/// <param name="ids">ids of test setups to delete</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupsDeleteById(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int[] ids);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// deletes all test setups that match the search criteria
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user deleting test setups</param>
|
|||
|
|
/// <param name="connection">connection to delete test setups on</param>
|
|||
|
|
/// <param name="names">names of test setups to delete</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are error codes</returns>
|
|||
|
|
ulong TestSetupsDeleteByName(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
string[] names);
|
|||
|
|
/// <summary>
|
|||
|
|
/// commits a test setup into the database
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user committing record</param>
|
|||
|
|
/// <param name="connection">connection record is being committed on</param>
|
|||
|
|
/// <param name="clientDbVersion">the database version of the client code</param>
|
|||
|
|
/// <param name="record">record being committed</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are errors</returns>
|
|||
|
|
ulong TestSetupsUpdateInsert(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int clientDbVersion,
|
|||
|
|
ref ITestSetupRecord record);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Retrieves all test setups which match given search criteria
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="user">user making query</param>
|
|||
|
|
/// <param name="connection">connection over which query is to be made</param>
|
|||
|
|
/// <param name="clientDbVersion">the database version of the client code</param>
|
|||
|
|
/// <param name="testSetupId">database id of test setup (can be null)</param>
|
|||
|
|
/// <param name="testSetupName">name of test setup (can be null or empty)</param>
|
|||
|
|
/// <param name="defaultROIStart">start time for any ROIs that have to be generated
|
|||
|
|
/// some old test setups may not have ROIs specified for every event</param>
|
|||
|
|
/// <param name="defaultROIEnd">end time for any ROIs that have to be generated
|
|||
|
|
/// some old test setups may not have ROIs specified for every event</param>
|
|||
|
|
/// <param name="defaultIgnoreShortedStart">whether or not to ignore a shorted start
|
|||
|
|
/// since we may be using a Version 91 database that doesn't store this</param>
|
|||
|
|
/// <param name="defaultIgnoreShortedTrigger">whether or not to ignore a shorted trigger
|
|||
|
|
/// since we may be using a Version 91 database that doesn't store this</param>
|
|||
|
|
/// <param name="records">matching records</param>
|
|||
|
|
/// <param name="errors">any errors encountered while retrieving test setups</param>
|
|||
|
|
/// <returns>0 (ERROR_SUCCESS) on success, all other values are errors</returns>
|
|||
|
|
ulong TestSetupsGet(IUserDbRecord user,
|
|||
|
|
IConnectionDetails connection,
|
|||
|
|
int clientDbVersion,
|
|||
|
|
int? testSetupId,
|
|||
|
|
string testSetupName,
|
|||
|
|
double defaultROIStart,
|
|||
|
|
double defaultROIEnd,
|
|||
|
|
bool defaultIgnoreShortedStart,
|
|||
|
|
bool defaultIgnoreShortedTrigger,
|
|||
|
|
out ITestSetupRecord[] records,
|
|||
|
|
out string[] errors);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|