diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 530556c..5e0760e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Machine.cpp b/Machine.cpp index cdbefa1..d19033c 100644 --- a/Machine.cpp +++ b/Machine.cpp @@ -690,11 +690,12 @@ Machine::EnableHeadInSet( const string& sHead) const STRVECTOR& vsHSet = GetHSet( sHead) ; if ( vsHSet.empty()) return false ; - // spengo tutte le teste tranne questa + // spengo tutte le teste dell'insieme tranne questa for ( size_t i = 0 ; i < vsHSet.size() ; ++ i) { int nH = GetGroup( vsHSet[i]) ; bool bShow = ( vsHSet[i] == sHead) ; - m_pGeomDB->SetStatus( nH, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ; + m_pGeomDB->SetMode( nH, ( bShow ? GDB_MD_STD : GDB_MD_HIDDEN)) ; + //m_pGeomDB->SetStatus( nH, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ; } return true ; } diff --git a/MachineHeads.cpp b/MachineHeads.cpp index 1a4b6b0..6985669 100644 --- a/MachineHeads.cpp +++ b/MachineHeads.cpp @@ -178,7 +178,8 @@ Machine::ResetHeadSet( const string& sHead) pExit->SetTool( "") ; } // visualizzo solo la prima testa - m_pGeomDB->SetStatus( nHdGrp, ( i == 0 ? GDB_ST_ON : GDB_ST_OFF)) ; + m_pGeomDB->SetMode( nHdGrp, ( i == 0 ? GDB_MD_STD : GDB_MD_HIDDEN)) ; + //m_pGeomDB->SetStatus( nHdGrp, ( i == 0 ? GDB_ST_ON : GDB_ST_OFF)) ; } return true ; } \ No newline at end of file diff --git a/Simulator.cpp b/Simulator.cpp index 1168476..d5c94d5 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -314,8 +314,8 @@ Simulator::UpdateTool( bool bForced) // ripristino l'utensile corrente m_pMchMgr->TdbSetCurrTool( m_sTool) ; } - // se cambierà e non forzato (inizio), scarico l'utensile corrente - if ( sTool != m_sTool && ! bForced) { + // se cambierà ed esiste il corrente, lo scarico + if ( sTool != m_sTool && ! m_sTool.empty()) { // eventuale lancio script per scarico utensile if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) return false ; @@ -344,9 +344,12 @@ Simulator::UpdateTool( bool bForced) // recupero i dati string sTool ; string sHead ; int nExit ; string sTcPos ; pDisp->GetToolData( sTool, sHead, nExit, sTcPos) ; - // eventuale lancio script per scarico utensile - if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) - return false ; + // se cambierà ed esiste il corrente, lo scarico + if ( sTool != m_sTool && ! m_sTool.empty()) { + // eventuale lancio script per scarico utensile + if ( ! OnToolDeselect( sTool, sHead, nExit, sTcPos)) + return false ; + } // carico l'utensile if ( ! m_pMchMgr->SetCalcTool( sTool, sHead, nExit)) return false ; @@ -452,7 +455,7 @@ Simulator::FindAndManageOperationStart( bool bFirst, int& nStatus) Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( m_nOpId)) ; if ( pMch != nullptr && ! pMch->IsEmpty()) { // aggiorno utensile e assi conseguenti - if ( ! UpdateTool()) { + if ( ! UpdateTool( bFirst)) { nStatus = MCH_SIM_ERR ; return false ; }