- modificate BatchProcessNew e BeamExec per contemplare nuova tabella RESULTS
This commit is contained in:
+42
-14
@@ -1018,6 +1018,42 @@ local function OrderFeatures( vProc)
|
||||
return vProcToSort
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO gestire Proc che non hanno una ChosenStrategy, perchè sono specchiate, multi (si legge il risultato da un'altra feature?) o non è stata trovata una strategia
|
||||
local function AddFeatureResultToGlobalList( Proc, nRotation)
|
||||
RESULT[#RESULT+1] = {
|
||||
sType = 'Feature',
|
||||
id = Proc.id,
|
||||
idFeature = Proc.idFeature,
|
||||
idTask = Proc.idTask,
|
||||
idCut = Proc.idCut,
|
||||
nFlg = Proc.nFlg,
|
||||
nRotation = nRotation,
|
||||
idPart = Proc.idPart,
|
||||
ChosenStrategy = {
|
||||
sStrategyName = Proc.ChosenStrategy.sStrategyId,
|
||||
sStatus = Proc.ChosenStrategy.Result.sStatus,
|
||||
nCompletionIndex = Proc.ChosenStrategy.Result.nCompletionIndex,
|
||||
dCompositeRating = Proc.ChosenStrategy.Result.dCompositeRating,
|
||||
sInfo = Proc.ChosenStrategy.Result.sInfo
|
||||
},
|
||||
AvailableStrategies = BeamLib.TableCopyDeep( Proc.AvailableStrategies)
|
||||
}
|
||||
|
||||
return RESULT
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddApplyResultToGlobalList( nErr, idCut, sMsg)
|
||||
RESULT[#RESULT+1] = {
|
||||
sType = 'Part',
|
||||
idCut = idCut,
|
||||
idTask = 0,
|
||||
nErr = nErr,
|
||||
sMsg = sMsg
|
||||
}
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- esegue le strategie migliori che ha precedentemente scelto
|
||||
local function CalculateMachinings( vProc, Part, nInitialRotation)
|
||||
@@ -1055,18 +1091,6 @@ local function CalculateMachinings( vProc, Part, nInitialRotation)
|
||||
local StrategyScript = require( StrategyScriptName)
|
||||
-- eseguo la strategia e si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
||||
_, _ = StrategyScript.Make( true, Proc, Part, Proc.ChosenStrategy)
|
||||
-- scrivo risultato in tabella globale
|
||||
-- TODO funzione
|
||||
RESULT[#RESULT+1] = {
|
||||
id = Proc.id,
|
||||
idFeature = Proc.idFeature,
|
||||
idTask = Proc.idTask,
|
||||
idCut = Proc.idCut,
|
||||
nFlag = Proc.nFlg,
|
||||
nRotation = nCurrRotation,
|
||||
ChosenStrategy = BeamLib.TableCopyDeep( Proc.ChosenStrategy),
|
||||
AvailableStrategies = BeamLib.TableCopyDeep( Proc.AvailableStrategies)
|
||||
}
|
||||
else
|
||||
-- se non esiste una strategia scelta (non dovrebbe mai succedere) cancello da lista generale
|
||||
PROCESSINGS[Proc.nIndexPartInParts].Rotation[Proc.nIndexRotation][Proc.nIndexInVProc].ChosenStrategy = nil
|
||||
@@ -1078,6 +1102,8 @@ local function CalculateMachinings( vProc, Part, nInitialRotation)
|
||||
bAreAllApplyOk = false
|
||||
end
|
||||
end
|
||||
-- scrivo risultato in tabella globale
|
||||
AddFeatureResultToGlobalList( Proc, nCurrRotation)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1621,9 +1647,11 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
bApplOk, sApplErrors, _ = EgtApplyAllMachinings()
|
||||
EgtRemoveInfo( EgtGetCurrMachGroup(), 'RECALC')
|
||||
end
|
||||
-- TODO qui restituire errori in modo migliore, come per feature
|
||||
-- TODO in caso di lavorazioni di coda saltate, l'informazione va restituita anche sulle singole feature
|
||||
if not bApplOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {nErr = 1, sMsg=sApplErrors, nRot=0, idCut=0, idTask=0})
|
||||
AddApplyResultToGlobalList( 1, 0, sApplErrors)
|
||||
elseif sApplWarns and #sApplWarns > 0 then
|
||||
local vLine = EgtSplitString( sApplWarns, '\r\n')
|
||||
for i = 1, #vLine do
|
||||
@@ -1634,7 +1662,7 @@ function BeamExec.ProcessMachinings( PARTS)
|
||||
local nWarn = EgtGetVal( vVal[1] or '', 'WRN', 'i')
|
||||
local nCutId = EgtGetVal( vVal[2] or '', 'CUTID', 'i')
|
||||
if nWarn and nCutId then
|
||||
table.insert( Stats, { nErr=-nWarn, sMsg=vLine[i], nRot=0, idCut=nCutId, idTask=0})
|
||||
AddApplyResultToGlobalList( -nWarn, nCutId, vLine[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user