- Nella BasicCustomerStrategies aggiunte funzioni per leggere parametri Q per cliente Essetre
- I parametri delle BasicCustomerStrategies vengono letti all'inizio della Make di ogni strategia dalla BeamLib.LoadCustomParametersInStrategy - Se feature taglio compatibile con taglio testa/coda viene saltato ( controllo nella InfoAndDependency)
This commit is contained in:
+12
-26
@@ -9,6 +9,8 @@ local BeamLib = {}
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local BeamData = require( 'BeamData')
|
||||
local BCS = require( 'BasicCustomerStrategies')
|
||||
|
||||
|
||||
EgtOutLog( ' BeamLib started', 1)
|
||||
|
||||
@@ -35,19 +37,6 @@ function BeamLib.AddPartStartFace( PartId, b3Solid)
|
||||
EgtSetName( nStmId, 'StartCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 1)
|
||||
EgtSetInfo( nStmId, 'PRC', 340)
|
||||
-- verifico se sostituisce un taglio di testa già presente
|
||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( PartId, 'Processings') or GDB_ID.NULL)
|
||||
while nProcId do
|
||||
local nGrp = EgtGetInfo( nProcId, 'GRP', 'i') or 0
|
||||
local nProc = EgtGetInfo( nProcId, 'PRC', 'i') or 0
|
||||
if ( nGrp == 1 or nGrp == 2) and nProc == 10 then
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nProcId, 0, GDB_ID.ROOT)
|
||||
if ptC and vtN and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
EgtSetInfo( nStmId, 'ORI', nProcId)
|
||||
end
|
||||
end
|
||||
nProcId = EgtGetNext( nProcId)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -73,19 +62,6 @@ function BeamLib.AddPartEndFace( PartId, b3Solid)
|
||||
EgtSetName( nStmId, 'EndCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 2)
|
||||
EgtSetInfo( nStmId, 'PRC', 350)
|
||||
-- verifico se sostituisce un taglio di coda già presente
|
||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( PartId, 'Processings') or GDB_ID.NULL)
|
||||
while nProcId do
|
||||
local nGrp = EgtGetInfo( nProcId, 'GRP', 'i') or 0
|
||||
local nProc = EgtGetInfo( nProcId, 'PRC', 'i') or 0
|
||||
if ( nGrp == 1 or nGrp == 2) and nProc == 10 then
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nProcId, 0, GDB_ID.ROOT)
|
||||
if ptC and vtN and AreSameVectorApprox( vtN, -X_AX()) and abs( ptC:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL then
|
||||
EgtSetInfo( nStmId, 'ORI', nProcId)
|
||||
end
|
||||
end
|
||||
nProcId = EgtGetNext( nProcId)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -385,6 +361,15 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default
|
||||
local UpdatedParameters = {}
|
||||
-- TODO serve controllare se campo 'sStrategyId' congruente tra il Config (DefaultStrategyParamList) e i parametri custom (CustomParameters)?
|
||||
if DefaultStrategyParamList and DefaultStrategyParamList.Parameters and #DefaultStrategyParamList.Parameters > 0 then
|
||||
-- se le strategie disponibili sono le basic, non si possono customizzare valori di default da interfaccia, si leggono allora eventuali parametri di default decisi con cliente
|
||||
if Proc.AvailableStrategies.bIsBasicStrategy then
|
||||
-- essendo una strategia basic, la lista dei parametri custom dovrebbe essere sempre vuota. Si leggono ora
|
||||
if not CustomParameters.Parameters then
|
||||
CustomParameters.Parameters = BCS.GetParametersFromBasicCustomerStrategies( Proc, CustomParameters.sStrategyId)
|
||||
end
|
||||
end
|
||||
|
||||
-- lettura e settaggio parametri finali per la strategia (customizzati o default)
|
||||
for i=1, #DefaultStrategyParamList.Parameters do
|
||||
local xParameterValue = nil
|
||||
-- se strategia forzata, leggo eventuali parametri nelle info
|
||||
@@ -405,6 +390,7 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- se non arriva forzato da strategia, oppure se non è stato configurato da cliente, si prende default
|
||||
if not xParameterValue then
|
||||
xParameterValue = DefaultStrategyParamList.Parameters[i].sValue
|
||||
|
||||
Reference in New Issue
Block a user