diff --git a/EgtInterface.vb b/EgtInterface.vb index 7090930..65bd429 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -5508,6 +5508,20 @@ Public Function EgtTdbIsCurrToolModified() As Boolean End If End Function + +Private Function EgtTdbSetCurrToolParamBool_32(ByVal nType As Integer, ByVal bVal As Boolean) As Boolean +End Function + +Private Function EgtTdbSetCurrToolParamBool_64(ByVal nType As Integer, ByVal bVal As Boolean) As Boolean +End Function +Public Function EgtTdbSetCurrToolParam(ByVal nType As Integer, ByVal 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(ByVal nType As Integer, ByVal nVal As Integer) As Boolean End Function @@ -5550,6 +5564,20 @@ Public Function EgtTdbSetCurrToolParam(ByVal nType As Integer, ByVal sVal As Str End If End Function + +Private Function EgtTdbGetCurrToolParamBool_32(ByVal nType As Integer, ByRef bVal As Boolean) As Boolean +End Function + +Private Function EgtTdbGetCurrToolParamBool_64(ByVal nType As Integer, ByRef bVal As Boolean) As Boolean +End Function +Public Function EgtTdbGetCurrToolParam(ByVal 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(ByVal nType As Integer, ByRef nVal As Integer) As Boolean End Function @@ -5661,6 +5689,318 @@ Public Function EgtTdbGetToolHolderDir(ByRef sTHolderDir As String) As Boolean Return bOk End Function +' Machinings Database + +Private Function EgtMdbGetMachiningNewName_32(ByVal sName As String, ByRef psNewName As IntPtr) As Boolean +End Function + +Private Function EgtMdbGetMachiningNewName_64(ByVal 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(ByVal sName As String, ByVal nType As Integer) As Boolean +End Function + +Private Function EgtMdbAddMachining_64(ByVal sName As String, ByVal nType As Integer) As Boolean +End Function +Public Function EgtMdbAddMachining(ByVal sName As String, ByVal 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(ByVal sSource As String, ByVal sName As String) As Boolean +End Function + +Private Function EgtMdbCopyMachining_64(ByVal sSource As String, ByVal sName As String) As Boolean +End Function +Public Function EgtMdbCopyMachining(ByVal sSource As String, ByVal 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(ByVal sName As String) As Boolean +End Function + +Private Function EgtMdbRemoveMachining_64(ByVal sName As String) As Boolean +End Function +Public Function EgtMdbRemoveMachining(ByVal 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(ByVal nType As Integer, ByRef psName As IntPtr) As Boolean +End Function + +Private Function EgtMdbGetFirstMachining_64(ByVal nType As Integer, ByRef psName As IntPtr) As Boolean +End Function +Public Function EgtMdbGetFirstMachining(ByVal 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(ByVal nType As Integer, ByRef psName As IntPtr) As Boolean +End Function + +Private Function EgtMdbGetNextMachining_64(ByVal nType As Integer, ByRef psName As IntPtr) As Boolean +End Function +Public Function EgtMdbGetNextMachining(ByVal 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 EgtMdbSetCurrMachining_32(ByVal sName As String) As Boolean +End Function + +Private Function EgtMdbSetCurrMachining_64(ByVal sName As String) As Boolean +End Function +Public Function EgtMdbSetCurrMachining(ByVal 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(ByVal nType As Integer, ByVal nVal As Boolean) As Boolean +End Function + +Private Function EgtMdbSetCurrMachiningParamBool_64(ByVal nType As Integer, ByVal nVal As Boolean) As Boolean +End Function +Public Function EgtMdbSetCurrMachiningParam(ByVal nType As Integer, ByVal 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(ByVal nType As Integer, ByVal nVal As Integer) As Boolean +End Function + +Private Function EgtMdbSetCurrMachiningParamInt_64(ByVal nType As Integer, ByVal nVal As Integer) As Boolean +End Function +Public Function EgtMdbSetCurrMachiningParam(ByVal nType As Integer, ByVal 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(ByVal nType As Integer, ByVal dVal As Double) As Boolean +End Function + +Private Function EgtMdbSetCurrMachiningParamDouble_64(ByVal nType As Integer, ByVal dVal As Double) As Boolean +End Function +Public Function EgtMdbSetCurrMachiningParam(ByVal nType As Integer, ByVal 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(ByVal nType As Integer, ByVal sVal As String) As Boolean +End Function + +Private Function EgtMdbSetCurrMachiningParamString_64(ByVal nType As Integer, ByVal sVal As String) As Boolean +End Function +Public Function EgtMdbSetCurrMachiningParam(ByVal nType As Integer, ByVal 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(ByVal nType As Integer, ByRef bVal As Boolean) As Boolean +End Function + +Private Function EgtMdbGetCurrMachiningParamBool_64(ByVal nType As Integer, ByRef bVal As Boolean) As Boolean +End Function +Public Function EgtMdbGetCurrMachiningParam(ByVal 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(ByVal nType As Integer, ByRef nVal As Integer) As Boolean +End Function + +Private Function EgtMdbGetCurrMachiningParamInt_64(ByVal nType As Integer, ByRef nVal As Integer) As Boolean +End Function +Public Function EgtMdbGetCurrMachiningParam(ByVal 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(ByVal nType As Integer, ByRef dVal As Double) As Boolean +End Function + +Private Function EgtMdbGetCurrMachiningParamDouble_64(ByVal nType As Integer, ByRef dVal As Double) As Boolean +End Function +Public Function EgtMdbGetCurrMachiningParam(ByVal 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(ByVal nType As Integer, ByRef psVal As IntPtr) As Boolean +End Function + +Private Function EgtMdbGetCurrMachiningParamString_64(ByVal nType As Integer, ByRef psVal As IntPtr) As Boolean +End Function +Public Function EgtMdbGetCurrMachiningParam(ByVal 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 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 + ' Simulation Private Function EgtSimStart_32() As Boolean @@ -7324,5 +7664,62 @@ Public Enum MCH_TP As Integer TCPOS = 32773 UUID = 32774 End Enum +'Costanti : tipi di lavorazioni +Public Enum MCH_MY As Integer + NONE = 0 + DRILLING = 256 + SAWING = 512 + MILLING = 1024 + POCKETING = 2048 + MORTISING = 4096 +End Enum +'Costanti : parametri delle lavorazioni +Public Enum MCH_MP As Integer + NONE = 0 + INVERT = 4096 + TOANDFROM = 4097 + LEAVETAB = 4098 + WORKSIDE = 8192 + HEADSIDE = 8193 + LEADINTYPE = 8194 + EXTLINKTYPE = 8195 + LEADOUTTYPE = 8196 + CURVEUSE = 8197 + STEPTYPE = 8198 + TOOLSPEED = 16384 + TOOLFEED = 16385 + TOOLSTARTFEED = 16386 + TOOLENDFEED = 16387 + TOOLTIPFEED = 16388 + TOOLOFFSR = 16389 + TOOLOFFSL = 16390 + DEPTH = 16391 + SIDEANGLE = 16392 + APPROX = 16393 + STARTPOS = 16394 + STARTSLOWLEN = 16395 + ENDSLOWLEN = 16396 + THROUADDLEN = 16397 + STEP_ = 16398 + RETURNPOS = 16399 + OVERLAP = 16400 + TABLEN = 16401 + TABDIST = 16402 + TABHEIGHT = 16403 + TABANGLE = 16404 + LITANG = 16405 + LIPERP = 16406 + LIELEV = 16407 + LICOMPLEN = 16408 + LOTANG = 16409 + LOPERP = 16410 + LOELEV = 16411 + LOCOMPLEN = 16412 + NAME = 32768 + TOOL = 32769 + DEPTH_STR = 32770 + TUUID = 32771 + UUID = 32772 +End Enum End Module diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 1d3247f..4bba9d4 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + +