- gestione errori su dati d'ingresso
- verifica sulla stima fatta per sezione - aggiunta funziona CreateProduction ed abbozzo CalcProduction - anticipato subscribe a risposta verifica via Redis - aggiunta lettura dati del profilo
This commit is contained in:
+967
-504
File diff suppressed because it is too large
Load Diff
+6
-3
@@ -347,9 +347,12 @@ function BeamWallPipeLib.AsyncVerifyPartCalc( nPartId, BarPath, ProjType, sMachi
|
||||
Args = Args}
|
||||
local JsonQuestion = JSON:encode( Question)
|
||||
|
||||
EgtRedisAsyncSubscribe( nRedisConnectionId, CurrAnswerChannel)
|
||||
local bOk = EgtRedisAsyncPublish( nRedisConnectionId, QuestionChannel, JsonQuestion)
|
||||
if bOk then
|
||||
EgtRedisAsyncSubscribe( nRedisConnectionId, CurrAnswerChannel)
|
||||
if not bOk then
|
||||
EgtOutLog( 'Error! Verify Redis publish failed on PartId ' .. nPartId .. ' and channel ' .. CurrAnswerChannel .. '!')
|
||||
EgtRedisAsyncUnsubscribe( nRedisConnectionId, CurrAnswerChannel)
|
||||
EgtOutLog( 'EgtRedisAsyncUnsubscribe ' .. nRedisConnectionId .. ' ' .. CurrAnswerChannel)
|
||||
end
|
||||
return bOk, CurrAnswerChannel
|
||||
end
|
||||
@@ -469,7 +472,7 @@ function BeamWallPipeLib.NestBeam( PartIdList, RawList, MachineNameList, StartOf
|
||||
if not bOk then
|
||||
local sErrorMsg = 'Errore! Chiamata alla funzione NestProcessNew.lua fallita! (' .. ( sErr or '') .. ')'
|
||||
EgtOutLog( sErrorMsg)
|
||||
return false, { Error = sErrorMsg}
|
||||
return false, sErrorMsg
|
||||
end
|
||||
--EgtSaveFile()
|
||||
--local bMachiningOk ,dTime = AnalyzeResult( RESULT)
|
||||
|
||||
+77
-10
@@ -39,6 +39,7 @@ QUESTION_HARDWARE_SUBMODES = {
|
||||
CALCHARDWARE = 2,
|
||||
HARDWAREOPTION = 3,
|
||||
SASHSHAPE = 4,
|
||||
PROFILEDATAFROMAREA = 5,
|
||||
}
|
||||
|
||||
-- produttore
|
||||
@@ -348,8 +349,8 @@ local function Calc_SashShape( QuestionArgs)
|
||||
WDG.VALUE = false
|
||||
WinCalculate_SetCalcPreview()
|
||||
-- creazione pezzi
|
||||
--WDG.FRAMEID = AreaId
|
||||
--WinCalculate_CreatePartFromArea()
|
||||
WDG.FRAMEID = AreaId
|
||||
WinCalculate_CreatePartFromArea()
|
||||
for i = 1, #GroupId do
|
||||
WDG['AREANBR' .. tostring(i)] = GroupId[i]
|
||||
end
|
||||
@@ -378,6 +379,56 @@ local function Calc_SashShape( QuestionArgs)
|
||||
end
|
||||
end
|
||||
|
||||
local function Calc_AreaProfiles( QuestionArgs)
|
||||
-- leggo argomenti passati
|
||||
local sJwd = QuestionArgs["SerializedData"]
|
||||
local JsonGroupId = QuestionArgs["GroupId"]
|
||||
if sJwd and JsonGroupId and #sJwd > 0 and #JsonGroupId > 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
|
||||
local GroupId = JSON:decode( JsonGroupId)
|
||||
-- carico jwd
|
||||
WDG.JWD = sJwd
|
||||
WinManage_LoadJwd()
|
||||
local AreaId = WDG.AREAID
|
||||
-- imposto opzioni visualizzazione
|
||||
WDG.VALUE = false
|
||||
_G.WinCalculate_SetCalcSolid()
|
||||
WDG.VALUE = false
|
||||
WinCalculate_SetSimplifiedSolid()
|
||||
WDG.VALUE = false
|
||||
WinCalculate_SetCalcPreview()
|
||||
-- creazione pezzi
|
||||
WDG.FRAMEID = AreaId
|
||||
WinCalculate_CreatePartFromArea()
|
||||
for i = 1, #GroupId do
|
||||
WDG['AREANBR' .. tostring(i)] = GroupId[i]
|
||||
end
|
||||
WinGetAreaProfiles()
|
||||
local nCalcShape = 0
|
||||
local AnswerGroupId = {}
|
||||
if WDG.AREAPROFILES and #WDG.AREAPROFILES > 0 then
|
||||
local JsonAnswerGroupId = JSON:encode( WDG.AREAPROFILES)
|
||||
return 1, { AreaProfiles = JsonAnswerGroupId}
|
||||
else
|
||||
return 0, { Error = "Errore! Dati profilo per l'area non trovati!", GroupId = JsonGroupId}
|
||||
end
|
||||
else
|
||||
local sErrorMsg = 'Errore! Jwd o GroupId non trovato!'
|
||||
EgtOutLog(sErrorMsg)
|
||||
return 0, { Error = sErrorMsg, GroupId = JsonGroupId}
|
||||
end
|
||||
end
|
||||
|
||||
local function Calc_ProfileList()
|
||||
-- leggo cartella profili
|
||||
local sProfileDir = ''
|
||||
@@ -413,18 +464,32 @@ local function Calc_ThresholdList( QuestionArgs)
|
||||
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
|
||||
WinGetProfileData()
|
||||
if not WDG.THRESHOLDSLIST then
|
||||
local sErrorMsg = 'Errore! Soglie non trovate!'
|
||||
EgtOutLog(sErrorMsg)
|
||||
return 0, { Error = sErrorMsg}
|
||||
end
|
||||
if not WDG.PROFILEDATA then
|
||||
local sErrorMsg = 'Errore! Dati profilo non trovati!'
|
||||
EgtOutLog(sErrorMsg)
|
||||
return 0, { Error = sErrorMsg}
|
||||
end
|
||||
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}
|
||||
--local ProfileDataDictionary = { }
|
||||
--for ThresholdIndex = 1, #WDG.THRESHOLDSLIST do
|
||||
-- table.insert( ProfileDataDictionary.ThresholdList, { Type = WDG.THRESHOLDSLIST[ThresholdIndex].nType, Name = WDG.THRESHOLDSLIST[ThresholdIndex].sName})
|
||||
--end
|
||||
--for k, v in pairs(WDG.PROFILEDATA) do
|
||||
-- ProfileDataDictionary[k] = v
|
||||
--end
|
||||
local JsonProfileDataDictionary = JSON:encode( WDG.PROFILEDATA)
|
||||
return 1, { ThresholdList = JsonThresholdList, ProfileData = JsonProfileDataDictionary}
|
||||
else
|
||||
local sErrorMsg = 'Errore! Profilo non trovato!'
|
||||
EgtOutLog(sErrorMsg)
|
||||
@@ -481,6 +546,8 @@ while bRun do
|
||||
nResult, AnswerArgs = Calc_HardwareOptions( QuestionArgs)
|
||||
elseif nSubMode == QUESTION_HARDWARE_SUBMODES.SASHSHAPE then
|
||||
nResult, AnswerArgs = Calc_SashShape( QuestionArgs)
|
||||
elseif nSubMode == QUESTION_HARDWARE_SUBMODES.PROFILEDATAFROMAREA then
|
||||
nResult, AnswerArgs = Calc_AreaProfiles( QuestionArgs)
|
||||
else
|
||||
nResult = 0
|
||||
local sErrorMsg = 'Errore! Valore di SubMode errato!'
|
||||
|
||||
Reference in New Issue
Block a user