From e241be8b8253a9456473f3c899e857a72cb0178a Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 11 Jan 2017 17:20:51 +0000 Subject: [PATCH] TestEIn 1.6x6 : - aggiornamento. --- EgtInterface.vb | 5231 +++++++++++++++++++----------------- My Project/AssemblyInfo.vb | 6 +- Scene.vb | 7 +- 3 files changed, 2750 insertions(+), 2494 deletions(-) diff --git a/EgtInterface.vb b/EgtInterface.vb index f53cdb5..49a357d 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -648,6 +648,12 @@ Class BBox3d PtMax.z += dDelta Return True End Function + Public Function Expand(dDeltaX As Double, dDeltaY As Double, dDeltaZ As Double) As Boolean + If IsEmpty() Then Return True + PtMin -= New Vector3d(dDeltaX, dDeltaY, dDeltaZ) + PtMax += New Vector3d(dDeltaX, dDeltaY, dDeltaZ) + Return True + End Function ' Restituzione componenti Public Function Min() As Point3d Return PtMin @@ -656,18 +662,22 @@ Class BBox3d Return PtMax End Function Public Function DimX() As Double + If IsEmpty() Then Return 0 Return PtMax.x - PtMin.x End Function Public Function DimY() As Double + If IsEmpty() Then Return 0 Return PtMax.y - PtMin.y End Function Public Function DimZ() As Double + If IsEmpty() Then Return 0 Return PtMax.z - PtMin.z End Function Public Function Center() As Point3d Return Point3d.Media(PtMin, PtMax) End Function Public Function Radius() As Double + If IsEmpty() Then Return 0 Return 0.5 * Point3d.Dist(PtMin, PtMax) End Function ' Traslazione @@ -706,14 +716,37 @@ Class BBox3d Return False End If End Function + ' Punto incluso nel box + Public Function Encloses(ByRef ptOther As Point3d) As Boolean + If PtMax.x < ptOther.x - EPS_SMALL Or PtMin.x > ptOther.x + EPS_SMALL Then Return False + If PtMax.y < ptOther.y - EPS_SMALL Or PtMin.y > ptOther.y + EPS_SMALL Then Return False + If PtMax.z < ptOther.z - EPS_SMALL Or PtMin.z > ptOther.z + EPS_SMALL Then Return False + Return True + End Function + Public Function EnclosesXY(ByRef ptOther As Point3d) As Boolean + If PtMax.x < ptOther.x - EPS_SMALL Or PtMin.x > ptOther.x + EPS_SMALL Then Return False + If PtMax.y < ptOther.y - EPS_SMALL Or PtMin.y > ptOther.y + EPS_SMALL Then Return False + Return True + End Function + ' Altro box incluso nel box + Public Function Encloses(ByRef b3Other As BBox3d) As Boolean + If b3Other.IsEmpty() Then Return False + Return Encloses(b3Other.PtMin) AndAlso Encloses(b3Other.PtMax) + End Function + Public Function EnclosesXY(ByRef b3Other As BBox3d) As Boolean + If b3Other.IsEmpty() Then Return False + Return EnclosesXY(b3Other.PtMin) AndAlso EnclosesXY(b3Other.PtMax) + End Function ' Sovrapposizione con altro box Public Function Overlaps(ByRef b3Other As BBox3d) As Boolean + If b3Other.IsEmpty() Then Return False If PtMax.x < b3Other.PtMin.x - EPS_SMALL Or PtMin.x > b3Other.PtMax.x + EPS_SMALL Then Return False If PtMax.y < b3Other.PtMin.y - EPS_SMALL Or PtMin.y > b3Other.PtMax.y + EPS_SMALL Then Return False If PtMax.z < b3Other.PtMin.z - EPS_SMALL Or PtMin.z > b3Other.PtMax.z + EPS_SMALL Then Return False Return True End Function Public Function OverlapsXY(ByRef b3Other As BBox3d) As Boolean + If b3Other.IsEmpty() Then Return False If PtMax.x < b3Other.PtMin.x - EPS_SMALL Or PtMin.x > b3Other.PtMax.x + EPS_SMALL Then Return False If PtMax.y < b3Other.PtMin.y - EPS_SMALL Or PtMin.y > b3Other.PtMax.y + EPS_SMALL Then Return False Return True @@ -3349,6 +3382,48 @@ Public Function EgtSurfFrOffset(nId As Integer, dDist As Double, nType As Intege End If End Function + +Private Function EgtExtractSurfFrChunkLoops_32(nId As Integer, nChunk As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer +End Function + +Private Function EgtExtractSurfFrChunkLoops_64(nId As Integer, nChunk As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer +End Function +Public Function EgtExtractSurfFrChunkLoops(nId As Integer, nChunk As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtExtractSurfFrChunkLoops_32(nId, nChunk, nDestGrpId, nCount) + Else + Return EgtExtractSurfFrChunkLoops_64(nId, nChunk, nDestGrpId, nCount) + End If +End Function + + +Private Function EgtGetSurfTmSilhouette_32(nId As Integer, ByRef vtDir As Vector3d, nDestGrpId As Integer, nRefType As Integer, ByRef nCount As Integer) As Integer +End Function + +Private Function EgtGetSurfTmSilhouette_64(nId As Integer, ByRef vtDir As Vector3d, nDestGrpId As Integer, nRefType As Integer, ByRef nCount As Integer) As Integer +End Function +Public Function EgtGetSurfTmSilhouette(nId As Integer, vtDir As Vector3d, nDestGrpId As Integer, nRefType As Integer, ByRef nCount As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetSurfTmSilhouette_32(nId, vtDir, nDestGrpId, nRefType, nCount) + Else + Return EgtGetSurfTmSilhouette_64(nId, vtDir, nDestGrpId, nRefType, nCount) + End If +End Function + + +Private Function EgtExtractSurfTmFacetLoops_32(nId As Integer, nFacet As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer +End Function + +Private Function EgtExtractSurfTmFacetLoops_64(nId As Integer, nFacet As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer +End Function +Public Function EgtExtractSurfTmFacetLoops(nId As Integer, nFacet As Integer, nDestGrpId As Integer, ByRef nCount As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtExtractSurfTmFacetLoops_32(nId, nFacet, nDestGrpId, nCount) + Else + Return EgtExtractSurfTmFacetLoops_64(nId, nFacet, nDestGrpId, nCount) + End If +End Function + '---------- GeomDb Parts & Layers ---------------------------------------------- @@ -5665,6 +5740,48 @@ Public Function EgtGetMinDistPntSidePointCurve(ByRef ptP As Point3d, nId As Inte End If End Function + +Private Function EgtArcRadius_32(nId As Integer, ByRef dRad As Double) As Boolean +End Function + +Private Function EgtArcRadius_64(nId As Integer, ByRef dRad As Double) As Boolean +End Function +Public Function EgtArcRadius(nId As Integer, ByRef dRad As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtArcRadius_32(nId, dRad) + Else + Return EgtArcRadius_64(nId, dRad) + End If +End Function + + +Private Function EgtArcAngCenter_32(nId As Integer, ByRef dAngDeg As Double) As Boolean +End Function + +Private Function EgtArcAngCenter_64(nId As Integer, ByRef dAngDeg As Double) As Boolean +End Function +Public Function EgtArcAngCenter(nId As Integer, ByRef dAngDeg As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtArcAngCenter_32(nId, dAngDeg) + Else + Return EgtArcAngCenter_64(nId, dAngDeg) + End If +End Function + + +Private Function EgtArcDeltaN_32(nId As Integer, ByRef dDeltaN As Double) As Boolean +End Function + +Private Function EgtArcDeltaN_64(nId As Integer, ByRef dDeltaN As Double) As Boolean +End Function +Public Function EgtArcDeltaN(nId As Integer, ByRef dDeltaN As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtArcDeltaN_32(nId, dDeltaN) + Else + Return EgtArcDeltaN_64(nId, dDeltaN) + End If +End Function + Private Function EgtArcNormVersor_32(nId As Integer, nRefId As Integer, ByRef VtNorm As Vector3d) As Boolean End Function @@ -6601,6 +6718,21 @@ Public Function EgtGetCurrMachGroup() As Integer End If End Function +' Setup + +Private Function EgtGetCurrSetup_32() As Integer +End Function + +Private Function EgtGetCurrSetup_64() As Integer +End Function +Public Function EgtGetCurrSetup() As Integer + If IntPtr.Size = 4 Then + Return EgtGetCurrSetup_32() + Else + Return EgtGetCurrSetup_64() + End If +End Function + ' Phases Private Function EgtAddPhase_32() As Integer @@ -6822,2548 +6954,2618 @@ Public Function EgtVerifyRawPartPhase(nRawId As Integer, nPhase As Integer) As B End If End Function - -Private Function EgtVerifyRawPartCurrPhase_32(nRawId As Integer) As Boolean -End Function - -Private Function EgtVerifyRawPartCurrPhase_64(nRawId As Integer) As Boolean -End Function -Public Function EgtVerifyRawPartCurrPhase(nRawId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtVerifyRawPartCurrPhase_32(nRawId) - Else - Return EgtVerifyRawPartCurrPhase_64(nRawId) - End If -End Function - - -Private Function EgtRemoveRawPartFromCurrPhase_32(nRawId As Integer) As Boolean -End Function - -Private Function EgtRemoveRawPartFromCurrPhase_64(nRawId As Integer) As Boolean -End Function -Public Function EgtRemoveRawPartFromCurrPhase(nRawId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveRawPartFromCurrPhase_32(nRawId) - Else - Return EgtRemoveRawPartFromCurrPhase_64(nRawId) - End If -End Function - - -Private Function EgtRemoveRawPart_32(nRawId As Integer) As Boolean -End Function - -Private Function EgtRemoveRawPart_64(nRawId As Integer) As Boolean -End Function -Public Function EgtRemoveRawPart(nRawId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveRawPart_32(nRawId) - Else - Return EgtRemoveRawPart_64(nRawId) - End If -End Function - - -Private Function EgtMoveToCornerRawPart_32(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean -End Function - -Private Function EgtMoveToCornerRawPart_64(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean -End Function -Public Function EgtMoveToCornerRawPart(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtMoveToCornerRawPart_32(nRawId, ptCorner, nFlag) - Else - Return EgtMoveToCornerRawPart_64(nRawId, ptCorner, nFlag) - End If -End Function - - -Private Function EgtMoveRawPart_32(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean -End Function - -Private Function EgtMoveRawPart_64(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean -End Function -Public Function EgtMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtMoveRawPart_32(nRawId, vtMove) - Else - Return EgtMoveRawPart_64(nRawId, vtMove) - End If -End Function - - -Private Function EgtRotateRawPart_32(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean -End Function - -Private Function EgtRotateRawPart_64(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean -End Function -Public Function EgtRotateRawPart(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtRotateRawPart_32(nRawId, vtAx, dAngDeg) - Else - Return EgtRotateRawPart_64(nRawId, vtAx, dAngDeg) - End If -End Function - - -Private Function EgtSplitFlatRawPartWithMachinings_32(nRawId As Integer, nNumMch As Integer, nMchId() As Integer) As Integer -End Function - -Private Function EgtSplitFlatRawPartWithMachinings_64(nRawId As Integer, nNumMch As Integer, nMchId() As Integer) As Integer -End Function -Public Function EgtSplitFlatRawPartWithMachinings(nRawId As Integer, nMchId() As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtSplitFlatRawPartWithMachinings_32(nRawId, nMchId.Length(), nMchId) - Else - Return EgtSplitFlatRawPartWithMachinings_64(nRawId, nMchId.Length(), nMchId) - End If -End Function - - -Private Function EgtGetPartInRawPartCount_32(nRawId As Integer) As Integer -End Function - -Private Function EgtGetPartInRawPartCount_64(nRawId As Integer) As Integer -End Function -Public Function EgtGetPartInRawPartCount(nRawId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetPartInRawPartCount_32(nRawId) - Else - Return EgtGetPartInRawPartCount_64(nRawId) - End If -End Function - - -Private Function EgtGetFirstPartInRawPart_32(nRawId As Integer) As Integer -End Function - -Private Function EgtGetFirstPartInRawPart_64(nRawId As Integer) As Integer -End Function -Public Function EgtGetFirstPartInRawPart(nRawId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetFirstPartInRawPart_32(nRawId) - Else - Return EgtGetFirstPartInRawPart_64(nRawId) - End If -End Function - - -Private Function EgtGetNextPartInRawPart_32(nPartId As Integer) As Integer -End Function - -Private Function EgtGetNextPartInRawPart_64(nPartId As Integer) As Integer -End Function -Public Function EgtGetNextPartInRawPart(nPartId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetNextPartInRawPart_32(nPartId) - Else - Return EgtGetNextPartInRawPart_64(nPartId) - End If -End Function - - -Private Function EgtAddPartToRawPart_32(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean -End Function - -Private Function EgtAddPartToRawPart_64(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean -End Function -Public Function EgtAddPartToRawPart(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtAddPartToRawPart_32(nPartId, ptPos, nRawId) - Else - Return EgtAddPartToRawPart_64(nPartId, ptPos, nRawId) - End If -End Function - - -Private Function EgtGetRawPartFromPart_32(nPartId As Integer) As Integer -End Function - -Private Function EgtGetRawPartFromPart_64(nPartId As Integer) As Integer -End Function -Public Function EgtGetRawPartFromPart(nPartId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetRawPartFromPart_32(nPartId) - Else - Return EgtGetRawPartFromPart_64(nPartId) - End If -End Function - - -Private Function EgtRemovePartFromRawPart_32(nPartId As Integer) As Boolean -End Function - -Private Function EgtRemovePartFromRawPart_64(nPartId As Integer) As Boolean -End Function -Public Function EgtRemovePartFromRawPart(nPartId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemovePartFromRawPart_32(nPartId) - Else - Return EgtRemovePartFromRawPart_64(nPartId) - End If -End Function - -' Table & Fixtures - -Private Function EgtSetTable_32(sTable As String) As Boolean -End Function - -Private Function EgtSetTable_64(sTable As String) As Boolean -End Function -Public Function EgtSetTable(sTable As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetTable_32(sTable) - Else - Return EgtSetTable_64(sTable) - End If -End Function - - -Private Function EgtGetTableName_32(ByRef psTableName As IntPtr) As Boolean -End Function - -Private Function EgtGetTableName_64(ByRef psTableName As IntPtr) As Boolean -End Function -Public Function EgtGetTableName(ByRef sTableName As String) As Boolean - Dim psTableName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtGetTableName_32(psTableName) - Else - bOk = EgtGetTableName_64(psTableName) - End If - If bOk Then - sTableName = Marshal.PtrToStringUni(psTableName) - EgtFreeMemory(psTableName) - Else - sTableName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtGetTableRef_32(nInd As Integer, ByRef ptPos As Point3d) As Boolean -End Function - -Private Function EgtGetTableRef_64(nInd As Integer, ByRef ptPos As Point3d) As Boolean -End Function -Public Function EgtGetTableRef(nInd As Integer, ByRef ptPos As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetTableRef_32(nInd, ptPos) - Else - Return EgtGetTableRef_64(nInd, ptPos) - End If -End Function - - -Private Function EgtGetTableArea_32(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean -End Function - -Private Function EgtGetTableArea_64(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean -End Function -Public Function EgtGetTableArea(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetTableArea_32(nInd, ptMin, ptMax) - Else - Return EgtGetTableArea_64(nInd, ptMin, ptMax) - End If -End Function -Public Function EgtGetTableArea(nInd As Integer, ByRef b3Box As BBox3d) As Boolean - b3Box.Setup() - Dim ptMin, ptMax As Point3d - If IntPtr.Size = 4 Then - If Not EgtGetTableArea_32(nInd, ptMin, ptMax) Then Return False - Else - If Not EgtGetTableArea_64(nInd, ptMin, ptMax) Then Return False - End If - b3Box.Add(ptMin) - b3Box.Add(ptMax) - Return True -End Function - - -Private Function EgtShowOnlyTable_32(bVal As Boolean) As Boolean -End Function - -Private Function EgtShowOnlyTable_64(bVal As Boolean) As Boolean -End Function -Public Function EgtShowOnlyTable(bVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtShowOnlyTable_32(bVal) - Else - Return EgtShowOnlyTable_64(bVal) - End If -End Function - - -Private Function EgtAddFixture_32(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer -End Function - -Private Function EgtAddFixture_64(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer -End Function -Public Function EgtAddFixture(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer - If IntPtr.Size = 4 Then - Return EgtAddFixture_32(sName, ptPos, dAngRotDeg, dMov) - Else - Return EgtAddFixture_64(sName, ptPos, dAngRotDeg, dMov) - End If -End Function - - -Private Function EgtKeepFixture_32(nFixtId As Integer, nSouPhase As Integer) As Boolean -End Function - -Private Function EgtKeepFixture_64(nFixtId As Integer, nSouPhase As Integer) As Boolean -End Function -Public Function EgtKeepFixture(nFixtId As Integer, Optional nSouPhase As Integer = 0) As Boolean - If IntPtr.Size = 4 Then - Return EgtKeepFixture_32(nFixtId, nSouPhase) - Else - Return EgtKeepFixture_64(nFixtId, nSouPhase) - End If -End Function - - -Private Function EgtRemoveFixture_32(nFixtId As Integer) As Boolean -End Function - -Private Function EgtRemoveFixture_64(nFixtId As Integer) As Boolean -End Function -Public Function EgtRemoveFixture(nFixtId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveFixture_32(nFixtId) - Else - Return EgtRemoveFixture_64(nFixtId) - End If -End Function - - -Private Function EgtVerifyFixture_32(nFixtId As Integer) As Boolean -End Function - -Private Function EgtVerifyFixture_64(nFixtId As Integer) As Boolean -End Function -Public Function EgtVerifyFixture(nFixtId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtVerifyFixture_32(nFixtId) - Else - Return EgtVerifyFixture_64(nFixtId) - End If -End Function - - -Private Function EgtGetFirstFixture_32() As Integer -End Function - -Private Function EgtGetFirstFixture_64() As Integer -End Function -Public Function EgtGetFirstFixture() As Integer - If IntPtr.Size = 4 Then - Return EgtGetFirstFixture_32() - Else - Return EgtGetFirstFixture_64() - End If -End Function - - -Private Function EgtGetNextFixture_32(nFixtId As Integer) As Integer -End Function - -Private Function EgtGetNextFixture_64(nFixtId As Integer) As Integer -End Function -Public Function EgtGetNextFixture(nFixtId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetNextFixture_32(nFixtId) - Else - Return EgtGetNextFixture_64(nFixtId) - End If -End Function - - -Private Function EgtMoveFixture_32(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean -End Function - -Private Function EgtMoveFixture_64(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean -End Function -Public Function EgtMoveFixture(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtMoveFixture_32(nFixtId, vtMove) - Else - Return EgtMoveFixture_64(nFixtId, vtMove) - End If -End Function - - -Private Function EgtRotateFixture_32(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean -End Function - -Private Function EgtRotateFixture_64(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean -End Function -Public Function EgtRotateFixture(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtRotateFixture_32(nFixtId, dDeltaAngDeg) - Else - Return EgtRotateFixture_64(nFixtId, dDeltaAngDeg) - End If -End Function - - -Private Function EgtMoveFixtureMobile_32(nFixtId As Integer, dDeltaMov As Double) As Boolean -End Function - -Private Function EgtMoveFixtureMobile_64(nFixtId As Integer, dDeltaMov As Double) As Boolean -End Function -Public Function EgtMoveFixtureMobile(nFixtId As Integer, dDeltaMov As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtMoveFixtureMobile_32(nFixtId, dDeltaMov) - Else - Return EgtMoveFixtureMobile_64(nFixtId, dDeltaMov) - End If -End Function - -' Tools Database - -Private Function EgtTdbGetToolNewName_32(sName As String, ByRef psNewName As IntPtr) As Boolean -End Function - -Private Function EgtTdbGetToolNewName_64(sName As String, ByRef psNewName As IntPtr) As Boolean -End Function -Public Function EgtTdbGetToolNewName(ByRef sName As String) As Boolean - Dim psNewName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetToolNewName_32(sName, psNewName) - Else - bOk = EgtTdbGetToolNewName_64(sName, psNewName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psNewName) - EgtFreeMemory(psNewName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbAddTool_32(sName As String, nType As Integer) As Boolean -End Function - -Private Function EgtTdbAddTool_64(sName As String, nType As Integer) As Boolean -End Function -Public Function EgtTdbAddTool(sName As String, nType As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbAddTool_32(sName, nType) - Else - Return EgtTdbAddTool_64(sName, nType) - End If -End Function - - -Private Function EgtTdbCopyTool_32(sSource As String, sName As String) As Boolean -End Function - -Private Function EgtTdbCopyTool_64(sSource As String, sName As String) As Boolean -End Function -Public Function EgtTdbCopyTool(sSource As String, sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbCopyTool_32(sSource, sName) - Else - Return EgtTdbCopyTool_64(sSource, sName) - End If -End Function - - -Private Function EgtTdbRemoveTool_32(sName As String) As Boolean -End Function - -Private Function EgtTdbRemoveTool_64(sName As String) As Boolean -End Function -Public Function EgtTdbRemoveTool(sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbRemoveTool_32(sName) - Else - Return EgtTdbRemoveTool_64(sName) - End If -End Function - - -Private Function EgtTdbGetFirstTool_32(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean -End Function - -Private Function EgtTdbGetFirstTool_64(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean -End Function -Public Function EgtTdbGetFirstTool(nFamily As Integer, ByRef sName As String, ByRef nType As Integer) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetFirstTool_32(nFamily, psName, nType) - Else - bOk = EgtTdbGetFirstTool_64(nFamily, psName, nType) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbGetNextTool_32(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean -End Function - -Private Function EgtTdbGetNextTool_64(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean -End Function -Public Function EgtTdbGetNextTool(nFamily As Integer, ByRef sName As String, ByRef nType As Integer) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetNextTool_32(nFamily, psName, nType) - Else - bOk = EgtTdbGetNextTool_64(nFamily, psName, nType) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbGetToolFromUUID_32(sTuuid As String, ByRef psName As IntPtr) As Boolean -End Function - -Private Function EgtTdbGetToolFromUUID_64(sTuuid As String, ByRef psName As IntPtr) As Boolean -End Function -Public Function EgtTdbGetToolFromUUID(sTuuid As String, ByRef sName As String) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetToolFromUUID_32(sTuuid, psName) - Else - bOk = EgtTdbGetToolFromUUID_64(sTuuid, psName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbSetCurrTool_32(sName As String) As Boolean -End Function - -Private Function EgtTdbSetCurrTool_64(sName As String) As Boolean -End Function -Public Function EgtTdbSetCurrTool(sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSetCurrTool_32(sName) - Else - Return EgtTdbSetCurrTool_64(sName) - End If -End Function - - -Private Function EgtTdbSaveCurrTool_32() As Boolean -End Function - -Private Function EgtTdbSaveCurrTool_64() As Boolean -End Function -Public Function EgtTdbSaveCurrTool() As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSaveCurrTool_32() - Else - Return EgtTdbSaveCurrTool_64() - End If -End Function - - -Private Function EgtTdbIsCurrToolModified_32() As Boolean -End Function - -Private Function EgtTdbIsCurrToolModified_64() As Boolean -End Function -Public Function EgtTdbIsCurrToolModified() As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbIsCurrToolModified_32() - Else - Return EgtTdbIsCurrToolModified_64() - End If -End Function - - -Private Function EgtTdbSetCurrToolParamBool_32(nType As Integer, bVal As Boolean) As Boolean -End Function - -Private Function EgtTdbSetCurrToolParamBool_64(nType As Integer, bVal As Boolean) As Boolean -End Function -Public Function EgtTdbSetCurrToolParam(nType As Integer, bVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSetCurrToolParamBool_32(nType, bVal) - Else - Return EgtTdbSetCurrToolParamBool_64(nType, bVal) - End If -End Function - - -Private Function EgtTdbSetCurrToolParamInt_32(nType As Integer, nVal As Integer) As Boolean -End Function - -Private Function EgtTdbSetCurrToolParamInt_64(nType As Integer, nVal As Integer) As Boolean -End Function -Public Function EgtTdbSetCurrToolParam(nType As Integer, nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSetCurrToolParamInt_32(nType, nVal) - Else - Return EgtTdbSetCurrToolParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtTdbSetCurrToolParamDouble_32(nType As Integer, dVal As Double) As Boolean -End Function - -Private Function EgtTdbSetCurrToolParamDouble_64(nType As Integer, dVal As Double) As Boolean -End Function -Public Function EgtTdbSetCurrToolParam(nType As Integer, dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSetCurrToolParamDouble_32(nType, dVal) - Else - Return EgtTdbSetCurrToolParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtTdbSetCurrToolParamString_32(nType As Integer, sVal As String) As Boolean -End Function - -Private Function EgtTdbSetCurrToolParamString_64(nType As Integer, sVal As String) As Boolean -End Function -Public Function EgtTdbSetCurrToolParam(nType As Integer, sVal As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSetCurrToolParamString_32(nType, sVal) - Else - Return EgtTdbSetCurrToolParamString_64(nType, sVal) - End If -End Function - - -Private Function EgtTdbGetCurrToolParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function - -Private Function EgtTdbGetCurrToolParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function -Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef bVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbGetCurrToolParamBool_32(nType, bVal) - Else - Return EgtTdbGetCurrToolParamBool_64(nType, bVal) - End If -End Function - - -Private Function EgtTdbGetCurrToolParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean -End Function - -Private Function EgtTdbGetCurrToolParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean -End Function -Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbGetCurrToolParamInt_32(nType, nVal) - Else - Return EgtTdbGetCurrToolParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtTdbGetCurrToolParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean -End Function - -Private Function EgtTdbGetCurrToolParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean -End Function -Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbGetCurrToolParamDouble_32(nType, dVal) - Else - Return EgtTdbGetCurrToolParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtTdbGetCurrToolParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function - -Private Function EgtTdbGetCurrToolParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function -Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef sVal As String) As Boolean - Dim psVal As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetCurrToolParamString_32(nType, psVal) - Else - bOk = EgtTdbGetCurrToolParamString_64(nType, psVal) - End If - If bOk Then - sVal = Marshal.PtrToStringUni(psVal) - EgtFreeMemory(psVal) - Else - sVal = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbReload_32() As Boolean -End Function - -Private Function EgtTdbReload_64() As Boolean -End Function -Public Function EgtTdbReload() As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbReload_32() - Else - Return EgtTdbReload_64() - End If -End Function - - -Private Function EgtTdbSave_32() As Boolean -End Function - -Private Function EgtTdbSave_64() As Boolean -End Function -Public Function EgtTdbSave() As Boolean - If IntPtr.Size = 4 Then - Return EgtTdbSave_32() - Else - Return EgtTdbSave_64() - End If -End Function - - -Private Function EgtTdbGetToolDir_32(ByRef psToolDir As IntPtr) As Boolean -End Function - -Private Function EgtTdbGetToolDir_64(ByRef psToolDir As IntPtr) As Boolean -End Function -Public Function EgtTdbGetToolDir(ByRef sToolDir As String) As Boolean - Dim psToolDir As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetToolDir_32(psToolDir) - Else - bOk = EgtTdbGetToolDir_64(psToolDir) - End If - If bOk Then - sToolDir = Marshal.PtrToStringUni(psToolDir) - EgtFreeMemory(psToolDir) - Else - sToolDir = String.Empty - End If - Return bOk -End Function - - -Private Function EgtTdbGetToolHolderDir_32(ByRef psTHolderDir As IntPtr) As Boolean -End Function - -Private Function EgtTdbGetToolHolderDir_64(ByRef psTHolderDir As IntPtr) As Boolean -End Function -Public Function EgtTdbGetToolHolderDir(ByRef sTHolderDir As String) As Boolean - Dim psTHolderDir As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtTdbGetToolHolderDir_32(psTHolderDir) - Else - bOk = EgtTdbGetToolHolderDir_64(psTHolderDir) - End If - If bOk Then - sTHolderDir = Marshal.PtrToStringUni(psTHolderDir) - EgtFreeMemory(psTHolderDir) - Else - sTHolderDir = String.Empty - End If - Return bOk -End Function - -' Machinings Database - -Private Function EgtMdbGetMachiningNewName_32(sName As String, ByRef psNewName As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetMachiningNewName_64(sName As String, ByRef psNewName As IntPtr) As Boolean -End Function -Public Function EgtMdbGetMachiningNewName(ByRef sName As String) As Boolean - Dim psNewName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetMachiningNewName_32(sName, psNewName) - Else - bOk = EgtMdbGetMachiningNewName_64(sName, psNewName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psNewName) - EgtFreeMemory(psNewName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtMdbAddMachining_32(sName As String, nType As Integer) As Boolean -End Function - -Private Function EgtMdbAddMachining_64(sName As String, nType As Integer) As Boolean -End Function -Public Function EgtMdbAddMachining(sName As String, nType As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbAddMachining_32(sName, nType) - Else - Return EgtMdbAddMachining_64(sName, nType) - End If -End Function - - -Private Function EgtMdbCopyMachining_32(sSource As String, sName As String) As Boolean -End Function - -Private Function EgtMdbCopyMachining_64(sSource As String, sName As String) As Boolean -End Function -Public Function EgtMdbCopyMachining(sSource As String, sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbCopyMachining_32(sSource, sName) - Else - Return EgtMdbCopyMachining_64(sSource, sName) - End If -End Function - - -Private Function EgtMdbRemoveMachining_32(sName As String) As Boolean -End Function - -Private Function EgtMdbRemoveMachining_64(sName As String) As Boolean -End Function -Public Function EgtMdbRemoveMachining(sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbRemoveMachining_32(sName) - Else - Return EgtMdbRemoveMachining_64(sName) - End If -End Function - - -Private Function EgtMdbGetFirstMachining_32(nType As Integer, ByRef psName As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetFirstMachining_64(nType As Integer, ByRef psName As IntPtr) As Boolean -End Function -Public Function EgtMdbGetFirstMachining(nType As Integer, ByRef sName As String) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetFirstMachining_32(nType, psName) - Else - bOk = EgtMdbGetFirstMachining_64(nType, psName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtMdbGetNextMachining_32(nType As Integer, ByRef psName As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetNextMachining_64(nType As Integer, ByRef psName As IntPtr) As Boolean -End Function -Public Function EgtMdbGetNextMachining(nType As Integer, ByRef sName As String) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetNextMachining_32(nType, psName) - Else - bOk = EgtMdbGetNextMachining_64(nType, psName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtMdbGetMachiningFromUUID_32(sMuuid As String, ByRef psName As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetMachiningFromUUID_64(sMuuid As String, ByRef psName As IntPtr) As Boolean -End Function -Public Function EgtMdbGetMachiningFromUUID(sMuuid As String, ByRef sName As String) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetMachiningFromUUID_32(sMuuid, psName) - Else - bOk = EgtMdbGetMachiningFromUUID_64(sMuuid, psName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtMdbSetCurrMachining_32(sName As String) As Boolean -End Function - -Private Function EgtMdbSetCurrMachining_64(sName As String) As Boolean -End Function -Public Function EgtMdbSetCurrMachining(sName As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetCurrMachining_32(sName) - Else - Return EgtMdbSetCurrMachining_64(sName) - End If -End Function - - -Private Function EgtMdbSaveCurrMachining_32() As Boolean -End Function - -Private Function EgtMdbSaveCurrMachining_64() As Boolean -End Function -Public Function EgtMdbSaveCurrMachining() As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSaveCurrMachining_32() - Else - Return EgtMdbSaveCurrMachining_64() - End If -End Function - - -Private Function EgtMdbIsCurrMachiningModified_32() As Boolean -End Function - -Private Function EgtMdbIsCurrMachiningModified_64() As Boolean -End Function -Public Function EgtMdbIsCurrMachiningModified() As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbIsCurrMachiningModified_32() - Else - Return EgtMdbIsCurrMachiningModified_64() - End If -End Function - - -Private Function EgtMdbSetCurrMachiningParamBool_32(nType As Integer, nVal As Boolean) As Boolean -End Function - -Private Function EgtMdbSetCurrMachiningParamBool_64(nType As Integer, nVal As Boolean) As Boolean -End Function -Public Function EgtMdbSetCurrMachiningParam(nType As Integer, nVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetCurrMachiningParamBool_32(nType, nVal) - Else - Return EgtMdbSetCurrMachiningParamBool_64(nType, nVal) - End If -End Function - - -Private Function EgtMdbSetCurrMachiningParamInt_32(nType As Integer, nVal As Integer) As Boolean -End Function - -Private Function EgtMdbSetCurrMachiningParamInt_64(nType As Integer, nVal As Integer) As Boolean -End Function -Public Function EgtMdbSetCurrMachiningParam(nType As Integer, nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetCurrMachiningParamInt_32(nType, nVal) - Else - Return EgtMdbSetCurrMachiningParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtMdbSetCurrMachiningParamDouble_32(nType As Integer, dVal As Double) As Boolean -End Function - -Private Function EgtMdbSetCurrMachiningParamDouble_64(nType As Integer, dVal As Double) As Boolean -End Function -Public Function EgtMdbSetCurrMachiningParam(nType As Integer, dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetCurrMachiningParamDouble_32(nType, dVal) - Else - Return EgtMdbSetCurrMachiningParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtMdbSetCurrMachiningParamString_32(nType As Integer, sVal As String) As Boolean -End Function - -Private Function EgtMdbSetCurrMachiningParamString_64(nType As Integer, sVal As String) As Boolean -End Function -Public Function EgtMdbSetCurrMachiningParam(nType As Integer, sVal As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetCurrMachiningParamString_32(nType, sVal) - Else - Return EgtMdbSetCurrMachiningParamString_64(nType, sVal) - End If -End Function - - -Private Function EgtMdbGetCurrMachiningParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function - -Private Function EgtMdbGetCurrMachiningParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function -Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef bVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbGetCurrMachiningParamBool_32(nType, bVal) - Else - Return EgtMdbGetCurrMachiningParamBool_64(nType, bVal) - End If -End Function - - -Private Function EgtMdbGetCurrMachiningParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean -End Function - -Private Function EgtMdbGetCurrMachiningParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean -End Function -Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbGetCurrMachiningParamInt_32(nType, nVal) - Else - Return EgtMdbGetCurrMachiningParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtMdbGetCurrMachiningParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean -End Function - -Private Function EgtMdbGetCurrMachiningParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean -End Function -Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbGetCurrMachiningParamDouble_32(nType, dVal) - Else - Return EgtMdbGetCurrMachiningParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtMdbGetCurrMachiningParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetCurrMachiningParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function -Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef sVal As String) As Boolean - Dim psVal As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetCurrMachiningParamString_32(nType, psVal) - Else - bOk = EgtMdbGetCurrMachiningParamString_64(nType, psVal) - End If - If bOk Then - sVal = Marshal.PtrToStringUni(psVal) - EgtFreeMemory(psVal) - Else - sVal = String.Empty - End If - Return bOk -End Function - - -Private Function EgtMdbSetGeneralParamDouble_32(nType As Integer, dVal As Double) As Boolean -End Function - -Private Function EgtMdbSetGeneralParamDouble_64(nType As Integer, dVal As Double) As Boolean -End Function -Public Function EgtMdbSetGeneralParam(nType As Integer, dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSetGeneralParamDouble_32(nType, dVal) - Else - Return EgtMdbSetGeneralParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtMdbGetGeneralParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean -End Function - -Private Function EgtMdbGetGeneralParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean -End Function -Public Function EgtMdbGetGeneralParam(nType As Integer, ByRef dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbGetGeneralParamDouble_32(nType, dVal) - Else - Return EgtMdbGetGeneralParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtMdbReload_32() As Boolean -End Function - -Private Function EgtMdbReload_64() As Boolean -End Function -Public Function EgtMdbReload() As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbReload_32() - Else - Return EgtMdbReload_64() - End If -End Function - - -Private Function EgtMdbSave_32() As Boolean -End Function - -Private Function EgtMdbSave_64() As Boolean -End Function -Public Function EgtMdbSave() As Boolean - If IntPtr.Size = 4 Then - Return EgtMdbSave_32() - Else - Return EgtMdbSave_64() - End If -End Function - - -Private Function EgtMdbGetMachiningDir_32(ByRef psMachiningDir As IntPtr) As Boolean -End Function - -Private Function EgtMdbGetMachiningDir_64(ByRef psMachiningDir As IntPtr) As Boolean -End Function -Public Function EgtMdbGetMachiningDir(ByRef sMachiningDir As String) As Boolean - Dim psMachiningDir As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtMdbGetMachiningDir_32(psMachiningDir) - Else - bOk = EgtMdbGetMachiningDir_64(psMachiningDir) - End If - If bOk Then - sMachiningDir = Marshal.PtrToStringUni(psMachiningDir) - EgtFreeMemory(psMachiningDir) - Else - sMachiningDir = String.Empty - End If - Return bOk -End Function - -' Operations - -Private Function EgtGetFirstOperation_32() As Integer -End Function - -Private Function EgtGetFirstOperation_64() As Integer -End Function -Public Function EgtGetFirstOperation() As Integer - If IntPtr.Size = 4 Then - Return EgtGetFirstOperation_32() - Else - Return EgtGetFirstOperation_64() - End If -End Function - - -Private Function EgtGetNextOperation_32(nId As Integer) As Integer -End Function - -Private Function EgtGetNextOperation_64(nId As Integer) As Integer -End Function -Public Function EgtGetNextOperation(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetNextOperation_32(nId) - Else - Return EgtGetNextOperation_64(nId) - End If -End Function - - -Private Function EgtGetLastOperation_32() As Integer -End Function - -Private Function EgtGetLastOperation_64() As Integer -End Function -Public Function EgtGetLastOperation() As Integer - If IntPtr.Size = 4 Then - Return EgtGetLastOperation_32() - Else - Return EgtGetLastOperation_64() - End If -End Function - - -Private Function EgtGetPrevOperation_32(nId As Integer) As Integer -End Function - -Private Function EgtGetPrevOperation_64(nId As Integer) As Integer -End Function -Public Function EgtGetPrevOperation(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetPrevOperation_32(nId) - Else - Return EgtGetPrevOperation_64(nId) - End If -End Function - - -Private Function EgtGetFirstActiveOperation_32() As Integer -End Function - -Private Function EgtGetFirstActiveOperation_64() As Integer -End Function -Public Function EgtGetFirstActiveOperation() As Integer - If IntPtr.Size = 4 Then - Return EgtGetFirstActiveOperation_32() - Else - Return EgtGetFirstActiveOperation_64() - End If -End Function - - -Private Function EgtGetNextActiveOperation_32(nId As Integer) As Integer -End Function - -Private Function EgtGetNextActiveOperation_64(nId As Integer) As Integer -End Function -Public Function EgtGetNextActiveOperation(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetNextActiveOperation_32(nId) - Else - Return EgtGetNextActiveOperation_64(nId) - End If -End Function - - -Private Function EgtGetLastActiveOperation_32() As Integer -End Function - -Private Function EgtGetLastActiveOperation_64() As Integer -End Function -Public Function EgtGetLastActiveOperation() As Integer - If IntPtr.Size = 4 Then - Return EgtGetLastActiveOperation_32() - Else - Return EgtGetLastActiveOperation_64() - End If -End Function - - -Private Function EgtGetPrevActiveOperation_32(nId As Integer) As Integer -End Function - -Private Function EgtGetPrevActiveOperation_64(nId As Integer) As Integer -End Function -Public Function EgtGetPrevActiveOperation(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetPrevActiveOperation_32(nId) - Else - Return EgtGetPrevActiveOperation_64(nId) - End If -End Function - - -Private Function EgtGetOperationType_32(nId As Integer) As Integer -End Function - -Private Function EgtGetOperationType_64(nId As Integer) As Integer -End Function -Public Function EgtGetOperationType(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetOperationType_32(nId) - Else - Return EgtGetOperationType_64(nId) - End If -End Function - - -Private Function EgtGetOperationPhase_32(nId As Integer) As Integer -End Function - -Private Function EgtGetOperationPhase_64(nId As Integer) As Integer -End Function -Public Function EgtGetOperationPhase(nId As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetOperationPhase_32(nId) - Else - Return EgtGetOperationPhase_64(nId) - End If -End Function - - -Private Function EgtGetOperationName_32(nId As Integer, ByRef psName As IntPtr) As Boolean -End Function - -Private Function EgtGetOperationName_64(nId As Integer, ByRef psName As IntPtr) As Boolean -End Function -Public Function EgtGetOperationName(nId As Integer, ByRef sName As String) As Boolean - Dim psName As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtGetOperationName_32(nId, psName) - Else - bOk = EgtGetOperationName_64(nId, psName) - End If - If bOk Then - sName = Marshal.PtrToStringUni(psName) - EgtFreeMemory(psName) - Else - sName = String.Empty - End If - Return bOk -End Function - - -Private Function EgtGetOperationId_32(sName As String) As Integer -End Function - -Private Function EgtGetOperationId_64(sName As String) As Integer -End Function -Public Function EgtGetOperationId(sName As String) As Integer - If IntPtr.Size = 4 Then - Return EgtGetOperationId_32(sName) - Else - Return EgtGetOperationId_64(sName) - End If -End Function - - -Private Function EgtRemoveOperation_32(nId As Integer) As Boolean -End Function - -Private Function EgtRemoveOperation_64(nId As Integer) As Boolean -End Function -Public Function EgtRemoveOperation(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveOperation_32(nId) - Else - Return EgtRemoveOperation_64(nId) - End If -End Function - - -Private Function EgtRemoveAllPhaseOperations_32(nPhase As Integer) As Boolean -End Function - -Private Function EgtRemoveAllPhaseOperations_64(nPhase As Integer) As Boolean -End Function -Public Function EgtRemoveAllPhaseOperations(nPhase As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveAllPhaseOperations_32(nPhase) - Else - Return EgtRemoveAllPhaseOperations_64(nPhase) - End If -End Function - - -Private Function EgtRemoveAllOperations_32() As Boolean -End Function - -Private Function EgtRemoveAllOperations_64() As Boolean -End Function -Public Function EgtRemoveAllOperations() As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveAllOperations_32() - Else - Return EgtRemoveAllOperations_64() - End If -End Function - - -Private Function EgtSetOperationMode_32(nId As Integer, bActive As Boolean) As Boolean -End Function - -Private Function EgtSetOperationMode_64(nId As Integer, bActive As Boolean) As Boolean -End Function -Public Function EgtSetOperationMode(nId As Integer, bActive As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetOperationMode_32(nId, bActive) - Else - Return EgtSetOperationMode_64(nId, bActive) - End If -End Function - - -Private Function EgtGetOperationMode_32(nId As Integer) As Boolean -End Function - -Private Function EgtGetOperationMode_64(nId As Integer) As Boolean -End Function -Public Function EgtGetOperationMode(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetOperationMode_32(nId) - Else - Return EgtGetOperationMode_64(nId) - End If -End Function - - -Private Function EgtSetAllOperationsMode_32(bActive As Boolean) As Boolean -End Function - -Private Function EgtSetAllOperationsMode_64(bActive As Boolean) As Boolean -End Function -Public Function EgtSetAllOperationsMode(bActive As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetAllOperationsMode_32(bActive) - Else - Return EgtSetAllOperationsMode_64(bActive) - End If -End Function - - -Private Function EgtSetOperationStatus_32(nId As Integer, bShow As Boolean) As Boolean -End Function - -Private Function EgtSetOperationStatus_64(nId As Integer, bShow As Boolean) As Boolean -End Function -Public Function EgtSetOperationStatus(nId As Integer, bShow As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetOperationStatus_32(nId, bShow) - Else - Return EgtSetOperationStatus_64(nId, bShow) - End If -End Function - - -Private Function EgtGetOperationStatus_32(nId As Integer) As Boolean -End Function - -Private Function EgtGetOperationStatus_64(nId As Integer) As Boolean -End Function -Public Function EgtGetOperationStatus(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetOperationStatus_32(nId) - Else - Return EgtGetOperationStatus_64(nId) - End If -End Function - - -Private Function EgtSetAllOperationsStatus_32(bShow As Boolean) As Boolean -End Function - -Private Function EgtSetAllOperationsStatus_64(bShow As Boolean) As Boolean -End Function -Public Function EgtSetAllOperationsStatus(bShow As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetAllOperationsStatus_32(bShow) - Else - Return EgtSetAllOperationsStatus_64(bShow) - End If -End Function - - -Private Function EgtChangeOperationPhase_32(nId As Integer, nNewPhase As Integer) As Boolean -End Function - -Private Function EgtChangeOperationPhase_64(nId As Integer, nNewPhase As Integer) As Boolean -End Function -Public Function EgtChangeOperationPhase(nId As Integer, nNewPhase As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtChangeOperationPhase_32(nId, nNewPhase) - Else - Return EgtChangeOperationPhase_64(nId, nNewPhase) - End If -End Function - - -Private Function EgtGetPhaseLastOperation_32(nPhase As Integer) As Integer -End Function - -Private Function EgtGetPhaseLastOperation_64(nPhase As Integer) As Integer -End Function -Public Function EgtGetPhaseLastOperation(nPhase As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetPhaseLastOperation_32(nPhase) - Else - Return EgtGetPhaseLastOperation_64(nPhase) - End If -End Function - - -Private Function EgtRemoveOperationHome_32(nId As Integer) As Boolean -End Function - -Private Function EgtRemoveOperationHome_64(nId As Integer) As Boolean -End Function -Public Function EgtRemoveOperationHome(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtRemoveOperationHome_32(nId) - Else - Return EgtRemoveOperationHome_64(nId) - End If -End Function - -' Dispositions - -Private Function EgtGetPhaseDisposition_32(nPhase As Integer) As Integer -End Function - -Private Function EgtGetPhaseDisposition_64(nPhase As Integer) As Integer -End Function -Public Function EgtGetPhaseDisposition(nPhase As Integer) As Integer - If IntPtr.Size = 4 Then - Return EgtGetPhaseDisposition_32(nPhase) - Else - Return EgtGetPhaseDisposition_64(nPhase) - End If -End Function - - -Private Function EgtSpecialApplyDisposition_32(nId As Integer, bRecalc As Boolean) As Boolean -End Function - -Private Function EgtSpecialApplyDisposition_64(nId As Integer, bRecalc As Boolean) As Boolean -End Function -Public Function EgtSpecialApplyDisposition(nId As Integer, bRecalc As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSpecialApplyDisposition_32(nId, bRecalc) - Else - Return EgtSpecialApplyDisposition_64(nId, bRecalc) - End If -End Function - -' Machinings - -Private Function EgtAddMachining_32(sName As String, sMachining As String) As Integer -End Function - -Private Function EgtAddMachining_64(sName As String, sMachining As String) As Integer -End Function -Public Function EgtAddMachining(sName As String, sMachining As String) As Integer - If IntPtr.Size = 4 Then - Return EgtAddMachining_32(sName, sMachining) - Else - Return EgtAddMachining_64(sName, sMachining) - End If -End Function - - -Private Function EgtCreateMachining_32(sName As String, nType As Integer, sMachining As String) As Integer -End Function - -Private Function EgtCreateMachining_64(sName As String, nType As Integer, sMachining As String) As Integer -End Function -Public Function EgtCreateMachining(sName As String, nType As Integer, sMachining As String) As Integer - If IntPtr.Size = 4 Then - Return EgtCreateMachining_32(sName, nType, sMachining) - Else - Return EgtCreateMachining_64(sName, nType, sMachining) - End If -End Function - - -Private Function EgtSetCurrMachining_32(nId As Integer) As Boolean -End Function - -Private Function EgtSetCurrMachining_64(nId As Integer) As Boolean -End Function -Public Function EgtSetCurrMachining(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetCurrMachining_32(nId) - Else - Return EgtSetCurrMachining_64(nId) - End If -End Function - - -Private Function EgtGetCurrMachining_32() As Integer -End Function - -Private Function EgtGetCurrMachining_64() As Integer -End Function -Public Function EgtGetCurrMachining() As Integer - If IntPtr.Size = 4 Then - Return EgtGetCurrMachining_32() - Else - Return EgtGetCurrMachining_64() - End If -End Function - - -Private Function EgtSetMachiningParamBool_32(nType As Integer, nVal As Boolean) As Boolean -End Function - -Private Function EgtSetMachiningParamBool_64(nType As Integer, nVal As Boolean) As Boolean -End Function -Public Function EgtSetMachiningParam(nType As Integer, nVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMachiningParamBool_32(nType, nVal) - Else - Return EgtSetMachiningParamBool_64(nType, nVal) - End If -End Function - - -Private Function EgtSetMachiningParamInt_32(nType As Integer, nVal As Integer) As Boolean -End Function - -Private Function EgtSetMachiningParamInt_64(nType As Integer, nVal As Integer) As Boolean -End Function -Public Function EgtSetMachiningParam(nType As Integer, nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMachiningParamInt_32(nType, nVal) - Else - Return EgtSetMachiningParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtSetMachiningParamDouble_32(nType As Integer, dVal As Double) As Boolean -End Function - -Private Function EgtSetMachiningParamDouble_64(nType As Integer, dVal As Double) As Boolean -End Function -Public Function EgtSetMachiningParam(nType As Integer, dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMachiningParamDouble_32(nType, dVal) - Else - Return EgtSetMachiningParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtSetMachiningParamString_32(nType As Integer, sVal As String) As Boolean -End Function - -Private Function EgtSetMachiningParamString_64(nType As Integer, sVal As String) As Boolean -End Function -Public Function EgtSetMachiningParam(nType As Integer, sVal As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMachiningParamString_32(nType, sVal) - Else - Return EgtSetMachiningParamString_64(nType, sVal) - End If -End Function - - -Private Function EgtSetMachiningGeometry_32(nNumId As Integer, nId() As Integer, nSub() As Integer) As Boolean -End Function - -Private Function EgtSetMachiningGeometry_64(nNumId As Integer, nId() As Integer, nSub() As Integer) As Boolean -End Function -Public Function EgtSetMachiningGeometry(nId() As Integer, nSub() As Integer) As Boolean - If nId.Length() <> nSub.Length() Then Return False - If IntPtr.Size = 4 Then - Return EgtSetMachiningGeometry_32(nId.Length(), nId, nSub) - Else - Return EgtSetMachiningGeometry_64(nId.Length(), nId, nSub) - End If -End Function -Public Function EgtSetMachiningGeometry(nId() As Integer) As Boolean - Dim nSub(nId.Length() - 1) As Integer - For I As Integer = 0 To nId.Length() - 1 - nSub(I) = -1 - Next - If IntPtr.Size = 4 Then - Return EgtSetMachiningGeometry_32(nId.Length(), nId, nSub) - Else - Return EgtSetMachiningGeometry_64(nId.Length(), nId, nSub) - End If -End Function - - -Private Function EgtPreviewMachining_32(bRecalc As Boolean) As Boolean -End Function - -Private Function EgtPreviewMachining_64(bRecalc As Boolean) As Boolean -End Function -Public Function EgtPreviewMachining(bRecalc As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtPreviewMachining_32(bRecalc) - Else - Return EgtPreviewMachining_64(bRecalc) - End If -End Function - - -Private Function EgtApplyMachining_32(bRecalc As Boolean) As Boolean -End Function - -Private Function EgtApplyMachining_64(bRecalc As Boolean) As Boolean -End Function -Public Function EgtApplyMachining(bRecalc As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtApplyMachining_32(bRecalc) - Else - Return EgtApplyMachining_64(bRecalc) - End If -End Function - - -Private Function EgtGetMachiningParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function - -Private Function EgtGetMachiningParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean -End Function -Public Function EgtGetMachiningParam(nType As Integer, ByRef bVal As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMachiningParamBool_32(nType, bVal) - Else - Return EgtGetMachiningParamBool_64(nType, bVal) - End If -End Function - - -Private Function EgtGetMachiningParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean -End Function - -Private Function EgtGetMachiningParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean -End Function -Public Function EgtGetMachiningParam(nType As Integer, ByRef nVal As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMachiningParamInt_32(nType, nVal) - Else - Return EgtGetMachiningParamInt_64(nType, nVal) - End If -End Function - - -Private Function EgtGetMachiningParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean -End Function - -Private Function EgtGetMachiningParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean -End Function -Public Function EgtGetMachiningParam(nType As Integer, ByRef dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMachiningParamDouble_32(nType, dVal) - Else - Return EgtGetMachiningParamDouble_64(nType, dVal) - End If -End Function - - -Private Function EgtGetMachiningParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function - -Private Function EgtGetMachiningParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean -End Function -Public Function EgtGetMachiningParam(nType As Integer, ByRef sVal As String) As Boolean - Dim psVal As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtGetMachiningParamString_32(nType, psVal) - Else - bOk = EgtGetMachiningParamString_64(nType, psVal) - End If - If bOk Then - sVal = Marshal.PtrToStringUni(psVal) - EgtFreeMemory(psVal) - Else - sVal = String.Empty - End If - Return bOk -End Function - - -Private Function EgtGetMachiningGeometry_32(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean -End Function - -Private Function EgtGetMachiningGeometry_64(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean -End Function -Public Function EgtGetMachiningGeometry(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMachiningGeometry_32(nInd, nId, nSub) - Else - Return EgtGetMachiningGeometry_64(nInd, nId, nSub) - End If -End Function - - -Private Function EgtIsMachiningEmpty_32() As Boolean -End Function - -Private Function EgtIsMachiningEmpty_64() As Boolean -End Function -Public Function EgtIsMachiningEmpty() As Boolean - If IntPtr.Size = 4 Then - Return EgtIsMachiningEmpty_32() - Else - Return EgtIsMachiningEmpty_64() - End If -End Function - -' Simulation - -Private Function EgtSimStart_32() As Boolean -End Function - -Private Function EgtSimStart_64() As Boolean -End Function -Public Function EgtSimStart() As Boolean - If IntPtr.Size = 4 Then - Return EgtSimStart_32() - Else - Return EgtSimStart_64() - End If -End Function - - -Private Function EgtSimMove_32(ByRef nStatus As Integer) As Boolean -End Function - -Private Function EgtSimMove_64(ByRef nStatus As Integer) As Boolean -End Function -Public Function EgtSimMove(ByRef nStatus As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSimMove_32(nStatus) - Else - Return EgtSimMove_64(nStatus) - End If -End Function - - -Private Function EgtSimHome_32() As Boolean -End Function - -Private Function EgtSimHome_64() As Boolean -End Function -Public Function EgtSimHome() As Boolean - If IntPtr.Size = 4 Then - Return EgtSimHome_32() - Else - Return EgtSimHome_64() - End If -End Function - - -Private Function EgtSimGetAxisInfoPos_32(nInd As Integer, ByRef psToken As IntPtr, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean -End Function - -Private Function EgtSimGetAxisInfoPos_64(nInd As Integer, ByRef psToken As IntPtr, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean -End Function -Public Function EgtSimGetAxisInfoPos(nInd As Integer, ByRef sToken As String, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean - Dim psToken As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtSimGetAxisInfoPos_32(nInd, psToken, bLinear, dVal) - Else - bOk = EgtSimGetAxisInfoPos_64(nInd, psToken, bLinear, dVal) - End If - If bOk Then - sToken = Marshal.PtrToStringUni(psToken) - EgtFreeMemory(psToken) - Else - sToken = String.Empty - End If - Return bOk -End Function - - -Private Function EgtSimGetToolInfo_32(ByRef psTool As IntPtr, ByRef dSpeed As Double) As Boolean -End Function - -Private Function EgtSimGetToolInfo_64(ByRef psTool As IntPtr, ByRef dSpeed As Double) As Boolean -End Function -Public Function EgtSimGetToolInfo(ByRef sTool As String, ByRef dSpeed As Double) As Boolean - Dim psTool As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtSimGetToolInfo_32(psTool, dSpeed) - Else - bOk = EgtSimGetToolInfo_64(psTool, dSpeed) - End If - If bOk Then - sTool = Marshal.PtrToStringUni(psTool) - EgtFreeMemory(psTool) - Else - sTool = String.Empty - End If - Return bOk -End Function - - -Private Function EgtSimGetMoveInfo_32(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean -End Function - -Private Function EgtSimGetMoveInfo_64(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean -End Function -Public Function EgtSimGetMoveInfo(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtSimGetMoveInfo_32(nGmove, dSpeed) - Else - Return EgtSimGetMoveInfo_64(nGmove, dSpeed) - End If -End Function - - -Private Function EgtSimSetStep_32(dStep As Double) As Boolean -End Function - -Private Function EgtSimSetStep_64(dStep As Double) As Boolean -End Function -Public Function EgtSimSetStep(dStep As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtSimSetStep_32(dStep) - Else - Return EgtSimSetStep_64(dStep) - End If -End Function - - -Private Function EgtSimStop_32() As Boolean -End Function - -Private Function EgtSimStop_64() As Boolean -End Function -Public Function EgtSimStop() As Boolean - If IntPtr.Size = 4 Then - Return EgtSimStop_32() - Else - Return EgtSimStop_64() - End If -End Function - -' Generation - -Private Function EgtGenerate_32(sCncFile As String, sInfo As String) As Boolean -End Function - -Private Function EgtGenerate_64(sCncFile As String, sInfo As String) As Boolean -End Function -Public Function EgtGenerate(sCncFile As String, sInfo As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtGenerate_32(sCncFile, sInfo) - Else - Return EgtGenerate_64(sCncFile, sInfo) - End If -End Function - -' Machine - -Private Function EgtGetBaseId_32(sBase As String) As Integer -End Function - -Private Function EgtGetBaseId_64(sBase As String) As Integer -End Function -Public Function EgtGetBaseId(sBase As String) As Integer - If IntPtr.Size = 4 Then - Return EgtGetBaseId_32(sBase) - Else - Return EgtGetBaseId_64(sBase) - End If -End Function - - -Private Function EgtGetTableId_32(sTable As String) As Integer -End Function - -Private Function EgtGetTableId_64(sTable As String) As Integer -End Function -Public Function EgtGetTableId(sTable As String) As Integer - If IntPtr.Size = 4 Then - Return EgtGetTableId_32(sTable) - Else - Return EgtGetTableId_64(sTable) - End If -End Function - - -Private Function EgtGetAxisId_32(sAxis As String) As Integer -End Function - -Private Function EgtGetAxisId_64(sAxis As String) As Integer -End Function -Public Function EgtGetAxisId(sAxis As String) As Integer - If IntPtr.Size = 4 Then - Return EgtGetAxisId_32(sAxis) - Else - Return EgtGetAxisId_64(sAxis) - End If -End Function - - -Private Function EgtGetHeadId_32(sHead As String) As Integer -End Function - -Private Function EgtGetHeadId_64(sHead As String) As Integer -End Function -Public Function EgtGetHeadId(sHead As String) As Integer - If IntPtr.Size = 4 Then - Return EgtGetHeadId_32(sHead) - Else - Return EgtGetHeadId_64(sHead) - End If -End Function - -' Machine Calc - -Private Function EgtSetCalcTool_32(sTool As String, sHead As String, nExit As Integer) As Boolean -End Function - -Private Function EgtSetCalcTool_64(sTool As String, sHead As String, nExit As Integer) As Boolean -End Function -Public Function EgtSetCalcTool(sTool As String, sHead As String, nExit As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetCalcTool_32(sTool, sHead, nExit) - Else - Return EgtSetCalcTool_64(sTool, sHead, nExit) - End If -End Function - - -Private Function EgtGetCalcTipFromPositions_32(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, + + Private Function EgtVerifyRawPartCurrPhase_32(nRawId As Integer) As Boolean + End Function + + Private Function EgtVerifyRawPartCurrPhase_64(nRawId As Integer) As Boolean + End Function + Public Function EgtVerifyRawPartCurrPhase(nRawId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtVerifyRawPartCurrPhase_32(nRawId) + Else + Return EgtVerifyRawPartCurrPhase_64(nRawId) + End If + End Function + + + Private Function EgtRemoveRawPartFromCurrPhase_32(nRawId As Integer) As Boolean + End Function + + Private Function EgtRemoveRawPartFromCurrPhase_64(nRawId As Integer) As Boolean + End Function + Public Function EgtRemoveRawPartFromCurrPhase(nRawId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveRawPartFromCurrPhase_32(nRawId) + Else + Return EgtRemoveRawPartFromCurrPhase_64(nRawId) + End If + End Function + + + Private Function EgtRemoveRawPart_32(nRawId As Integer) As Boolean + End Function + + Private Function EgtRemoveRawPart_64(nRawId As Integer) As Boolean + End Function + Public Function EgtRemoveRawPart(nRawId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveRawPart_32(nRawId) + Else + Return EgtRemoveRawPart_64(nRawId) + End If + End Function + + + Private Function EgtMoveToCornerRawPart_32(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean + End Function + + Private Function EgtMoveToCornerRawPart_64(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean + End Function + Public Function EgtMoveToCornerRawPart(nRawId As Integer, ByRef ptCorner As Point3d, nFlag As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMoveToCornerRawPart_32(nRawId, ptCorner, nFlag) + Else + Return EgtMoveToCornerRawPart_64(nRawId, ptCorner, nFlag) + End If + End Function + + + Private Function EgtMoveRawPart_32(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean + End Function + + Private Function EgtMoveRawPart_64(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean + End Function + Public Function EgtMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtMoveRawPart_32(nRawId, vtMove) + Else + Return EgtMoveRawPart_64(nRawId, vtMove) + End If + End Function + + + Private Function EgtRotateRawPart_32(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean + End Function + + Private Function EgtRotateRawPart_64(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean + End Function + Public Function EgtRotateRawPart(nRawId As Integer, ByRef vtAx As Vector3d, dAngDeg As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtRotateRawPart_32(nRawId, vtAx, dAngDeg) + Else + Return EgtRotateRawPart_64(nRawId, vtAx, dAngDeg) + End If + End Function + + + Private Function EgtSplitFlatRawPartWithMachinings_32(nRawId As Integer, nNumMch As Integer, nMchId() As Integer) As Integer + End Function + + Private Function EgtSplitFlatRawPartWithMachinings_64(nRawId As Integer, nNumMch As Integer, nMchId() As Integer) As Integer + End Function + Public Function EgtSplitFlatRawPartWithMachinings(nRawId As Integer, nMchId() As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtSplitFlatRawPartWithMachinings_32(nRawId, nMchId.Length(), nMchId) + Else + Return EgtSplitFlatRawPartWithMachinings_64(nRawId, nMchId.Length(), nMchId) + End If + End Function + + + Private Function EgtGetPartInRawPartCount_32(nRawId As Integer) As Integer + End Function + + Private Function EgtGetPartInRawPartCount_64(nRawId As Integer) As Integer + End Function + Public Function EgtGetPartInRawPartCount(nRawId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetPartInRawPartCount_32(nRawId) + Else + Return EgtGetPartInRawPartCount_64(nRawId) + End If + End Function + + + Private Function EgtGetFirstPartInRawPart_32(nRawId As Integer) As Integer + End Function + + Private Function EgtGetFirstPartInRawPart_64(nRawId As Integer) As Integer + End Function + Public Function EgtGetFirstPartInRawPart(nRawId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetFirstPartInRawPart_32(nRawId) + Else + Return EgtGetFirstPartInRawPart_64(nRawId) + End If + End Function + + + Private Function EgtGetNextPartInRawPart_32(nPartId As Integer) As Integer + End Function + + Private Function EgtGetNextPartInRawPart_64(nPartId As Integer) As Integer + End Function + Public Function EgtGetNextPartInRawPart(nPartId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetNextPartInRawPart_32(nPartId) + Else + Return EgtGetNextPartInRawPart_64(nPartId) + End If + End Function + + + Private Function EgtAddPartToRawPart_32(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean + End Function + + Private Function EgtAddPartToRawPart_64(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean + End Function + Public Function EgtAddPartToRawPart(nPartId As Integer, ByRef ptPos As Point3d, nRawId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtAddPartToRawPart_32(nPartId, ptPos, nRawId) + Else + Return EgtAddPartToRawPart_64(nPartId, ptPos, nRawId) + End If + End Function + + + Private Function EgtGetRawPartFromPart_32(nPartId As Integer) As Integer + End Function + + Private Function EgtGetRawPartFromPart_64(nPartId As Integer) As Integer + End Function + Public Function EgtGetRawPartFromPart(nPartId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetRawPartFromPart_32(nPartId) + Else + Return EgtGetRawPartFromPart_64(nPartId) + End If + End Function + + + Private Function EgtRemovePartFromRawPart_32(nPartId As Integer) As Boolean + End Function + + Private Function EgtRemovePartFromRawPart_64(nPartId As Integer) As Boolean + End Function + Public Function EgtRemovePartFromRawPart(nPartId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemovePartFromRawPart_32(nPartId) + Else + Return EgtRemovePartFromRawPart_64(nPartId) + End If + End Function + + ' Table & Fixtures + + Private Function EgtSetTable_32(sTable As String) As Boolean + End Function + + Private Function EgtSetTable_64(sTable As String) As Boolean + End Function + Public Function EgtSetTable(sTable As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetTable_32(sTable) + Else + Return EgtSetTable_64(sTable) + End If + End Function + + + Private Function EgtGetTableName_32(ByRef psTableName As IntPtr) As Boolean + End Function + + Private Function EgtGetTableName_64(ByRef psTableName As IntPtr) As Boolean + End Function + Public Function EgtGetTableName(ByRef sTableName As String) As Boolean + Dim psTableName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetTableName_32(psTableName) + Else + bOk = EgtGetTableName_64(psTableName) + End If + If bOk Then + sTableName = Marshal.PtrToStringUni(psTableName) + EgtFreeMemory(psTableName) + Else + sTableName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtGetTableRef_32(nInd As Integer, ByRef ptPos As Point3d) As Boolean + End Function + + Private Function EgtGetTableRef_64(nInd As Integer, ByRef ptPos As Point3d) As Boolean + End Function + Public Function EgtGetTableRef(nInd As Integer, ByRef ptPos As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetTableRef_32(nInd, ptPos) + Else + Return EgtGetTableRef_64(nInd, ptPos) + End If + End Function + + + Private Function EgtGetTableArea_32(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean + End Function + + Private Function EgtGetTableArea_64(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean + End Function + Public Function EgtGetTableArea(nInd As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetTableArea_32(nInd, ptMin, ptMax) + Else + Return EgtGetTableArea_64(nInd, ptMin, ptMax) + End If + End Function + Public Function EgtGetTableArea(nInd As Integer, ByRef b3Box As BBox3d) As Boolean + b3Box.Setup() + Dim ptMin, ptMax As Point3d + If IntPtr.Size = 4 Then + If Not EgtGetTableArea_32(nInd, ptMin, ptMax) Then Return False + Else + If Not EgtGetTableArea_64(nInd, ptMin, ptMax) Then Return False + End If + b3Box.Add(ptMin) + b3Box.Add(ptMax) + Return True + End Function + + + Private Function EgtShowOnlyTable_32(bVal As Boolean) As Boolean + End Function + + Private Function EgtShowOnlyTable_64(bVal As Boolean) As Boolean + End Function + Public Function EgtShowOnlyTable(bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtShowOnlyTable_32(bVal) + Else + Return EgtShowOnlyTable_64(bVal) + End If + End Function + + + Private Function EgtAddFixture_32(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer + End Function + + Private Function EgtAddFixture_64(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer + End Function + Public Function EgtAddFixture(sName As String, ByRef ptPos As Point3d, dAngRotDeg As Double, dMov As Double) As Integer + If IntPtr.Size = 4 Then + Return EgtAddFixture_32(sName, ptPos, dAngRotDeg, dMov) + Else + Return EgtAddFixture_64(sName, ptPos, dAngRotDeg, dMov) + End If + End Function + + + Private Function EgtKeepFixture_32(nFixtId As Integer, nSouPhase As Integer) As Boolean + End Function + + Private Function EgtKeepFixture_64(nFixtId As Integer, nSouPhase As Integer) As Boolean + End Function + Public Function EgtKeepFixture(nFixtId As Integer, Optional nSouPhase As Integer = 0) As Boolean + If IntPtr.Size = 4 Then + Return EgtKeepFixture_32(nFixtId, nSouPhase) + Else + Return EgtKeepFixture_64(nFixtId, nSouPhase) + End If + End Function + + + Private Function EgtRemoveFixture_32(nFixtId As Integer) As Boolean + End Function + + Private Function EgtRemoveFixture_64(nFixtId As Integer) As Boolean + End Function + Public Function EgtRemoveFixture(nFixtId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveFixture_32(nFixtId) + Else + Return EgtRemoveFixture_64(nFixtId) + End If + End Function + + + Private Function EgtVerifyFixture_32(nFixtId As Integer) As Boolean + End Function + + Private Function EgtVerifyFixture_64(nFixtId As Integer) As Boolean + End Function + Public Function EgtVerifyFixture(nFixtId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtVerifyFixture_32(nFixtId) + Else + Return EgtVerifyFixture_64(nFixtId) + End If + End Function + + + Private Function EgtGetFirstFixture_32() As Integer + End Function + + Private Function EgtGetFirstFixture_64() As Integer + End Function + Public Function EgtGetFirstFixture() As Integer + If IntPtr.Size = 4 Then + Return EgtGetFirstFixture_32() + Else + Return EgtGetFirstFixture_64() + End If + End Function + + + Private Function EgtGetNextFixture_32(nFixtId As Integer) As Integer + End Function + + Private Function EgtGetNextFixture_64(nFixtId As Integer) As Integer + End Function + Public Function EgtGetNextFixture(nFixtId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetNextFixture_32(nFixtId) + Else + Return EgtGetNextFixture_64(nFixtId) + End If + End Function + + + Private Function EgtMoveFixture_32(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean + End Function + + Private Function EgtMoveFixture_64(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean + End Function + Public Function EgtMoveFixture(nFixtId As Integer, ByRef vtMove As Vector3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtMoveFixture_32(nFixtId, vtMove) + Else + Return EgtMoveFixture_64(nFixtId, vtMove) + End If + End Function + + + Private Function EgtRotateFixture_32(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean + End Function + + Private Function EgtRotateFixture_64(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean + End Function + Public Function EgtRotateFixture(nFixtId As Integer, dDeltaAngDeg As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtRotateFixture_32(nFixtId, dDeltaAngDeg) + Else + Return EgtRotateFixture_64(nFixtId, dDeltaAngDeg) + End If + End Function + + + Private Function EgtMoveFixtureMobile_32(nFixtId As Integer, dDeltaMov As Double) As Boolean + End Function + + Private Function EgtMoveFixtureMobile_64(nFixtId As Integer, dDeltaMov As Double) As Boolean + End Function + Public Function EgtMoveFixtureMobile(nFixtId As Integer, dDeltaMov As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMoveFixtureMobile_32(nFixtId, dDeltaMov) + Else + Return EgtMoveFixtureMobile_64(nFixtId, dDeltaMov) + End If + End Function + + ' Tools Database + + Private Function EgtTdbGetToolNewName_32(sName As String, ByRef psNewName As IntPtr) As Boolean + End Function + + Private Function EgtTdbGetToolNewName_64(sName As String, ByRef psNewName As IntPtr) As Boolean + End Function + Public Function EgtTdbGetToolNewName(ByRef sName As String) As Boolean + Dim psNewName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetToolNewName_32(sName, psNewName) + Else + bOk = EgtTdbGetToolNewName_64(sName, psNewName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psNewName) + EgtFreeMemory(psNewName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbAddTool_32(sName As String, nType As Integer) As Boolean + End Function + + Private Function EgtTdbAddTool_64(sName As String, nType As Integer) As Boolean + End Function + Public Function EgtTdbAddTool(sName As String, nType As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbAddTool_32(sName, nType) + Else + Return EgtTdbAddTool_64(sName, nType) + End If + End Function + + + Private Function EgtTdbCopyTool_32(sSource As String, sName As String) As Boolean + End Function + + Private Function EgtTdbCopyTool_64(sSource As String, sName As String) As Boolean + End Function + Public Function EgtTdbCopyTool(sSource As String, sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbCopyTool_32(sSource, sName) + Else + Return EgtTdbCopyTool_64(sSource, sName) + End If + End Function + + + Private Function EgtTdbRemoveTool_32(sName As String) As Boolean + End Function + + Private Function EgtTdbRemoveTool_64(sName As String) As Boolean + End Function + Public Function EgtTdbRemoveTool(sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbRemoveTool_32(sName) + Else + Return EgtTdbRemoveTool_64(sName) + End If + End Function + + + Private Function EgtTdbGetFirstTool_32(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean + End Function + + Private Function EgtTdbGetFirstTool_64(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean + End Function + Public Function EgtTdbGetFirstTool(nFamily As Integer, ByRef sName As String, ByRef nType As Integer) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetFirstTool_32(nFamily, psName, nType) + Else + bOk = EgtTdbGetFirstTool_64(nFamily, psName, nType) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbGetNextTool_32(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean + End Function + + Private Function EgtTdbGetNextTool_64(nFamily As Integer, ByRef psName As IntPtr, ByRef nType As Integer) As Boolean + End Function + Public Function EgtTdbGetNextTool(nFamily As Integer, ByRef sName As String, ByRef nType As Integer) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetNextTool_32(nFamily, psName, nType) + Else + bOk = EgtTdbGetNextTool_64(nFamily, psName, nType) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbGetToolFromUUID_32(sTuuid As String, ByRef psName As IntPtr) As Boolean + End Function + + Private Function EgtTdbGetToolFromUUID_64(sTuuid As String, ByRef psName As IntPtr) As Boolean + End Function + Public Function EgtTdbGetToolFromUUID(sTuuid As String, ByRef sName As String) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetToolFromUUID_32(sTuuid, psName) + Else + bOk = EgtTdbGetToolFromUUID_64(sTuuid, psName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbSetCurrTool_32(sName As String) As Boolean + End Function + + Private Function EgtTdbSetCurrTool_64(sName As String) As Boolean + End Function + Public Function EgtTdbSetCurrTool(sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSetCurrTool_32(sName) + Else + Return EgtTdbSetCurrTool_64(sName) + End If + End Function + + + Private Function EgtTdbSaveCurrTool_32() As Boolean + End Function + + Private Function EgtTdbSaveCurrTool_64() As Boolean + End Function + Public Function EgtTdbSaveCurrTool() As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSaveCurrTool_32() + Else + Return EgtTdbSaveCurrTool_64() + End If + End Function + + + Private Function EgtTdbIsCurrToolModified_32() As Boolean + End Function + + Private Function EgtTdbIsCurrToolModified_64() As Boolean + End Function + Public Function EgtTdbIsCurrToolModified() As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbIsCurrToolModified_32() + Else + Return EgtTdbIsCurrToolModified_64() + End If + End Function + + + Private Function EgtTdbSetCurrToolParamBool_32(nType As Integer, bVal As Boolean) As Boolean + End Function + + Private Function EgtTdbSetCurrToolParamBool_64(nType As Integer, bVal As Boolean) As Boolean + End Function + Public Function EgtTdbSetCurrToolParam(nType As Integer, bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSetCurrToolParamBool_32(nType, bVal) + Else + Return EgtTdbSetCurrToolParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtTdbSetCurrToolParamInt_32(nType As Integer, nVal As Integer) As Boolean + End Function + + Private Function EgtTdbSetCurrToolParamInt_64(nType As Integer, nVal As Integer) As Boolean + End Function + Public Function EgtTdbSetCurrToolParam(nType As Integer, nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSetCurrToolParamInt_32(nType, nVal) + Else + Return EgtTdbSetCurrToolParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtTdbSetCurrToolParamDouble_32(nType As Integer, dVal As Double) As Boolean + End Function + + Private Function EgtTdbSetCurrToolParamDouble_64(nType As Integer, dVal As Double) As Boolean + End Function + Public Function EgtTdbSetCurrToolParam(nType As Integer, dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSetCurrToolParamDouble_32(nType, dVal) + Else + Return EgtTdbSetCurrToolParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtTdbSetCurrToolParamString_32(nType As Integer, sVal As String) As Boolean + End Function + + Private Function EgtTdbSetCurrToolParamString_64(nType As Integer, sVal As String) As Boolean + End Function + Public Function EgtTdbSetCurrToolParam(nType As Integer, sVal As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSetCurrToolParamString_32(nType, sVal) + Else + Return EgtTdbSetCurrToolParamString_64(nType, sVal) + End If + End Function + + + Private Function EgtTdbGetCurrToolParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + + Private Function EgtTdbGetCurrToolParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbGetCurrToolParamBool_32(nType, bVal) + Else + Return EgtTdbGetCurrToolParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtTdbGetCurrToolParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + + Private Function EgtTdbGetCurrToolParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbGetCurrToolParamInt_32(nType, nVal) + Else + Return EgtTdbGetCurrToolParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtTdbGetCurrToolParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean + End Function + + Private Function EgtTdbGetCurrToolParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean + End Function + Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbGetCurrToolParamDouble_32(nType, dVal) + Else + Return EgtTdbGetCurrToolParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtTdbGetCurrToolParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + + Private Function EgtTdbGetCurrToolParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + Public Function EgtTdbGetCurrToolParam(nType As Integer, ByRef sVal As String) As Boolean + Dim psVal As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetCurrToolParamString_32(nType, psVal) + Else + bOk = EgtTdbGetCurrToolParamString_64(nType, psVal) + End If + If bOk Then + sVal = Marshal.PtrToStringUni(psVal) + EgtFreeMemory(psVal) + Else + sVal = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbReload_32() As Boolean + End Function + + Private Function EgtTdbReload_64() As Boolean + End Function + Public Function EgtTdbReload() As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbReload_32() + Else + Return EgtTdbReload_64() + End If + End Function + + + Private Function EgtTdbSave_32() As Boolean + End Function + + Private Function EgtTdbSave_64() As Boolean + End Function + Public Function EgtTdbSave() As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbSave_32() + Else + Return EgtTdbSave_64() + End If + End Function + + + Private Function EgtTdbGetToolDir_32(ByRef psToolDir As IntPtr) As Boolean + End Function + + Private Function EgtTdbGetToolDir_64(ByRef psToolDir As IntPtr) As Boolean + End Function + Public Function EgtTdbGetToolDir(ByRef sToolDir As String) As Boolean + Dim psToolDir As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetToolDir_32(psToolDir) + Else + bOk = EgtTdbGetToolDir_64(psToolDir) + End If + If bOk Then + sToolDir = Marshal.PtrToStringUni(psToolDir) + EgtFreeMemory(psToolDir) + Else + sToolDir = String.Empty + End If + Return bOk + End Function + + + Private Function EgtTdbGetToolHolderDir_32(ByRef psTHolderDir As IntPtr) As Boolean + End Function + + Private Function EgtTdbGetToolHolderDir_64(ByRef psTHolderDir As IntPtr) As Boolean + End Function + Public Function EgtTdbGetToolHolderDir(ByRef sTHolderDir As String) As Boolean + Dim psTHolderDir As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtTdbGetToolHolderDir_32(psTHolderDir) + Else + bOk = EgtTdbGetToolHolderDir_64(psTHolderDir) + End If + If bOk Then + sTHolderDir = Marshal.PtrToStringUni(psTHolderDir) + EgtFreeMemory(psTHolderDir) + Else + sTHolderDir = String.Empty + End If + Return bOk + End Function + + ' Machinings Database + + Private Function EgtMdbGetMachiningNewName_32(sName As String, ByRef psNewName As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetMachiningNewName_64(sName As String, ByRef psNewName As IntPtr) As Boolean + End Function + Public Function EgtMdbGetMachiningNewName(ByRef sName As String) As Boolean + Dim psNewName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetMachiningNewName_32(sName, psNewName) + Else + bOk = EgtMdbGetMachiningNewName_64(sName, psNewName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psNewName) + EgtFreeMemory(psNewName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtMdbAddMachining_32(sName As String, nType As Integer) As Boolean + End Function + + Private Function EgtMdbAddMachining_64(sName As String, nType As Integer) As Boolean + End Function + Public Function EgtMdbAddMachining(sName As String, nType As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbAddMachining_32(sName, nType) + Else + Return EgtMdbAddMachining_64(sName, nType) + End If + End Function + + + Private Function EgtMdbCopyMachining_32(sSource As String, sName As String) As Boolean + End Function + + Private Function EgtMdbCopyMachining_64(sSource As String, sName As String) As Boolean + End Function + Public Function EgtMdbCopyMachining(sSource As String, sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbCopyMachining_32(sSource, sName) + Else + Return EgtMdbCopyMachining_64(sSource, sName) + End If + End Function + + + Private Function EgtMdbRemoveMachining_32(sName As String) As Boolean + End Function + + Private Function EgtMdbRemoveMachining_64(sName As String) As Boolean + End Function + Public Function EgtMdbRemoveMachining(sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbRemoveMachining_32(sName) + Else + Return EgtMdbRemoveMachining_64(sName) + End If + End Function + + + Private Function EgtMdbGetFirstMachining_32(nType As Integer, ByRef psName As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetFirstMachining_64(nType As Integer, ByRef psName As IntPtr) As Boolean + End Function + Public Function EgtMdbGetFirstMachining(nType As Integer, ByRef sName As String) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetFirstMachining_32(nType, psName) + Else + bOk = EgtMdbGetFirstMachining_64(nType, psName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtMdbGetNextMachining_32(nType As Integer, ByRef psName As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetNextMachining_64(nType As Integer, ByRef psName As IntPtr) As Boolean + End Function + Public Function EgtMdbGetNextMachining(nType As Integer, ByRef sName As String) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetNextMachining_32(nType, psName) + Else + bOk = EgtMdbGetNextMachining_64(nType, psName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtMdbGetMachiningFromUUID_32(sMuuid As String, ByRef psName As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetMachiningFromUUID_64(sMuuid As String, ByRef psName As IntPtr) As Boolean + End Function + Public Function EgtMdbGetMachiningFromUUID(sMuuid As String, ByRef sName As String) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetMachiningFromUUID_32(sMuuid, psName) + Else + bOk = EgtMdbGetMachiningFromUUID_64(sMuuid, psName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtMdbSetCurrMachining_32(sName As String) As Boolean + End Function + + Private Function EgtMdbSetCurrMachining_64(sName As String) As Boolean + End Function + Public Function EgtMdbSetCurrMachining(sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetCurrMachining_32(sName) + Else + Return EgtMdbSetCurrMachining_64(sName) + End If + End Function + + + Private Function EgtMdbSaveCurrMachining_32() As Boolean + End Function + + Private Function EgtMdbSaveCurrMachining_64() As Boolean + End Function + Public Function EgtMdbSaveCurrMachining() As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSaveCurrMachining_32() + Else + Return EgtMdbSaveCurrMachining_64() + End If + End Function + + + Private Function EgtMdbIsCurrMachiningModified_32() As Boolean + End Function + + Private Function EgtMdbIsCurrMachiningModified_64() As Boolean + End Function + Public Function EgtMdbIsCurrMachiningModified() As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbIsCurrMachiningModified_32() + Else + Return EgtMdbIsCurrMachiningModified_64() + End If + End Function + + + Private Function EgtMdbSetCurrMachiningParamBool_32(nType As Integer, nVal As Boolean) As Boolean + End Function + + Private Function EgtMdbSetCurrMachiningParamBool_64(nType As Integer, nVal As Boolean) As Boolean + End Function + Public Function EgtMdbSetCurrMachiningParam(nType As Integer, nVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetCurrMachiningParamBool_32(nType, nVal) + Else + Return EgtMdbSetCurrMachiningParamBool_64(nType, nVal) + End If + End Function + + + Private Function EgtMdbSetCurrMachiningParamInt_32(nType As Integer, nVal As Integer) As Boolean + End Function + + Private Function EgtMdbSetCurrMachiningParamInt_64(nType As Integer, nVal As Integer) As Boolean + End Function + Public Function EgtMdbSetCurrMachiningParam(nType As Integer, nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetCurrMachiningParamInt_32(nType, nVal) + Else + Return EgtMdbSetCurrMachiningParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtMdbSetCurrMachiningParamDouble_32(nType As Integer, dVal As Double) As Boolean + End Function + + Private Function EgtMdbSetCurrMachiningParamDouble_64(nType As Integer, dVal As Double) As Boolean + End Function + Public Function EgtMdbSetCurrMachiningParam(nType As Integer, dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetCurrMachiningParamDouble_32(nType, dVal) + Else + Return EgtMdbSetCurrMachiningParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtMdbSetCurrMachiningParamString_32(nType As Integer, sVal As String) As Boolean + End Function + + Private Function EgtMdbSetCurrMachiningParamString_64(nType As Integer, sVal As String) As Boolean + End Function + Public Function EgtMdbSetCurrMachiningParam(nType As Integer, sVal As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetCurrMachiningParamString_32(nType, sVal) + Else + Return EgtMdbSetCurrMachiningParamString_64(nType, sVal) + End If + End Function + + + Private Function EgtMdbGetCurrMachiningParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + + Private Function EgtMdbGetCurrMachiningParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetCurrMachiningParamBool_32(nType, bVal) + Else + Return EgtMdbGetCurrMachiningParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtMdbGetCurrMachiningParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + + Private Function EgtMdbGetCurrMachiningParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetCurrMachiningParamInt_32(nType, nVal) + Else + Return EgtMdbGetCurrMachiningParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtMdbGetCurrMachiningParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean + End Function + + Private Function EgtMdbGetCurrMachiningParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean + End Function + Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetCurrMachiningParamDouble_32(nType, dVal) + Else + Return EgtMdbGetCurrMachiningParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtMdbGetCurrMachiningParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetCurrMachiningParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + Public Function EgtMdbGetCurrMachiningParam(nType As Integer, ByRef sVal As String) As Boolean + Dim psVal As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetCurrMachiningParamString_32(nType, psVal) + Else + bOk = EgtMdbGetCurrMachiningParamString_64(nType, psVal) + End If + If bOk Then + sVal = Marshal.PtrToStringUni(psVal) + EgtFreeMemory(psVal) + Else + sVal = String.Empty + End If + Return bOk + End Function + + + Private Function EgtMdbSetGeneralParamBool_32(nType As Integer, bVal As Boolean) As Boolean + End Function + + Private Function EgtMdbSetGeneralParamBool_64(nType As Integer, bVal As Boolean) As Boolean + End Function + Public Function EgtMdbSetGeneralParam(nType As Integer, bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetGeneralParamBool_32(nType, bVal) + Else + Return EgtMdbSetGeneralParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtMdbSetGeneralParamInt_32(nType As Integer, nVal As Integer) As Boolean + End Function + + Private Function EgtMdbSetGeneralParamInt_64(nType As Integer, nVal As Integer) As Boolean + End Function + Public Function EgtMdbSetGeneralParam(nType As Integer, nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetGeneralParamInt_32(nType, nVal) + Else + Return EgtMdbSetGeneralParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtMdbSetGeneralParamDouble_32(nType As Integer, dVal As Double) As Boolean + End Function + + Private Function EgtMdbSetGeneralParamDouble_64(nType As Integer, dVal As Double) As Boolean + End Function + Public Function EgtMdbSetGeneralParam(nType As Integer, dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSetGeneralParamDouble_32(nType, dVal) + Else + Return EgtMdbSetGeneralParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtMdbGetGeneralParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + + Private Function EgtMdbGetGeneralParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + Public Function EgtMdbGetGeneralParam(nType As Integer, ByRef bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetGeneralParamBool_32(nType, bVal) + Else + Return EgtMdbGetGeneralParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtMdbGetGeneralParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + + Private Function EgtMdbGetGeneralParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + Public Function EgtMdbGetGeneralParam(nType As Integer, ByRef nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetGeneralParamInt_32(nType, nVal) + Else + Return EgtMdbGetGeneralParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtMdbGetGeneralParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean + End Function + + Private Function EgtMdbGetGeneralParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean + End Function + Public Function EgtMdbGetGeneralParam(nType As Integer, ByRef dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbGetGeneralParamDouble_32(nType, dVal) + Else + Return EgtMdbGetGeneralParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtMdbReload_32() As Boolean + End Function + + Private Function EgtMdbReload_64() As Boolean + End Function + Public Function EgtMdbReload() As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbReload_32() + Else + Return EgtMdbReload_64() + End If + End Function + + + Private Function EgtMdbSave_32() As Boolean + End Function + + Private Function EgtMdbSave_64() As Boolean + End Function + Public Function EgtMdbSave() As Boolean + If IntPtr.Size = 4 Then + Return EgtMdbSave_32() + Else + Return EgtMdbSave_64() + End If + End Function + + + Private Function EgtMdbGetMachiningDir_32(ByRef psMachiningDir As IntPtr) As Boolean + End Function + + Private Function EgtMdbGetMachiningDir_64(ByRef psMachiningDir As IntPtr) As Boolean + End Function + Public Function EgtMdbGetMachiningDir(ByRef sMachiningDir As String) As Boolean + Dim psMachiningDir As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtMdbGetMachiningDir_32(psMachiningDir) + Else + bOk = EgtMdbGetMachiningDir_64(psMachiningDir) + End If + If bOk Then + sMachiningDir = Marshal.PtrToStringUni(psMachiningDir) + EgtFreeMemory(psMachiningDir) + Else + sMachiningDir = String.Empty + End If + Return bOk + End Function + + ' Operations + + Private Function EgtGetFirstOperation_32() As Integer + End Function + + Private Function EgtGetFirstOperation_64() As Integer + End Function + Public Function EgtGetFirstOperation() As Integer + If IntPtr.Size = 4 Then + Return EgtGetFirstOperation_32() + Else + Return EgtGetFirstOperation_64() + End If + End Function + + + Private Function EgtGetNextOperation_32(nId As Integer) As Integer + End Function + + Private Function EgtGetNextOperation_64(nId As Integer) As Integer + End Function + Public Function EgtGetNextOperation(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetNextOperation_32(nId) + Else + Return EgtGetNextOperation_64(nId) + End If + End Function + + + Private Function EgtGetLastOperation_32() As Integer + End Function + + Private Function EgtGetLastOperation_64() As Integer + End Function + Public Function EgtGetLastOperation() As Integer + If IntPtr.Size = 4 Then + Return EgtGetLastOperation_32() + Else + Return EgtGetLastOperation_64() + End If + End Function + + + Private Function EgtGetPrevOperation_32(nId As Integer) As Integer + End Function + + Private Function EgtGetPrevOperation_64(nId As Integer) As Integer + End Function + Public Function EgtGetPrevOperation(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetPrevOperation_32(nId) + Else + Return EgtGetPrevOperation_64(nId) + End If + End Function + + + Private Function EgtGetFirstActiveOperation_32() As Integer + End Function + + Private Function EgtGetFirstActiveOperation_64() As Integer + End Function + Public Function EgtGetFirstActiveOperation() As Integer + If IntPtr.Size = 4 Then + Return EgtGetFirstActiveOperation_32() + Else + Return EgtGetFirstActiveOperation_64() + End If + End Function + + + Private Function EgtGetNextActiveOperation_32(nId As Integer) As Integer + End Function + + Private Function EgtGetNextActiveOperation_64(nId As Integer) As Integer + End Function + Public Function EgtGetNextActiveOperation(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetNextActiveOperation_32(nId) + Else + Return EgtGetNextActiveOperation_64(nId) + End If + End Function + + + Private Function EgtGetLastActiveOperation_32() As Integer + End Function + + Private Function EgtGetLastActiveOperation_64() As Integer + End Function + Public Function EgtGetLastActiveOperation() As Integer + If IntPtr.Size = 4 Then + Return EgtGetLastActiveOperation_32() + Else + Return EgtGetLastActiveOperation_64() + End If + End Function + + + Private Function EgtGetPrevActiveOperation_32(nId As Integer) As Integer + End Function + + Private Function EgtGetPrevActiveOperation_64(nId As Integer) As Integer + End Function + Public Function EgtGetPrevActiveOperation(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetPrevActiveOperation_32(nId) + Else + Return EgtGetPrevActiveOperation_64(nId) + End If + End Function + + + Private Function EgtGetOperationType_32(nId As Integer) As Integer + End Function + + Private Function EgtGetOperationType_64(nId As Integer) As Integer + End Function + Public Function EgtGetOperationType(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetOperationType_32(nId) + Else + Return EgtGetOperationType_64(nId) + End If + End Function + + + Private Function EgtGetOperationPhase_32(nId As Integer) As Integer + End Function + + Private Function EgtGetOperationPhase_64(nId As Integer) As Integer + End Function + Public Function EgtGetOperationPhase(nId As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetOperationPhase_32(nId) + Else + Return EgtGetOperationPhase_64(nId) + End If + End Function + + + Private Function EgtGetOperationName_32(nId As Integer, ByRef psName As IntPtr) As Boolean + End Function + + Private Function EgtGetOperationName_64(nId As Integer, ByRef psName As IntPtr) As Boolean + End Function + Public Function EgtGetOperationName(nId As Integer, ByRef sName As String) As Boolean + Dim psName As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetOperationName_32(nId, psName) + Else + bOk = EgtGetOperationName_64(nId, psName) + End If + If bOk Then + sName = Marshal.PtrToStringUni(psName) + EgtFreeMemory(psName) + Else + sName = String.Empty + End If + Return bOk + End Function + + + Private Function EgtGetOperationId_32(sName As String) As Integer + End Function + + Private Function EgtGetOperationId_64(sName As String) As Integer + End Function + Public Function EgtGetOperationId(sName As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetOperationId_32(sName) + Else + Return EgtGetOperationId_64(sName) + End If + End Function + + + Private Function EgtRemoveOperation_32(nId As Integer) As Boolean + End Function + + Private Function EgtRemoveOperation_64(nId As Integer) As Boolean + End Function + Public Function EgtRemoveOperation(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveOperation_32(nId) + Else + Return EgtRemoveOperation_64(nId) + End If + End Function + + + Private Function EgtRemoveAllPhaseOperations_32(nPhase As Integer) As Boolean + End Function + + Private Function EgtRemoveAllPhaseOperations_64(nPhase As Integer) As Boolean + End Function + Public Function EgtRemoveAllPhaseOperations(nPhase As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveAllPhaseOperations_32(nPhase) + Else + Return EgtRemoveAllPhaseOperations_64(nPhase) + End If + End Function + + + Private Function EgtRemoveAllOperations_32() As Boolean + End Function + + Private Function EgtRemoveAllOperations_64() As Boolean + End Function + Public Function EgtRemoveAllOperations() As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveAllOperations_32() + Else + Return EgtRemoveAllOperations_64() + End If + End Function + + + Private Function EgtSetOperationMode_32(nId As Integer, bActive As Boolean) As Boolean + End Function + + Private Function EgtSetOperationMode_64(nId As Integer, bActive As Boolean) As Boolean + End Function + Public Function EgtSetOperationMode(nId As Integer, bActive As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetOperationMode_32(nId, bActive) + Else + Return EgtSetOperationMode_64(nId, bActive) + End If + End Function + + + Private Function EgtGetOperationMode_32(nId As Integer) As Boolean + End Function + + Private Function EgtGetOperationMode_64(nId As Integer) As Boolean + End Function + Public Function EgtGetOperationMode(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetOperationMode_32(nId) + Else + Return EgtGetOperationMode_64(nId) + End If + End Function + + + Private Function EgtSetAllOperationsMode_32(bActive As Boolean) As Boolean + End Function + + Private Function EgtSetAllOperationsMode_64(bActive As Boolean) As Boolean + End Function + Public Function EgtSetAllOperationsMode(bActive As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetAllOperationsMode_32(bActive) + Else + Return EgtSetAllOperationsMode_64(bActive) + End If + End Function + + + Private Function EgtSetOperationStatus_32(nId As Integer, bShow As Boolean) As Boolean + End Function + + Private Function EgtSetOperationStatus_64(nId As Integer, bShow As Boolean) As Boolean + End Function + Public Function EgtSetOperationStatus(nId As Integer, bShow As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetOperationStatus_32(nId, bShow) + Else + Return EgtSetOperationStatus_64(nId, bShow) + End If + End Function + + + Private Function EgtGetOperationStatus_32(nId As Integer) As Boolean + End Function + + Private Function EgtGetOperationStatus_64(nId As Integer) As Boolean + End Function + Public Function EgtGetOperationStatus(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetOperationStatus_32(nId) + Else + Return EgtGetOperationStatus_64(nId) + End If + End Function + + + Private Function EgtSetAllOperationsStatus_32(bShow As Boolean) As Boolean + End Function + + Private Function EgtSetAllOperationsStatus_64(bShow As Boolean) As Boolean + End Function + Public Function EgtSetAllOperationsStatus(bShow As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetAllOperationsStatus_32(bShow) + Else + Return EgtSetAllOperationsStatus_64(bShow) + End If + End Function + + + Private Function EgtChangeOperationPhase_32(nId As Integer, nNewPhase As Integer) As Boolean + End Function + + Private Function EgtChangeOperationPhase_64(nId As Integer, nNewPhase As Integer) As Boolean + End Function + Public Function EgtChangeOperationPhase(nId As Integer, nNewPhase As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtChangeOperationPhase_32(nId, nNewPhase) + Else + Return EgtChangeOperationPhase_64(nId, nNewPhase) + End If + End Function + + + Private Function EgtGetPhaseLastOperation_32(nPhase As Integer) As Integer + End Function + + Private Function EgtGetPhaseLastOperation_64(nPhase As Integer) As Integer + End Function + Public Function EgtGetPhaseLastOperation(nPhase As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetPhaseLastOperation_32(nPhase) + Else + Return EgtGetPhaseLastOperation_64(nPhase) + End If + End Function + + + Private Function EgtRemoveOperationHome_32(nId As Integer) As Boolean + End Function + + Private Function EgtRemoveOperationHome_64(nId As Integer) As Boolean + End Function + Public Function EgtRemoveOperationHome(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtRemoveOperationHome_32(nId) + Else + Return EgtRemoveOperationHome_64(nId) + End If + End Function + + ' Dispositions + + Private Function EgtGetPhaseDisposition_32(nPhase As Integer) As Integer + End Function + + Private Function EgtGetPhaseDisposition_64(nPhase As Integer) As Integer + End Function + Public Function EgtGetPhaseDisposition(nPhase As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtGetPhaseDisposition_32(nPhase) + Else + Return EgtGetPhaseDisposition_64(nPhase) + End If + End Function + + + Private Function EgtSpecialApplyDisposition_32(nId As Integer, bRecalc As Boolean) As Boolean + End Function + + Private Function EgtSpecialApplyDisposition_64(nId As Integer, bRecalc As Boolean) As Boolean + End Function + Public Function EgtSpecialApplyDisposition(nId As Integer, bRecalc As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSpecialApplyDisposition_32(nId, bRecalc) + Else + Return EgtSpecialApplyDisposition_64(nId, bRecalc) + End If + End Function + + ' Machinings + + Private Function EgtAddMachining_32(sName As String, sMachining As String) As Integer + End Function + + Private Function EgtAddMachining_64(sName As String, sMachining As String) As Integer + End Function + Public Function EgtAddMachining(sName As String, sMachining As String) As Integer + If IntPtr.Size = 4 Then + Return EgtAddMachining_32(sName, sMachining) + Else + Return EgtAddMachining_64(sName, sMachining) + End If + End Function + + + Private Function EgtCreateMachining_32(sName As String, nType As Integer, sMachining As String) As Integer + End Function + + Private Function EgtCreateMachining_64(sName As String, nType As Integer, sMachining As String) As Integer + End Function + Public Function EgtCreateMachining(sName As String, nType As Integer, sMachining As String) As Integer + If IntPtr.Size = 4 Then + Return EgtCreateMachining_32(sName, nType, sMachining) + Else + Return EgtCreateMachining_64(sName, nType, sMachining) + End If + End Function + + + Private Function EgtSetCurrMachining_32(nId As Integer) As Boolean + End Function + + Private Function EgtSetCurrMachining_64(nId As Integer) As Boolean + End Function + Public Function EgtSetCurrMachining(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetCurrMachining_32(nId) + Else + Return EgtSetCurrMachining_64(nId) + End If + End Function + + + Private Function EgtGetCurrMachining_32() As Integer + End Function + + Private Function EgtGetCurrMachining_64() As Integer + End Function + Public Function EgtGetCurrMachining() As Integer + If IntPtr.Size = 4 Then + Return EgtGetCurrMachining_32() + Else + Return EgtGetCurrMachining_64() + End If + End Function + + + Private Function EgtSetMachiningParamBool_32(nType As Integer, nVal As Boolean) As Boolean + End Function + + Private Function EgtSetMachiningParamBool_64(nType As Integer, nVal As Boolean) As Boolean + End Function + Public Function EgtSetMachiningParam(nType As Integer, nVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMachiningParamBool_32(nType, nVal) + Else + Return EgtSetMachiningParamBool_64(nType, nVal) + End If + End Function + + + Private Function EgtSetMachiningParamInt_32(nType As Integer, nVal As Integer) As Boolean + End Function + + Private Function EgtSetMachiningParamInt_64(nType As Integer, nVal As Integer) As Boolean + End Function + Public Function EgtSetMachiningParam(nType As Integer, nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMachiningParamInt_32(nType, nVal) + Else + Return EgtSetMachiningParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtSetMachiningParamDouble_32(nType As Integer, dVal As Double) As Boolean + End Function + + Private Function EgtSetMachiningParamDouble_64(nType As Integer, dVal As Double) As Boolean + End Function + Public Function EgtSetMachiningParam(nType As Integer, dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMachiningParamDouble_32(nType, dVal) + Else + Return EgtSetMachiningParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtSetMachiningParamString_32(nType As Integer, sVal As String) As Boolean + End Function + + Private Function EgtSetMachiningParamString_64(nType As Integer, sVal As String) As Boolean + End Function + Public Function EgtSetMachiningParam(nType As Integer, sVal As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMachiningParamString_32(nType, sVal) + Else + Return EgtSetMachiningParamString_64(nType, sVal) + End If + End Function + + + Private Function EgtSetMachiningGeometry_32(nNumId As Integer, nId() As Integer, nSub() As Integer) As Boolean + End Function + + Private Function EgtSetMachiningGeometry_64(nNumId As Integer, nId() As Integer, nSub() As Integer) As Boolean + End Function + Public Function EgtSetMachiningGeometry(nId() As Integer, nSub() As Integer) As Boolean + If nId.Length() <> nSub.Length() Then Return False + If IntPtr.Size = 4 Then + Return EgtSetMachiningGeometry_32(nId.Length(), nId, nSub) + Else + Return EgtSetMachiningGeometry_64(nId.Length(), nId, nSub) + End If + End Function + Public Function EgtSetMachiningGeometry(nId() As Integer) As Boolean + Dim nSub(nId.Length() - 1) As Integer + For I As Integer = 0 To nId.Length() - 1 + nSub(I) = -1 + Next + If IntPtr.Size = 4 Then + Return EgtSetMachiningGeometry_32(nId.Length(), nId, nSub) + Else + Return EgtSetMachiningGeometry_64(nId.Length(), nId, nSub) + End If + End Function + + + Private Function EgtPreviewMachining_32(bRecalc As Boolean) As Boolean + End Function + + Private Function EgtPreviewMachining_64(bRecalc As Boolean) As Boolean + End Function + Public Function EgtPreviewMachining(bRecalc As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtPreviewMachining_32(bRecalc) + Else + Return EgtPreviewMachining_64(bRecalc) + End If + End Function + + + Private Function EgtApplyMachining_32(bRecalc As Boolean) As Boolean + End Function + + Private Function EgtApplyMachining_64(bRecalc As Boolean) As Boolean + End Function + Public Function EgtApplyMachining(bRecalc As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtApplyMachining_32(bRecalc) + Else + Return EgtApplyMachining_64(bRecalc) + End If + End Function + + + Private Function EgtGetMachiningParamBool_32(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + + Private Function EgtGetMachiningParamBool_64(nType As Integer, ByRef bVal As Boolean) As Boolean + End Function + Public Function EgtGetMachiningParam(nType As Integer, ByRef bVal As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetMachiningParamBool_32(nType, bVal) + Else + Return EgtGetMachiningParamBool_64(nType, bVal) + End If + End Function + + + Private Function EgtGetMachiningParamInt_32(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + + Private Function EgtGetMachiningParamInt_64(nType As Integer, ByRef nVal As Integer) As Boolean + End Function + Public Function EgtGetMachiningParam(nType As Integer, ByRef nVal As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetMachiningParamInt_32(nType, nVal) + Else + Return EgtGetMachiningParamInt_64(nType, nVal) + End If + End Function + + + Private Function EgtGetMachiningParamDouble_32(nType As Integer, ByRef dVal As Double) As Boolean + End Function + + Private Function EgtGetMachiningParamDouble_64(nType As Integer, ByRef dVal As Double) As Boolean + End Function + Public Function EgtGetMachiningParam(nType As Integer, ByRef dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetMachiningParamDouble_32(nType, dVal) + Else + Return EgtGetMachiningParamDouble_64(nType, dVal) + End If + End Function + + + Private Function EgtGetMachiningParamString_32(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + + Private Function EgtGetMachiningParamString_64(nType As Integer, ByRef psVal As IntPtr) As Boolean + End Function + Public Function EgtGetMachiningParam(nType As Integer, ByRef sVal As String) As Boolean + Dim psVal As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetMachiningParamString_32(nType, psVal) + Else + bOk = EgtGetMachiningParamString_64(nType, psVal) + End If + If bOk Then + sVal = Marshal.PtrToStringUni(psVal) + EgtFreeMemory(psVal) + Else + sVal = String.Empty + End If + Return bOk + End Function + + + Private Function EgtGetMachiningGeometry_32(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean + End Function + + Private Function EgtGetMachiningGeometry_64(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean + End Function + Public Function EgtGetMachiningGeometry(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetMachiningGeometry_32(nInd, nId, nSub) + Else + Return EgtGetMachiningGeometry_64(nInd, nId, nSub) + End If + End Function + + + Private Function EgtIsMachiningEmpty_32() As Boolean + End Function + + Private Function EgtIsMachiningEmpty_64() As Boolean + End Function + Public Function EgtIsMachiningEmpty() As Boolean + If IntPtr.Size = 4 Then + Return EgtIsMachiningEmpty_32() + Else + Return EgtIsMachiningEmpty_64() + End If + End Function + + ' Simulation + + Private Function EgtSimStart_32() As Boolean + End Function + + Private Function EgtSimStart_64() As Boolean + End Function + Public Function EgtSimStart() As Boolean + If IntPtr.Size = 4 Then + Return EgtSimStart_32() + Else + Return EgtSimStart_64() + End If + End Function + + + Private Function EgtSimMove_32(ByRef nStatus As Integer) As Boolean + End Function + + Private Function EgtSimMove_64(ByRef nStatus As Integer) As Boolean + End Function + Public Function EgtSimMove(ByRef nStatus As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSimMove_32(nStatus) + Else + Return EgtSimMove_64(nStatus) + End If + End Function + + + Private Function EgtSimHome_32() As Boolean + End Function + + Private Function EgtSimHome_64() As Boolean + End Function + Public Function EgtSimHome() As Boolean + If IntPtr.Size = 4 Then + Return EgtSimHome_32() + Else + Return EgtSimHome_64() + End If + End Function + + + Private Function EgtSimGetAxisInfoPos_32(nInd As Integer, ByRef psToken As IntPtr, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean + End Function + + Private Function EgtSimGetAxisInfoPos_64(nInd As Integer, ByRef psToken As IntPtr, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean + End Function + Public Function EgtSimGetAxisInfoPos(nInd As Integer, ByRef sToken As String, ByRef bLinear As Boolean, ByRef dVal As Double) As Boolean + Dim psToken As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtSimGetAxisInfoPos_32(nInd, psToken, bLinear, dVal) + Else + bOk = EgtSimGetAxisInfoPos_64(nInd, psToken, bLinear, dVal) + End If + If bOk Then + sToken = Marshal.PtrToStringUni(psToken) + EgtFreeMemory(psToken) + Else + sToken = String.Empty + End If + Return bOk + End Function + + + Private Function EgtSimGetToolInfo_32(ByRef psTool As IntPtr, ByRef dSpeed As Double) As Boolean + End Function + + Private Function EgtSimGetToolInfo_64(ByRef psTool As IntPtr, ByRef dSpeed As Double) As Boolean + End Function + Public Function EgtSimGetToolInfo(ByRef sTool As String, ByRef dSpeed As Double) As Boolean + Dim psTool As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtSimGetToolInfo_32(psTool, dSpeed) + Else + bOk = EgtSimGetToolInfo_64(psTool, dSpeed) + End If + If bOk Then + sTool = Marshal.PtrToStringUni(psTool) + EgtFreeMemory(psTool) + Else + sTool = String.Empty + End If + Return bOk + End Function + + + Private Function EgtSimGetMoveInfo_32(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean + End Function + + Private Function EgtSimGetMoveInfo_64(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean + End Function + Public Function EgtSimGetMoveInfo(ByRef nGmove As Integer, ByRef dSpeed As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtSimGetMoveInfo_32(nGmove, dSpeed) + Else + Return EgtSimGetMoveInfo_64(nGmove, dSpeed) + End If + End Function + + + Private Function EgtSimSetStep_32(dStep As Double) As Boolean + End Function + + Private Function EgtSimSetStep_64(dStep As Double) As Boolean + End Function + Public Function EgtSimSetStep(dStep As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtSimSetStep_32(dStep) + Else + Return EgtSimSetStep_64(dStep) + End If + End Function + + + Private Function EgtSimStop_32() As Boolean + End Function + + Private Function EgtSimStop_64() As Boolean + End Function + Public Function EgtSimStop() As Boolean + If IntPtr.Size = 4 Then + Return EgtSimStop_32() + Else + Return EgtSimStop_64() + End If + End Function + + ' Generation + + Private Function EgtGenerate_32(sCncFile As String, sInfo As String) As Boolean + End Function + + Private Function EgtGenerate_64(sCncFile As String, sInfo As String) As Boolean + End Function + Public Function EgtGenerate(sCncFile As String, sInfo As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtGenerate_32(sCncFile, sInfo) + Else + Return EgtGenerate_64(sCncFile, sInfo) + End If + End Function + + ' Machine + + Private Function EgtGetBaseId_32(sBase As String) As Integer + End Function + + Private Function EgtGetBaseId_64(sBase As String) As Integer + End Function + Public Function EgtGetBaseId(sBase As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetBaseId_32(sBase) + Else + Return EgtGetBaseId_64(sBase) + End If + End Function + + + Private Function EgtGetTableId_32(sTable As String) As Integer + End Function + + Private Function EgtGetTableId_64(sTable As String) As Integer + End Function + Public Function EgtGetTableId(sTable As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetTableId_32(sTable) + Else + Return EgtGetTableId_64(sTable) + End If + End Function + + + Private Function EgtGetAxisId_32(sAxis As String) As Integer + End Function + + Private Function EgtGetAxisId_64(sAxis As String) As Integer + End Function + Public Function EgtGetAxisId(sAxis As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetAxisId_32(sAxis) + Else + Return EgtGetAxisId_64(sAxis) + End If + End Function + + + Private Function EgtGetHeadId_32(sHead As String) As Integer + End Function + + Private Function EgtGetHeadId_64(sHead As String) As Integer + End Function + Public Function EgtGetHeadId(sHead As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetHeadId_32(sHead) + Else + Return EgtGetHeadId_64(sHead) + End If + End Function + + + Private Function EgtGetHeadExitCount_32(sHead As String) As Integer + End Function + + Private Function EgtGetHeadExitCount_64(sHead As String) As Integer + End Function + Public Function EgtGetHeadExitCount(sHead As String) As Integer + If IntPtr.Size = 4 Then + Return EgtGetHeadExitCount_32(sHead) + Else + Return EgtGetHeadExitCount_64(sHead) + End If + End Function + + ' Machine Calc + + Private Function EgtSetCalcTool_32(sTool As String, sHead As String, nExit As Integer) As Boolean + End Function + + Private Function EgtSetCalcTool_64(sTool As String, sHead As String, nExit As Integer) As Boolean + End Function + Public Function EgtSetCalcTool(sTool As String, sHead As String, nExit As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetCalcTool_32(sTool, sHead, nExit) + Else + Return EgtSetCalcTool_64(sTool, sHead, nExit) + End If + End Function + + + Private Function EgtGetCalcTipFromPositions_32(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, bBottom As Boolean, ByRef ptTip As Point3d) As Boolean -End Function - -Private Function EgtGetCalcTipFromPositions_64(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, + End Function + + Private Function EgtGetCalcTipFromPositions_64(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, bBottom As Boolean, ByRef ptTip As Point3d) As Boolean -End Function -Public Function EgtGetCalcTipFromPositions(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, - bBottom As Boolean, ByRef ptTip As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetCalcTipFromPositions_32(dX, dY, dZ, dAngA, dAngB, bBottom, ptTip) - Else - Return EgtGetCalcTipFromPositions_64(dX, dY, dZ, dAngA, dAngB, bBottom, ptTip) - End If -End Function + End Function + Public Function EgtGetCalcTipFromPositions(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, + bBottom As Boolean, ByRef ptTip As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetCalcTipFromPositions_32(dX, dY, dZ, dAngA, dAngB, bBottom, ptTip) + Else + Return EgtGetCalcTipFromPositions_64(dX, dY, dZ, dAngA, dAngB, bBottom, ptTip) + End If + End Function - -Private Function EgtGetCalcToolDirFromAngles_32(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean -End Function - -Private Function EgtGetCalcToolDirFromAngles_64(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean -End Function -Public Function EgtGetCalcToolDirFromAngles(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetCalcToolDirFromAngles_32(dAngA, dAngB, vtDir) - Else - Return EgtGetCalcToolDirFromAngles_64(dAngA, dAngB, vtDir) - End If -End Function + + Private Function EgtGetCalcToolDirFromAngles_32(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean + End Function + + Private Function EgtGetCalcToolDirFromAngles_64(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean + End Function + Public Function EgtGetCalcToolDirFromAngles(dAngA As Double, dAngB As Double, ByRef vtDir As Vector3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetCalcToolDirFromAngles_32(dAngA, dAngB, vtDir) + Else + Return EgtGetCalcToolDirFromAngles_64(dAngA, dAngB, vtDir) + End If + End Function - -Private Function EgtVerifyOutstroke_32(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean -End Function - -Private Function EgtVerifyOutstroke_64(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean -End Function -Public Function EgtVerifyOutstroke(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtVerifyOutstroke_32(dX, dY, dZ, dAngA, dAngB, nStat) - Else - Return EgtVerifyOutstroke_64(dX, dY, dZ, dAngA, dAngB, nStat) - End If -End Function + + Private Function EgtVerifyOutstroke_32(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean + End Function + + Private Function EgtVerifyOutstroke_64(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean + End Function + Public Function EgtVerifyOutstroke(dX As Double, dY As Double, dZ As Double, dAngA As Double, dAngB As Double, ByRef nStat As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtVerifyOutstroke_32(dX, dY, dZ, dAngA, dAngB, nStat) + Else + Return EgtVerifyOutstroke_64(dX, dY, dZ, dAngA, dAngB, nStat) + End If + End Function - -Private Function EgtGetOutstrokeInfo_32(ByRef psInfo As IntPtr) As Boolean -End Function - -Private Function EgtGetOutstrokeInfo_64(ByRef psInfo As IntPtr) As Boolean -End Function -Public Function EgtGetOutstrokeInfo(ByRef sInfo As String) As Boolean - Dim psInfo As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtGetOutstrokeInfo_32(psInfo) - Else - bOk = EgtGetOutstrokeInfo_64(psInfo) - End If - If bOk Then - sInfo = Marshal.PtrToStringUni(psInfo) - EgtFreeMemory(psInfo) - Else - sInfo = String.Empty - End If - Return bOk -End Function + + Private Function EgtGetOutstrokeInfo_32(ByRef psInfo As IntPtr) As Boolean + End Function + + Private Function EgtGetOutstrokeInfo_64(ByRef psInfo As IntPtr) As Boolean + End Function + Public Function EgtGetOutstrokeInfo(ByRef sInfo As String) As Boolean + Dim psInfo As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetOutstrokeInfo_32(psInfo) + Else + bOk = EgtGetOutstrokeInfo_64(psInfo) + End If + If bOk Then + sInfo = Marshal.PtrToStringUni(psInfo) + EgtFreeMemory(psInfo) + Else + sInfo = String.Empty + End If + Return bOk + End Function -' Machine Move - -Private Function EgtSetAxisPos_32(sAxis As String, dVal As Double) As Boolean -End Function - -Private Function EgtSetAxisPos_64(sAxis As String, dVal As Double) As Boolean -End Function -Public Function EgtSetAxisPos(sAxis As String, dVal As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetAxisPos_32(sAxis, dVal) - Else - Return EgtSetAxisPos_64(sAxis, dVal) - End If -End Function + ' Machine Move + + Private Function EgtSetAxisPos_32(sAxis As String, dVal As Double) As Boolean + End Function + + Private Function EgtSetAxisPos_64(sAxis As String, dVal As Double) As Boolean + End Function + Public Function EgtSetAxisPos(sAxis As String, dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetAxisPos_32(sAxis, dVal) + Else + Return EgtSetAxisPos_64(sAxis, dVal) + End If + End Function - -Private Function EgtLoadTool_32(sHead As String, nExit As Integer, sTool As String) As Boolean -End Function - -Private Function EgtLoadTool_64(sHead As String, nExit As Integer, sTool As String) As Boolean -End Function -Public Function EgtLoadTool(sHead As String, nExit As Integer, sTool As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtLoadTool_32(sHead, nExit, sTool) - Else - Return EgtLoadTool_64(sHead, nExit, sTool) - End If -End Function + + Private Function EgtLoadTool_32(sHead As String, nExit As Integer, sTool As String) As Boolean + End Function + + Private Function EgtLoadTool_64(sHead As String, nExit As Integer, sTool As String) As Boolean + End Function + Public Function EgtLoadTool(sHead As String, nExit As Integer, sTool As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtLoadTool_32(sHead, nExit, sTool) + Else + Return EgtLoadTool_64(sHead, nExit, sTool) + End If + End Function - -Private Function EgtResetHeadSet_32(sHead As String) As Boolean -End Function - -Private Function EgtResetHeadSet_64(sHead As String) As Boolean -End Function -Public Function EgtResetHeadSet(sHead As String) As Boolean - If IntPtr.Size = 4 Then - Return EgtResetHeadSet_32(sHead) - Else - Return EgtResetHeadSet_64(sHead) - End If -End Function + + Private Function EgtResetHeadSet_32(sHead As String) As Boolean + End Function + + Private Function EgtResetHeadSet_64(sHead As String) As Boolean + End Function + Public Function EgtResetHeadSet(sHead As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtResetHeadSet_32(sHead) + Else + Return EgtResetHeadSet_64(sHead) + End If + End Function - -Private Function EgtSetMachineLook_32(nFlag As Integer) As Boolean -End Function - -Private Function EgtSetMachineLook_64(nFlag As Integer) As Boolean -End Function -Public Function EgtSetMachineLook(nFlag As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMachineLook_32(nFlag) - Else - Return EgtSetMachineLook_64(nFlag) - End If -End Function + + Private Function EgtSetMachineLook_32(nFlag As Integer) As Boolean + End Function + + Private Function EgtSetMachineLook_64(nFlag As Integer) As Boolean + End Function + Public Function EgtSetMachineLook(nFlag As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMachineLook_32(nFlag) + Else + Return EgtSetMachineLook_64(nFlag) + End If + End Function -'---------- Scene -------------------------------------------------------------- - -Private Function EgtInitScene_32(hWnd As IntPtr, nDriver As Integer, + '---------- Scene -------------------------------------------------------------- + + Private Function EgtInitScene_32(hWnd As IntPtr, nDriver As Integer, b2Buff As Boolean, nColorBits As Integer, nDepthBits As Integer) As Boolean -End Function - -Private Function EgtInitScene_64(hWnd As IntPtr, nDriver As Integer, + End Function + + Private Function EgtInitScene_64(hWnd As IntPtr, nDriver As Integer, b2Buff As Boolean, nColorBits As Integer, nDepthBits As Integer) As Boolean -End Function -Public Function EgtInitScene(hWnd As IntPtr, nDriver As Integer, - b2Buff As Boolean, nColorBits As Integer, nDepthBits As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtInitScene_32(hWnd, nDriver, b2Buff, nColorBits, nDepthBits) - Else - Return EgtInitScene_64(hWnd, nDriver, b2Buff, nColorBits, nDepthBits) - End If -End Function + End Function + Public Function EgtInitScene(hWnd As IntPtr, nDriver As Integer, + b2Buff As Boolean, nColorBits As Integer, nDepthBits As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtInitScene_32(hWnd, nDriver, b2Buff, nColorBits, nDepthBits) + Else + Return EgtInitScene_64(hWnd, nDriver, b2Buff, nColorBits, nDepthBits) + End If + End Function - -Private Function EgtGetSceneInfo_32(ByRef psInfo As IntPtr) As Boolean -End Function - -Private Function EgtGetSceneInfo_64(ByRef psInfo As IntPtr) As Boolean -End Function -Public Function EgtGetSceneInfo(ByRef sInfo As String) As Boolean - Dim psInfo As IntPtr - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtGetSceneInfo_32(psInfo) - Else - bOk = EgtGetSceneInfo_64(psInfo) - End If - If bOk Then - sInfo = Marshal.PtrToStringUni(psInfo) - EgtFreeMemory(psInfo) - Else - sInfo = String.Empty - End If - Return bOk -End Function + + Private Function EgtGetSceneInfo_32(ByRef psInfo As IntPtr) As Boolean + End Function + + Private Function EgtGetSceneInfo_64(ByRef psInfo As IntPtr) As Boolean + End Function + Public Function EgtGetSceneInfo(ByRef sInfo As String) As Boolean + Dim psInfo As IntPtr + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtGetSceneInfo_32(psInfo) + Else + bOk = EgtGetSceneInfo_64(psInfo) + End If + If bOk Then + sInfo = Marshal.PtrToStringUni(psInfo) + EgtFreeMemory(psInfo) + Else + sInfo = String.Empty + End If + Return bOk + End Function - -Private Function EgtSetBackground_32(ByRef colTop As Color3d, ByRef colBottom As Color3d, bRedraw As Boolean) As Boolean -End Function - -Private Function EgtSetBackground_64(ByRef colTop As Color3d, ByRef colBottom As Color3d, bRedraw As Boolean) As Boolean -End Function -Public Function EgtSetBackground(ByRef colTop As Color3d, ByRef colBottom As Color3d, Optional bRedraw As Boolean = True) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetBackground_32(colTop, colBottom, bRedraw) - Else - Return EgtSetBackground_64(colTop, colBottom, bRedraw) - End If -End Function + + Private Function EgtSetBackground_32(ByRef colTop As Color3d, ByRef colBottom As Color3d, bRedraw As Boolean) As Boolean + End Function + + Private Function EgtSetBackground_64(ByRef colTop As Color3d, ByRef colBottom As Color3d, bRedraw As Boolean) As Boolean + End Function + Public Function EgtSetBackground(ByRef colTop As Color3d, ByRef colBottom As Color3d, Optional bRedraw As Boolean = True) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetBackground_32(colTop, colBottom, bRedraw) + Else + Return EgtSetBackground_64(colTop, colBottom, bRedraw) + End If + End Function - -Private Function EgtSetMarkAttribs_32(ByRef colMark As Color3d) As Boolean -End Function - -Private Function EgtSetMarkAttribs_64(ByRef colMark As Color3d) As Boolean -End Function -Public Function EgtSetMarkAttribs(ByRef colMark As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetMarkAttribs_32(colMark) - Else - Return EgtSetMarkAttribs_64(colMark) - End If -End Function + + Private Function EgtSetMarkAttribs_32(ByRef colMark As Color3d) As Boolean + End Function + + Private Function EgtSetMarkAttribs_64(ByRef colMark As Color3d) As Boolean + End Function + Public Function EgtSetMarkAttribs(ByRef colMark As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetMarkAttribs_32(colMark) + Else + Return EgtSetMarkAttribs_64(colMark) + End If + End Function - -Private Function EgtSetSelSurfAttribs_32(ByRef colSelSurf As Color3d) As Boolean -End Function - -Private Function EgtSetSelSurfAttribs_64(ByRef colSelSurf As Color3d) As Boolean -End Function -Public Function EgtSetSelSurfAttribs(ByRef colSelSurf As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetSelSurfAttribs_32(colSelSurf) - Else - Return EgtSetSelSurfAttribs_64(colSelSurf) - End If -End Function + + Private Function EgtSetSelSurfAttribs_32(ByRef colSelSurf As Color3d) As Boolean + End Function + + Private Function EgtSetSelSurfAttribs_64(ByRef colSelSurf As Color3d) As Boolean + End Function + Public Function EgtSetSelSurfAttribs(ByRef colSelSurf As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetSelSurfAttribs_32(colSelSurf) + Else + Return EgtSetSelSurfAttribs_64(colSelSurf) + End If + End Function - -Private Function EgtSetGeoLineAttribs_32(ByRef colGl As Color3d) As Boolean -End Function - -Private Function EgtSetGeoLineAttribs_64(ByRef colGl As Color3d) As Boolean -End Function -Public Function EgtSetGeoLineAttribs(ByRef colGl As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGeoLineAttribs_32(colGl) - Else - Return EgtSetGeoLineAttribs_64(colGl) - End If -End Function + + Private Function EgtSetGeoLineAttribs_32(ByRef colGl As Color3d) As Boolean + End Function + + Private Function EgtSetGeoLineAttribs_64(ByRef colGl As Color3d) As Boolean + End Function + Public Function EgtSetGeoLineAttribs(ByRef colGl As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGeoLineAttribs_32(colGl) + Else + Return EgtSetGeoLineAttribs_64(colGl) + End If + End Function - -Private Function EgtSetGeoTriaAttribs_32(ByRef colGt As Color3d) As Boolean -End Function - -Private Function EgtSetGeoTriaAttribs_64(ByRef colGt As Color3d) As Boolean -End Function -Public Function EgtSetGeoTriaAttribs(ByRef colGt As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGeoTriaAttribs_32(colGt) - Else - Return EgtSetGeoTriaAttribs_64(colGt) - End If -End Function + + Private Function EgtSetGeoTriaAttribs_32(ByRef colGt As Color3d) As Boolean + End Function + + Private Function EgtSetGeoTriaAttribs_64(ByRef colGt As Color3d) As Boolean + End Function + Public Function EgtSetGeoTriaAttribs(ByRef colGt As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGeoTriaAttribs_32(colGt) + Else + Return EgtSetGeoTriaAttribs_64(colGt) + End If + End Function - -Private Function EgtSetWinRectAttribs_32(bOutline As Boolean, ByRef colWr As Color3d) As Boolean -End Function - -Private Function EgtSetWinRectAttribs_64(bOutline As Boolean, ByRef colWr As Color3d) As Boolean -End Function -Public Function EgtSetWinRectAttribs(bOutline As Boolean, ByRef colWr As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetWinRectAttribs_32(bOutline, colWr) - Else - Return EgtSetWinRectAttribs_64(bOutline, colWr) - End If -End Function + + Private Function EgtSetWinRectAttribs_32(bOutline As Boolean, ByRef colWr As Color3d) As Boolean + End Function + + Private Function EgtSetWinRectAttribs_64(bOutline As Boolean, ByRef colWr As Color3d) As Boolean + End Function + Public Function EgtSetWinRectAttribs(bOutline As Boolean, ByRef colWr As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetWinRectAttribs_32(bOutline, colWr) + Else + Return EgtSetWinRectAttribs_64(bOutline, colWr) + End If + End Function - -Private Function EgtSetGlobFrameShow_32(bShow As Boolean) As Boolean -End Function - -Private Function EgtSetGlobFrameShow_64(bShow As Boolean) As Boolean -End Function -Public Function EgtSetGlobFrameShow(bShow As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGlobFrameShow_32(bShow) - Else - Return EgtSetGlobFrameShow_64(bShow) - End If -End Function + + Private Function EgtSetGlobFrameShow_32(bShow As Boolean) As Boolean + End Function + + Private Function EgtSetGlobFrameShow_64(bShow As Boolean) As Boolean + End Function + Public Function EgtSetGlobFrameShow(bShow As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGlobFrameShow_32(bShow) + Else + Return EgtSetGlobFrameShow_64(bShow) + End If + End Function - -Private Function EgtSetGridShow_32(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean -End Function - -Private Function EgtSetGridShow_64(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean -End Function -Public Function EgtSetGridShow(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGridShow_32(bShowGrid, bShowFrame) - Else - Return EgtSetGridShow_64(bShowGrid, bShowFrame) - End If -End Function + + Private Function EgtSetGridShow_32(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean + End Function + + Private Function EgtSetGridShow_64(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean + End Function + Public Function EgtSetGridShow(bShowGrid As Boolean, bShowFrame As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGridShow_32(bShowGrid, bShowFrame) + Else + Return EgtSetGridShow_64(bShowGrid, bShowFrame) + End If + End Function - -Private Function EgtSetGridGeo_32(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean -End Function - -Private Function EgtSetGridGeo_64(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean -End Function -Public Function EgtSetGridGeo(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGridGeo_32(dSnapStep, nMinLineSstep, nMajLineSstep, nExtSstep) - Else - Return EgtSetGridGeo_64(dSnapStep, nMinLineSstep, nMajLineSstep, nExtSstep) - End If -End Function + + Private Function EgtSetGridGeo_32(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean + End Function + + Private Function EgtSetGridGeo_64(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean + End Function + Public Function EgtSetGridGeo(dSnapStep As Double, nMinLineSstep As Integer, nMajLineSstep As Integer, nExtSstep As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGridGeo_32(dSnapStep, nMinLineSstep, nMajLineSstep, nExtSstep) + Else + Return EgtSetGridGeo_64(dSnapStep, nMinLineSstep, nMajLineSstep, nExtSstep) + End If + End Function - -Private Function EgtSetGridColor_32(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean -End Function - -Private Function EgtSetGridColor_64(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean -End Function -Public Function EgtSetGridColor(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetGridColor_32(colMinLine, colMajLine) - Else - Return EgtSetGridColor_64(colMinLine, colMajLine) - End If -End Function + + Private Function EgtSetGridColor_32(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean + End Function + + Private Function EgtSetGridColor_64(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean + End Function + Public Function EgtSetGridColor(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetGridColor_32(colMinLine, colMajLine) + Else + Return EgtSetGridColor_64(colMinLine, colMajLine) + End If + End Function - -Private Function EgtResize_32(nW As Integer, nH As Integer) As Boolean -End Function - -Private Function EgtResize_64(nW As Integer, nH As Integer) As Boolean -End Function -Public Function EgtResize(nW As Integer, nH As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtResize_32(nW, nH) - Else - Return EgtResize_64(nW, nH) - End If -End Function + + Private Function EgtResize_32(nW As Integer, nH As Integer) As Boolean + End Function + + Private Function EgtResize_64(nW As Integer, nH As Integer) As Boolean + End Function + Public Function EgtResize(nW As Integer, nH As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtResize_32(nW, nH) + Else + Return EgtResize_64(nW, nH) + End If + End Function - -Private Function EgtDraw_32() As Boolean -End Function - -Private Function EgtDraw_64() As Boolean -End Function -Public Function EgtDraw() As Boolean - If IntPtr.Size = 4 Then - Return EgtDraw_32() - Else - Return EgtDraw_64() - End If -End Function + + Private Function EgtDraw_32() As Boolean + End Function + + Private Function EgtDraw_64() As Boolean + End Function + Public Function EgtDraw() As Boolean + If IntPtr.Size = 4 Then + Return EgtDraw_32() + Else + Return EgtDraw_64() + End If + End Function - -Private Function EgtSelect_32(nWinX As Integer, nWinY As Integer, + + Private Function EgtSelect_32(nWinX As Integer, nWinY As Integer, nSelW As Integer, nSelH As Integer, ByRef nSel As Integer) As Boolean -End Function - -Private Function EgtSelect_64(nWinX As Integer, nWinY As Integer, + End Function + + Private Function EgtSelect_64(nWinX As Integer, nWinY As Integer, nSelW As Integer, nSelH As Integer, ByRef nSel As Integer) As Boolean -End Function -Public Function EgtSelect(Curr As Point, nSelW As Integer, nSelH As Integer, - ByRef nSel As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtSelect_32(Curr.X, Curr.Y, nSelW, nSelH, nSel) - Else - Return EgtSelect_64(Curr.X, Curr.Y, nSelW, nSelH, nSel) - End If -End Function + End Function + Public Function EgtSelect(Curr As Point, nSelW As Integer, nSelH As Integer, + ByRef nSel As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtSelect_32(Curr.X, Curr.Y, nSelW, nSelH, nSel) + Else + Return EgtSelect_64(Curr.X, Curr.Y, nSelW, nSelH, nSel) + End If + End Function - -Private Function EgtSetObjFilterForSelWin_32(bZeroDim As Boolean, bCurve As Boolean, + + Private Function EgtSetObjFilterForSelWin_32(bZeroDim As Boolean, bCurve As Boolean, bSurf As Boolean, bVolume As Boolean, bExtra As Boolean) As Boolean -End Function - -Private Function EgtSetObjFilterForSelWin_64(bZeroDim As Boolean, bCurve As Boolean, + End Function + + Private Function EgtSetObjFilterForSelWin_64(bZeroDim As Boolean, bCurve As Boolean, bSurf As Boolean, bVolume As Boolean, bExtra As Boolean) As Boolean -End Function -Public Function EgtSetObjFilterForSelWin(bZeroDim As Boolean, bCurve As Boolean, - bSurf As Boolean, bVolume As Boolean, bExtra As Boolean) As Boolean - If IntPtr.Size = 4 Then - Return EgtSetObjFilterForSelWin_32(bZeroDim, bCurve, bSurf, bVolume, bExtra) - Else - Return EgtSetObjFilterForSelWin_64(bZeroDim, bCurve, bSurf, bVolume, bExtra) - End If -End Function + End Function + Public Function EgtSetObjFilterForSelWin(bZeroDim As Boolean, bCurve As Boolean, + bSurf As Boolean, bVolume As Boolean, bExtra As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetObjFilterForSelWin_32(bZeroDim, bCurve, bSurf, bVolume, bExtra) + Else + Return EgtSetObjFilterForSelWin_64(bZeroDim, bCurve, bSurf, bVolume, bExtra) + End If + End Function - -Private Function EgtUnselectableAdd_32(nId As Integer) As Boolean -End Function - -Private Function EgtUnselectableAdd_64(nId As Integer) As Boolean -End Function -Public Function EgtUnselectableAdd(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtUnselectableAdd_32(nId) - Else - Return EgtUnselectableAdd_64(nId) - End If -End Function + + Private Function EgtUnselectableAdd_32(nId As Integer) As Boolean + End Function + + Private Function EgtUnselectableAdd_64(nId As Integer) As Boolean + End Function + Public Function EgtUnselectableAdd(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtUnselectableAdd_32(nId) + Else + Return EgtUnselectableAdd_64(nId) + End If + End Function - -Private Function EgtUnselectableRemove_32(nId As Integer) As Boolean -End Function - -Private Function EgtUnselectableRemove_64(nId As Integer) As Boolean -End Function -Public Function EgtUnselectableRemove(nId As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtUnselectableRemove_32(nId) - Else - Return EgtUnselectableRemove_64(nId) - End If -End Function + + Private Function EgtUnselectableRemove_32(nId As Integer) As Boolean + End Function + + Private Function EgtUnselectableRemove_64(nId As Integer) As Boolean + End Function + Public Function EgtUnselectableRemove(nId As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtUnselectableRemove_32(nId) + Else + Return EgtUnselectableRemove_64(nId) + End If + End Function - -Private Function EgtUnselectableClearAll_32() As Boolean -End Function - -Private Function EgtUnselectableClearAll_64() As Boolean -End Function -Public Function EgtUnselectableClearAll() As Boolean - If IntPtr.Size = 4 Then - Return EgtUnselectableClearAll_32() - Else - Return EgtUnselectableClearAll_64() - End If -End Function + + Private Function EgtUnselectableClearAll_32() As Boolean + End Function + + Private Function EgtUnselectableClearAll_64() As Boolean + End Function + Public Function EgtUnselectableClearAll() As Boolean + If IntPtr.Size = 4 Then + Return EgtUnselectableClearAll_32() + Else + Return EgtUnselectableClearAll_64() + End If + End Function - -Private Function EgtGetFirstObjInSelWin_32() As Integer -End Function - -Private Function EgtGetFirstObjInSelWin_64() As Integer -End Function -Public Function EgtGetFirstObjInSelWin() As Integer - If IntPtr.Size = 4 Then - Return EgtGetFirstObjInSelWin_32() - Else - Return EgtGetFirstObjInSelWin_64() - End If -End Function + + Private Function EgtGetFirstObjInSelWin_32() As Integer + End Function + + Private Function EgtGetFirstObjInSelWin_64() As Integer + End Function + Public Function EgtGetFirstObjInSelWin() As Integer + If IntPtr.Size = 4 Then + Return EgtGetFirstObjInSelWin_32() + Else + Return EgtGetFirstObjInSelWin_64() + End If + End Function - -Private Function EgtGetNextObjInSelWin_32() As Integer -End Function - -Private Function EgtGetNextObjInSelWin_64() As Integer -End Function -Public Function EgtGetNextObjInSelWin() As Integer - If IntPtr.Size = 4 Then - Return EgtGetNextObjInSelWin_32() - Else - Return EgtGetNextObjInSelWin_64() - End If -End Function + + Private Function EgtGetNextObjInSelWin_32() As Integer + End Function + + Private Function EgtGetNextObjInSelWin_64() As Integer + End Function + Public Function EgtGetNextObjInSelWin() As Integer + If IntPtr.Size = 4 Then + Return EgtGetNextObjInSelWin_32() + Else + Return EgtGetNextObjInSelWin_64() + End If + End Function - -Private Function EgtGetPointFromSelect_32(nSelId As Integer, nWinX As Integer, nWinY As Integer, + + Private Function EgtGetPointFromSelect_32(nSelId As Integer, nWinX As Integer, nWinY As Integer, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean -End Function - -Private Function EgtGetPointFromSelect_64(nSelId As Integer, nWinX As Integer, nWinY As Integer, + End Function + + Private Function EgtGetPointFromSelect_64(nSelId As Integer, nWinX As Integer, nWinY As Integer, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean -End Function -Public Function EgtGetPointFromSelect(nSelId As Integer, PtWin As Point, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetPointFromSelect_32(nSelId, PtWin.X, PtWin.Y, ptP, nAux) - Else - Return EgtGetPointFromSelect_64(nSelId, PtWin.X, PtWin.Y, ptP, nAux) - End If -End Function + End Function + Public Function EgtGetPointFromSelect(nSelId As Integer, PtWin As Point, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetPointFromSelect_32(nSelId, PtWin.X, PtWin.Y, ptP, nAux) + Else + Return EgtGetPointFromSelect_64(nSelId, PtWin.X, PtWin.Y, ptP, nAux) + End If + End Function - -Private Function EgtGetGraphicSnapPoint_32(nSnap As Integer, + + Private Function EgtGetGraphicSnapPoint_32(nSnap As Integer, nWinX As Integer, nWinY As Integer, nSelW As Integer, nSelH As Integer, ByRef ptP As Point3d) As Boolean -End Function - -Private Function EgtGetGraphicSnapPoint_64(nSnap As Integer, + End Function + + Private Function EgtGetGraphicSnapPoint_64(nSnap As Integer, nWinX As Integer, nWinY As Integer, nSelW As Integer, nSelH As Integer, ByRef ptP As Point3d) As Boolean -End Function -Public Function EgtGetGraphicSnapPoint(nSnap As Integer, - PtWin As Point, nSelW As Integer, nSelH As Integer, - ByRef ptP As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetGraphicSnapPoint_32(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) - Else - Return EgtGetGraphicSnapPoint_64(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) - End If -End Function + End Function + Public Function EgtGetGraphicSnapPoint(nSnap As Integer, + PtWin As Point, nSelW As Integer, nSelH As Integer, + ByRef ptP As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetGraphicSnapPoint_32(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) + Else + Return EgtGetGraphicSnapPoint_64(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) + End If + End Function - -Private Function EgtGetGridSnapPointZ_32(bSketch As Boolean, + + Private Function EgtGetGridSnapPointZ_32(bSketch As Boolean, nWinX As Integer, nWinY As Integer, ByRef ptGrid As Point3d, ByRef ptP As Point3d) As Boolean -End Function - -Private Function EgtGetGridSnapPointZ_64(bSketch As Boolean, + End Function + + Private Function EgtGetGridSnapPointZ_64(bSketch As Boolean, nWinX As Integer, nWinY As Integer, ByRef ptGrid As Point3d, ByRef ptP As Point3d) As Boolean -End Function -Public Function EgtGetGridSnapPointZ(bSketch As Boolean, - PtWin As Point, ptGrid As Point3d, - ByRef ptP As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetGridSnapPointZ_32(bSketch, PtWin.X, PtWin.Y, ptGrid, ptP) - Else - Return EgtGetGridSnapPointZ_64(bSketch, PtWin.X, PtWin.Y, ptGrid, ptP) - End If -End Function + End Function + Public Function EgtGetGridSnapPointZ(bSketch As Boolean, + PtWin As Point, ptGrid As Point3d, + ByRef ptP As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetGridSnapPointZ_32(bSketch, PtWin.X, PtWin.Y, ptGrid, ptP) + Else + Return EgtGetGridSnapPointZ_64(bSketch, PtWin.X, PtWin.Y, ptGrid, ptP) + End If + End Function - -Private Function EgtGetLastSnapId_32() As Integer -End Function - -Private Function EgtGetLastSnapId_64() As Integer -End Function -Public Function EgtGetLastSnapId() As Integer - If IntPtr.Size = 4 Then - Return EgtGetLastSnapId_32() - Else - Return EgtGetLastSnapId_64() - End If -End Function + + Private Function EgtGetLastSnapId_32() As Integer + End Function + + Private Function EgtGetLastSnapId_64() As Integer + End Function + Public Function EgtGetLastSnapId() As Integer + If IntPtr.Size = 4 Then + Return EgtGetLastSnapId_32() + Else + Return EgtGetLastSnapId_64() + End If + End Function - -Private Function EgtGetLastSnapDir_32(ByRef VtDir As Vector3d) As Boolean -End Function - -Private Function EgtGetLastSnapDir_64(ByRef VtDir As Vector3d) As Boolean -End Function -Public Function EgtGetLastSnapDir(ByRef VtDir As Vector3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetLastSnapDir_32(VtDir) - Else - Return EgtGetLastSnapDir_64(VtDir) - End If -End Function + + Private Function EgtGetLastSnapDir_32(ByRef VtDir As Vector3d) As Boolean + End Function + + Private Function EgtGetLastSnapDir_64(ByRef VtDir As Vector3d) As Boolean + End Function + Public Function EgtGetLastSnapDir(ByRef VtDir As Vector3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetLastSnapDir_32(VtDir) + Else + Return EgtGetLastSnapDir_64(VtDir) + End If + End Function - -Private Function EgtGetPlaneSnapPoint_32(nWinX As Integer, nWinY As Integer, ByRef VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean -End Function - -Private Function EgtGetPlaneSnapPoint_64(nWinX As Integer, nWinY As Integer, ByRef VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean -End Function -Public Function EgtGetPlaneSnapPoint(PtWin As Point, VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetPlaneSnapPoint_32(PtWin.X, PtWin.Y, VtN, dDist, ptP) - Else - Return EgtGetPlaneSnapPoint_64(PtWin.X, PtWin.Y, VtN, dDist, ptP) - End If -End Function + + Private Function EgtGetPlaneSnapPoint_32(nWinX As Integer, nWinY As Integer, ByRef VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean + End Function + + Private Function EgtGetPlaneSnapPoint_64(nWinX As Integer, nWinY As Integer, ByRef VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean + End Function + Public Function EgtGetPlaneSnapPoint(PtWin As Point, VtN As Vector3d, dDist As Double, ByRef ptP As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetPlaneSnapPoint_32(PtWin.X, PtWin.Y, VtN, dDist, ptP) + Else + Return EgtGetPlaneSnapPoint_64(PtWin.X, PtWin.Y, VtN, dDist, ptP) + End If + End Function - -Private Function EgtSetShowMode_32(nShowMode As SM, bRedraw As Boolean) As Boolean -End Function + + Private Function EgtSetShowMode_32(nShowMode As SM, bRedraw As Boolean) As Boolean + End Function Private Function EgtSetShowMode_64(nShowMode As SM, bRedraw As Boolean) As Boolean End Function @@ -9683,6 +9885,20 @@ Public Function EgtGetGenericView(ByRef dAngVertDeg As Double, ByRef dAngHorizDe End If End Function + +Private Function EgtGetViewUp_32(ByRef vtUp As Vector3d) As Boolean +End Function + +Private Function EgtGetViewUp_64(ByRef vtUp As Vector3d) As Boolean +End Function +Public Function EgtGetViewUp(ByRef vtUp As Vector3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetViewUp_32(vtUp) + Else + Return EgtGetViewUp_64(vtUp) + End If +End Function + Private Function EgtProjectPoint_32(ByRef ptP As Point3d, ByRef ptWin As Point3d) As Boolean End Function @@ -10668,6 +10884,25 @@ Public Enum FPC_TYPE As Integer LAYER = 2 CLOSEDCURVE = 3 End Enum +' Costanti : nome solido del grezzo +Public RAWSOLID As String = "RawSolid" +' Costanti : nome centro del grezzo +Public RAWCENTER As String = "RawCenter" +' Costanti : nome centro del grezzo +Public RAWOUTLINE As String = "RawOutline" +' Costanti : solido del sottopezzo +Public SOLID As String = "SOLID" +' Costanti : tipo di Sottopezzo +Public FIX_TYPE As String = "TYPE" +Public FIX_REF As String = "REF" +Public FIX_VAC As String = "VAC" +Public FIX_VIS As String = "VIS" +' Costanti : arco dei riferimenti +Public REF_ARC As String = "Ref" +' Costanti : disco di contatto colorato +Public REF_CONTACTCOLDISK As String = "ContactColoredDisk" +' Costanti : superficie di contatto colorata +Public REF_CONTACTSURFACE As String = "ContactSurface" ' Costanti : tipo interferenza lavorazioni piane con pezzi Public Enum FMI_TYPE As Integer NONE = 0 @@ -10754,6 +10989,16 @@ Public Enum MCH_OY As Integer SAWROUGHING = 16384 SAWFINISHING = 32768 End Enum +' Funzioni per famiglie di operazioni +Public Function IsValidDispositionType(nType As Integer) As Boolean + Return (nType = MCH_OY.DISP) +End Function +Public Function IsValidMachiningType(nType As Integer) As Boolean + Return (nType = MCH_OY.DRILLING Or nType = MCH_OY.SAWING Or + nType = MCH_OY.MILLING Or nType = MCH_OY.POCKETING Or + nType = MCH_OY.MORTISING Or nType = MCH_OY.SAWROUGHING Or + nType = MCH_OY.SAWFINISHING) +End Function 'Costanti : tipi di lavorazioni (altre operazioni) Public Enum MCH_MY As Integer NONE = 0 @@ -10768,12 +11013,22 @@ End Enum 'Costanti : parametri generali delle lavorazioni Public Enum MCH_GP As Integer NONE = 0 + COMP3A = 4096 + COMP5A = 4097 + SPLITARCS = 8192 SAFEZ = 16384 EXTRALONCUTREG = 16385 EXTRARONDRIREG = 16386 HOLEDIAMTOLER = 16387 EXTSAWARCMINRAD = 16388 End Enum +'Costanti : tipi di splitarcs +Public Enum MCH_SA As Integer + NEVER = 0 + GEN_PLANE = 1 + NO_XY_PLANE = 2 + ALWAYS = 3 +End Enum 'Costanti : parametri delle lavorazioni Public Enum MCH_MP As Integer NONE = 0 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 4d55cee..c7b84ff 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -27,7 +27,7 @@ Imports System.Runtime.InteropServices #End If - + @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/Scene.vb b/Scene.vb index 47a33e8..a47678b 100644 --- a/Scene.vb +++ b/Scene.vb @@ -157,7 +157,7 @@ Public Class Scene 'Mettere EgtExit nell'evento FormClosing Public Function Init() As Boolean - m_nGseContext = EgtInitContext() + Dim nGseContext As Integer = EgtInitContext() Dim bOk As Boolean = EgtSetDefaultMaterial(m_DefColor) EgtInitScene(Handle, m_nDriver, m_b2Buff, m_nColorBits, m_nDepthBits) EgtSetBackground(m_BackTopColor, m_BackBotColor) @@ -167,6 +167,7 @@ Public Class Scene EgtSetGeoLineAttribs(m_DstLnColor) EgtSetGeoTriaAttribs(m_DstLnColor) EgtInitTscExec() + m_nGseContext = nGseContext RaiseEvent OnChangedSnapPointType(Me, m_nSnapType, True) Return bOk End Function @@ -540,9 +541,9 @@ Public Class Scene If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext) End If - ' Se sono abbastanza all'interno della scena (10% della dimensione), imposto il focus + ' Se sono abbastanza all'interno della scena (15% della dimensione), imposto il focus If m_bSetFocusOnMove Then - Const BordPu As Double = 0.1 + Const BordPu As Double = 0.15 If e.Location.X > BordPu * Size.Width AndAlso e.Location.X < (1 - BordPu) * Size.Width AndAlso e.Location.Y > BordPu * Size.Height AndAlso e.Location.Y < (1 - BordPu) * Size.Height Then Focus()