| | | 1 | | using pva.SuperV.Engine.HistoryRetrieval; |
| | | 2 | | using pva.SuperV.Engine.Processing; |
| | | 3 | | |
| | | 4 | | namespace pva.SuperV.Engine.HistoryStorage |
| | | 5 | | { |
| | | 6 | | /// <summary> |
| | | 7 | | /// Null history storage engine doing nothing. Used for unit tests. |
| | | 8 | | /// </summary> |
| | | 9 | | public class NullHistoryStorageEngine : IHistoryStorageEngine |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Null history storage string. |
| | | 13 | | /// </summary> |
| | | 14 | | public const string Prefix = "NullHistoryStorage"; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Upsert a history repository in storage engine. |
| | | 18 | | /// </summary> |
| | | 19 | | /// <param name="projectName">Project name to zhich the repository belongs.</param> |
| | | 20 | | /// <param name="repository">History repository</param> |
| | | 21 | | /// <returns>ID of repository in storqge engine.</returns> |
| | | 22 | | public string UpsertRepository(string projectName, HistoryRepository repository) |
| | 96 | 23 | | { |
| | 96 | 24 | | return $"{projectName}_{repository.Name}"; |
| | 96 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Deletes a history repository from storage engine. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name="projectName">Project name to zhich the repository belongs.</param> |
| | | 31 | | /// <param name="repositoryName">History repository name.</param> |
| | | 32 | | public void DeleteRepository(string projectName, string repositoryName) |
| | 0 | 33 | | { |
| | 0 | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Upsert a class time series in storage engine |
| | | 38 | | /// </summary> |
| | | 39 | | /// <typeparam name="T"></typeparam> |
| | | 40 | | /// <param name="repositoryStorageId">History respository in which the time series should be created.</param> |
| | | 41 | | /// <param name="projectName">Project name to zhich the time series belongs.</param> |
| | | 42 | | /// <param name="className">Class name</param> |
| | | 43 | | /// <param name="historizationProcessing">History processing for which the time series should be created.</param |
| | | 44 | | /// <returns>Time series ID in storage engine.</returns> |
| | | 45 | | public string UpsertClassTimeSerie<T>(string repositoryStorageId, string projectName, string className, Historiz |
| | 192 | 46 | | { |
| | 192 | 47 | | return $"{projectName}_{className}"; |
| | 192 | 48 | | } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Historize instance values in storage engine |
| | | 52 | | /// </summary> |
| | | 53 | | /// <param name="repositoryStorageId">The history repository ID.</param> |
| | | 54 | | /// <param name="classTimeSerieId">The time series ID.</param> |
| | | 55 | | /// <param name="instanceName">The instance name.</param> |
| | | 56 | | /// <param name="timestamp">the timestamp of the values</param> |
| | | 57 | | /// <param name="fieldsToHistorize">List of fields to be historized.</param> |
| | | 58 | | public void HistorizeValues(string repositoryStorageId, string classTimeSerieId, string instanceName, DateTime t |
| | 6 | 59 | | { |
| | 6 | 60 | | } |
| | | 61 | | |
| | | 62 | | /// <summary> |
| | | 63 | | /// Gets instance values historized between 2 timestamps. |
| | | 64 | | /// </summary> |
| | | 65 | | /// <param name="repositoryStorageId">The history repository ID.</param> |
| | | 66 | | /// <param name="classTimeSerieId">The time series ID.</param> |
| | | 67 | | /// <param name="instanceName">The instance name.</param> |
| | | 68 | | /// <param name="timeRange">Query containing time range parameters.</param> |
| | | 69 | | /// <param name="fields">List of fields to be retrieved. One of them should have the <see cref="HistorizationPro |
| | | 70 | | /// <returns>List of history rows.</returns> |
| | | 71 | | public List<HistoryRow> GetHistoryValues(string repositoryStorageId, string classTimeSerieId, string instanceNam |
| | 0 | 72 | | { |
| | 0 | 73 | | return []; |
| | 0 | 74 | | } |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Gets instance statistic values historized between 2 timestamps. |
| | | 78 | | /// </summary> |
| | | 79 | | /// <param name="repositoryStorageId">The history repository ID.</param> |
| | | 80 | | /// <param name="classTimeSerieId">The time series ID.</param> |
| | | 81 | | /// <param name="instanceName">The instance name.</param> |
| | | 82 | | /// <param name="timeRange">Query containing time range parameters.</param> |
| | | 83 | | /// <param name="fields">List of fields to be retrieved. One of them should have the <see cref="HistorizationPro |
| | | 84 | | /// <returns>List of history rows.</returns> |
| | | 85 | | public List<HistoryStatisticRow> GetHistoryStatistics(string repositoryStorageId, string classTimeSerieId, strin |
| | 0 | 86 | | { |
| | 0 | 87 | | return []; |
| | 0 | 88 | | } |
| | | 89 | | |
| | | 90 | | /// <summary> |
| | | 91 | | /// Disposes the instance. |
| | | 92 | | /// </summary> |
| | | 93 | | public void Dispose() |
| | 96 | 94 | | { |
| | 96 | 95 | | Dispose(true); |
| | 96 | 96 | | GC.SuppressFinalize(this); |
| | 96 | 97 | | } |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Disposes the instance. |
| | | 101 | | /// </summary> |
| | | 102 | | /// <param name="disposing"></param> |
| | | 103 | | protected virtual void Dispose(bool disposing) |
| | 96 | 104 | | { |
| | | 105 | | // Do nothing |
| | 96 | 106 | | } |
| | | 107 | | } |
| | | 108 | | } |