ok gestione info iob

This commit is contained in:
zaccaria.majid
2023-10-05 17:46:41 +02:00
parent 4b564df8de
commit b3aa2e1a9f
9 changed files with 74 additions and 10 deletions
+3 -5
View File
@@ -1,5 +1,3 @@
<h3>IobInfoMan</h3>
@code {
}
@infosIob.IP
@infosIob.iType
@infosIob.name
@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DTO;
using MP.Data.Services;
namespace MP_TAB_SERV.Components
{
public partial class IobInfoMan
{
[Parameter]
public string idxMacch { get; set; } = "";
[Inject]
protected TabDataService TabSrv { get; set; } = null!;
protected IobInfoDTO infosIob { get; set; } = new IobInfoDTO();
protected override async Task OnInitializedAsync()
{
infosIob = await TabSrv.IobInfo(idxMacch);
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2310.516</Version>
<Version>6.16.2310.517</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -9,5 +9,5 @@ else
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<AlarmsMan></AlarmsMan>
<IobInfoMan idxMacch="@IdxMacc"></IobInfoMan>
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2310.516</h4>
<h4>Versione: 6.16.2310.517</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2310.516
6.16.2310.517
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2310.516</version>
<version>6.16.2310.517</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DTO
{
public class IobInfoDTO
{
public string name { get; set; } = "ND";
public string IP { get; set; } = "::1";
public string iType { get; set; } = "Win";
}
}
+28
View File
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
@@ -157,6 +158,32 @@ namespace MP.Data.Services
return result;
}
public async Task<IobInfoDTO> IobInfo(string IdxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
IobInfoDTO? result = new IobInfoDTO();
// cerco in redis...
string currKey = $"{moonProRedisBaseKey}:{IdxMacchina}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<IobInfoDTO>($"{rawData}");
source = "REDIS";
}
if (result == null)
{
result = new IobInfoDTO();
}
sw.Stop();
Log.Debug($"IobInfo | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
public void Dispose()
{
// Clear database controller
@@ -414,6 +441,7 @@ namespace MP.Data.Services
private static Logger Log = LogManager.GetCurrentClassLogger();
private string redisBaseKey = "MP:TAB:Cache";
private string moonProRedisBaseKey = "MoonPro:SQL2016DEV:MoonPro:hM2IOB";
#endregion Private Fields
}