EgtMachKernel :

- aggiunta gestione attivazione e stato di visualizzazione di una operazione.
This commit is contained in:
Dario Sassi
2015-12-17 10:44:39 +00:00
parent cc2a72d5af
commit dd591f1853
6 changed files with 123 additions and 12 deletions
+106 -5
View File
@@ -95,10 +95,58 @@ MachMgr::GetPrevOperation( int nId) const
if ( m_pGeomDB->GetParentId( nId) != nOperGrpId)
return GDB_ID_NULL ;
// recupero il precedente sottogruppo
int nNextId = m_pGeomDB->GetPrevGroup( nId) ;
int nPrevId = m_pGeomDB->GetPrevGroup( nId) ;
return nPrevId ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetFirstActiveOperation( void) const
{
int nId = GetFirstOperation() ;
int nMode ;
while ( nId != GDB_ID_NULL &&
m_pGeomDB->GetCalcMode( nId, nMode) && nMode == GDB_MD_HIDDEN)
nId = GetNextOperation( nId) ;
return nId ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetNextActiveOperation( int nId) const
{
int nNextId = GetNextOperation( nId) ;
int nMode ;
while ( nNextId != GDB_ID_NULL &&
m_pGeomDB->GetCalcMode( nNextId, nMode) && nMode == GDB_MD_HIDDEN)
nNextId = GetNextOperation( nNextId) ;
return nNextId ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetLastActiveOperation( void) const
{
int nId = GetLastOperation() ;
int nMode ;
while ( nId != GDB_ID_NULL &&
m_pGeomDB->GetCalcMode( nId, nMode) && nMode == GDB_MD_HIDDEN)
nId = GetPrevOperation( nId) ;
return nId ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetPrevActiveOperation( int nId) const
{
int nPrevId = GetPrevOperation( nId) ;
int nMode ;
while ( nPrevId != GDB_ID_NULL &&
m_pGeomDB->GetCalcMode( nPrevId, nMode) && nMode == GDB_MD_HIDDEN)
nPrevId = GetPrevOperation( nPrevId) ;
return nPrevId ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetOperationType( int nId) const
@@ -217,12 +265,65 @@ MachMgr::RemoveAllOperations( bool bExceptFirstDisp)
// indice terminazione ciclo
int nStopId = ( bExceptFirstDisp ? GetFirstOperation() : GDB_ID_NULL) ;
// rimuovo tutte le operazioni a partire dalla fine
int nOperId = GetLastOperation() ;
while ( nOperId != nStopId) {
RemoveOperation( nOperId) ;
nOperId = GetLastOperation() ;
int nId = GetLastOperation() ;
while ( nId != GDB_ID_NULL && nId != nStopId) {
RemoveOperation( nId) ;
nId = GetLastOperation() ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetOperationMode( int nId, bool bActive)
{
// verifico sia una Operazione
if ( GetOperationType( nId) == OPER_NULL)
return false ;
// eseguo attivazione/disattivazione
m_pGeomDB->SetMode( nId, ( bActive ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetAllOperationsMode( bool bExceptFirstDisp, bool bActive)
{
// modifico lo stato di tutte le operazioni
int nId = ( bExceptFirstDisp ? GetNextOperation( GetFirstOperation()) : GetFirstOperation()) ;
while ( nId != GDB_ID_NULL) {
// eseguo attivazione/disattivazione
m_pGeomDB->SetMode( nId, ( bActive ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
// passo alla successiva
nId = GetNextOperation( nId) ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetOperationStatus( int nId, bool bShow)
{
// verifico sia una Operazione
if ( GetOperationType( nId) == OPER_NULL)
return false ;
// eseguo cambio di stato di visualizzazione
m_pGeomDB->SetStatus( nId, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetAllOperationsStatus( bool bExceptFirstDisp, bool bShow)
{
// modifico lo stato di tutte le operazioni
int nId = ( bExceptFirstDisp ? GetNextOperation( GetFirstOperation()) : GetFirstOperation()) ;
while ( nId != GDB_ID_NULL) {
// eseguo cambio di stato di visualizzazione
m_pGeomDB->SetStatus( nId, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ;
// passo alla successiva
nId = GetNextOperation( nId) ;
}
return true ;
}