Update gestione parametro display PDF + inizio TabDataFeeder
This commit is contained in:
@@ -45,9 +45,14 @@ else
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0 bg-dark">
|
||||
<div class="@RecMSE.Semaforo p-0">
|
||||
<div class="d-flex justify-content-center fs-5">
|
||||
<span><b>@RecMSE.DescrizioneStato</b>: @(FormatDurata(RecMSE.Durata))</span>
|
||||
<div class="@RecMSE.Semaforo py-0 px-1">
|
||||
<div class="d-flex justify-content-between fs-5">
|
||||
<div class="px-0 @textDescrCss">
|
||||
<span>@RecMSE.DescrizioneStato </span>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<b>@(FormatDurata(RecMSE.Durata))</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-around">
|
||||
@@ -309,7 +314,7 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
@if (showDraw && RecMSE != null)
|
||||
@if (enableDisegno && showDraw && RecMSE != null)
|
||||
{
|
||||
string docUrl = string.IsNullOrEmpty(RecMSE.Disegno) ? $"disegni/{RecMSE.CodArticolo}.pdf" : $"disegni/{RecMSE.Disegno}.pdf";
|
||||
<PdfDisplay Width="100%" PdfUrl="@docUrl" HeightList="@heightList"></PdfDisplay>
|
||||
|
||||
@@ -81,21 +81,23 @@ namespace MP_TAB3.Components
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
|
||||
/// </summary>
|
||||
protected string overlayCss
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (RecMSE != null)
|
||||
{
|
||||
answ = RecMSE.Semaforo == "sGr" ? "bg-dark opacity-50" : "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
|
||||
protected int currMaxVal = 1000;
|
||||
|
||||
protected List<CircleGaugeMulti.CircSegm> innerCircleVals = new List<CircleGaugeMulti.CircSegm>();
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
protected int maxVal = 1000;
|
||||
|
||||
protected List<CircleGaugeMulti.CircSegm> outerCircleVals = new List<CircleGaugeMulti.CircSegm>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// CSS Class bordo da stato macchina
|
||||
@@ -117,7 +119,6 @@ namespace MP_TAB3.Components
|
||||
answ += " border-danger";
|
||||
break;
|
||||
|
||||
|
||||
case "sGr":
|
||||
answ += " border-dark";
|
||||
break;
|
||||
@@ -139,35 +140,6 @@ namespace MP_TAB3.Components
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CSS class x testo (se descr lunga scorre...)
|
||||
/// </summary>
|
||||
protected string textDescrCss
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "text-nowrap";
|
||||
if (RecMSE != null && RecMSE.DescrizioneStato.Length > 18)
|
||||
{
|
||||
answ = " scroll-left";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
protected int currMaxVal = 1000;
|
||||
protected List<CircleGaugeMulti.CircSegm> innerCircleVals = new List<CircleGaugeMulti.CircSegm>();
|
||||
protected int kaFactor = 60 / 2;
|
||||
protected int maxVal = 1000;
|
||||
protected List<CircleGaugeMulti.CircSegm> outerCircleVals = new List<CircleGaugeMulti.CircSegm>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration config { get; set; } = null!;
|
||||
|
||||
@@ -203,12 +175,44 @@ namespace MP_TAB3.Components
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
|
||||
/// </summary>
|
||||
protected string overlayCss
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (RecMSE != null)
|
||||
{
|
||||
answ = RecMSE.Semaforo == "sGr" ? "bg-dark opacity-50" : "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected StatusData SDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// CSS class x testo (se descr lunga scorre...)
|
||||
/// </summary>
|
||||
protected string textDescrCss
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "text-nowrap";
|
||||
if (RecMSE != null && RecMSE.DescrizioneStato.Length >= 20)
|
||||
{
|
||||
answ = " scroll-left";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -229,6 +233,8 @@ namespace MP_TAB3.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
// abilitazione disegni...
|
||||
TabDServ.ConfigGetVal("enableDisegno", ref enableDisegno);
|
||||
// se configurata uso cartella virtuale... altrimenti cartella processo
|
||||
var sImgBasePath = config.GetValue<string>("OptConf:ImgBasePath");
|
||||
if (!string.IsNullOrEmpty(sImgBasePath))
|
||||
@@ -318,6 +324,7 @@ namespace MP_TAB3.Components
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private bool enableDisegno = false;
|
||||
private string imgBasePath = "";
|
||||
private bool isLoading = false;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2402.2614</Version>
|
||||
<Version>6.16.2402.2615</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2402.2614</h4>
|
||||
<h4>Versione: 6.16.2402.2615</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2402.2614
|
||||
6.16.2402.2615
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2402.2614</version>
|
||||
<version>6.16.2402.2615</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||
public static readonly string MON_ACT_BLINK_KEY = $"{BASE_HASH}:MON:Current:Blink";
|
||||
public static readonly string MON_ACT_MSE_DATA_KEY = $"{BASE_HASH}:MON:Current:MSE";
|
||||
|
||||
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||
public static readonly string TAB_ACT_BLINK_KEY = $"{BASE_HASH}:TAB:Current:Blink";
|
||||
public static readonly string TAB_ACT_MSE_DATA_KEY = $"{BASE_HASH}:TAB:Current:MSE";
|
||||
|
||||
public static readonly string BROADCAST_M_PIPE = $"BroadCastMsg";
|
||||
public static readonly string BROADCAST_CURR_KEY = $"{BASE_HASH}:Current:BroadCast";
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace MP.Data.Services
|
||||
{
|
||||
|
||||
// setup canali pub/sub
|
||||
dataPipe = new MessagePipe(redisConn, Constants.ACT_MSE_DATA_KEY);
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.ACT_BLINK_KEY);
|
||||
dataPipe = new MessagePipe(redisConn, Constants.MON_ACT_MSE_DATA_KEY);
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.MON_ACT_BLINK_KEY);
|
||||
|
||||
// avvio timers...
|
||||
startTimers();
|
||||
@@ -40,13 +40,15 @@ namespace MP.Data.Services
|
||||
stopTimers();
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Impostazione forzata timer refresh
|
||||
@@ -85,11 +87,13 @@ namespace MP.Data.Services
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min
|
||||
/// ad ogni chiamata client)
|
||||
/// </summary>
|
||||
private DateTime fastLimit = DateTime.Now;
|
||||
private DateTime fastLimit = DateTime.Now;
|
||||
#endif
|
||||
|
||||
private int fastRefreshMs = 1000;
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Services
|
||||
{
|
||||
public class TabDataFeeder : StatusData, IDisposable
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public TabDataFeeder(IConfiguration configuration) : base(configuration)
|
||||
{
|
||||
|
||||
// setup canali pub/sub
|
||||
dataPipe = new MessagePipe(redisConn, Constants.TAB_ACT_MSE_DATA_KEY);
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.TAB_ACT_BLINK_KEY);
|
||||
|
||||
// avvio timers...
|
||||
startTimers();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
|
||||
public MessagePipe dataPipe { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public new void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
stopTimers();
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Impostazione forzata timer refresh
|
||||
/// </summary>
|
||||
/// <param name="FastTimerMs"></param>
|
||||
public void setTimers(int FastTimerMs)
|
||||
{
|
||||
stopTimers();
|
||||
fastRefreshMs = FastTimerMs;
|
||||
// avvio timers...
|
||||
startTimers();
|
||||
}
|
||||
|
||||
public void startTimers()
|
||||
{
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
}
|
||||
|
||||
public void stopTimers()
|
||||
{
|
||||
// stop timers
|
||||
fastTimer.Elapsed -= ElapsedFastTimer;
|
||||
fastTimer.Enabled = false;
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min
|
||||
/// ad ogni chiamata client)
|
||||
/// </summary>
|
||||
private DateTime fastLimit = DateTime.Now;
|
||||
#endif
|
||||
|
||||
private int fastRefreshMs = 1000;
|
||||
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
// secondi pari --> blink, secondi dispari --> ricarica
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
// invio in channel blink il segnale
|
||||
blinkPipe.sendMessage("true");
|
||||
Log.Debug("Elapsed Fast Timer Blink");
|
||||
}
|
||||
else
|
||||
{
|
||||
// invio in channel blink segnale false
|
||||
blinkPipe.sendMessage("false");
|
||||
// rileggo dati...
|
||||
var newData = await MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
Log.Debug("Elapsed Fast Timer reload");
|
||||
}
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user