c207175e7b
- aggiunte funzioni Exe e Lua per nesting 1D ( MaxFillerStart, MaxFillerAddPart, MaxFillerCompute, MaxFillerGetResults, MaxFillerGetOneResult).
86 lines
2.8 KiB
C++
86 lines
2.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2020-2020
|
|
//----------------------------------------------------------------------------
|
|
// File : EXE_MaxFiller.cpp Data : 06.11.20 Versione : 2.2k2
|
|
// Contenuto : Funzioni Maximum Filler.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 06.11.20 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "EXE.h"
|
|
#include "EXE_Macro.h"
|
|
#include "EXE_Const.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
#include "/EgtDev/Include/ENkMaximumFiller.h"
|
|
#include "/EgtDev/Include/EgtPointerOwner.h"
|
|
|
|
using namespace std ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
static PtrOwner<IMaximumFiller> s_pMaximumFiller ;
|
|
static int s_nTotParts ;
|
|
static double s_dTotFillRatio ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerStart( void)
|
|
{
|
|
s_nTotParts = 0 ;
|
|
s_dTotFillRatio = 0 ;
|
|
if ( IsNull( s_pMaximumFiller)) {
|
|
s_pMaximumFiller.Set( CreateMaximumFiller()) ;
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
}
|
|
return s_pMaximumFiller->Clear() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerAddPart( int nPartId, double dLen)
|
|
{
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
return s_pMaximumFiller->AddPart( nPartId, dLen) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerAddPart( int nPartId, double dLen, double dDispLen, int nCount)
|
|
{
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
return s_pMaximumFiller->AddPart( nPartId, dLen, dDispLen, nCount) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerCompute( double dLenToFill, double dStartGap, double dMidGap, double dEndGap, int nSortType)
|
|
{
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
return s_pMaximumFiller->Compute( dLenToFill, dStartGap, dMidGap, dEndGap, nSortType) ;
|
|
}
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerGetResults( int& nFilledParts, int& nDiffParts, double& dTotFillRatio)
|
|
{
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
return s_pMaximumFiller->GetResults( nFilledParts, nDiffParts, dTotFillRatio) ;
|
|
}
|
|
//-----------------------------------------------------------------------------
|
|
bool
|
|
ExeMaxFillerGetOneResult( int nInd, int& nPartId, int& nCount)
|
|
{
|
|
if ( IsNull( s_pMaximumFiller))
|
|
return false ;
|
|
return s_pMaximumFiller->GetOneResult( nInd, nPartId, nCount) ;
|
|
}
|