2024-07-04 11:02:45 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2022-04-08 13:10:06 +05:00
|
|
|
|
using AsbCloudApp.Data.SAUB;
|
2024-08-21 14:52:31 +05:00
|
|
|
|
using AsbCloudApp.Requests;
|
2023-12-15 13:41:29 +05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
2021-10-15 12:24:04 +05:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2021-04-07 18:01:56 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
namespace AsbCloudApp.Services;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сервис телеметрии
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ITelemetryService
|
2021-04-07 18:01:56 +05:00
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// <summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// сервис временных зон
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// </summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
ITimezoneService TimeZoneService { get; }
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить idWell по uid телеметрии
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
int? GetIdWellByTelemetryUid(string uid);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить id телеметрии. Если её нет в БД, то добавить новую.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
TelemetryDto GetOrCreateTelemetryByUid(string uid);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-09-18 12:59:25 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить список телеметрии по ключам скважин
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idsWells">ключи скважин</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
IEnumerable<TelemetryDto> GetOrDefaultTelemetriesByIdsWells(IEnumerable<int> idsWells);
|
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить временную зону скважины по idTelemetry
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idTelemetry"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
SimpleTimezoneDto GetTimezone(int idTelemetry);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить idTelemetry по IdWell
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
TelemetryBaseDto? GetOrDefaultTelemetryByIdWell(int idWell);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить диапазон дат за которые есть данные
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idTelemetry"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
DatesRangeDto GetDatesRange(int idTelemetry);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// обновить данные о телеметрии (используется панелью)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task UpdateInfoAsync(string uid, TelemetryInfoDto info, CancellationToken token);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2024-08-21 14:52:31 +05:00
|
|
|
|
/// <summary>
|
2024-08-27 16:55:49 +05:00
|
|
|
|
/// Получить версии ПО
|
2024-08-21 14:52:31 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-08-27 16:55:49 +05:00
|
|
|
|
Task<IEnumerable<VersionDto>> GetVersionsAsync(VersionRequest request, CancellationToken token);
|
2024-08-21 14:52:31 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Слить данные телеметрии в одну
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="from">старая (исходная)</param>
|
|
|
|
|
/// <param name="to">новая</param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> MergeAsync(int from, int to, CancellationToken token);
|
2024-05-23 14:07:40 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить телеметрию по последней дате
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="from"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<Stream> GetTelemetriesInfoByLastData(DateTimeOffset from, CancellationToken token);
|
2021-12-07 15:55:11 +05:00
|
|
|
|
}
|