Channels:

- renaming in conf json
- fix gestione classi post rename
This commit is contained in:
Samuele Locatelli
2025-11-06 18:10:47 +01:00
parent a70ed095e9
commit 8fa8732cf1
22 changed files with 277 additions and 264 deletions
+108 -75
View File
@@ -37,49 +37,58 @@ namespace EgwCoreLib.Lux.Data.Services
_config = Configuration;
redisConn = RedisConn;
redisDb = redisConn.GetDatabase();
// channel name setup
pngChannel = _config.GetValue<string>("ServerConf:PngChannel") ?? "Egw:png:img";
svgChannel = _config.GetValue<string>("ServerConf:SvgChannel") ?? "Egw:svg:img";
bomChannel = _config.GetValue<string>("ServerConf:BomChannel") ?? "Egw:bom";
updateChannel = _config.GetValue<string>("ServerConf:UpdateChannel") ?? "Egw:update";
shapeChannel = _config.GetValue<string>("ServerConf:ShapeChannel") ?? "Egw:shape:curr";
hwListChannel = _config.GetValue<string>("ServerConf:HwListChannel") ?? "Egw:hw:list";
hwOptChannel = _config.GetValue<string>("ServerConf:HwOptChannel") ?? "Egw:hw:opt";
profListChannel = _config.GetValue<string>("ServerConf:ProfListChannel") ?? "Egw:prof:list";
// receving channel name setup
chBom = _config.GetValue<string>("ServerConf:ChannelBom") ?? "lux:bom";
chHwList = _config.GetValue<string>("ServerConf:ChannelHwList") ?? "lux:hw:list";
chHwOpt = _config.GetValue<string>("ServerConf:ChannelHwOpt") ?? "lux:hw:opt";
chPng = _config.GetValue<string>("ServerConf:ChannelPng") ?? "lux:png:img";
chProfList = _config.GetValue<string>("ServerConf:ChannelProfList") ?? "lux:prof:list";
chShape = _config.GetValue<string>("ServerConf:ChannelShape") ?? "lux:shape:curr";
chSvg = _config.GetValue<string>("ServerConf:ChannelSvg") ?? "lux:svg:img";
chUpdate = _config.GetValue<string>("ServerConf:ChannelUpdate") ?? "lux:update";
// Appends ":*" to the channels to enable wildcard subscription for dynamic events
if (!pngChannel.EndsWith(":*"))
fixRecChannel(ref chBom);
fixRecChannel(ref chHwList);
fixRecChannel(ref chHwOpt);
fixRecChannel(ref chPng);
fixRecChannel(ref chProfList);
fixRecChannel(ref chShape);
fixRecChannel(ref chSvg);
fixRecChannel(ref chUpdate);
#if false
if (!chPng.EndsWith(":*"))
{
pngChannel += ":*";
chPng += ":*";
}
if (!svgChannel.EndsWith(":*"))
if (!chSvg.EndsWith(":*"))
{
svgChannel += ":*";
chSvg += ":*";
}
if (!bomChannel.EndsWith(":*"))
if (!chBom.EndsWith(":*"))
{
bomChannel += ":*";
chBom += ":*";
}
if (!updateChannel.EndsWith(":*"))
if (!chUpdate.EndsWith(":*"))
{
updateChannel += ":*";
chUpdate += ":*";
}
if (!shapeChannel.EndsWith(":*"))
if (!chShape.EndsWith(":*"))
{
shapeChannel += ":*";
chShape += ":*";
}
if (!hwListChannel.EndsWith(":*"))
if (!chHwList.EndsWith(":*"))
{
hwListChannel += ":*";
chHwList += ":*";
}
if (!hwOptChannel.EndsWith(":*"))
if (!chHwOpt.EndsWith(":*"))
{
hwOptChannel += ":*";
chHwOpt += ":*";
}
if (!profListChannel.EndsWith(":*"))
if (!chProfList.EndsWith(":*"))
{
profListChannel += ":*";
chProfList += ":*";
}
#endif
// Configurazione serializzatore JSON per risolvere errore di loop circolare
JSSettings = new JsonSerializerSettings()
@@ -88,14 +97,14 @@ namespace EgwCoreLib.Lux.Data.Services
};
// Configurazione pipe dei messaggi
PipePng = new MessagePipe(redisConn, pngChannel);
PipeSvg = new MessagePipe(redisConn, svgChannel);
PipeBom = new MessagePipe(RedisConn, bomChannel);
PipeUpdate = new MessagePipe(RedisConn, updateChannel);
PipeShape = new MessagePipe(RedisConn, shapeChannel);
PipeHwList = new MessagePipe(RedisConn, hwListChannel);
PipeHwOpt = new MessagePipe(RedisConn, hwOptChannel);
PipeProfList = new MessagePipe(RedisConn, profListChannel);
PipeBom = new MessagePipe(redisConn, chBom);
PipeHwList = new MessagePipe(redisConn, chHwList);
PipeHwOpt = new MessagePipe(redisConn, chHwOpt);
PipePng = new MessagePipe(redisConn, chPng);
PipeProfList = new MessagePipe(redisConn, chProfList);
PipeShape = new MessagePipe(redisConn, chShape);
PipeSvg = new MessagePipe(redisConn, chSvg);
PipeUpdate = new MessagePipe(redisConn, chUpdate);
}
#endregion Public Constructors
@@ -109,36 +118,37 @@ namespace EgwCoreLib.Lux.Data.Services
/// <summary>
/// Pipe dei messaggi per ritorno HwList da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da HwListChannel.
/// I messaggi vengono inviati sul canale Redis definito da ChannelHwList.
/// </summary>
public MessagePipe PipeHwList { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno HwOptions calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da HwOptChannel.
/// I messaggi vengono inviati sul canale Redis definito da ChannelHwOpt.
/// </summary>
public MessagePipe PipeHwOpt { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno PNG calcolati da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da ChannelPng.
/// </summary>
public MessagePipe PipePng { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno ProfileList calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da ProfListChannel.
/// I messaggi vengono inviati sul canale Redis definito da ChannelProfList.
/// </summary>
public MessagePipe PipeProfList { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno Shape calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da ShapeChannel.
/// I messaggi vengono inviati sul canale Redis definito da ChannelShape.
/// </summary>
public MessagePipe PipeShape { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno PNG calcolati da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da PngChannel.
/// </summary>
public MessagePipe PipePng { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno SVG calcolati da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da SvgChannel.
/// I messaggi vengono inviati sul canale Redis definito da ChannelSvg.
/// </summary>
public MessagePipe PipeSvg { get; set; } = null!;
@@ -220,11 +230,6 @@ namespace EgwCoreLib.Lux.Data.Services
/// </summary>
private static Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Redis channel for BOM related info
/// </summary>
private string bomChannel = "";
/// <summary>
/// Durata della cache lunga in secondi (predefinito: 5 minuti)
/// Utilizzato nella proprietà LongCache per definire quanto a lungo i dati devono essere memorizzati in cache.
@@ -237,19 +242,47 @@ namespace EgwCoreLib.Lux.Data.Services
/// </summary>
private int cacheTtlShort = 60 * 1;
/// <summary>
/// Redis channel for BOM related info
/// </summary>
private string chBom = "";
/// <summary>
/// Canale ritorno Hw List
/// </summary>
private string hwListChannel = "";
private string chHwList = "";
/// <summary>
/// Canale ritorno Hw Options
/// </summary>
private string hwOptChannel = "";
private string chHwOpt = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img png.
/// Predefinito a "png:img" con suffisso ":*".
/// </summary>
private string chPng = "";
/// <summary>
/// Canale ritorno Profile List
/// </summary>
private string profListChannel = "";
private string chProfList = "";
/// <summary>
/// Canale ritorno shape calcolate
/// </summary>
private string chShape = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img svg.
/// Predefinito a "svg:img" con suffisso ":*".
/// </summary>
private string chSvg = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi di update
/// </summary>
private string chUpdate = "";
/// <summary>
/// Generatore di numeri casuali utilizzato per introdurre variabilità dinamica nelle durate della cache
@@ -257,28 +290,28 @@ namespace EgwCoreLib.Lux.Data.Services
/// </summary>
private Random rnd = new Random();
/// <summary>
/// Canale ritorno shape calcolate
/// </summary>
private string shapeChannel = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img svg.
/// Predefinito a "svg:img" con suffisso ":*".
/// </summary>
private string svgChannel = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img png.
/// Predefinito a "png:img" con suffisso ":*".
/// </summary>
private string pngChannel = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi di update
/// </summary>
private string updateChannel = "";
#endregion Private Fields
#region Private Methods
/// <summary>
/// Fix Receive Channel (ricerca "like")
/// </summary>
/// <param name="currCh"></param>
private void fixRecChannel(ref string currCh)
{
#if false
if (!currCh.EndsWith(":*"))
{
//currCh += ":*";
}
#endif
if (!currCh.EndsWith("*"))
{
currCh += "*";
}
}
#endregion Private Methods
}
}
@@ -14,11 +14,9 @@ namespace EgwCoreLib.Lux.Data.Services
{
#region Public Constructors
public CalcRequestService(IConfiguration config, IRedisService redisService)
public CalcRequestService(IConfiguration config)
{
_config = config;
_redisService = redisService;
bomChannel = _config.GetValue<string>("ServerConf:BomChannel") ?? "bom";
// verifico la url base
apiUrl = _config.GetValue<string>("ServerConf:Prog.ApiUrl") ?? "https://iis01.egalware.com/lux/srv/api";
routeBasePath = _config.GetValue<string>("ServerConf:RouteBaseUrl") ?? "window";
@@ -61,9 +59,7 @@ namespace EgwCoreLib.Lux.Data.Services
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private readonly IRedisService _redisService;
private readonly string apiUrl = "";
private readonly string bomChannel = "bomdev";
private readonly string routeBasePath = "";
private IConfiguration _config;
@@ -1,15 +1,8 @@
using EgwCoreLib.Lux.Core.RestPayload;
using EgwMultiEngineManager.Data;
using EgwMultiEngineManager.Data;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using NLog;
using RestSharp;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.Services
{
@@ -22,14 +15,14 @@ namespace EgwCoreLib.Lux.Data.Services
_config = config;
_redisService = redisService;
// conf channels x comunicazione broadcast
hwOptChannel = _config.GetValue<string>("ServerConf:HwOptChannel") ?? "Egw:hw";
pngChannel = _config.GetValue<string>("ServerConf:PngChannel") ?? "Egw:png:img";
svgChannel = _config.GetValue<string>("ServerConf:SvgChannel") ?? "Egw:svg:img";
bomChannel = _config.GetValue<string>("ServerConf:BomChannel") ?? "Egw:bom";
hmlChannel = _config.GetValue<string>("ServerConf:HwListChannel") ?? "Egw:hml";
profListChannel = _config.GetValue<string>("ServerConf:ProfListChannel") ?? "Egw:prof";
shapeChannel = _config.GetValue<string>("ServerConf:ShapeChannel") ?? "Egw:shape";
updateChannel = _config.GetValue<string>("ServerConf:UpdateChannel") ?? "Egw:update";
chBom = _config.GetValue<string>("ServerConf:ChannelBom") ?? "lux:bom";
chHwList = _config.GetValue<string>("ServerConf:ChannelHwList") ?? "lux:hw:list";
chHwOpt = _config.GetValue<string>("ServerConf:ChannelHwOpt") ?? "lux:hw:opt";
chPng = _config.GetValue<string>("ServerConf:ChannelPng") ?? "lux:png:img";
chProfList = _config.GetValue<string>("ServerConf:ChannelProfList") ?? "lux:prof";
chShape = _config.GetValue<string>("ServerConf:ChannelShape") ?? "lux:shape";
chSvg = _config.GetValue<string>("ServerConf:ChannelSvg") ?? "lux:svg:img";
chUpdate = _config.GetValue<string>("ServerConf:ChannelUpdate") ?? "lux:update";
// conf tag x cache
liveTag = _config.GetValue<string>("ServerConf:ImageLiveTag") ?? "svg";
cacheTag = _config.GetValue<string>("ServerConf:ImageFileTag") ?? "svgfile";
@@ -138,9 +131,11 @@ namespace EgwCoreLib.Lux.Data.Services
{
case Constants.EXECENVIRONMENTS.NULL:
break;
case Constants.EXECENVIRONMENTS.WINDOW:
fType = "svg";
break;
case Constants.EXECENVIRONMENTS.BEAM:
case Constants.EXECENVIRONMENTS.WALL:
case Constants.EXECENVIRONMENTS.CABINET:
@@ -148,7 +143,7 @@ namespace EgwCoreLib.Lux.Data.Services
fType = "png";
break;
}
string rndImg = $"{DateTime.Now:HHmmssfff}";
string fullUrl = $"{baseUrl}/{tag}/{imgUID}-{rndImg}.{fType}?env={envir}".Replace("////", "//");
return fullUrl;
@@ -203,7 +198,7 @@ namespace EgwCoreLib.Lux.Data.Services
{
bool done = false;
// invio notifica sul canale di update generale...
string notifyChannel = $"{updateChannel}:{env}";
string notifyChannel = $"{chUpdate}:{env}";
// contenuto è UID
long numSent = await _redisService.PublishAsync(notifyChannel, $"{uid}");
done = numSent > 0;
@@ -241,7 +236,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:BOM:{uid.Replace("/", ":")}";
var done = await _redisService.SetAsync(currKey, bomContent);
// invio notifica nuova svg generata sul canale... viene inviato solo svg con ID nel canale
string notifyChannel = $"{bomChannel}:{uid}";
string notifyChannel = $"{chBom}:{uid}";
long numSent = await _redisService.PublishAsync(notifyChannel, bomContent);
return done;
}
@@ -257,7 +252,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:HML:{uid.Replace("/", ":")}";
var done = await _redisService.SetAsync(currKey, rawData);
// invio notifica nuova svg generata sul canale... viene inviato solo svg con ID nel canale
string notifyChannel = $"{hmlChannel}:{uid}";
string notifyChannel = $"{chHwList}:{uid}";
long numSent = await _redisService.PublishAsync(notifyChannel, rawData);
return done;
}
@@ -275,7 +270,7 @@ namespace EgwCoreLib.Lux.Data.Services
// lascio in cache 15 min x poterlo verificare
var done = await _redisService.SetAsync(currKey, xmlContent, TimeSpan.FromMinutes(15));
// invio notifica nuova XML sul canale (inviato solo XML pulito con ID nel canale)
string notifyChannel = $"{hwOptChannel}:{uid}";
string notifyChannel = $"{chHwOpt}:{uid}";
long numSent = await _redisService.PublishAsync(notifyChannel, xmlContent);
return done;
}
@@ -309,7 +304,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:Img:Png:{imgId.Replace("/", ":")}";
var done = await _redisService.SetAsync(currKey, pngContent);
// invio notifica nuova png generata sul canale... viene inviato solo contenuto con ID nel canale
string notifyChannel = $"{pngChannel}:{imgId}";
string notifyChannel = $"{chPng}:{imgId}";
long numSent = await _redisService.PublishAsync(notifyChannel, "PNG");
// NON pubblico contenuto che x PNG non serve...
//long numSent = await _redisService.PublishAsync(notifyChannel, pngContent);
@@ -327,7 +322,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:PROFLIST:{uid.Replace("/", ":")}";
var done = await _redisService.SetAsync(currKey, rawData);
// invio notifica nuova svg generata sul canale... viene inviato solo svg con ID nel canale
string notifyChannel = $"{profListChannel}:{uid}";
string notifyChannel = $"{chProfList}:{uid}";
long numSent = await _redisService.PublishAsync(notifyChannel, rawData);
return done;
}
@@ -344,7 +339,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:Shape:{uid}";
var done = await _redisService.SetAsync(currKey, shapeContent);
// invio notifica nuova svg generata sul canale... viene inviato solo svg con ID nel canale
string notifyChannel = $"{shapeChannel}:{uid}";
string notifyChannel = $"{chShape}:{uid}";
long numSent = await _redisService.PublishAsync(notifyChannel, shapeContent);
return done;
}
@@ -378,7 +373,7 @@ namespace EgwCoreLib.Lux.Data.Services
string currKey = $"{redisBaseKey}:{env}:Img:Svg:{imgId.Replace("/", ":")}";
var done = await _redisService.SetAsync(currKey, svgContent);
// invio notifica nuova svg generata sul canale... viene inviato solo contenuto con ID nel canale
string notifyChannel = $"{svgChannel}:{imgId}";
string notifyChannel = $"{chSvg}:{imgId}";
long numSent = await _redisService.PublishAsync(notifyChannel, svgContent);
return done;
}
@@ -393,18 +388,18 @@ namespace EgwCoreLib.Lux.Data.Services
private readonly string apiUrl = "";
private readonly string bomChannel = "bom:item";
private readonly string cacheTag = "svgfile";
private readonly string calcTag = "svgpreview";
private readonly string hmlChannel = "hml:item";
private readonly string hwOptChannel = "hw:opt";
private readonly string chBom = "lux:bom";
private readonly string chHwList = "lux:hw:list";
private readonly string chHwOpt = "lux:hw:opt";
private readonly string chPng = "lux:png:img";
private readonly string chProfList = "lux:prof:list";
private readonly string chShape = "shape:curr";
private readonly string chSvg = "lux:svg:img";
private readonly string chUpdate = "lux::update";
private readonly string imgBasePath = "";
private readonly string liveTag = "svg";
private readonly string pngChannel = "png:img";
private readonly string profListChannel = "prof:list";
private readonly string shapeChannel = "shape:curr";
private readonly string svgChannel = "svg:img";
private readonly string updateChannel = "ui:update";
private IConfiguration _config;
private string imageBaseUrl = "";
+4 -4
View File
@@ -19,7 +19,7 @@ namespace Lux.API.Controllers
_config = config;
_redisService = redisService;
_imgService = imgServ;
pubChannel = _config.GetValue<string>("ServerConf:PubChannel") ?? "";
chPub = _config.GetValue<string>("ServerConf:ChannelPub") ?? "";
}
#endregion Public Constructors
@@ -60,7 +60,7 @@ namespace Lux.API.Controllers
// da modificare con tipo richiesta...
QuestionDTO currArgs = new QuestionDTO(nId, currReq.EnvType, DictExec);
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
await _redisService.PublishAsync(chPub, currArgs.sProcessArgs);
retVal = "DONE";
}
sw.Stop();
@@ -97,7 +97,7 @@ namespace Lux.API.Controllers
// da modificare con tipo richiesta...
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
await _redisService.PublishAsync(chPub, currArgs.sProcessArgs);
retVal = "DONE";
}
sw.Stop();
@@ -111,7 +111,7 @@ namespace Lux.API.Controllers
private static Logger Log = LogManager.GetCurrentClassLogger();
private readonly IRedisService _redisService;
private readonly string pubChannel = "";
private readonly string chPub = "";
private IConfiguration _config;
#endregion Private Fields
+5 -5
View File
@@ -21,7 +21,7 @@ namespace Lux.API.Controllers
_redisService = redisService;
_imgService = imgServ;
_confService = confServ;
pubChannel = _config.GetValue<string>("ServerConf:PubChannel") ?? "";
chPub = _config.GetValue<string>("ServerConf:ChannelPub") ?? "";
}
#endregion Public Constructors
@@ -69,7 +69,7 @@ namespace Lux.API.Controllers
// da modificare con tipo richiesta...
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
await _redisService.PublishAsync(chPub, currArgs.sProcessArgs);
svgContent = "DONE";
}
sw.Stop();
@@ -111,7 +111,7 @@ namespace Lux.API.Controllers
int nId = 1;
// da modificare con tipo richiesta...
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
await _redisService.PublishAsync(chPub, currArgs.sProcessArgs);
}
/// <summary>
@@ -247,7 +247,7 @@ namespace Lux.API.Controllers
// da modificare con tipo richiesta...
QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec);
await _redisService.PublishAsync(pubChannel, currArgs.sProcessArgs);
await _redisService.PublishAsync(chPub, currArgs.sProcessArgs);
svgContent = "DONE";
}
sw.Stop();
@@ -261,7 +261,7 @@ namespace Lux.API.Controllers
private static Logger Log = LogManager.GetCurrentClassLogger();
private readonly IRedisService _redisService;
private readonly string pubChannel = "";
private readonly string chPub = "";
private IConfiguration _config;
/// <summary>
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2511.0616</Version>
<Version>0.9.2511.0618</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -62,7 +62,7 @@ app.UsePathBase(baseUrl);
logger.Info($"BaseUrl: {baseUrl}");
// log channels di ritorno UI
List<string> listParams = new List<string>() { "PngChannel", "SubChannel", "PubChannel", "SvgChannel" };
List<string> listParams = new List<string>() { "ChannelPng", "ChannelSub", "ChannelPub", "ChannelSvg" };
foreach (var param in listParams)
{
logger.Info($"{param}: {configuration.GetValue<string>($"ServerConf:{param}") ?? ""}");
+3 -3
View File
@@ -12,7 +12,7 @@ namespace Lux.API.Services
_subManager = subManager;
_processor = processor;
_config = config;
subChannel = _config.GetValue<string>("ServerConf:SubChannel") ?? "";
chSub = _config.GetValue<string>("ServerConf:ChannelSub") ?? "";
}
#endregion Public Constructors
@@ -21,7 +21,7 @@ namespace Lux.API.Services
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_subManager.Subscribe(subChannel, async (ch, msg) =>
_subManager.Subscribe(chSub, async (ch, msg) =>
{
await _processor.HandleResultMessageAsync($"{ch}", $"{msg}");
});
@@ -36,7 +36,7 @@ namespace Lux.API.Services
private readonly IConfiguration _config;
private readonly ExternalMessageProcessor _processor;
private readonly RedisSubscriptionManager _subManager;
private readonly string subChannel = "";
private readonly string chSub = "";
#endregion Private Fields
}
+10 -10
View File
@@ -6,17 +6,17 @@
}
},
"ServerConf": {
"PngChannel": "luxdev:png:img",
"SvgChannel": "luxdev:svg:img",
"ShapeChannel": "luxdev:shape:curr",
"HwListChannel": "luxdev:hw:list",
"HwOptChannel": "luxdev:hw:opt",
"ProfListChannel": "luxdev:prof:list",
"BomChannel": "luxdev:bom",
"UpdateChannel": "luxdev:update",
"ChannelPng": "luxdev:png:img",
"ChannelSvg": "luxdev:svg:img",
"ChannelShape": "luxdev:shape:curr",
"ChannelHwList": "luxdev:hw:list",
"ChannelHwOpt": "luxdev:hw:opt",
"ChannelProfList": "luxdev:prof:list",
"ChannelBom": "luxdev:bom",
"ChannelUpdate": "luxdev:update",
"BaseUrl": "/lux/srv/",
//"PubChannel": "EgwDevEngineInput",
//"SubChannel": "EgwDevEngineOutput",
//"ChannelPub": "EgwDevEngineInput",
//"ChannelSub": "EgwDevEngineOutput",
"ImageBaseUrl": "https://iis01.egalware.com/lux/srv/api/window/"
}
}
+10 -10
View File
@@ -7,16 +7,16 @@
},
"ServerConf": {
"BaseUrl": "/lux/srv/",
"PngChannel": "Egw:png:img",
"SvgChannel": "Egw:svg:img",
"ShapeChannel": "Egw:shape:curr",
"HwListChannel": "Egw:hw:list",
"HwOptChannel": "Egw:hw:opt",
"ProfListChannel": "Egw:prof:list",
"BomChannel": "Egw:bom",
"UpdateChannel": "Egw:update",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"ChannelPng": "Egw:png:img",
"ChannelSvg": "Egw:svg:img",
"ChannelShape": "Egw:shape:curr",
"ChannelHwList": "Egw:hw:list",
"ChannelHwOpt": "Egw:hw:opt",
"ChannelProfList": "Egw:prof:list",
"ChannelBom": "Egw:bom",
"ChannelUpdate": "Egw:update",
"ChannelPub": "EgwEngineInput",
"ChannelSub": "EgwEngineOutput",
"ImageBaseUrl": "https://office.egalware.com/lux/srv/api/window/"
}
}
+10 -10
View File
@@ -6,16 +6,16 @@
}
},
"ServerConf": {
"PngChannel": "luxstag:png:img",
"SvgChannel": "luxstag:svg:img",
"ShapeChannel": "luxstag:shape:curr",
"HwListChannel": "luxstag:hw:list",
"HwOptChannel": "luxstag:hw:opt",
"ProfListChannel": "luxstag:prof:list",
"BomChannel": "luxstag:bom",
"UpdateChannel": "luxstag:update",
"ChannelPng": "luxstag:png:img",
"ChannelSvg": "luxstag:svg:img",
"ChannelShape": "luxstag:shape:curr",
"ChannelHwList": "luxstag:hw:list",
"ChannelHwOpt": "luxstag:hw:opt",
"ChannelProfList": "luxstag:prof:list",
"ChannelBom": "luxstag:bom",
"ChannelUpdate": "luxstag:update",
"BaseUrl": "/lux/srv/",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput"
"ChannelPub": "EgwEngineInput",
"ChannelSub": "EgwEngineOutput"
}
}
+18 -18
View File
@@ -56,26 +56,26 @@
},
"ServerConf": {
"CalcTag": "calc",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"ChannelPub": "EgwEngineInput",
"ChannelSub": "EgwEngineOutput",
"PngChannel": "luxdev:png:img",
"SvgChannel": "luxdev:svg:img",
"ShapeChannel": "luxdev:shape:curr",
"HwListChannel": "luxdev:hw:list",
"HwOptChannel": "luxdev:hw:opt",
"ProfListChannel": "luxdev:prof:list",
"BomChannel": "luxdev:bom",
"UpdateChannel": "luxdev:update",
"ChannelPng": "luxdev:png:img",
"ChannelSvg": "luxdev:svg:img",
"ChannelShape": "luxdev:shape:curr",
"ChannelHwList": "luxdev:hw:list",
"ChannelHwOpt": "luxdev:hw:opt",
"ChannelProfList": "luxdev:prof:list",
"ChannelBom": "luxdev:bom",
"ChannelUpdate": "luxdev:update",
//"PngChannel": "Egw:png:img",
//"SvgChannel": "Egw:svg:img",
//"ShapeChannel": "Egw:shape:curr",
//"HwListChannel": "Egw:hw:list",
//"HwOptChannel": "Egw:hw:opt",
//"ProfListChannel": "Egw:prof:list",
//"BomChannel": "Egw:bom",
//"UpdateChannel": "Egw:update",
//"ChannelPng": "Egw:png:img",
//"ChannelSvg": "Egw:svg:img",
//"ChannelShape": "Egw:shape:curr",
//"ChannelHwList": "Egw:hw:list",
//"ChannelHwOpt": "Egw:hw:opt",
//"ChannelProfList": "Egw:prof:list",
//"ChannelBom": "Egw:bom",
//"ChannelUpdate": "Egw:update",
"BaseUrl": "/lux/srv/",
"ImageBaseUrl": "https://iis01.egalware.com/lux/srv/api/window/",
"ImageCalcTag": "svg-preview",
+30 -30
View File
@@ -22,7 +22,7 @@ namespace Lux.UI.Components.Compo
#region Public Enums
/// <summary>
/// modalità modifica riga offerta
/// modalit modifica riga offerta
/// </summary>
public enum EditMode
{
@@ -276,7 +276,7 @@ namespace Lux.UI.Components.Compo
var listCalc = SorListCalc();
foreach (var item in listCalc)
{
// se UID è tra quelli da ricalcolare...
// se UID tra quelli da ricalcolare...
if (list2fix.Contains(item.OfferRowUID))
{
// chiedo BOM e immagine
@@ -311,7 +311,7 @@ namespace Lux.UI.Components.Compo
{
// imposto edit record
EditRecord = curRec;
/// modalitàedit: gestione valori campi record
/// modalitedit: gestione valori campi record
CurrEditMode = EditMode.RecData;
}
@@ -324,7 +324,7 @@ namespace Lux.UI.Components.Compo
protected void DoEditFile(OfferRowModel curRec)
{
EditRecord = curRec;
/// modalitàedit: gestione JWD
/// modalitedit: gestione JWD
CurrEditMode = EditMode.File;
#if false
// preparazione dati da record corrente
@@ -341,7 +341,7 @@ namespace Lux.UI.Components.Compo
protected void DoEditJwd(OfferRowModel curRec)
{
EditRecord = curRec;
/// modalitàedit: gestione JWD
/// modalitedit: gestione JWD
CurrEditMode = EditMode.SerStruc;
// preparazione dati da record corrente
PrepareWindowData(EditRecord.SerStruct);
@@ -369,19 +369,19 @@ namespace Lux.UI.Components.Compo
}
/// <summary>
/// Seleziono riga senza cambiare modalità editing
/// Seleziono riga senza cambiare modalit editing
/// </summary>
/// <param name="curRec"></param>
protected void DoSelect(OfferRowModel curRec)
{
// imposto edit record
EditRecord = curRec;
/// modalitàedit: gestione valori campi record
/// modalitedit: gestione valori campi record
CurrEditMode = EditMode.None;
}
/// <summary>
/// Imposta modalità edit ciclo di lavoro
/// Imposta modalit edit ciclo di lavoro
/// </summary>
/// <param name="currRow"></param>
protected void DoSwapJobCycle(OfferRowModel currRow)
@@ -392,7 +392,7 @@ namespace Lux.UI.Components.Compo
}
/// <summary>
/// Imposta modalità ad edit BOM
/// Imposta modalit ad edit BOM
/// </summary>
/// <param name="currRow"></param>
protected void DoSwapMat(OfferRowModel currRow)
@@ -449,7 +449,7 @@ namespace Lux.UI.Components.Compo
foreach (var item in listCalc)
{
await DLService.OffertUpdateAwaitState(item.OfferRowID, true, true);
// poiché non è gestito evento ritorno update window interno si "scassa" --> try catch/ if FALSE
// poich non gestito evento ritorno update window interno si "scassa" --> try catch/ if FALSE
try
{
string rColor = CurrSel.GetVal("Color");
@@ -626,7 +626,7 @@ namespace Lux.UI.Components.Compo
private List<BomItemDTO>? CurrBomList = null;
/// <summary>
/// Modalità editint attiva
/// Modalit editint attiva
/// </summary>
private EditMode CurrEditMode = EditMode.None;
@@ -651,12 +651,12 @@ namespace Lux.UI.Components.Compo
/// <summary>
/// Channel update HwOptions
/// </summary>
private string hwOptChannel = "";
private string chHwOpt = "";
private string imgBasePath = "";
/// <summary>
/// Semaforo x definire se sia già in modalità ionterattiva o di prerendering
/// Semaforo x definire se sia gi in modalit ionterattiva o di prerendering
/// </summary>
private bool isInteractive = false;
@@ -674,7 +674,7 @@ namespace Lux.UI.Components.Compo
/// <summary>
/// Channel update PNG
/// </summary>
private string pngChannel = "";
private string chPng = "";
/// <summary>
/// Versione precedente JWD x test e confronto
@@ -684,7 +684,7 @@ namespace Lux.UI.Components.Compo
/// <summary>
/// Channel update Profile List
/// </summary>
private string profListChannel = "";
private string chProfList = "";
/// <summary>
/// Dizionario richieste
@@ -694,12 +694,12 @@ namespace Lux.UI.Components.Compo
/// <summary>
/// Channel update Shape
/// </summary>
private string shapeChannel = "";
private string chShape = "";
/// <summary>
/// Channel update SVG
/// </summary>
private string svgChannel = "";
private string chSvg = "";
private int totalCount = 0;
@@ -766,11 +766,11 @@ namespace Lux.UI.Components.Compo
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
genericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "calc";
pngChannel = Config.GetValue<string>("ServerConf:PngChannel") ?? "";
svgChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
shapeChannel = Config.GetValue<string>("ServerConf:ShapeChannel") ?? "";
hwOptChannel = Config.GetValue<string>("ServerConf:HwOptChannel") ?? "";
profListChannel = Config.GetValue<string>("ServerConf:ProfListChannel") ?? "";
chHwOpt = Config.GetValue<string>("ServerConf:ChannelHwOpt") ?? "";
chPng = Config.GetValue<string>("ServerConf:ChannelPng") ?? "";
chProfList = Config.GetValue<string>("ServerConf:ChannelProfList") ?? "";
chShape = Config.GetValue<string>("ServerConf:ChannelShape") ?? "";
chSvg = Config.GetValue<string>("ServerConf:ChannelSvg") ?? "";
}
private async Task DoRecalcOffer()
@@ -819,7 +819,7 @@ namespace Lux.UI.Components.Compo
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{hwOptChannel}:{EditRecord.OfferRowUID}"))
if (currArgs.msgUid.Equals($"{chHwOpt}:{EditRecord.OfferRowUID}"))
{
var rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage) ?? new Dictionary<int, string>();
currHwOption = rawDict;
@@ -841,7 +841,7 @@ namespace Lux.UI.Components.Compo
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{pngChannel}:{EditRecord.OfferRowUID}"))
if (currArgs.msgUid.Equals($"{chPng}:{EditRecord.OfferRowUID}"))
{
currPng = currArgs.newMessage;
// non devo passarlo al componente...
@@ -870,7 +870,7 @@ namespace Lux.UI.Components.Compo
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{profListChannel}:{EditRecord.OfferRowUID}"))
if (currArgs.msgUid.Equals($"{chProfList}:{EditRecord.OfferRowUID}"))
{
try
{
@@ -918,7 +918,7 @@ namespace Lux.UI.Components.Compo
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.StartsWith($"{shapeChannel}:{EditRecord.OfferRowUID}"))
if (currArgs.msgUid.StartsWith($"{chShape}:{EditRecord.OfferRowUID}"))
{
// deserializzo il dizionario delle risposte...
var rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage);
@@ -944,7 +944,7 @@ namespace Lux.UI.Components.Compo
}
/// <summary>
/// Ricevuto SVG, se è il mio lo aggiorno...
/// Ricevuto SVG, se il mio lo aggiorno...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@@ -958,7 +958,7 @@ namespace Lux.UI.Components.Compo
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{svgChannel}:{EditRecord.OfferRowUID}"))
if (currArgs.msgUid.Equals($"{chSvg}:{EditRecord.OfferRowUID}"))
{
currSvg = currArgs.newMessage;
// salvo in live data...
@@ -1289,7 +1289,7 @@ namespace Lux.UI.Components.Compo
}
/// <summary>
/// Verifia ammissibilità display btn ricalcolo BOM da item
/// Verifia ammissibilit display btn ricalcolo BOM da item
/// </summary>
/// <param name="reqItem"></param>
/// <returns></returns>
@@ -1333,7 +1333,7 @@ namespace Lux.UI.Components.Compo
}
/// <summary>
/// Toggle visibilità modifica file indicando ID della OfferRow corrente (o zero se deselect)
/// Toggle visibilit modifica file indicando ID della OfferRow corrente (o zero se deselect)
/// </summary>
private void ToggleFileEdit(OfferRowModel? currRec)
{
+4 -4
View File
@@ -60,7 +60,7 @@ namespace Lux.UI.Components.Pages
apiUrl = Config.GetValue<string>("ServerConf:Prog.ApiUrl") ?? "";
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
calcTag = Config.GetValue<string>("ServerConf:ImageCalcTag") ?? "";
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
chSub = Config.GetValue<string>("ServerConf:ChannelSvg") ?? "";
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
}
@@ -97,11 +97,11 @@ namespace Lux.UI.Components.Pages
private string imgBasePath = "";
/// <summary>
/// Semaforo x definire se sia già in modalità ionterattiva o di prerendering
/// Semaforo x definire se sia gi in modalit ionterattiva o di prerendering
/// </summary>
private bool isInteractive = false;
private string subChannel = "";
private string chSub = "";
private string windowUid = "TestWindow";
#endregion Private Fields
@@ -115,7 +115,7 @@ namespace Lux.UI.Components.Pages
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{subChannel}:{windowUid}"))
if (currArgs.msgUid.Equals($"{chSub}:{windowUid}"))
{
currSvg = currArgs.newMessage;
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2511.0616</Version>
<Version>0.9.2511.0618</Version>
</PropertyGroup>
<ItemGroup>
+10 -10
View File
@@ -6,15 +6,15 @@
}
},
"ServerConf": {
"PngChannel": "luxdev:png:img",
"SvgChannel": "luxdev:svg:img",
"ShapeChannel": "luxdev:shape:curr",
"HwListChannel": "luxdev:hw:list",
"HwOptChannel": "luxdev:hw:opt",
"ProfListChannel": "luxdev:prof:list",
"BomChannel": "luxdev:bom",
"UpdateChannel": "luxdev:update",
"PubChannel": "EgwDevEngineInput",
"SubChannel": "EgwDevEngineOutput"
"ChannelPng": "luxdev:png:img",
"ChannelSvg": "luxdev:svg:img",
"ChannelShape": "luxdev:shape:curr",
"ChannelHwList": "luxdev:hw:list",
"ChannelHwOpt": "luxdev:hw:opt",
"ChannelProfList": "luxdev:prof:list",
"ChannelBom": "luxdev:bom",
"ChannelUpdate": "luxdev:update",
"ChannelPub": "EgwDevEngineInput",
"ChannelSub": "EgwDevEngineOutput"
}
}
+10 -10
View File
@@ -6,16 +6,16 @@
}
},
"ServerConf": {
"PngChannel": "Egw:png:img",
"SvgChannel": "Egw:svg:img",
"ShapeChannel": "Egw:shape:curr",
"HwListChannel": "Egw:hw:list",
"HwOptChannel": "Egw:hw:opt",
"ProfListChannel": "Egw:prof:list",
"BomChannel": "Egw:bom",
"UpdateChannel": "Egw:update",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"ChannelPng": "Egw:png:img",
"ChannelSvg": "Egw:svg:img",
"ChannelShape": "Egw:shape:curr",
"ChannelHwList": "Egw:hw:list",
"ChannelHwOpt": "Egw:hw:opt",
"ChannelProfList": "Egw:prof:list",
"ChannelBom": "Egw:bom",
"ChannelUpdate": "Egw:update",
"ChannelPub": "EgwEngineInput",
"ChannelSub": "EgwEngineOutput",
"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api"
}
}
+10 -10
View File
@@ -6,16 +6,16 @@
}
},
"ServerConf": {
"PngChannel": "luxstag:png:img",
"SvgChannel": "luxstag:svg:img",
"ShapeChannel": "luxstag:shape:curr",
"HwListChannel": "luxstag:hw:list",
"HwOptChannel": "luxstag:hw:opt",
"ProfListChannel": "luxstag:prof:list",
"BomChannel": "luxstag:bom",
"UpdateChannel": "luxstag:update",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"ChannelPng": "luxstag:png:img",
"ChannelSvg": "luxstag:svg:img",
"ChannelShape": "luxstag:shape:curr",
"ChannelHwList": "luxstag:hw:list",
"ChannelHwOpt": "luxstag:hw:opt",
"ChannelProfList": "luxstag:prof:list",
"ChannelBom": "luxstag:bom",
"ChannelUpdate": "luxstag:update",
"ChannelPub": "EgwEngineInput",
"ChannelSub": "EgwEngineOutput",
"Prog.ApiUrl": "https://iis01.egalware.com/lux/srv/api"
}
}
+10 -21
View File
@@ -63,27 +63,16 @@
//"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api",
"ImageBaseUrl": "Image",
"RouteBaseUrl": "window",
"PngChannel": "luxdev:png:img",
"SvgChannel": "luxdev:svg:img",
"ShapeChannel": "luxdev:shape:curr",
"HwListChannel": "luxdev:hw:list",
"HwOptChannel": "luxdev:hw:opt",
"ProfListChannel": "luxdev:prof:list",
"BomChannel": "luxdev:bom",
"UpdateChannel": "luxdev:update",
//"BomChannel": "Egw:bom",
//"HwListChannel": "Egw:hw:list",
//"HwOptChannel": "Egw:hw:opt",
//"ProfListChannel": "Egw:prof:list",
//"ShapeChannel": "Egw:shape:curr",
//"PngChannel": "Egw:png:img",
//"SvgChannel": "Egw:svg:img",
//"UpdateChannel": "Egw:update",
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"ChannelBom": "luxdev:bom",
"ChannelHwList": "luxdev:hw:list",
"ChannelHwOpt": "luxdev:hw:opt",
"ChannelPng": "luxdev:png:img",
"ChannelProfList": "luxdev:prof:list",
"ChannelPub": "EgwEngineInput",
"ChannelShape": "luxdev:shape:curr",
"ChannelSub": "EgwEngineOutput",
"ChannelSvg": "luxdev:svg:img",
"ChannelUpdate": "luxdev:update",
"ImageCalcTag": "live",
"ImageFileTag": "cache",
"ImageLiveTag": "svg",
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2511.0616</h4>
<h4>Versione: 0.9.2511.0618</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2511.0616
0.9.2511.0618
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2511.0616</version>
<version>0.9.2511.0618</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>