From 2a7b442084c791377eac2a89c0c27a88164975f4 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 18 Jan 2021 07:33:07 +0000 Subject: [PATCH] EgtGeomKernel 2.3a3 : - piccole modifiche alle chiamate async. --- CAvToolSurfTm.cpp | 4 ++-- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes VolZmap.cpp | 2 +- VolZmap.h | 2 +- VolZmapGraphics.cpp | 2 +- VolZmapVolume.cpp | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CAvToolSurfTm.cpp b/CAvToolSurfTm.cpp index d8eff2c..d03bc8a 100644 --- a/CAvToolSurfTm.cpp +++ b/CAvToolSurfTm.cpp @@ -161,13 +161,13 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& m_bBreak = false ; future vRes[MAX_PARTS] ; for ( int i = 0 ; i < nPartCnt ; ++ i) - vRes[i] = async( launch::async, &CAvToolSurfTm::TestSubPath, this, i, ref( vlPntM[i]), vtDir, dLinTol) ; + vRes[i] = async( launch::async, &CAvToolSurfTm::TestSubPath, this, i, ref( vlPntM[i]), cref( vtDir), dLinTol) ; // attendo i risultati int nFin = 0 ; int nNextPE = 0 ; while ( nFin < nPartCnt) { for ( int i = 0 ; i < nPartCnt ; ++ i) { - if ( vRes[i].valid() && vRes[i].wait_for( chrono::milliseconds{ 1}) == future_status::ready) { + if ( vRes[i].valid() && vRes[i].wait_for( chrono::nanoseconds{ 1}) == future_status::ready) { bOk = vRes[i].get() && bOk ; ++ nFin ; } diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index eba8a1376266aebf7f8a6013bbcc0614f45c1f54..c672b2cdb5c6de453cf1bdd04dd60e43f031c535 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&Qw&A-_cnHh~ID{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-W11TR delta 94 zcmdlNy)SyhFE&P_&A-_cnHh~HD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-Vf-5U diff --git a/VolZmap.cpp b/VolZmap.cpp index a9a0ee5..aeae9e3 100644 --- a/VolZmap.cpp +++ b/VolZmap.cpp @@ -787,7 +787,7 @@ VolZmap::CheckMapConnection( void) int nTerminated = 0 ; while ( nTerminated < nActiveThread) { for ( int i = 0 ; i < nThreadMax ; ++ i) { - if ( vRes[i].valid() && vRes[i].wait_for( chrono::microseconds{ 1}) == future_status::ready) { + if ( vRes[i].valid() && vRes[i].wait_for( chrono::nanoseconds{ 1}) == future_status::ready) { vRes[i].get() ; ++ nTerminated ; } diff --git a/VolZmap.h b/VolZmap.h index d02f924..8368772 100644 --- a/VolZmap.h +++ b/VolZmap.h @@ -222,7 +222,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW bool MillingTranslationStep( const Point3d& ptPs, const Point3d& ptPe, const Vector3d& vtD, const Vector3d& vtA) ; bool MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d& vtAs, const Point3d& ptPe, const Vector3d& vtDe, const Vector3d& vtAe) ; - bool SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d vtL, const Vector3d vtAL) ; + bool SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtL, const Vector3d& vtAL) ; bool InitializePointsAndVectors( const Point3d& ptPs, const Point3d& ptPe, const Vector3d& vtDs, const Vector3d& vtAs, Point3d ptLs[3], Point3d ptLe[3], Vector3d vtLs[3], Vector3d vtALs[3]) ; // SOTTRAZIONI diff --git a/VolZmapGraphics.cpp b/VolZmapGraphics.cpp index 09d998e..a86b07e 100644 --- a/VolZmapGraphics.cpp +++ b/VolZmapGraphics.cpp @@ -947,7 +947,7 @@ VolZmap::UpdateTripleMapGraphics( void) const int nTerminated = 0 ; while ( nTerminated < nBlockUpdated) { for ( int i = 0 ; i < m_nNumBlock ; ++ i) { - if ( m_BlockToUpdate[i] && vRes[i].valid() && vRes[i].wait_for( chrono::microseconds{ 1}) == future_status::ready) { + if ( m_BlockToUpdate[i] && vRes[i].valid() && vRes[i].wait_for( chrono::nanoseconds{ 1}) == future_status::ready) { bOk = vRes[i].get() && bOk ; ++ nTerminated ; } diff --git a/VolZmapVolume.cpp b/VolZmapVolume.cpp index 5d2a82d..aa11d6d 100644 --- a/VolZmapVolume.cpp +++ b/VolZmapVolume.cpp @@ -596,13 +596,13 @@ VolZmap::MillingTranslationStep( const Point3d& ptPs, const Point3d& ptPe, const vector< future> vRes ; vRes.resize( m_nMapNum) ; for ( int i = 0 ; i < m_nMapNum ; ++ i) { - vRes[i] = async( launch::async, &VolZmap::SelectMotion, this, i, ptLs[i], ptLe[i], vtLs[i], vtALs[i]) ; + vRes[i] = async( launch::async, &VolZmap::SelectMotion, this, i, cref( ptLs[i]), cref( ptLe[i]), cref( vtLs[i]), cref( vtALs[i])) ; } bool bOk = true ; int nTerminated = 0 ; while ( nTerminated < m_nMapNum) { for ( int i = 0 ; i < m_nMapNum ; ++ i) { - if ( vRes[i].valid() && vRes[i].wait_for(chrono::microseconds{ 1}) == future_status::ready) { + if ( vRes[i].valid() && vRes[i].wait_for( chrono::nanoseconds{ 1}) == future_status::ready) { bOk = vRes[i].get() && bOk ; ++ nTerminated ; } @@ -645,7 +645,7 @@ VolZmap::InitializePointsAndVectors( const Point3d& ptPs, const Point3d& ptPe, c //---------------------------------------------------------------------------- bool -VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d vtL, const Vector3d vtAL) +VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtL, const Vector3d& vtAL) { // Versore utensile parallelo all'asse Z (coincide con spillone) if ( vtL.SqLenXY() < EPS_ZERO * EPS_ZERO) {