- aggiunto RUID su tutte le richieste

- introdotta funzione EgtSanitizeUtf8 da LuaLibs
- aggiunta modalita' Balance su chiamata REST per Beam
- aggiunta funzione CreateBWEFromMachGroup
- aggiunta funzione per nesting travi
-  aggiunto calcolo lista soglie per finestre
- copiato file WindowRESTPipe da BeamRESTPipe
This commit is contained in:
Emmanuele Sassi
2026-01-09 13:32:19 +01:00
parent 4c871f76ef
commit d76c2e37e6
7 changed files with 977 additions and 26 deletions
+41 -14
View File
@@ -30,6 +30,7 @@ QUESTION_MODES = {
QUESTION_CONFIG_SUBMODES = {
NULL = 0,
PROFILELIST = 1,
THRESHOLDLIST = 2,
}
QUESTION_HARDWARE_SUBMODES = {
@@ -164,19 +165,6 @@ local function Calc_BOM( QuestionArgs)
WDG.CALC_OPTIONLIST=false
WinCalculate_AddHardware()
---- creo file svg
--WDG.GROUPID = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PREVIEW)
--WDG.FILE = 'C:\\Temp\\TestSvgManager.svg'
--WinGetSvg()
---- leggo il file
--local SouFh = io.open( WDG.FILE, "rb")
--local content
--if SouFh then
-- content = SouFh:read( "*all")
-- --EgtOutBox( 'Error opening ' .. sFilePath, 'ReadFromFile', 'ERROR')
-- SouFh:close()
-- --return false
--end
WinGetSectionsTotalLenghts()
WinGetGlassesList()
-- do risultato
@@ -408,7 +396,42 @@ local function Calc_ProfileList()
end
end
local nErr = 999
local function Calc_ThresholdList( QuestionArgs)
-- leggo argomenti passati
local sProfileName = QuestionArgs["ProfileName"]
if sProfileName and #sProfileName > 0 then
-- imposto cartella profili
local sProfileDir = ''
sProfileDir = EgtGetStringFromIni( 'Window', 'ProfileDir', '', sIniFilePath)
if sProfileDir and #sProfileDir > 0 then
WDG.PROFILEPATH = sProfileDir
SetProfilePath()
else
local sErrorMsg = 'Errore! Cartella dei profili non trovata!'
EgtOutLog(sErrorMsg)
return 0, { Error = sErrorMsg}
end
WDG.PROFILE = sProfileName
GetProfileThresholdsList()
if WDG.THRESHOLDSLIST then
local ThresholdList = {}
for ThresholdIndex = 1, #WDG.THRESHOLDSLIST do
table.insert( ThresholdList, { Type = WDG.THRESHOLDSLIST[ThresholdIndex].nType, Name = WDG.THRESHOLDSLIST[ThresholdIndex].sName})
end
local JsonThresholdList = JSON:encode( ThresholdList)
return 1, { ThresholdList = JsonThresholdList}
else
local sErrorMsg = 'Errore! Soglie non trovate!'
EgtOutLog(sErrorMsg)
return 0, { Error = sErrorMsg}
end
else
local sErrorMsg = 'Errore! Profilo non trovato!'
EgtOutLog(sErrorMsg)
return 0, { Error = sErrorMsg}
end
end
local nNilCount = 0
local bRun = true
@@ -437,6 +460,7 @@ while bRun do
local QuestionArgs = Question["Args"]
if QuestionArgs and QuestionArgs.Mode and QuestionArgs.UID then
local sUid = QuestionArgs["UID"]
local sRUID = QuestionArgs["RUID"]
local nMode = tonumber( QuestionArgs["Mode"])
_G.WDG = {}
WDG.REDISID = nRedisConnectionId
@@ -474,6 +498,8 @@ while bRun do
local nSubMode = tonumber( QuestionArgs["SubMode"])
if nSubMode == QUESTION_CONFIG_SUBMODES.PROFILELIST then
nResult, AnswerArgs = Calc_ProfileList()
elseif nSubMode == QUESTION_CONFIG_SUBMODES.THRESHOLDLIST then
nResult, AnswerArgs = Calc_ThresholdList( QuestionArgs)
else
nResult = 0
local sErrorMsg = 'Errore! Valore di SubMode errato!'
@@ -488,6 +514,7 @@ while bRun do
end
end
AnswerArgs.UID = sUid
AnswerArgs.RUID = sRUID or 0
else
nResult = 0
local sErrorMsg = 'Errore! Domanda senza argomenti o senza UID o Mode che sono obbligatori!'