EgtMachKernel 1.6j2 :
- aggiunta prima versione del Simulator.
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
//----------------------------------------------------------------------------
|
||||
// File : MachMgrSimulation.cpp Data : 20.10.15 Versione : 1.6j2
|
||||
// Contenuto : Implementazione gestione simulazione della classe MachMgr.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 20.10.15 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "MachMgr.h"
|
||||
#include "MachConst.h"
|
||||
#include "Simulator.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimStart( void)
|
||||
{
|
||||
// alloco simulatore
|
||||
if ( m_pSimul != nullptr)
|
||||
delete m_pSimul ;
|
||||
m_pSimul = new( std::nothrow) Simulator ;
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// lo inizializzo
|
||||
if ( ! m_pSimul->Init( this))
|
||||
return false ;
|
||||
// lo avvio
|
||||
return m_pSimul->Start() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimMove( void)
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// eseguo movimento
|
||||
return m_pSimul->Move() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimSetStep( double dStep)
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return false ;
|
||||
// imposto lo step di riferimento
|
||||
return m_pSimul->SetStep( dStep) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::SimStop( void)
|
||||
{
|
||||
// verifico simulatore
|
||||
if ( m_pSimul == nullptr)
|
||||
return true ;
|
||||
// lo fermo e cancello
|
||||
m_pSimul->Stop() ;
|
||||
delete m_pSimul ;
|
||||
m_pSimul = nullptr ;
|
||||
return true ;
|
||||
}
|
||||
Reference in New Issue
Block a user