From 4c45b9435a7eee671f1884d84f9be55816aa2c02 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 6 Dec 2021 16:50:13 +0100 Subject: [PATCH] EgtExecutor 2.3l2 : - aggiunte funzioni Exe e Lua AutoNestAddRestrictedZoneToSheet e AutoNestSetRestrictedZoneToPart. --- EXE_NstAutoNesting.cpp | 26 ++++++++++++++++++++++++++ EgtExecutor.rc | Bin 16184 -> 16184 bytes LUA_Nesting.cpp | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/EXE_NstAutoNesting.cpp b/EXE_NstAutoNesting.cpp index 6cfeafe..5502e01 100644 --- a/EXE_NstAutoNesting.cpp +++ b/EXE_NstAutoNesting.cpp @@ -135,6 +135,22 @@ ExeAutoNestAddDefectToSheet( int nSheetId, int nDefectId) return s_pAutoNester->AddDefectToSheet( nSheetId, Outline) ; } +//----------------------------------------------------------------------------- +bool +ExeAutoNestAddRestrictedZoneToSheet( int nSheetId, int nRstZoneId, int nRzConstrId) +{ + if ( IsNull( s_pAutoNester)) + return false ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero il contorno della zona ristretta + PolyArc Outline ; + if ( ! MyGetOutline( pGeomDB, nRstZoneId, Outline)) + return false ; + // aggiungo la zona ristretta al pannello + return s_pAutoNester->AddRestrictedZoneToSheet( nRzConstrId, nSheetId, Outline) ; +} + //----------------------------------------------------------------------------- bool ExeAutoNestAddPart( int nPartId, int nOutlineId, bool bCanFlip, bool bCanRotate, double dRotStep, int nPriority, int nCount) @@ -203,6 +219,16 @@ ExeAutoNestAddToolOutlineToPart( int nPartId, int nToolOutlineId) return s_pAutoNester->AddToolOutlineToPart( nPartId, ToolOutline) ; } +//----------------------------------------------------------------------------- +bool +ExeAutoNestSetRestrictedZoneToPart( int nPartId, int nRzConstrId) +{ + if ( IsNull( s_pAutoNester)) + return false ; + // aggiungo il vincolo di zona ristretta al pezzo + return s_pAutoNester->SetRestrictedZoneToPart( nPartId, nRzConstrId) ; +} + //----------------------------------------------------------------------------- bool ExeAutoNestSetInterpartGap( double dGap) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 07863fbb681c621f6783d3eb668487e6f2ce8fa7..85a6901336e18f304be38d794b13f4e0e3866250 100644 GIT binary patch delta 97 zcmdl{x1(;uA2vp#%@@V4Gflq2na5}}Ignd-a{*Tk3sCf++-0W82LxfF21;&>n->Y| cF@rU@0x76sKgP|Iq`|@mV0Jo1HG5`Po delta 97 zcmdl{x1(;uA2vqA%@@V4Gflq2na5~2Ignd-a{*Tk3sCf++-0W82LxfF21;&>n->Y| cF@rU@0x76sKgP|Iq`|@mV0JaGqDgXcg diff --git a/LUA_Nesting.cpp b/LUA_Nesting.cpp index 28b941c..fe07a48 100644 --- a/LUA_Nesting.cpp +++ b/LUA_Nesting.cpp @@ -174,6 +174,25 @@ LuaAutoNestAddDefectToSheet( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaAutoNestAddRestrictedZoneToSheet( lua_State* L) +{ + // 3 parametri : nSheetId, nRstZoneId, nRzConstrId + int nSheetId ; + LuaCheckParam( L, 1, nSheetId) + int nRstZoneId ; + LuaCheckParam( L, 2, nRstZoneId) + int nRzConstrId ; + LuaCheckParam( L, 3, nRzConstrId) + LuaClearStack( L) ; + // aggiungo un difetto al pannello indicato + bool bOk = ExeAutoNestAddRestrictedZoneToSheet( nSheetId, nRstZoneId, nRzConstrId) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAutoNestAddPart( lua_State* L) @@ -249,6 +268,22 @@ LuaAutoNestAddToolOutlineToPart( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaAutoNestSetRestrictedZoneToPart( lua_State* L) +{ + // 2 parametri : nPartId, nRzConstrId + int nPartId ; + LuaCheckParam( L, 1, nPartId) + int nRzConstrId ; + LuaCheckParam( L, 2, nRzConstrId) + // aggiungo un vincolo di zona protetta al pezzo indicato + bool bOk = ExeAutoNestSetRestrictedZoneToPart( nPartId, nRzConstrId) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAutoNestSetInterpartGap( lua_State* L) @@ -401,12 +436,14 @@ LuaInstallNesting( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestStart", LuaAutoNestStart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetGuillotineMode", LuaAutoNestSetGuillotineMode) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetStartCorner", LuaAutoNestSetStartCorner) ; - bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddDefectToSheet", LuaAutoNestAddDefectToSheet) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddSheet", LuaAutoNestAddSheet) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddDefectToSheet", LuaAutoNestAddDefectToSheet) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddRestrictedZoneToSheet", LuaAutoNestAddRestrictedZoneToSheet) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddPart", LuaAutoNestAddPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddHoleToPart", LuaAutoNestAddHoleToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddAnotherOutlineToPart", LuaAutoNestAddAnotherOutlineToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddToolOutlineToPart", LuaAutoNestAddToolOutlineToPart) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetRestrictedZoneToPart", LuaAutoNestSetRestrictedZoneToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetInterpartGap", LuaAutoNestSetInterpartGap) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetReportFile", LuaAutoNestSetReportFile) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestCompute", LuaAutoNestCompute) ;