EgtMachKernel 2.1c4 :
- modifiche per gestire lo stato delle operazioni (ok, da ricalcolare, ....).
This commit is contained in:
@@ -352,8 +352,34 @@ MachMgr::SetOperationMode( int nId, bool bActive)
|
||||
// verifico sia una Operazione
|
||||
if ( GetOperationType( nId) == OPER_NULL)
|
||||
return false ;
|
||||
// recupero lo stato di attivazione corrente
|
||||
int nMode ;
|
||||
if ( ! m_pGeomDB->GetMode( nId, nMode))
|
||||
return false ;
|
||||
bool bPrevActive = ( nMode == GDB_MD_STD) ;
|
||||
// eseguo attivazione/disattivazione
|
||||
m_pGeomDB->SetMode( nId, ( bActive ? GDB_MD_STD : GDB_MD_HIDDEN)) ;
|
||||
// se non cambia l'attivazione, esco
|
||||
if ( bActive == bPrevActive)
|
||||
return true ;
|
||||
// dichiaro da aggiornare questa lavorazione
|
||||
Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pOpe != nullptr)
|
||||
pOpe->UpdateStatus( MCH_ST_OTH_MODIF) ;
|
||||
// da aggiornare post apply della precedente attiva
|
||||
int nOpeId = GetPrevActiveOperation( nId) ;
|
||||
if ( nOpeId != GDB_ID_NULL) {
|
||||
Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nOpeId)) ;
|
||||
if ( pOpe != nullptr)
|
||||
pOpe->UpdateStatus( MCH_ST_NO_POSTAPPL) ;
|
||||
}
|
||||
// forzo aggiornamento della successiva, le altre seguiranno automaticamente
|
||||
nOpeId = GetNextActiveOperation( nId) ;
|
||||
if ( nOpeId != GDB_ID_NULL) {
|
||||
Operation* pOpe = GetOperation( m_pGeomDB->GetUserObj( nOpeId)) ;
|
||||
if ( pOpe != nullptr)
|
||||
pOpe->UpdateStatus( MCH_ST_OTH_MODIF) ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user