EgtExecutor :
- Aggiunte funzioni Lua per ottimizzazione ordine delle lavorazioni.
This commit is contained in:
+158
@@ -0,0 +1,158 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2025-2025
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EXE_MachOpt.cpp Data : 02.04.2025 Versione : 2.7c1
|
||||
// Contenuto : Funzioni per Ottimizzare i tempi tra le lavorazioni.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 02.04.25 RE Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "EXE.h"
|
||||
#include "EXE_Macro.h"
|
||||
#include "EXE_Const.h"
|
||||
#include "DllNesting.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include "/EgtDev/Include/ENkMachOptimization.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Static LuaMgr per EgtExecutor
|
||||
//----------------------------------------------------------------------------
|
||||
static PtrOwner<IMachOptimization> s_pMO ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachInit( void)
|
||||
{
|
||||
// Creo l'oggetto per il calcolo del percorso minimo (ShortestPath)
|
||||
s_pMO.Set( CreateMachOptimization()) ;
|
||||
return ( ! IsNull( s_pMO)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachTerminate( void)
|
||||
{
|
||||
// Distruggo l'oggetto
|
||||
s_pMO.Reset() ;
|
||||
return ( IsNull( s_pMO)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachAddTool( int nId, double dTCX, double dTCY, double dTCZ, double dTCA,
|
||||
double dTCB, double dTCC, bool bX, bool bY, bool bZ, bool bA,
|
||||
bool bB, bool bC, double dTLoad, double dTUnL)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Inserisco il Record
|
||||
return ( s_pMO->InsertTool( nId, dTCX, dTCY, dTCZ, dTCA, dTCB, dTCC, bX, bY, bZ, bA,
|
||||
bB, bC, dTLoad, dTUnL)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachAddMachining( int nId, int nToolId, int nGroup,
|
||||
double dX_Start, double dY_Start, double dZ_Start,
|
||||
double dA_Start, double dB_Start, double dC_Start,
|
||||
double dX_End, double dY_End, double dZ_End,
|
||||
double dA_End, double dB_End, double dC_End)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Inserisco il Record
|
||||
return ( s_pMO->InsertMachining( nId, nToolId, nGroup,
|
||||
dX_Start, dY_Start, dZ_Start,
|
||||
dA_Start, dB_Start, dC_Start,
|
||||
dX_End, dY_End, dZ_End,
|
||||
dA_End, dB_End, dC_End)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachSetFirstMachining( int nId)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Imposto la prima lavorazione
|
||||
return ( s_pMO->SetFirstMachining( nId)) ;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachSetLastMachining( int nId)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Imposto l'ultima lavorazione
|
||||
return ( s_pMO->SetLastMachining( nId)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachSetFeeds( double dFeedL, double dFeedA)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Imposto l'ultima lavorazione
|
||||
return ( s_pMO->SetFeeds( dFeedL, dFeedA)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachAddDependence( int nIdPrec, int nIdSucc)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Inserisco la Dipendenza obbligatoria
|
||||
return ( s_pMO->InsertDependence( nIdPrec, nIdSucc)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachAddSuggestedDependence( int nIdPrec, int nIdSucc)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Inserisco la Dipendenza obbligatoria
|
||||
return ( s_pMO->InsertSuggestedDependences( nIdPrec, nIdSucc)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachSetAllGroupDependencesAsMandatory( bool bAllMandatory)
|
||||
{
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Imposto il Flag
|
||||
return ( s_pMO->SetAllGroupsAsMandatory( bAllMandatory)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeOptMachGetResult( INTVECTOR& vIds)
|
||||
{
|
||||
vIds.clear() ;
|
||||
// Se oggetto non instanziato, errore
|
||||
if ( IsNull( s_pMO))
|
||||
return false ;
|
||||
// Recupero i risultati
|
||||
return ( s_pMO->GetResult( vIds)) ;
|
||||
}
|
||||
Reference in New Issue
Block a user