Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55faefcb9a | |||
| 1e5f894fd9 | |||
| cf8baa054f | |||
| 871a0c8ca5 | |||
| 78cb17d8fc | |||
| 22ff799204 |
+106
-105
@@ -121,19 +121,19 @@ MON:build:
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
script:
|
||||
- dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# WAMON:build:
|
||||
# stage: build
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# script:
|
||||
# - dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
LAND:test:
|
||||
stage: test
|
||||
@@ -199,22 +199,22 @@ MON:test:
|
||||
script:
|
||||
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:test:
|
||||
stage: test
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["WAMON:build"]
|
||||
script:
|
||||
- dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# WAMON:test:
|
||||
# stage: test
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
LAND:IIS01:deploy:
|
||||
stage: deploy
|
||||
@@ -280,22 +280,22 @@ MON:IIS01:deploy:
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:IIS01:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["WAMON:test"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# WAMON:IIS01:deploy:
|
||||
# stage: deploy
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# needs: ["WAMON:test"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
LAND:IIS02:deploy:
|
||||
stage: deploy
|
||||
@@ -365,23 +365,23 @@ MON:IIS02:deploy:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:IIS02:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- master
|
||||
needs: ["WAMON:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# WAMON:IIS02:deploy:
|
||||
# stage: deploy
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - master
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
LAND:installer:
|
||||
stage: installer
|
||||
@@ -467,27 +467,27 @@ MON:installer:
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
WAMON:installer:
|
||||
stage: installer
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
NEXUS_PATH: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
needs: ["WAMON:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
|
||||
# qui il deploy su nexus...
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
# WAMON:installer:
|
||||
# stage: installer
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# NEXUS_PATH: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# - master
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
|
||||
# # qui il deploy su nexus...
|
||||
# - *hashBuild
|
||||
# - *nexusUpload
|
||||
|
||||
LAND:release:
|
||||
stage: release
|
||||
@@ -583,25 +583,26 @@ MON:release:
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:release:
|
||||
stage: release
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
NEXUS_PATH: MP-WAMON
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- tags
|
||||
except:
|
||||
- branches
|
||||
needs: ["WAMON:build"]
|
||||
artifacts:
|
||||
paths:
|
||||
- publish/
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# WAMON:release:
|
||||
# stage: release
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# NEXUS_PATH: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - tags
|
||||
# except:
|
||||
# - branches
|
||||
# needs: ["WAMON:build"]
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - publish/
|
||||
# script:
|
||||
# - dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
|
||||
@@ -12,11 +12,6 @@ namespace MP.Mon.Components
|
||||
[Parameter]
|
||||
public MappaStatoExpl? CurrRecord { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Valore precedente x calcolo variazione
|
||||
/// </summary>
|
||||
private MappaStatoExpl? OldRecord { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public List<TagData>? currTagConf { get; set; } = null;
|
||||
|
||||
@@ -26,37 +21,22 @@ namespace MP.Mon.Components
|
||||
[Parameter]
|
||||
public bool doAnimate { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public bool doBlink { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
|
||||
[Parameter]
|
||||
public string showArt { get; set; } = "";
|
||||
|
||||
|
||||
[Parameter]
|
||||
public bool doBlink { get; set; } = false;
|
||||
//{
|
||||
// set
|
||||
// {
|
||||
// // se true --> ricarica
|
||||
// if (value)
|
||||
// {
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// await InvokeAsync(() => StateHasChanged());
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
@@ -114,6 +94,7 @@ namespace MP.Mon.Components
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
#endregion Protected Fields
|
||||
@@ -209,11 +190,21 @@ namespace MP.Mon.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer { get; set; } = null!;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private static System.Timers.Timer aTimer { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Valore precedente x calcolo variazione
|
||||
/// </summary>
|
||||
private MappaStatoExpl? OldRecord { get; set; } = null;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
|
||||
@@ -246,16 +237,6 @@ namespace MP.Mon.Components
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
if (doAnimate && codColore != "Ve")
|
||||
{
|
||||
#if false
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
#endif
|
||||
if (doBlink)
|
||||
{
|
||||
answ += "_b";
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace MP.Mon.Data
|
||||
dbController = new MP.Data.Controllers.MpMonController(configuration);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine($"DbController OK");
|
||||
//sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}");
|
||||
_logger.LogInformation(sb.ToString());
|
||||
}
|
||||
|
||||
@@ -47,75 +46,21 @@ namespace MP.Mon.Data
|
||||
startTimers();
|
||||
}
|
||||
|
||||
private void startTimers()
|
||||
{
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
}
|
||||
|
||||
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.Trace("Elapsed Fast Timer Blink");
|
||||
}
|
||||
else
|
||||
{
|
||||
// invio in channel blink segnale false
|
||||
blinkPipe.sendMessage("false");
|
||||
// rileggo dati ed invio
|
||||
await ReloadData();
|
||||
Log.Trace("Elapsed Fast Timer reload");
|
||||
}
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
// legge i dati e li invia tramite redis channels
|
||||
var newData = await MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
|
||||
}
|
||||
|
||||
/// <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 int fastRefreshMs = 1000;
|
||||
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public static MP.Data.Controllers.MpMonController dbController { get; set; } = null!;
|
||||
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei tag configurati per IOB
|
||||
/// </summary>
|
||||
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
|
||||
|
||||
public MessagePipe dataPipe { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -131,6 +76,14 @@ namespace MP.Mon.Data
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco setup dei tag conf correnti
|
||||
/// </summary>
|
||||
@@ -174,7 +127,7 @@ namespace MP.Mon.Data
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(rawData);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,7 +137,7 @@ namespace MP.Mon.Data
|
||||
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromSeconds(2));
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -195,16 +148,24 @@ namespace MP.Mon.Data
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
public MessagePipe dataPipe { get; set; } = null!;
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static ILogger<MpDataService> _logger = null!;
|
||||
|
||||
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <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 int fastRefreshMs = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
@@ -222,6 +183,42 @@ namespace MP.Mon.Data
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
private void startTimers()
|
||||
{
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prova a caricare da file la conf degli IOB se presente
|
||||
/// </summary>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.15.2207.1218</Version>
|
||||
<Version>6.15.2207.1219</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
|
||||
<logger name="*" minlevel="Debug" writeTo="f" />
|
||||
-->
|
||||
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
|
||||
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
|
||||
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
|
||||
<logger name="*" minlevel="Info" writeTo="fileTarget" />
|
||||
</rules>
|
||||
|
||||
@@ -14,42 +14,9 @@ namespace MP.Mon.Pages
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
#if false
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
#endif
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
disposeTimers();
|
||||
}
|
||||
|
||||
#if false
|
||||
public 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)
|
||||
{
|
||||
doBlink = true;
|
||||
Log.Trace("Elapsed Fast Timer Blink");
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
doBlink = false;
|
||||
await ReloadData();
|
||||
Log.Trace("Elapsed Fast Timer reload");
|
||||
}
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
#endif
|
||||
|
||||
public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
listMSE = null;
|
||||
@@ -57,19 +24,13 @@ namespace MP.Mon.Pages
|
||||
Log.Info("Elapsed Slow Timer --> full page reload");
|
||||
// dispongo i vari timers...
|
||||
disposeTimers();
|
||||
await Task.Delay(1);
|
||||
// reload pagina
|
||||
NavManager.NavigateTo(NavManager.Uri);
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
#if false
|
||||
// timer veloce
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
#endif
|
||||
// timer lento
|
||||
slowTimer = new System.Timers.Timer(slowRefreshMs);
|
||||
slowTimer.Elapsed += ElapsedSlowTimer;
|
||||
@@ -100,7 +61,12 @@ namespace MP.Mon.Pages
|
||||
|
||||
protected int slowRefreshMs
|
||||
{
|
||||
get => 1000 * slowRefreshSec;
|
||||
get
|
||||
{
|
||||
// tempo variabile tra +/- 10% del target
|
||||
int answ = rnd.Next(900, 1100) * slowRefreshSec;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
@@ -205,12 +171,10 @@ namespace MP.Mon.Pages
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
|
||||
|
||||
private List<ConfigModel>? CurrConfig = null;
|
||||
|
||||
private bool doBlink = false;
|
||||
|
||||
private List<MappaStatoExpl>? listMSE = null;
|
||||
private Random rnd = new Random();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -285,36 +249,11 @@ namespace MP.Mon.Pages
|
||||
|
||||
private void disposeTimers()
|
||||
{
|
||||
//fastTimer.Elapsed -= ElapsedFastTimer;
|
||||
//fastTimer.Stop();
|
||||
//fastTimer.Dispose();
|
||||
slowTimer.Elapsed -= ElapsedSlowTimer;
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
}
|
||||
|
||||
#if false
|
||||
private async Task ReloadData()
|
||||
{
|
||||
// legge i dati e li invia tramite redis channels
|
||||
var newData = await MMDataService.MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
MMDataService.dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
|
||||
//#if DEBUG
|
||||
// // hack: legge 4 volte i dati x stressare sistema
|
||||
// var singleData = await MMDataService.MseGetAll();
|
||||
// listMSE = new List<MappaStatoExpl>();
|
||||
// for (int i = 0; i < 4; i++)
|
||||
// {
|
||||
// listMSE.AddRange(singleData);
|
||||
// }
|
||||
//#else
|
||||
// listMSE = await MMDataService.MseGetAll();
|
||||
//#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
private async Task setupConf()
|
||||
{
|
||||
CurrConfig = await MMDataService.ConfigGetAll();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.15.2207.1218</h4>
|
||||
<h4>Versione: 6.15.2207.1219</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2207.1218
|
||||
6.15.2207.1219
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2207.1218</version>
|
||||
<version>6.15.2207.1219</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -246,16 +246,6 @@ namespace MP.WASM.Mon.Client.Components
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
if (doAnimate && codColore != "Ve")
|
||||
{
|
||||
#if false
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
#endif
|
||||
if (doBlink)
|
||||
{
|
||||
answ += "_b";
|
||||
|
||||
@@ -11,12 +11,6 @@ namespace MP.WASM.Mon.Client.Pages
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
#if false
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
#endif
|
||||
disposeTimers();
|
||||
}
|
||||
|
||||
@@ -222,7 +216,7 @@ namespace MP.WASM.Mon.Client.Pages
|
||||
{
|
||||
// leggo stato server...
|
||||
fastTimer.Interval = fastRefreshMs * 3;
|
||||
var res = await Http.GetAsync("/api/MSE/checkAlive");
|
||||
var res = await Http.GetAsync("api/MSE/checkAlive");
|
||||
Console.WriteLine("GetAsync end");
|
||||
if (res.IsSuccessStatusCode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user