Compare commits

..

No commits in common. "fb266caa62e88a07496a1e8433822331055bd75e" and "90ec8dd3440978fe08942d1087b166c1c5d2ec7a" have entirely different histories.

6 changed files with 14 additions and 43 deletions

View file

@ -64,16 +64,16 @@ namespace BLL.Integracion_DGA
listTagsID.Add(tag.Uid);
}
//HistoricRequest historicRequest = new HistoricRequest();
//historicRequest.DataSource = NexusApiUrl.DataSource;
//historicRequest.Resolution = NexusApiUrl.Resolution;
//historicRequest.Uids = listTagsID;
//historicRequest.StartTs = dateStart.ToUnixTimeSeconds();
//historicRequest.EndTs = dateEnd.ToUnixTimeSeconds();
HistoricRequest historicRequest = new HistoricRequest();
historicRequest.DataSource = NexusApiUrl.DataSource;
historicRequest.Resolution = NexusApiUrl.Resolution;
historicRequest.Uids = listTagsID;
historicRequest.StartTs = dateStart.ToUnixTimeSeconds();
historicRequest.EndTs = dateEnd.ToUnixTimeSeconds();
WriteLineAndLog($"Obteniendo Tagviews Historic");
string apiUrlHistoric = $"{apiUrlBase}/api/Documents/tagviews/{item.uid}/realtime";
responseData = await _apiService.PostApiResponseAsync(apiUrlHistoric, headers, listTagsID);
string apiUrlHistoric = $"{apiUrlBase}/api/Documents/tagviews/{item.uid}/historic";
responseData = await _apiService.PostApiResponseAsync(apiUrlHistoric, headers, historicRequest);
List<HistoricResponse> historicResponse = JsonSerializer.Deserialize<List<HistoricResponse>>(responseData, options);
List<DgaMacroResultado> listDgaMacroResultados = new List<DgaMacroResultado>();
@ -88,7 +88,7 @@ namespace BLL.Integracion_DGA
DgaMacroResultado dgaMacroResultado = new DgaMacroResultado();
dgaMacroResultado.TagName = tag.Name;
dgaMacroResultado.TagName = $"SCADA001.{tag.Name}.F_CV";
dgaMacroResultado.Value = historic.Value;
//dgaMacroResultado.TimeStamp = new DateTime(historic.TimeStamp);
dgaMacroResultado.TimeStamp = fechaHoraChile;

View file

@ -14,16 +14,6 @@ namespace Integracion_DGA
{
static async Task Main(string[] args)
{
IConfiguration configuration;
configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
FileLoggerHelper.ConfigureLogger(configuration);
try
{
Console.Write("Obteniendo variables de entorno...");
@ -45,7 +35,9 @@ namespace Integracion_DGA
using IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((context, services) =>
{
IConfiguration configuration = context.Configuration;
services.AddSingleton<IConfiguration>(configuration);
services.AddScoped<MedicionScadaRepository>();
services.AddScoped<EnvioDGA>();
services.AddHttpClient<RegistrarMedicion>();

View file

@ -14,16 +14,6 @@ namespace Recuperacion_DGA
{
static async Task Main(string[] args)
{
IConfiguration configuration;
configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
FileLoggerHelper.ConfigureLogger(configuration);
try
{
Console.WriteLine("Obteniendo variables de entorno...");
@ -45,7 +35,9 @@ namespace Recuperacion_DGA
using IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((context, services) =>
{
IConfiguration configuration = context.Configuration;
services.AddSingleton<IConfiguration>(configuration);
services.AddScoped<MedicionScadaRepository>();
services.AddScoped<EnvioDGA>();
services.AddHttpClient<RegistrarMedicion>();

View file

@ -20,10 +20,4 @@
<ProjectReference Include="..\SHARED\Shared.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View file

@ -1,7 +0,0 @@
{
"Logging": {
"LogFile": {
"Path": "logs/log.txt"
}
}
}

View file

@ -4,6 +4,6 @@
{
public string Uid { get; set; }
public double? Value { get; set; }
public double TimeStamp { get; set; }
public long TimeStamp { get; set; }
}
}