EgtMachKernel :

- aggiunto aggiornamento disegni utensili al salvataggio DB utensili
- aggiunta funzione MachMgr::TdbCurrToolDraw
- modifiche varie per supportare i punti precedenti.
This commit is contained in:
Dario Sassi
2019-05-17 18:21:32 +00:00
parent 5da6e922b1
commit 7a451b3e3f
6 changed files with 415 additions and 11 deletions
+13 -2
View File
@@ -56,6 +56,7 @@ ToolsMgr::Clear( void)
m_suCIter = m_suData.cend() ;
m_bCurrTool = false ;
m_bModified = false ;
m_utModified.clear() ;
return true ;
}
@@ -271,6 +272,7 @@ ToolsMgr::Save( bool bCompressed) const
// dichiaro non più modificato rispetto al file
m_bModified = false ;
m_utModified.clear() ;
return true ;
}
@@ -359,6 +361,8 @@ ToolsMgr::AddTool( const string& sName, int nType)
! m_suData.emplace( tData.m_sName, tData.m_Uuid).second)
return false ;
m_bModified = true ;
if ( find( m_utModified.begin(), m_utModified.end(), tData.m_Uuid) == m_utModified.end())
m_utModified.emplace_back( tData.m_Uuid) ;
// lo rendo il nuovo utensile corrente
m_bCurrTool = true ;
m_tdCurrTool = tData ;
@@ -391,6 +395,8 @@ ToolsMgr::CopyTool( const string& sSource, const string& sName)
! m_suData.emplace( tData.m_sName, tData.m_Uuid).second)
return false ;
m_bModified = true ;
if ( find( m_utModified.begin(), m_utModified.end(), tData.m_Uuid) == m_utModified.end())
m_utModified.emplace_back( tData.m_Uuid) ;
// lo rendo il nuovo utensile corrente
m_bCurrTool = true ;
m_tdCurrTool = tData ;
@@ -405,15 +411,18 @@ ToolsMgr::RemoveTool( const string& sName)
auto iNameIter = m_suData.find( sName) ;
if ( iNameIter == m_suData.end())
return true ;
EgtUUID ToolUuid = iNameIter->second ;
// se era anche l'utensile corrente, lo resetto
if ( m_bCurrTool && m_tdCurrTool.m_Uuid == iNameIter->second)
if ( m_bCurrTool && m_tdCurrTool.m_Uuid == ToolUuid)
m_bCurrTool = false ;
// rimuovo l'utensile dal dizionario degli UUID
m_utData.erase( iNameIter->second) ;
m_utData.erase( ToolUuid) ;
// rimuovo l'utensile dall'elenco dei nomi
m_suData.erase( iNameIter) ;
// dichiaro la modifica
m_bModified = true ;
if ( find( m_utModified.begin(), m_utModified.end(), ToolUuid) == m_utModified.end())
m_utModified.emplace_back( ToolUuid) ;
return true ;
}
@@ -535,6 +544,8 @@ ToolsMgr::SaveCurrTool( void)
UpdateCurrToolHolderData() ;
// eseguo salvataggio
m_bModified = true ;
if ( find( m_utModified.begin(), m_utModified.end(), m_tdCurrTool.m_Uuid) == m_utModified.end())
m_utModified.emplace_back( m_tdCurrTool.m_Uuid) ;
iIter->second = m_tdCurrTool ;
return true ;
}