bff983e12c
- prime modifiche per tagli inclinati su esterno archi.
219 lines
6.0 KiB
C++
219 lines
6.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2018
|
|
//----------------------------------------------------------------------------
|
|
// File : Generator.cpp Data : 28.05.18 Versione : 1.9e6
|
|
// Contenuto : Implementazione della classe Generator.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 28.10.15 DS Creazione modulo.
|
|
// 26.02.16 DS Aggiunta gestione archi.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "DllMain.h"
|
|
#include "Generator.h"
|
|
#include "Machine.h"
|
|
#include "OutputConst.h"
|
|
#include "/EgtDev/Include/EGnFileUtils.h"
|
|
|
|
using namespace std ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
static const string ERR_EXT = ".err" ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
Generator::Generator( void)
|
|
{
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
Generator::~Generator( void)
|
|
{
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::Init( MachMgr* pMchMgr)
|
|
{
|
|
return Processor::Init( pMchMgr) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::Run( const string& sCncFile, const string& sInfo)
|
|
{
|
|
// emetto info di log
|
|
{ string sOut = "Generator Run : " + sCncFile ;
|
|
LOG_INFO( GetEMkLogger(), sOut.c_str()) ; }
|
|
|
|
// cancello l'eventuale file di uscita (e anche il file errore)
|
|
EraseFile( sCncFile) ;
|
|
string sErrFile = ChangeFileExtension( sCncFile, ERR_EXT) ;
|
|
EraseFile( sErrFile) ;
|
|
|
|
// lancio il processore
|
|
bool bOk = Processor::Run( sCncFile, sInfo) ;
|
|
|
|
// in caso di errore rinomino il file di output
|
|
if ( ! bOk)
|
|
RenameFile( sCncFile, sErrFile) ;
|
|
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnStart( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_START) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnEnd( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_END) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnProgramStart( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_PROGRAM_START) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnProgramEnd( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_PROGRAM_END) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnToolData( void)
|
|
{
|
|
if ( ! m_pMachine->LuaExistsFunction( ON_TOOL_DATA))
|
|
return true ;
|
|
return m_pMachine->LuaCallFunction( ON_TOOL_DATA) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnDispositionStart( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_DISPOSITION_START) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnDispositionEnd( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_DISPOSITION_END) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnTableData( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_TABLE_DATA) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnFixtureData( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_FIXTURE_DATA) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnRawMoveData( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_RAWMOVE_DATA) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnToolSelect( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_TOOL_SELECT) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnToolDeselect( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_TOOL_DESELECT) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnMachiningStart( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_MACHINING_START) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnMachiningEnd( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_MACHINING_END) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnPathStart( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_PATH_START) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnPathEnd( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_PATH_END) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnPathStartAux( void)
|
|
{
|
|
if ( ! m_pMachine->LuaExistsFunction( ON_PATH_START_AUX))
|
|
return true ;
|
|
return m_pMachine->LuaCallFunction( ON_PATH_START_AUX) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnPathEndAux( void)
|
|
{
|
|
if ( ! m_pMachine->LuaExistsFunction( ON_PATH_END_AUX))
|
|
return true ;
|
|
return m_pMachine->LuaCallFunction( ON_PATH_END_AUX) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnRapid( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_RAPID) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnLinear( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_LINEAR) ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
Generator::CallOnArc( void)
|
|
{
|
|
return m_pMachine->LuaCallFunction( ON_ARC) ;
|
|
}
|