2024-07-04 11:02:45 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2022-04-08 13:10:06 +05:00
|
|
|
|
using AsbCloudApp.Data.SAUB;
|
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
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Services
|
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сервис телеметрии
|
|
|
|
|
/// </summary>
|
2021-04-07 18:01:56 +05:00
|
|
|
|
public interface ITelemetryService
|
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// сервис временных зон
|
|
|
|
|
/// </summary>
|
2022-01-05 17:50:45 +05:00
|
|
|
|
ITimezoneService TimeZoneService { get; }
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить idWell по uid телеметрии
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <returns></returns>
|
2021-12-07 15:55:11 +05:00
|
|
|
|
int? GetIdWellByTelemetryUid(string uid);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить id телеметрии. Если её нет в БД, то добавить новую.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <returns></returns>
|
2023-06-20 14:41:19 +05:00
|
|
|
|
TelemetryDto GetOrCreateTelemetryByUid(string uid);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить временную зону скважины по idTelemetry
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idTelemetry"></param>
|
|
|
|
|
/// <returns></returns>
|
2022-01-05 17:50:45 +05:00
|
|
|
|
SimpleTimezoneDto GetTimezone(int idTelemetry);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить idTelemetry по IdWell
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
|
/// <returns></returns>
|
2023-03-07 09:12:49 +05:00
|
|
|
|
TelemetryBaseDto? GetOrDefaultTelemetryByIdWell(int idWell);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// получить диапазон дат за которые есть данные
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idTelemetry"></param>
|
|
|
|
|
/// <returns></returns>
|
2022-01-05 17:50:45 +05:00
|
|
|
|
DatesRangeDto GetDatesRange(int idTelemetry);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// обновить данные о телеметрии (используется панелью)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="uid"></param>
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2021-12-17 12:48:58 +05:00
|
|
|
|
Task UpdateInfoAsync(string uid, TelemetryInfoDto info, CancellationToken token);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
2021-12-17 12:48:58 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Слить данные телеметрии в одну
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="from">старая (исходная)</param>
|
|
|
|
|
/// <param name="to">новая</param>
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <param name="token"></param>
|
2021-12-17 12:48:58 +05:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task<int> MergeAsync(int from, int to, CancellationToken token);
|
2024-05-23 14:07:40 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить телеметрию по последней дате
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="from"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2023-12-15 13:41:29 +05:00
|
|
|
|
Task<Stream> GetTelemetriesInfoByLastData(DateTimeOffset from, CancellationToken token);
|
2021-04-07 18:01:56 +05:00
|
|
|
|
}
|
2021-12-07 15:55:11 +05:00
|
|
|
|
}
|