Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab8051275b | |||
| 18edeb5ee0 | |||
| 471ba49732 | |||
| fd6e15be1e | |||
| a2bb9e250c | |||
| 2673d51008 | |||
| 1d5cce387f | |||
| 07e5756793 | |||
| 233a63b95b | |||
| b1367d543f | |||
| 0362f77f23 | |||
| fd28e2f971 | |||
| 31264a20a0 | |||
| bee2c44ba7 | |||
| 65652f468c | |||
| 2236eb12c7 | |||
| e48837836b | |||
| d05fe9c6b2 | |||
| 8c8a26b692 | |||
| 0b1a39704c | |||
| 8d1b1adaa9 | |||
| eb881155d9 | |||
| 8c0d5a651d | |||
| 10655893e4 | |||
| ec1af67d5b | |||
| e103aa753f | |||
| ecacf89e93 | |||
| 7e5b813df1 | |||
| 108048b559 | |||
| 0086345f64 | |||
| a5cc976810 | |||
| 5bdc4c46bc | |||
| 6e8154d29a | |||
| c8614fe52d | |||
| f420926e3e | |||
| 794c5da9e6 | |||
| 9d58cec30e | |||
| e54c5f006e | |||
| 4a0a398e9f | |||
| 778219da1e | |||
| 4ac506fbf0 | |||
| 9616e211e5 | |||
| 61b16af746 | |||
| 7d010be835 |
+148
-32
@@ -1,5 +1,6 @@
|
|||||||
Imports System.Windows.Forms.Integration
|
Imports System.Windows.Forms.Integration
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
Friend Module CamAuto
|
Friend Module CamAuto
|
||||||
|
|
||||||
@@ -33,6 +34,43 @@ Friend Module CamAuto
|
|||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function AddSawMachining(nOperId As Integer, ByRef nNewOperation As Integer) As Boolean
|
||||||
|
EgtLuaCreateGlobTable("CAM")
|
||||||
|
SetLuaStandardCamParams()
|
||||||
|
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
|
||||||
|
Dim nErr As Integer = 999
|
||||||
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
||||||
|
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
|
||||||
|
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateSawing")
|
||||||
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||||
|
EgtLuaGetGlobIntVar("CAM.NEW_OPERATION", nNewOperation)
|
||||||
|
EgtLuaResetGlobVar("CAM")
|
||||||
|
If nErr <> 0 Then
|
||||||
|
bOk = False
|
||||||
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function ChangePvColor(nOperId As Integer, colCut As Color3d)
|
||||||
|
EgtLuaCreateGlobTable("CAM")
|
||||||
|
SetLuaStandardCamParams()
|
||||||
|
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
|
||||||
|
Dim nErr As Integer = 999
|
||||||
|
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
||||||
|
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
|
||||||
|
bOk = bOk AndAlso EgtLuaExecLine("CAM.ChangePvColor( " & nOperId.ToString & ",Color3d(" & colCut.R.ToString & "," & colCut.G.ToString & "," & colCut.B.ToString & "))")
|
||||||
|
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||||
|
EgtLuaResetGlobVar("CAM")
|
||||||
|
If nErr <> 0 Then
|
||||||
|
bOk = False
|
||||||
|
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean
|
Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean
|
||||||
EgtLuaCreateGlobTable("CAM")
|
EgtLuaCreateGlobTable("CAM")
|
||||||
SetLuaStandardCamParams()
|
SetLuaStandardCamParams()
|
||||||
@@ -134,6 +172,63 @@ Friend Module CamAuto
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function RestoreDef_Machinig(Optional bOnlySideAng As Boolean = True)
|
||||||
|
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||||
|
Dim bApplySawingTilted As Boolean = m_MainWindow.m_CurrentMachine.bApplySawingTilted
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop dei pezzi nel grezzo
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
|
||||||
|
nIdPart = EgtGetNextPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||||
|
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop dei pezzi in parcheggio
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
|
||||||
|
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' ripristina la lavorazone indicata di default per i tagli inclinati
|
||||||
|
Private Sub SetResetDef_Machining(nEntId As Integer, sSawingTilted As String, bApplySawingTilted As Boolean, bOnlySideAng As Boolean)
|
||||||
|
While nEntId <> GDB_ID.NULL
|
||||||
|
Dim sInfoSIdeAng As String = String.Empty
|
||||||
|
EgtGetInfo(nEntId, INFO_SIDE_ANGLE, sInfoSIdeAng)
|
||||||
|
' Se è un'entità associata ad una lavorazione inclinata
|
||||||
|
If Not String.IsNullOrEmpty(sInfoSIdeAng) Then
|
||||||
|
If bApplySawingTilted Then
|
||||||
|
' forzo la lavorazione inclinata
|
||||||
|
If String.IsNullOrEmpty(sSawingTilted) Then
|
||||||
|
' ma se non esiste nessuna lavorezione specifica applico qualla standard
|
||||||
|
EgtRemoveInfo(nEntId, DEF_MACHINING)
|
||||||
|
Else
|
||||||
|
' Applico quella specificata
|
||||||
|
EgtSetInfo(nEntId, DEF_MACHINING, sSawingTilted)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' Rimuovo la lavorazione e applico quella standard
|
||||||
|
EgtRemoveInfo(nEntId, DEF_MACHINING)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf Not bOnlySideAng Then
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
EgtGetInfo(nEntId, DEF_MACHINING, sInfo)
|
||||||
|
If Not String.IsNullOrEmpty(sInfo) Then
|
||||||
|
' se esiste una lavorazione specificata allora la rimuovo
|
||||||
|
EgtRemoveInfo(nEntId, DEF_MACHINING)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nEntId = EgtGetNext(nEntId)
|
||||||
|
End While
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function ResetAllSplitCurv() As Boolean
|
Friend Function ResetAllSplitCurv() As Boolean
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
Dim nIdPart As Integer = EgtGetFirstPart()
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
@@ -360,7 +455,7 @@ Friend Module CamAuto
|
|||||||
EgtGetGroupObjs(EgtGetFirstNameInGroup(nPartId, NAME_UNDERDRILL)) = 0 Then
|
EgtGetGroupObjs(EgtGetFirstNameInGroup(nPartId, NAME_UNDERDRILL)) = 0 Then
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
' Se tutti i pezzi
|
' Se tutti i pezzi
|
||||||
Else
|
Else
|
||||||
' Salvo fase attualmente corrente
|
' Salvo fase attualmente corrente
|
||||||
Dim nOriPhase As Integer = EgtGetCurrPhase()
|
Dim nOriPhase As Integer = EgtGetCurrPhase()
|
||||||
@@ -487,6 +582,7 @@ Friend Module CamAuto
|
|||||||
Return EgtRemoveOperationHome(nId)
|
Return EgtRemoveOperationHome(nId)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' Verifico che per tutte le lavorazioni sia attrezzato l'utensile
|
||||||
Friend Function VerifySetup(ByRef sMissingTools As String) As Boolean
|
Friend Function VerifySetup(ByRef sMissingTools As String) As Boolean
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
Dim bIsMultiCut = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
Dim bIsMultiCut = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||||
@@ -501,9 +597,9 @@ Friend Module CamAuto
|
|||||||
Dim sTool2 As String = String.Empty
|
Dim sTool2 As String = String.Empty
|
||||||
EgtGetMachiningParam(MCH_MP.TUUID, sTuuid)
|
EgtGetMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||||
If String.IsNullOrWhiteSpace( sTool) Then
|
If String.IsNullOrWhiteSpace(sTool) Then
|
||||||
Dim sMchTool As String = ""
|
Dim sMchTool As String = ""
|
||||||
EgtGetMachiningParam( MCH_MP.TOOL, sMchTool)
|
EgtGetMachiningParam(MCH_MP.TOOL, sMchTool)
|
||||||
bOk = False
|
bOk = False
|
||||||
If sMissingTools.IndexOf(sMchTool) = -1 Then
|
If sMissingTools.IndexOf(sMchTool) = -1 Then
|
||||||
sMissingTools = sMissingTools & sMchTool & ", "
|
sMissingTools = sMissingTools & sMchTool & ", "
|
||||||
@@ -516,8 +612,24 @@ Friend Module CamAuto
|
|||||||
End If
|
End If
|
||||||
sTool2 = sTool & "-2"
|
sTool2 = sTool & "-2"
|
||||||
End If
|
End If
|
||||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0 AndAlso
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
( String.IsNullOrWhiteSpace( sTool2) OrElse String.Compare(sTool2, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0) AndAlso
|
Dim bOnHolder As Boolean = False
|
||||||
|
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
|
If sTool = ToolPosition.sTool Then
|
||||||
|
bOnHolder = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If Not bOnHolder Then
|
||||||
|
bOk = False
|
||||||
|
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||||
|
sMissingTools = sMissingTools & sTool & ", "
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ElseIf String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0 AndAlso
|
||||||
|
(String.IsNullOrWhiteSpace(sTool2) OrElse String.Compare(sTool2, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0) AndAlso
|
||||||
String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDripSaw) <> 0 Then
|
String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDripSaw) <> 0 Then
|
||||||
bOk = False
|
bOk = False
|
||||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||||
@@ -555,6 +667,8 @@ Friend Module CamAuto
|
|||||||
End If
|
End If
|
||||||
nId = EgtGetNextOperation(nId)
|
nId = EgtGetNextOperation(nId)
|
||||||
End While
|
End While
|
||||||
|
Dim index As Integer = sMissingTools.LastIndexOf(","c)
|
||||||
|
sMissingTools = If(index >= 0, sMissingTools.Remove(index, 1), sMissingTools)
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -584,7 +698,7 @@ Friend Module CamAuto
|
|||||||
Dim LocalListOperId As New List(Of Integer)
|
Dim LocalListOperId As New List(Of Integer)
|
||||||
While nOperId <> GDB_ID.NULL
|
While nOperId <> GDB_ID.NULL
|
||||||
' verifico sia una lavorazione valida di taglio con lama
|
' verifico sia una lavorazione valida di taglio con lama
|
||||||
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
|
If IsValidMachining(nOperId) And EgtGetOperationType(nOperId) = MCH_OY.SAWING Then
|
||||||
' verifica interferenza
|
' verifica interferenza
|
||||||
Dim nFlag As Integer = FMI_TYPE.NONE
|
Dim nFlag As Integer = FMI_TYPE.NONE
|
||||||
If Not VerifyComposedMachining(nOperId, nFlag) Then
|
If Not VerifyComposedMachining(nOperId, nFlag) Then
|
||||||
@@ -599,7 +713,7 @@ Friend Module CamAuto
|
|||||||
LocalListOperId.Add(nOperId)
|
LocalListOperId.Add(nOperId)
|
||||||
'AddWaterJetMachining(nOperId, nWarn)
|
'AddWaterJetMachining(nOperId, nWarn)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
nOperId = EgtGetNextOperation(nOperId)
|
nOperId = EgtGetNextOperation(nOperId)
|
||||||
End While
|
End While
|
||||||
@@ -707,8 +821,8 @@ Friend Module CamAuto
|
|||||||
If nOriLeadIn <> MCH_SAW_LI.STRICT Then
|
If nOriLeadIn <> MCH_SAW_LI.STRICT Then
|
||||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.STRICT)
|
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.STRICT)
|
||||||
Dim dUserAddLen As Double = 0
|
Dim dUserAddLen As Double = 0
|
||||||
EgtGetInfo( nMchId, INFO_MCH_USER_SAL, dUserAddLen)
|
EgtGetInfo(nMchId, INFO_MCH_USER_SAL, dUserAddLen)
|
||||||
EgtRemoveInfo( nMchId, INFO_MCH_USER_SAL)
|
EgtRemoveInfo(nMchId, INFO_MCH_USER_SAL)
|
||||||
Dim dAddLen As Double = 0
|
Dim dAddLen As Double = 0
|
||||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen - dUserAddLen - dSafeLen)
|
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen - dUserAddLen - dSafeLen)
|
||||||
@@ -727,8 +841,8 @@ Friend Module CamAuto
|
|||||||
If nOriLeadOut <> MCH_SAW_LO.STRICT Then
|
If nOriLeadOut <> MCH_SAW_LO.STRICT Then
|
||||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.STRICT)
|
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.STRICT)
|
||||||
Dim dUserAddLen As Double = 0
|
Dim dUserAddLen As Double = 0
|
||||||
EgtGetInfo( nMchId, INFO_MCH_USER_EAL, dUserAddLen)
|
EgtGetInfo(nMchId, INFO_MCH_USER_EAL, dUserAddLen)
|
||||||
EgtRemoveInfo( nMchId, INFO_MCH_USER_EAL)
|
EgtRemoveInfo(nMchId, INFO_MCH_USER_EAL)
|
||||||
Dim dAddLen As Double = 0
|
Dim dAddLen As Double = 0
|
||||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen - dUserAddLen - dSafeLen)
|
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen - dUserAddLen - dSafeLen)
|
||||||
@@ -885,9 +999,9 @@ Friend Module CamAuto
|
|||||||
Friend Function RemoveAllExitPreCuts() As Boolean
|
Friend Function RemoveAllExitPreCuts() As Boolean
|
||||||
Dim nOperId As Integer = EgtGetFirstOperation()
|
Dim nOperId As Integer = EgtGetFirstOperation()
|
||||||
While nOperId <> GDB_ID.NULL
|
While nOperId <> GDB_ID.NULL
|
||||||
Dim nNextOperId As Integer = EgtGetNextOperation( nOperId)
|
Dim nNextOperId As Integer = EgtGetNextOperation(nOperId)
|
||||||
If EgtGetType( nOperId) <> MCH_OY.DISP AndAlso EgtExistsInfo(nOperId, INFO_MCH_EPC) Then
|
If EgtGetType(nOperId) <> MCH_OY.DISP AndAlso EgtExistsInfo(nOperId, INFO_MCH_EPC) Then
|
||||||
EgtRemoveOperation( nOperId)
|
EgtRemoveOperation(nOperId)
|
||||||
End If
|
End If
|
||||||
nOperId = nNextOperId
|
nOperId = nNextOperId
|
||||||
End While
|
End While
|
||||||
@@ -897,6 +1011,7 @@ Friend Module CamAuto
|
|||||||
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
|
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
|
||||||
Dim sMaterial As String = m_MainWindow.m_CurrentMachine.CurrMat.sName
|
Dim sMaterial As String = m_MainWindow.m_CurrentMachine.CurrMat.sName
|
||||||
Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
Dim sSawTiltedMch As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||||
Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling
|
Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling
|
||||||
Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||||
Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
|
Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
|
||||||
@@ -915,6 +1030,7 @@ Friend Module CamAuto
|
|||||||
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||||
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
|
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
|
||||||
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
||||||
|
EgtLuaSetGlobStringVar("CAM.SAWTILTEDMCH", sSawTiltedMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
|
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
|
||||||
EgtLuaSetGlobStringVar("CAM.POCKETMCH", sPocketMch)
|
EgtLuaSetGlobStringVar("CAM.POCKETMCH", sPocketMch)
|
||||||
@@ -1074,13 +1190,13 @@ Friend Module CamAuto
|
|||||||
Dim nRawId As Integer = GetCurrentRaw()
|
Dim nRawId As Integer = GetCurrentRaw()
|
||||||
If nRawId = GDB_ID.NULL Then Return False
|
If nRawId = GDB_ID.NULL Then Return False
|
||||||
' Se non ci sono pezzi, esco
|
' Se non ci sono pezzi, esco
|
||||||
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
|
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||||
If nPart1Id = GDB_ID.NULL Then Return True
|
If nPart1Id = GDB_ID.NULL Then Return True
|
||||||
' Verifico se cornice curva
|
' Verifico se cornice curva
|
||||||
Dim nDir As Integer = 0
|
Dim nDir As Integer = 0
|
||||||
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
|
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
|
||||||
Dim bSwap As Boolean = ( nDir = 0)
|
Dim bSwap As Boolean = (nDir = 0)
|
||||||
Dim bCurved As Boolean = ( nDir >= 2)
|
Dim bCurved As Boolean = (nDir >= 2)
|
||||||
' Recupero la lavorazione corrente di sgrossatura con lama
|
' Recupero la lavorazione corrente di sgrossatura con lama
|
||||||
Dim sCurrSawRoughing = m_MainWindow.m_CurrentMachine.sCurrSawRoughing
|
Dim sCurrSawRoughing = m_MainWindow.m_CurrentMachine.sCurrSawRoughing
|
||||||
If String.IsNullOrEmpty(sCurrSawRoughing) Then Return True
|
If String.IsNullOrEmpty(sCurrSawRoughing) Then Return True
|
||||||
@@ -1107,8 +1223,8 @@ Friend Module CamAuto
|
|||||||
' Imposto la geometria
|
' Imposto la geometria
|
||||||
EgtSetMachiningGeometry(vId)
|
EgtSetMachiningGeometry(vId)
|
||||||
' Imposto trim iniziale e finale
|
' Imposto trim iniziale e finale
|
||||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
|
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
|
||||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
|
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
|
||||||
' Se cornice curva, imposto SCC
|
' Se cornice curva, imposto SCC
|
||||||
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
||||||
' Applico la lavorazione
|
' Applico la lavorazione
|
||||||
@@ -1123,13 +1239,13 @@ Friend Module CamAuto
|
|||||||
Dim nRawId As Integer = GetCurrentRaw()
|
Dim nRawId As Integer = GetCurrentRaw()
|
||||||
If nRawId = GDB_ID.NULL Then Return False
|
If nRawId = GDB_ID.NULL Then Return False
|
||||||
' Se non ci sono pezzi, esco
|
' Se non ci sono pezzi, esco
|
||||||
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
|
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||||
If nPart1Id = GDB_ID.NULL Then Return True
|
If nPart1Id = GDB_ID.NULL Then Return True
|
||||||
' Verifico se cornice curva
|
' Verifico se cornice curva
|
||||||
Dim nDir As Integer = 0
|
Dim nDir As Integer = 0
|
||||||
EgtGetInfo( nPart1Id, INFO_FRAME_DIR, nDir)
|
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
|
||||||
Dim bSwap As Boolean = ( nDir = 0)
|
Dim bSwap As Boolean = (nDir = 0)
|
||||||
Dim bCurved As Boolean = ( nDir >= 2)
|
Dim bCurved As Boolean = (nDir >= 2)
|
||||||
' Recupero la lavorazione corrente di finitura con lama
|
' Recupero la lavorazione corrente di finitura con lama
|
||||||
Dim sCurrSawFinishing = m_MainWindow.m_CurrentMachine.sCurrSawFinishing
|
Dim sCurrSawFinishing = m_MainWindow.m_CurrentMachine.sCurrSawFinishing
|
||||||
If String.IsNullOrEmpty(sCurrSawFinishing) Then Return True
|
If String.IsNullOrEmpty(sCurrSawFinishing) Then Return True
|
||||||
@@ -1166,8 +1282,8 @@ Friend Module CamAuto
|
|||||||
' Imposto la geometria
|
' Imposto la geometria
|
||||||
EgtSetMachiningGeometry(vId)
|
EgtSetMachiningGeometry(vId)
|
||||||
' Imposto trim iniziale e finale
|
' Imposto trim iniziale e finale
|
||||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
|
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
|
||||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
|
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
|
||||||
' Se cornice curva, imposto SCC
|
' Se cornice curva, imposto SCC
|
||||||
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
||||||
' Applico la lavorazione
|
' Applico la lavorazione
|
||||||
@@ -1182,13 +1298,13 @@ Friend Module CamAuto
|
|||||||
Dim nRawId As Integer = GetCurrentRaw()
|
Dim nRawId As Integer = GetCurrentRaw()
|
||||||
If nRawId = GDB_ID.NULL Then Return False
|
If nRawId = GDB_ID.NULL Then Return False
|
||||||
' Se non ci sono pezzi, esco
|
' Se non ci sono pezzi, esco
|
||||||
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
|
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||||
If nPart1Id = GDB_ID.NULL Then Return True
|
If nPart1Id = GDB_ID.NULL Then Return True
|
||||||
' Verifico se cornice curva
|
' Verifico se cornice curva
|
||||||
Dim nDir As Integer = 0
|
Dim nDir As Integer = 0
|
||||||
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
|
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
|
||||||
Dim bSwap As Boolean = ( nDir = 0)
|
Dim bSwap As Boolean = (nDir = 0)
|
||||||
Dim bCurved As Boolean = ( nDir >= 2)
|
Dim bCurved As Boolean = (nDir >= 2)
|
||||||
' Recupero la lavorazione corrente di spatolatura con lama
|
' Recupero la lavorazione corrente di spatolatura con lama
|
||||||
Dim sCurrSawSideFinishing = m_MainWindow.m_CurrentMachine.sCurrSawSideFinishing
|
Dim sCurrSawSideFinishing = m_MainWindow.m_CurrentMachine.sCurrSawSideFinishing
|
||||||
If String.IsNullOrEmpty(sCurrSawSideFinishing) Then Return True
|
If String.IsNullOrEmpty(sCurrSawSideFinishing) Then Return True
|
||||||
@@ -1209,8 +1325,8 @@ Friend Module CamAuto
|
|||||||
' Imposto la geometria
|
' Imposto la geometria
|
||||||
EgtSetMachiningGeometry(vId)
|
EgtSetMachiningGeometry(vId)
|
||||||
' Imposto trim iniziale e finale
|
' Imposto trim iniziale e finale
|
||||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
|
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
|
||||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
|
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
|
||||||
' Se cornice curva, imposto SCC
|
' Se cornice curva, imposto SCC
|
||||||
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
|
||||||
' Applico la lavorazione
|
' Applico la lavorazione
|
||||||
@@ -1349,14 +1465,14 @@ Friend Module CamAuto
|
|||||||
dStartDist = dEndDist
|
dStartDist = dEndDist
|
||||||
dEndDist = dTemp
|
dEndDist = dTemp
|
||||||
End If
|
End If
|
||||||
' altrimenti
|
' altrimenti
|
||||||
Else
|
Else
|
||||||
Dim vtSide As Vector3d
|
Dim vtSide As Vector3d
|
||||||
' Se faccia non limitata da altre o sopra la limitante
|
' Se faccia non limitata da altre o sopra la limitante
|
||||||
If bFree Then
|
If bFree Then
|
||||||
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_DOWN)
|
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_DOWN)
|
||||||
vtSide = Vector3d.Z_AX()
|
vtSide = Vector3d.Z_AX()
|
||||||
' altrimenti è stata trovata una faccia adiacente limitante
|
' altrimenti è stata trovata una faccia adiacente limitante
|
||||||
Else
|
Else
|
||||||
If vtAdjN.x > 10 * EPS_SMALL Then
|
If vtAdjN.x > 10 * EPS_SMALL Then
|
||||||
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_LEFT)
|
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_LEFT)
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<Window x:Class="ChangeToolWD"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
FontFamily="{DynamicResource OmagCut_Font}"
|
||||||
|
Title="ChooseTool" Height="382.6" Width="426.6" WindowStyle="None"
|
||||||
|
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
|
||||||
|
Background="Transparent">
|
||||||
|
|
||||||
|
<Border Style="{DynamicResource OmagCut_Border}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="4*"/>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Name="FilePathTxBl" Grid.Column="1" Grid.Row="0" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
|
<!--TextAlignment="Center"
|
||||||
|
FontSize="20"
|
||||||
|
VerticalAlignment="Center"-->
|
||||||
|
|
||||||
|
<Grid Grid.Column="1" Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.8*"/>
|
||||||
|
<ColumnDefinition Width="0.7*"/>
|
||||||
|
<ColumnDefinition Width="0.7*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Text="MACHINING" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
|
<TextBlock Grid.Column="1" Text="TOOL" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
|
<TextBlock Grid.Column="2" Text="TC" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ListBox Name="SetUpToolListBox" Grid.Column="1" Grid.Row="2"
|
||||||
|
ItemsSource="{Binding ItemList}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Width="{Binding ActualWidth, ElementName=SetUpToolListBox}" Margin="0,0,-40,0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.6*"/>
|
||||||
|
<ColumnDefinition Width="0.7*"/>
|
||||||
|
<ColumnDefinition Width="0.3*"/>
|
||||||
|
<ColumnDefinition Width="0.005*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Text="{Binding Machining}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
|
||||||
|
<TextBlock Grid.Column="1" Text="{Binding ToolName}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding ToolPos}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
|
||||||
|
<Rectangle Grid.Column="2" Style="{DynamicResource Rect_SplitPage}"/>
|
||||||
|
<Grid.ToolTip>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Machining}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
|
||||||
|
<TextBlock Text="{Binding ToolName}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
|
||||||
|
<TextBlock Text="{Binding ToolPos}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid.ToolTip>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
|
<TextBlock Name="ErrorTxBl" Grid.Column="1" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_ErrorTextBlock}"/>
|
||||||
|
|
||||||
|
<Grid Grid.Column="1" Grid.Row="5">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
|
||||||
|
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
|
||||||
|
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,376 @@
|
|||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
|
Public Class ChangeToolWD
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
|
||||||
|
Private m_SetUpMachiningList As New ObservableCollection(Of ItemMachining)
|
||||||
|
|
||||||
|
Sub New(Owner As Window)
|
||||||
|
Me.Owner = Owner
|
||||||
|
InitializeComponent()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Parametri della lama impostata correntemente in macchina
|
||||||
|
Private m_DefaultSaw_Name As String = String.Empty
|
||||||
|
Private m_DefaultSaw_Diam As Double = 0
|
||||||
|
Private m_DefaultSaw_Thick As Double = 0
|
||||||
|
Private m_DefaultSaw_Exists As Boolean = False
|
||||||
|
|
||||||
|
' Il nome della lavorazione restituito dalla selezione
|
||||||
|
Private m_NewSawing As String = String.Empty
|
||||||
|
Public ReadOnly Property NewSawing As String
|
||||||
|
Get
|
||||||
|
Return m_NewSawing
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Il colore della lavorazione
|
||||||
|
Private m_EgtColor As New Color3d
|
||||||
|
Public ReadOnly Property EgtColor As Color3d
|
||||||
|
Get
|
||||||
|
Return m_EgtColor
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Il nome della posizione sulla rulliera
|
||||||
|
Private m_TCPos As String = String.Empty
|
||||||
|
Public ReadOnly Property TCPos As String
|
||||||
|
Get
|
||||||
|
Return m_TCPos
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Nome della lavorazione corrente
|
||||||
|
Private m_CurrSawing As String = String.Empty
|
||||||
|
Public Property CurrSawing As String
|
||||||
|
Get
|
||||||
|
Return m_CurrSawing
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_CurrSawing = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Sub GetDiamAndThickDefaultSaw()
|
||||||
|
m_DefaultSaw_Name = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
|
If EgtTdbSetCurrTool(m_DefaultSaw_Name) Then
|
||||||
|
' Diametro lama lavorazione
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_DefaultSaw_Diam)
|
||||||
|
' Spessore lama corrente
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, m_DefaultSaw_Thick)
|
||||||
|
m_DefaultSaw_Exists = True
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
' Posizione finestra
|
||||||
|
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||||
|
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||||
|
' Definizione del collegamento tra ItemList e ListBox1
|
||||||
|
SetUpToolListBox.ItemsSource = m_SetUpMachiningList
|
||||||
|
' 90378=Seleziona lavorazione
|
||||||
|
FilePathTxBl.Text = EgtMsg(90378)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||||
|
If String.IsNullOrEmpty(m_CurrSawing) Then
|
||||||
|
m_CurrSawing = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
End If
|
||||||
|
' carico elenco degli utensili impostati attualmente in macchina (anche il laser!)
|
||||||
|
LoadSetUpMachining()
|
||||||
|
' ricerco la lavorazione corrente
|
||||||
|
Dim Item As ItemMachining = m_SetUpMachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing)
|
||||||
|
Dim Index As Integer = m_SetUpMachiningList.IndexOf(Item)
|
||||||
|
If Index < 0 Then
|
||||||
|
' Imposto lavorazione di default
|
||||||
|
EgtMdbSetCurrMachining(m_CurrSawing)
|
||||||
|
Dim sTool As String = String.Empty
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sTool)
|
||||||
|
' ⚠️ Utensile {0} non attrezzato
|
||||||
|
ErrorTxBl.Text = String.Format(EgtMsg(90377), sTool)
|
||||||
|
Index = 0
|
||||||
|
End If
|
||||||
|
' se presente seleziono il primo elemento
|
||||||
|
If m_SetUpMachiningList.Count > 0 Then
|
||||||
|
SetUpToolListBox.SelectedItem = m_SetUpMachiningList(Index)
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
Else
|
||||||
|
OkBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "SET UP MACHINING"
|
||||||
|
|
||||||
|
' Creo le liste da mostrare nella lista
|
||||||
|
Private Function LoadSetUpMachining() As Boolean
|
||||||
|
Dim sNameTool As String = String.Empty
|
||||||
|
Dim nType As Integer = 0
|
||||||
|
Dim sHeadTool As String = String.Empty
|
||||||
|
Dim nExitTool As Integer = 0
|
||||||
|
' Imposto il contesto corrente
|
||||||
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
|
' Recupero la lista di tutte le lavorazioni di lama
|
||||||
|
Dim local_Sawing As TreeViewItem.CathegoryItem = GetAllSwaing()
|
||||||
|
' Se non ci sono lavorazioni di lama allora esco
|
||||||
|
If IsNothing(local_Sawing) Then Return False
|
||||||
|
|
||||||
|
' Ripulisco la lista degli utensili
|
||||||
|
m_SetUpMachiningList.Clear()
|
||||||
|
CreateSawingList(local_Sawing)
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Creo la lista delle delle lavorazioni di lama da proporre
|
||||||
|
Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem)
|
||||||
|
' Recupero le info della lama montata di default
|
||||||
|
GetDiamAndThickDefaultSaw()
|
||||||
|
' recupero la prima lavorazione
|
||||||
|
For Each Item As TreeViewItem.CustomItem In SawingFam.Items
|
||||||
|
Dim sNameTool As String = String.Empty
|
||||||
|
' Imposto la lavorazione corrente
|
||||||
|
EgtMdbSetCurrMachining(Item.Name)
|
||||||
|
' Recupero il nome dell'utensile della lavorazione
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool)
|
||||||
|
If Not String.IsNullOrEmpty(sNameTool) And VerifyCurrSawTollerance(sNameTool) Then
|
||||||
|
' Verifico che sia montata su un portautensile
|
||||||
|
EgtTdbSetCurrTool(sNameTool)
|
||||||
|
Dim sTCPos As String = String.Empty
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||||
|
If Not String.IsNullOrEmpty(sTCPos) Then
|
||||||
|
' Cerco nel porta utensili automaitico
|
||||||
|
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
|
If sNameTool = ToolPosition.sTool Then
|
||||||
|
' Verifico che il materiale e lo spessore
|
||||||
|
If VerifyCurrMachiningMaterial() Then
|
||||||
|
m_SetUpMachiningList.Add(New ItemMachining(Item.Name, sNameTool, sTCPos, Utility.GetColorPV()))
|
||||||
|
End If
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' reimposto la lavorazione di lama e la lama impostate in macchina
|
||||||
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||||
|
EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' verifico l'utensile corrente (impostato nella funzione chiamante) se può lavorare il grezzo corrente
|
||||||
|
Private Function VerifyCurrMachiningMaterial() As Boolean
|
||||||
|
Dim m_MaterialsList As New ObservableCollection(Of MachiningMaterial)
|
||||||
|
For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials
|
||||||
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
|
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName, Material.SubId))
|
||||||
|
Else
|
||||||
|
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName))
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim ToolString As String = String.Empty
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString)
|
||||||
|
If ToolString <> String.Empty Then
|
||||||
|
Dim sItems() = ToolString.Split(";".ToCharArray)
|
||||||
|
Dim Index As Integer = 0
|
||||||
|
For Each Material As MachiningMaterial In m_MaterialsList
|
||||||
|
Dim Param() As String = sItems(Index).Split(",".ToCharArray)
|
||||||
|
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
|
||||||
|
Dim nParId As Integer = 0
|
||||||
|
Dim nSubParId As Integer = 0
|
||||||
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
|
If StringToInt(SubParam(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId AndAlso SubParam.Count > 1 AndAlso
|
||||||
|
StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then
|
||||||
|
StringToDouble(Param(1), Material.dMinThickness)
|
||||||
|
StringToDouble(Param(2), Material.dMaxThickness)
|
||||||
|
Material.VerifyIfActive()
|
||||||
|
Else
|
||||||
|
Material.VerifyIfActive()
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If StringToInt(Param(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId Then
|
||||||
|
StringToDouble(Param(1), Material.dMinThickness)
|
||||||
|
StringToDouble(Param(2), Material.dMaxThickness)
|
||||||
|
Material.VerifyIfActive()
|
||||||
|
If m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight > Material.dMinThickness And m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight < Material.dMaxThickness Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Index += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' verifico l'utensile corrente (impostato nella funzione chiamante) se ha le stesse dimensioni della lama di default
|
||||||
|
Private Function VerifyCurrSawTollerance(sNameTool As String) As Boolean
|
||||||
|
If m_DefaultSaw_Exists Then
|
||||||
|
If EgtTdbSetCurrTool(sNameTool) Then
|
||||||
|
' Diametro nuova lama
|
||||||
|
Dim NewDiam As Double = 0
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, NewDiam)
|
||||||
|
' Spessore lama
|
||||||
|
Dim NewThick As Double = 0
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, NewThick)
|
||||||
|
' Verifico che la nuova lama possa essere applicata: diametro minore, uguale spessore
|
||||||
|
Dim Delta_Diam As Double = NewDiam - m_DefaultSaw_Diam
|
||||||
|
Dim Delta_Thick As Double = Math.Abs(NewThick - m_DefaultSaw_Thick)
|
||||||
|
If Delta_Diam < EPS_SMALL And Delta_Thick < EPS_SMALL Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
EgtOutLog(String.Format("New saw {0} can not repalce the current {1}; Delta_Diam={2}, |Delta_Thick|={3} ", sNameTool, m_DefaultSaw_Name, Delta_Diam, Delta_Thick))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
EgtOutLog("Impossible to find in tooldb SAW: " & sNameTool)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If String.IsNullOrEmpty(m_DefaultSaw_Name) Then
|
||||||
|
EgtOutLog("There is no currsaw setted in machine!")
|
||||||
|
Else
|
||||||
|
EgtOutLog("Impossible to find in tooldb currsaw setted in machine: " & m_DefaultSaw_Name)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Restituisce tutto l'elenco delle lavorazioni disponibili in macchina
|
||||||
|
Private Function GetAllSwaing() As TreeViewItem.CathegoryItem
|
||||||
|
Dim sFName As String = EgtMsg(MSG_MACHININGSDBPAGEUC + 31)
|
||||||
|
Dim nFType As Integer = MCH_MY.SAWING
|
||||||
|
If Not m_MainWindow.m_CurrentMachine.bSawing Then Return Nothing
|
||||||
|
' Inserisco categoria ed eventuali elementi
|
||||||
|
Dim MachiningCathegory As New TreeViewItem.CathegoryItem(sFName, nFType)
|
||||||
|
Dim MachiningName As String = String.Empty
|
||||||
|
If EgtMdbGetFirstMachining(nFType, MachiningName) Then
|
||||||
|
MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType))
|
||||||
|
While EgtMdbGetNextMachining(nFType, MachiningName)
|
||||||
|
MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType))
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
Return MachiningCathegory
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region ' Set up machinining
|
||||||
|
|
||||||
|
Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp
|
||||||
|
' Disabilito Ok
|
||||||
|
OkBtn.IsEnabled = False
|
||||||
|
' Recupero item selezionato
|
||||||
|
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||||
|
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
|
||||||
|
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||||
|
' A seconda del tipo
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SetUpToolListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SetUpToolListBox.SelectionChanged
|
||||||
|
' Disabilito Ok
|
||||||
|
OkBtn.IsEnabled = False
|
||||||
|
' Recupero item selezionato
|
||||||
|
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||||
|
Return
|
||||||
|
Else
|
||||||
|
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||||
|
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
|
||||||
|
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
|
DialogResult = True
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class ItemMachining
|
||||||
|
|
||||||
|
Private m_ToolPos As String = String.Empty
|
||||||
|
Private m_ToolName As String = String.Empty
|
||||||
|
Private m_Machining As String = String.Empty
|
||||||
|
Private m_ToolExit As Integer = 1
|
||||||
|
Private m_ToolType As Integer = -1
|
||||||
|
Private m_PrintFootToolColor As New Color3d(0, 255, 0, 100)
|
||||||
|
Private m_cSawColor As SolidColorBrush
|
||||||
|
|
||||||
|
' Posizione porta utensile
|
||||||
|
Public Property ToolPos As String
|
||||||
|
Get
|
||||||
|
Return m_ToolPos
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_ToolPos = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Nome utensile
|
||||||
|
Public Property ToolName As String
|
||||||
|
Get
|
||||||
|
Return m_ToolName
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_ToolName = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' Nome della lavorazione
|
||||||
|
Public Property Machining As String
|
||||||
|
Get
|
||||||
|
Return m_Machining
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_Machining = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Property ToolExit As Integer
|
||||||
|
Get
|
||||||
|
Return m_ToolExit
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_ToolExit = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Property ToolType As Integer
|
||||||
|
Get
|
||||||
|
Return m_ToolType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_ToolType = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Property PrintFootToolColor As Color3d
|
||||||
|
Get
|
||||||
|
Return m_PrintFootToolColor
|
||||||
|
End Get
|
||||||
|
Set(value As Color3d)
|
||||||
|
m_PrintFootToolColor = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Property SawColor As SolidColorBrush
|
||||||
|
Get
|
||||||
|
Return m_cSawColor
|
||||||
|
End Get
|
||||||
|
Set(value As SolidColorBrush)
|
||||||
|
m_cSawColor = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(sMachining As String, sToolName As String, sToolPos As String, cColor As Color3d)
|
||||||
|
m_Machining = sMachining
|
||||||
|
m_ToolPos = sToolPos
|
||||||
|
m_ToolName = sToolName
|
||||||
|
m_PrintFootToolColor = cColor
|
||||||
|
m_cSawColor = New SolidColorBrush(Color.FromRgb(m_PrintFootToolColor.R, m_PrintFootToolColor.G, m_PrintFootToolColor.B))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -142,6 +142,30 @@ Public Class ChooseTestToolWD
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Return True
|
Return True
|
||||||
|
|
||||||
|
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
|
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||||
|
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||||
|
sNameTool = ToolChangerPos.sTool
|
||||||
|
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||||
|
' Imposto la lama
|
||||||
|
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||||
|
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||||
|
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||||
|
sNameTool = ToolChangerPos.sTool
|
||||||
|
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||||
|
' Imposto la lama
|
||||||
|
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
Return False
|
Return False
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
@@ -2854,20 +2854,22 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function StoreOnePartDXF(nId As Integer, X As Double, Y As Double) As Boolean
|
Friend Function StoreOnePartDXF(nId As Integer, DimX As Double, DimY As Double, MaxPt As Point3d) As Boolean
|
||||||
Const STORE_LARGH As Double = 6000
|
'Const STORE_LARGH As Double = 6000
|
||||||
Const STORE_DIST As Double = 200
|
Const STORE_DIST As Double = 200
|
||||||
Const STORE_OFFS As Double = 20 + 40 + 20
|
'Const STORE_OFFS As Double = 20 + 40 + 20
|
||||||
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
|
'Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
|
||||||
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
||||||
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
'Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||||
' Recupero box tavola
|
' Recupero box tavola
|
||||||
Dim b3Tab As New BBox3d
|
Dim b3Tab As New BBox3d
|
||||||
If Not EgtGetTableArea(1, b3Tab) Then
|
If Not EgtGetTableArea(1, b3Tab) Then
|
||||||
b3Tab.Add(New Point3d(0, 0, 0))
|
b3Tab.Add(New Point3d(0, 0, 0))
|
||||||
b3Tab.Add(New Point3d(-3600, -2600, 0))
|
b3Tab.Add(New Point3d(-3600, -2600, 0))
|
||||||
End If
|
End If
|
||||||
Dim vt As New Vector3d(b3Tab.Min.x, b3Tab.Min.y - Y - STORE_DIST, b3Tab.Min.z)
|
Dim Offs_y As Double = b3Tab.Min.y - MaxPt.y - STORE_DIST
|
||||||
|
Dim Offs_x As Double = b3Tab.Min.x - (MaxPt.x - DimX) + (b3Tab.DimX - DimX) / 2
|
||||||
|
Dim vt As New Vector3d(Offs_x, Offs_y, b3Tab.Min.z)
|
||||||
EgtMove(nId, vt, GDB_RT.GLOB)
|
EgtMove(nId, vt, GDB_RT.GLOB)
|
||||||
' Recupero il centro del pezzo in parcheggio e lo salvo
|
' Recupero il centro del pezzo in parcheggio e lo salvo
|
||||||
Dim ptCenter As Point3d
|
Dim ptCenter As Point3d
|
||||||
|
|||||||
+296
-142
@@ -1,6 +1,4 @@
|
|||||||
Imports System.Net
|
Imports EgtUILib
|
||||||
Imports System.Windows.Forms.Integration
|
|
||||||
Imports EgtUILib
|
|
||||||
|
|
||||||
Public Module SplitAuto
|
Public Module SplitAuto
|
||||||
|
|
||||||
@@ -51,151 +49,296 @@ Public Module SplitAuto
|
|||||||
While nOperId <> GDB_ID.NULL
|
While nOperId <> GDB_ID.NULL
|
||||||
' verifico sia una lavorazione valida della fase corrente
|
' verifico sia una lavorazione valida della fase corrente
|
||||||
If IsValidMachining(nOperId) And EgtGetOperationPhase(nOperId) = nCurrPhase Then
|
If IsValidMachining(nOperId) And EgtGetOperationPhase(nOperId) = nCurrPhase Then
|
||||||
' se appartiene ad un grezzo attivo la inserisco in lista
|
Dim Mach As New SplitMach
|
||||||
If IsMachiningInActiveRaw(nOperId) Then
|
If CreateMach(Mach, nOperId) Then MachSplitList.Add(Mach)
|
||||||
Dim Mach As New SplitMach
|
'' se appartiene ad un grezzo attivo la inserisco in lista
|
||||||
Mach.m_nEntId = GDB_ID.NULL
|
'If IsMachiningInActiveRaw(nOperId) Then
|
||||||
' identificativo
|
' Dim Mach As New SplitMach
|
||||||
Mach.m_nId = nOperId
|
' Mach.m_nEntId = GDB_ID.NULL
|
||||||
' eventuali lavorazioni inglobate
|
' ' identificativo
|
||||||
Dim sInfo As String = String.Empty
|
' Mach.m_nId = nOperId
|
||||||
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
|
' ' eventuali lavorazioni inglobate
|
||||||
Dim sItems() As String = sInfo.Split(",".ToCharArray)
|
' Dim sInfo As String = String.Empty
|
||||||
For Each sId As String In sItems
|
' If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
|
||||||
Dim nId As Integer = 0
|
' Dim sItems() As String = sInfo.Split(",".ToCharArray)
|
||||||
StringToInt(sId, nId)
|
' For Each sId As String In sItems
|
||||||
If nId > 0 Then Mach.m_vOthId.Add(nId)
|
' Dim nId As Integer = 0
|
||||||
Next
|
' StringToInt(sId, nId)
|
||||||
End If
|
' If nId > 0 Then Mach.m_vOthId.Add(nId)
|
||||||
' tipo
|
' Next
|
||||||
Mach.m_nType = EgtGetOperationType(nOperId)
|
' End If
|
||||||
' layer di origine
|
' ' tipo
|
||||||
EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
|
' Mach.m_nType = EgtGetOperationType(nOperId)
|
||||||
' se taglio con lama
|
' ' layer di origine
|
||||||
If Mach.m_nType = MCH_OY.SAWING Then
|
' EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
|
||||||
' verifica interferenza
|
' ' se taglio con lama
|
||||||
If Mach.m_sLay = NAME_OUTLOOP Then
|
' If Mach.m_nType = MCH_OY.SAWING Then
|
||||||
EgtVerifyMachining(nOperId, Mach.m_nInterf)
|
' ' verifica interferenza
|
||||||
For Each nId As Integer In Mach.m_vOthId
|
' If Mach.m_sLay = NAME_OUTLOOP Then
|
||||||
Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
|
' EgtVerifyMachining(nOperId, Mach.m_nInterf)
|
||||||
EgtVerifyMachining(nId, nRes)
|
' For Each nId As Integer In Mach.m_vOthId
|
||||||
Mach.m_nInterf = Mach.m_nInterf Or nRes
|
' Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
|
||||||
Next
|
' EgtVerifyMachining(nId, nRes)
|
||||||
Else
|
' Mach.m_nInterf = Mach.m_nInterf Or nRes
|
||||||
Mach.m_nInterf = FMI_TYPE.NONE
|
' Next
|
||||||
End If
|
' Else
|
||||||
' la imposto come lavorazione corrente
|
' Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
EgtSetCurrMachining(nOperId)
|
' End If
|
||||||
' inversione
|
' ' la imposto come lavorazione corrente
|
||||||
EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
|
' EgtSetCurrMachining(nOperId)
|
||||||
' recupero l'angolo di fianco
|
' ' inversione
|
||||||
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
' EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
|
||||||
' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
|
' ' recupero l'angolo di fianco
|
||||||
Dim dStartAddLen As Double = -10
|
' EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
||||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
|
' ' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
|
||||||
Dim dEndAddLen As Double = -10
|
' Dim dStartAddLen As Double = -10
|
||||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
|
' EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
|
' Dim dEndAddLen As Double = -10
|
||||||
Mach.m_bIsLine = True
|
' EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
Mach.m_dPrevAng = 0
|
' ' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
|
||||||
Mach.m_dNextAng = 0
|
' Mach.m_bIsLine = True
|
||||||
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
' Mach.m_dPrevAng = 0
|
||||||
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
' Mach.m_dNextAng = 0
|
||||||
Dim nEntId, nSub As Integer
|
' Mach.m_dStartFreeLen = FREELEN_INF + 1
|
||||||
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
|
' Mach.m_dEndFreeLen = FREELEN_INF + 1
|
||||||
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
|
' Dim nEntId, nSub As Integer
|
||||||
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
' If EgtGetMachiningGeometry(0, nEntId, nSub) Then
|
||||||
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
' ' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
|
||||||
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
' If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
||||||
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
||||||
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
||||||
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
||||||
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
||||||
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
' Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
||||||
Mach.m_nEntId = nEntId
|
' EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||||
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
|
' If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
||||||
End If
|
' Mach.m_nEntId = nEntId
|
||||||
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
' EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
|
||||||
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
' End If
|
||||||
Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
|
' ' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
||||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
' If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
Dim bIn As Boolean = False
|
' Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
|
||||||
Dim bOut As Boolean = False
|
' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||||
CanExtendSides(Mach, bIn, bOut)
|
' Dim bIn As Boolean = False
|
||||||
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
|
' Dim bOut As Boolean = False
|
||||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
|
' CanExtendSides(Mach, bIn, bOut)
|
||||||
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
|
' Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
|
||||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
|
' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
|
||||||
If nRes = 0 Then
|
' Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
|
||||||
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
|
||||||
End If
|
' If nRes = 0 Then
|
||||||
|
' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
' Mach.m_sLay = NAME_OUTLOOP And
|
||||||
|
' (Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
|
||||||
|
' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||||
|
' Dim bIn As Boolean = False
|
||||||
|
' Dim bOut As Boolean = False
|
||||||
|
' CanExtendSides(Mach, bIn, bOut)
|
||||||
|
' ' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
|
||||||
|
' Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
|
||||||
|
' Mach.m_nInterf <> FMI_TYPE.LI
|
||||||
|
' ' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
|
||||||
|
' Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
|
||||||
|
' Mach.m_nInterf <> FMI_TYPE.LO
|
||||||
|
' If nRes = 0 Then
|
||||||
|
' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' ' se trasformabile in taglio di separazione, verifico se lo è
|
||||||
|
' If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
||||||
|
' EgtSetCurrMachining(nOperId)
|
||||||
|
' Dim nLiType As Integer
|
||||||
|
' EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
|
||||||
|
' Dim nLoType As Integer
|
||||||
|
' EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
|
||||||
|
' Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
|
||||||
|
' Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
|
||||||
|
' Else
|
||||||
|
' Mach.m_bStartAll = False
|
||||||
|
' Mach.m_bEndAll = False
|
||||||
|
' End If
|
||||||
|
' ' Waterjet
|
||||||
|
' ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
|
||||||
|
' Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
|
' ' recupero l'angolo di fianco
|
||||||
|
' EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
||||||
|
' Mach.m_bCanStartAll = False
|
||||||
|
' Mach.m_bCanEndAll = False
|
||||||
|
' Mach.m_bStartAll = False
|
||||||
|
' Mach.m_bEndAll = False
|
||||||
|
' ' Forature e fresature
|
||||||
|
' Else
|
||||||
|
' Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
|
' Mach.m_dSideAng = 0
|
||||||
|
' Mach.m_bCanStartAll = False
|
||||||
|
' Mach.m_bCanEndAll = False
|
||||||
|
' Mach.m_bStartAll = False
|
||||||
|
' Mach.m_bEndAll = False
|
||||||
|
' End If
|
||||||
|
' ' abilitazione
|
||||||
|
' Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
|
||||||
|
' ' pausa
|
||||||
|
' Mach.m_bPause = GetPause(nOperId)
|
||||||
|
' ' inserisco in lista
|
||||||
|
' MachSplitList.Add(Mach)
|
||||||
|
' ' altrimenti la disattivo
|
||||||
|
'Else
|
||||||
|
' EgtSetOperationMode(nOperId, False)
|
||||||
|
'End If
|
||||||
|
|
||||||
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
|
||||||
Mach.m_sLay = NAME_OUTLOOP And
|
|
||||||
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
|
|
||||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
|
||||||
Dim bIn As Boolean = False
|
|
||||||
Dim bOut As Boolean = False
|
|
||||||
CanExtendSides(Mach, bIn, bOut)
|
|
||||||
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
|
|
||||||
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
|
||||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
|
|
||||||
Mach.m_nInterf <> FMI_TYPE.LI
|
|
||||||
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
|
|
||||||
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
|
||||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
|
|
||||||
Mach.m_nInterf <> FMI_TYPE.LO
|
|
||||||
If nRes = 0 Then
|
|
||||||
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' se trasformabile in taglio di separazione, verifico se lo è
|
|
||||||
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
|
||||||
EgtSetCurrMachining(nOperId)
|
|
||||||
Dim nLiType As Integer
|
|
||||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
|
|
||||||
Dim nLoType As Integer
|
|
||||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
|
|
||||||
Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
|
|
||||||
Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
|
|
||||||
Else
|
|
||||||
Mach.m_bStartAll = False
|
|
||||||
Mach.m_bEndAll = False
|
|
||||||
End If
|
|
||||||
' Waterjet
|
|
||||||
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
|
|
||||||
Mach.m_nInterf = FMI_TYPE.NONE
|
|
||||||
' recupero l'angolo di fianco
|
|
||||||
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
|
||||||
Mach.m_bCanStartAll = False
|
|
||||||
Mach.m_bCanEndAll = False
|
|
||||||
Mach.m_bStartAll = False
|
|
||||||
Mach.m_bEndAll = False
|
|
||||||
' Forature e fresature
|
|
||||||
Else
|
|
||||||
Mach.m_nInterf = FMI_TYPE.NONE
|
|
||||||
Mach.m_dSideAng = 0
|
|
||||||
Mach.m_bCanStartAll = False
|
|
||||||
Mach.m_bCanEndAll = False
|
|
||||||
Mach.m_bStartAll = False
|
|
||||||
Mach.m_bEndAll = False
|
|
||||||
End If
|
|
||||||
' abilitazione
|
|
||||||
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
|
|
||||||
' pausa
|
|
||||||
Mach.m_bPause = GetPause(nOperId)
|
|
||||||
' inserisco in lista
|
|
||||||
MachSplitList.Add(Mach)
|
|
||||||
' altrimenti la disattivo
|
|
||||||
Else
|
|
||||||
EgtSetOperationMode(nOperId, False)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
nOperId = EgtGetNextOperation(nOperId)
|
nOperId = EgtGetNextOperation(nOperId)
|
||||||
End While
|
End While
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function CreateMach(ByRef Mach As SplitMach, nOperId As Integer) As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
' se appartiene ad un grezzo attivo la inserisco in lista
|
||||||
|
If IsMachiningInActiveRaw(nOperId) Then
|
||||||
|
Mach.m_nEntId = GDB_ID.NULL
|
||||||
|
' identificativo
|
||||||
|
Mach.m_nId = nOperId
|
||||||
|
' eventuali lavorazioni inglobate
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
|
||||||
|
Dim sItems() As String = sInfo.Split(",".ToCharArray)
|
||||||
|
For Each sId As String In sItems
|
||||||
|
Dim nId As Integer = 0
|
||||||
|
StringToInt(sId, nId)
|
||||||
|
If nId > 0 Then Mach.m_vOthId.Add(nId)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
' tipo
|
||||||
|
Mach.m_nType = EgtGetOperationType(nOperId)
|
||||||
|
' layer di origine
|
||||||
|
EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
|
||||||
|
' se taglio con lama
|
||||||
|
If Mach.m_nType = MCH_OY.SAWING Then
|
||||||
|
' verifica interferenza
|
||||||
|
If Mach.m_sLay = NAME_OUTLOOP Then
|
||||||
|
EgtVerifyMachining(nOperId, Mach.m_nInterf)
|
||||||
|
For Each nId As Integer In Mach.m_vOthId
|
||||||
|
Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
|
||||||
|
EgtVerifyMachining(nId, nRes)
|
||||||
|
Mach.m_nInterf = Mach.m_nInterf Or nRes
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
|
End If
|
||||||
|
' la imposto come lavorazione corrente
|
||||||
|
EgtSetCurrMachining(nOperId)
|
||||||
|
' inversione
|
||||||
|
EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
|
||||||
|
' recupero l'angolo di fianco
|
||||||
|
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
||||||
|
' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
|
||||||
|
Dim dStartAddLen As Double = -10
|
||||||
|
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
|
Dim dEndAddLen As Double = -10
|
||||||
|
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
|
' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
|
||||||
|
Mach.m_bIsLine = True
|
||||||
|
Mach.m_dPrevAng = 0
|
||||||
|
Mach.m_dNextAng = 0
|
||||||
|
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
||||||
|
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
||||||
|
Dim nEntId, nSub As Integer
|
||||||
|
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
|
||||||
|
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
|
||||||
|
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
||||||
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
||||||
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
||||||
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
||||||
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
||||||
|
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
||||||
|
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||||
|
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
||||||
|
Mach.m_nEntId = nEntId
|
||||||
|
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
|
||||||
|
End If
|
||||||
|
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
||||||
|
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
Mach.m_sLay = NAME_OUTLOOP And (Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
|
||||||
|
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||||
|
Dim bIn As Boolean = False
|
||||||
|
Dim bOut As Boolean = False
|
||||||
|
CanExtendSides(Mach, bIn, bOut)
|
||||||
|
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
|
||||||
|
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
|
||||||
|
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
|
||||||
|
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
|
||||||
|
If nRes = 0 Then
|
||||||
|
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
Mach.m_sLay = NAME_OUTLOOP And
|
||||||
|
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
|
||||||
|
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||||
|
Dim bIn As Boolean = False
|
||||||
|
Dim bOut As Boolean = False
|
||||||
|
CanExtendSides(Mach, bIn, bOut)
|
||||||
|
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
|
||||||
|
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
|
||||||
|
Mach.m_nInterf <> FMI_TYPE.LI
|
||||||
|
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
|
||||||
|
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
|
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
|
||||||
|
Mach.m_nInterf <> FMI_TYPE.LO
|
||||||
|
If nRes = 0 Then
|
||||||
|
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' se trasformabile in taglio di separazione, verifico se lo è
|
||||||
|
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
||||||
|
EgtSetCurrMachining(nOperId)
|
||||||
|
Dim nLiType As Integer
|
||||||
|
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
|
||||||
|
Dim nLoType As Integer
|
||||||
|
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
|
||||||
|
Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
|
||||||
|
Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
|
||||||
|
Else
|
||||||
|
Mach.m_bStartAll = False
|
||||||
|
Mach.m_bEndAll = False
|
||||||
|
End If
|
||||||
|
' Waterjet
|
||||||
|
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
|
||||||
|
Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
|
' recupero l'angolo di fianco
|
||||||
|
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
|
||||||
|
Mach.m_bCanStartAll = False
|
||||||
|
Mach.m_bCanEndAll = False
|
||||||
|
Mach.m_bStartAll = False
|
||||||
|
Mach.m_bEndAll = False
|
||||||
|
' Forature e fresature
|
||||||
|
Else
|
||||||
|
Mach.m_nInterf = FMI_TYPE.NONE
|
||||||
|
Mach.m_dSideAng = 0
|
||||||
|
Mach.m_bCanStartAll = False
|
||||||
|
Mach.m_bCanEndAll = False
|
||||||
|
Mach.m_bStartAll = False
|
||||||
|
Mach.m_bEndAll = False
|
||||||
|
End If
|
||||||
|
' abilitazione
|
||||||
|
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
|
||||||
|
' pausa
|
||||||
|
Mach.m_bPause = GetPause(nOperId)
|
||||||
|
Else
|
||||||
|
' altrimenti la disattivo
|
||||||
|
EgtSetOperationMode(nOperId, False)
|
||||||
|
bOk = False
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean
|
Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean
|
||||||
If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then
|
If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then
|
||||||
' Posso estendere SOLO l'uscita
|
' Posso estendere SOLO l'uscita
|
||||||
@@ -283,8 +426,19 @@ Public Module SplitAuto
|
|||||||
ElseIf Math.Abs(dSideAng) > EPS_ANG_SMALL Then
|
ElseIf Math.Abs(dSideAng) > EPS_ANG_SMALL Then
|
||||||
colCut = COL_MCH_CUT_ANG()
|
colCut = COL_MCH_CUT_ANG()
|
||||||
Else
|
Else
|
||||||
colCut = COL_MCH_CUT()
|
' Se macchina con cambio utensile di lama
|
||||||
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
|
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_SplitPage.GetCurrSawingandSaw(nOperId, sSawing, sSaw)
|
||||||
|
' Setto l'utensile corrente
|
||||||
|
EgtTdbSetCurrTool(sSaw)
|
||||||
|
' recupero il colore della lavorazione direttamente dall'utensile
|
||||||
|
colCut = Utility.GetColorPV()
|
||||||
|
Else
|
||||||
|
colCut = COL_MCH_CUT()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each nId In vCutId
|
For Each nId In vCutId
|
||||||
EgtSetColor(nId, colCut)
|
EgtSetColor(nId, colCut)
|
||||||
Next
|
Next
|
||||||
|
|||||||
+54
-29
@@ -1,10 +1,10 @@
|
|||||||
<UserControl x:Class="SplitPageUC"
|
<UserControl x:Class="SplitPageUC"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized">
|
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized">
|
||||||
|
|
||||||
<!-- Definizione della SplitPage -->
|
<!-- Definizione della SplitPage -->
|
||||||
<Grid Name="SplitPageGrid" >
|
<Grid Name="SplitPageGrid" >
|
||||||
@@ -64,24 +64,49 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ListBox Name="MachiningLsBx" Grid.Row="1"
|
<ListBox Name="MachiningLsBx" Grid.Row="1"
|
||||||
SelectionMode="Extended">
|
SelectionMode="Extended">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Name}">
|
<Grid Width="210">
|
||||||
<TextBlock.Style>
|
<Grid.ColumnDefinitions>
|
||||||
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
|
<ColumnDefinition Width="2.8*"/>
|
||||||
<Style.Triggers>
|
<ColumnDefinition Width="1.2*"/>
|
||||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
<ColumnDefinition Width="Auto"/>
|
||||||
<Setter Property="TextDecorations" Value="Strikethrough"/>
|
</Grid.ColumnDefinitions>
|
||||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
<TextBlock Text="{Binding Name}">
|
||||||
</DataTrigger>
|
<TextBlock.Style>
|
||||||
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Style.Triggers>
|
||||||
</DataTrigger>
|
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||||
</Style.Triggers>
|
<Setter Property="TextDecorations" Value="Strikethrough"/>
|
||||||
</Style>
|
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||||
</TextBlock.Style>
|
</DataTrigger>
|
||||||
</TextBlock>
|
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Grid.Column="1" Text="{Binding TCPos}">
|
||||||
|
<TextBlock.Style>
|
||||||
|
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||||
|
<Setter Property="TextDecorations" Value="Strikethrough"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
|
<Rectangle Grid.Column="2"
|
||||||
|
Visibility="{Binding MachiningTCPosVisibility}"
|
||||||
|
Style="{DynamicResource Rect_SplitPage}"/>
|
||||||
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
@@ -100,14 +125,14 @@
|
|||||||
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
|
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
|
||||||
Height="25" Width="25">
|
Height="25" Width="25">
|
||||||
<Image Name="LayNbArrImg"
|
<Image Name="LayNbArrImg"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" Stretch="Uniform"/>
|
VerticalAlignment="Center" Stretch="Uniform"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Row="3">
|
<Grid Grid.Row="3">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -152,7 +177,7 @@
|
|||||||
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
<!--solo per macchine con lavorazioni Waterjet-->
|
<!--solo per macchine con lavorazioni Waterjet-->
|
||||||
<Button Name="QualityWJBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="QualityWJBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource QualityWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource QualityWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
+209
-6
@@ -1,6 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports System.Drawing
|
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class SplitPageUC
|
Public Class SplitPageUC
|
||||||
@@ -206,28 +205,54 @@ Public Class SplitPageUC
|
|||||||
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
|
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
|
||||||
End If
|
End If
|
||||||
If Mach.m_bPause Then AddPauseText(sText)
|
If Mach.m_bPause Then AddPauseText(sText)
|
||||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING))
|
AddItemToList(i, Mach, sText, MCH_OY.SAWING)
|
||||||
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
|
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
|
||||||
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
|
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
|
||||||
If Mach.m_bPause Then AddPauseText(sText)
|
If Mach.m_bPause Then AddPauseText(sText)
|
||||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
|
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
|
||||||
|
AddItemToList(i, Mach, sText, MCH_OY.DRILLING)
|
||||||
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
|
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
|
||||||
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
|
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
|
||||||
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
|
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
|
||||||
If Mach.m_bPause Then AddPauseText(sText)
|
If Mach.m_bPause Then AddPauseText(sText)
|
||||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
|
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
|
||||||
|
AddItemToList(i, Mach, sText, MCH_OY.MILLING)
|
||||||
ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura
|
ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura
|
||||||
Dim sText As String = EgtMsg(90796) & " " & i.ToString()
|
Dim sText As String = EgtMsg(90796) & " " & i.ToString()
|
||||||
If Mach.m_bPause Then AddPauseText(sText)
|
If Mach.m_bPause Then AddPauseText(sText)
|
||||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
|
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
|
||||||
|
AddItemToList(i, Mach, sText, MCH_OY.POCKETING)
|
||||||
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet
|
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet
|
||||||
Dim sText As String = EgtMsg(90797) & " " & i.ToString()
|
Dim sText As String = EgtMsg(90797) & " " & i.ToString()
|
||||||
If Mach.m_bPause Then AddPauseText(sText)
|
If Mach.m_bPause Then AddPauseText(sText)
|
||||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
|
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
|
||||||
|
AddItemToList(i, Mach, sText, MCH_OY.WATERJETTING)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AddItemToList(i As Integer, Mach As SplitMach, sText As String, nMach As Integer)
|
||||||
|
Dim sTCPos As String = String.Empty
|
||||||
|
' Visualizzo la posizione utensile solo se configurata
|
||||||
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
|
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
|
||||||
|
GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw)
|
||||||
|
' Verifico che sia montata su un portautensile
|
||||||
|
EgtTdbSetCurrTool(sSaw)
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||||
|
End If
|
||||||
|
' Se TCPos non trovato
|
||||||
|
If String.IsNullOrEmpty(sTCPos) Then
|
||||||
|
' Inserisco solo nome lavorazione
|
||||||
|
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach))
|
||||||
|
Else
|
||||||
|
' altrimenti se esiste una lama impostata nell'if sopra
|
||||||
|
Dim sawColor As Color3d = Utility.GetColorPV()
|
||||||
|
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B)
|
||||||
|
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach, sTCPos, New SolidColorBrush(tmpSawColor)))
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "BRIDGE"
|
#Region "BRIDGE"
|
||||||
|
|
||||||
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
|
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
|
||||||
@@ -470,6 +495,39 @@ Public Class SplitPageUC
|
|||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
|
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
|
||||||
If Not m_bActive OrElse m_bShow Then Return
|
If Not m_bActive OrElse m_bShow Then Return
|
||||||
|
|
||||||
|
If e.Button = Windows.Forms.MouseButtons.Right And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
|
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||||
|
Dim nSel1 As Integer = GDB_ID.NULL
|
||||||
|
Dim nPvId As Integer = GDB_ID.NULL
|
||||||
|
Dim nMchId As Integer = GDB_ID.NULL
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel1)
|
||||||
|
Dim nId1 As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
While nId1 <> GDB_ID.NULL
|
||||||
|
' Verifico sia un attacco o uscita di taglio con lama
|
||||||
|
Dim nType As Integer = 0
|
||||||
|
Dim sName As String = ""
|
||||||
|
EgtGetName(nId1, sName)
|
||||||
|
nPvId = EgtGetParent(EgtGetParent(nId1))
|
||||||
|
nMchId = GDB_ID.NULL
|
||||||
|
If String.Compare(sName, NAME_PV_PRECUT) = 0 Or String.Compare(sName, NAME_PV_POSTCUT) = 0 Or String.Compare(sName, NAME_PV_CUT) = 0 Then
|
||||||
|
If EgtGetInfo(nPvId, "MId", nMchId) Then
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nId1 = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
|
||||||
|
If nMchId = GDB_ID.NULL Then
|
||||||
|
GetCurrSelection()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
ChangeMachinig(nMchId)
|
||||||
|
GetCurrSelection()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||||
@@ -489,6 +547,7 @@ Public Class SplitPageUC
|
|||||||
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
|
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
|
||||||
DeselectWJBridgesPart()
|
DeselectWJBridgesPart()
|
||||||
End If
|
End If
|
||||||
|
GetCurrSelection()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -497,6 +556,7 @@ Public Class SplitPageUC
|
|||||||
OnMyMouseDownSceneBridgesDelete(sender, e)
|
OnMyMouseDownSceneBridgesDelete(sender, e)
|
||||||
' aggiorno la visualizzazione delle lavorazioni e la lista
|
' aggiorno la visualizzazione delle lavorazioni e la lista
|
||||||
RefreshMachList()
|
RefreshMachList()
|
||||||
|
GetCurrSelection()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -584,6 +644,88 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
MachiningLsBx.SelectedIndex = -1
|
MachiningLsBx.SelectedIndex = -1
|
||||||
End If
|
End If
|
||||||
|
GetCurrSelection()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ChangeMachinig(nMchId As Integer)
|
||||||
|
' Imposto la lavorazione corrente
|
||||||
|
Dim sSawing As String = String.Empty
|
||||||
|
Dim EntId As Integer = GDB_ID.NULL
|
||||||
|
Dim SubEntId As Integer = GDB_ID.NULL
|
||||||
|
EgtSetCurrMachining(nMchId)
|
||||||
|
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return
|
||||||
|
' Recupero il nome della lavorazione
|
||||||
|
EgtGetInfo(EntId, DEF_MACHINING, sSawing)
|
||||||
|
|
||||||
|
' Apro pagina di selezione della lavorazione
|
||||||
|
Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow)
|
||||||
|
' Imposto nome lavorazione corrente
|
||||||
|
m_ChangeToolPage.CurrSawing = sSawing
|
||||||
|
' apro la finestra per la selezione delle lavorazioni
|
||||||
|
m_ChangeToolPage.ShowDialog()
|
||||||
|
|
||||||
|
' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto
|
||||||
|
If m_ChangeToolPage.DialogResult Then
|
||||||
|
EgtSetInfo(EntId, DEF_MACHINING, m_ChangeToolPage.NewSawing)
|
||||||
|
Dim Index As Integer = 0
|
||||||
|
For Index = 0 To m_MachiningList.Count() - 1
|
||||||
|
If m_MachiningList(Index).m_nId = nMchId Then
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Dim nNewMchId As Integer = -1
|
||||||
|
CamAuto.AddSawMachining(nMchId, nNewMchId)
|
||||||
|
' Elimino la numerazione e la freccia
|
||||||
|
EgtErase(m_MachiningList(Index).m_nArrId)
|
||||||
|
EgtErase(m_MachiningList(Index).m_nNbrId)
|
||||||
|
Dim Mach As New SplitMach
|
||||||
|
' Sostituisco la vecchia lavorazione con la nuova
|
||||||
|
If SplitAuto.CreateMach(Mach, nNewMchId) Then
|
||||||
|
' Assegno la lavorazione alla lista
|
||||||
|
m_MachiningList(Index) = Mach
|
||||||
|
' Riassegno la numerazione
|
||||||
|
NumberDirectionMachining(Index)
|
||||||
|
m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos
|
||||||
|
' Recupero il colore della lavorazione
|
||||||
|
Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor
|
||||||
|
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B)
|
||||||
|
m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor)
|
||||||
|
m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub GetCurrSawingandSaw(ByVal nMchId As Integer, ByRef sSawing As String, ByRef sNameTool As String)
|
||||||
|
Dim EntId As Integer = GDB_ID.NULL
|
||||||
|
Dim SubEntId As Integer = GDB_ID.NULL
|
||||||
|
EgtSetCurrMachining(nMchId)
|
||||||
|
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return
|
||||||
|
' Eventualmente recupero il nome della lavorazione
|
||||||
|
EgtGetInfo(EntId, DEF_MACHINING, sSawing)
|
||||||
|
If String.IsNullOrEmpty(sSawing) Then sSawing = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
' Imposto la lavorazione corrente
|
||||||
|
EgtMdbSetCurrMachining(sSawing)
|
||||||
|
' Recupero il nome dell'utensile della lavorazione
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Dato l'id della lavorazione nel grezzo colora il taglio del colore assegnato
|
||||||
|
Public Sub ColorsCut(nOperId As Integer, EgtCol As Color3d)
|
||||||
|
' Recupero la lavorazione
|
||||||
|
Dim nPVRawId As Integer = EgtGetFirstNameInGroup(nOperId, "PV")
|
||||||
|
Dim nPVPartId As Integer = GDB_ID.NULL
|
||||||
|
EgtGetInfo(nPVRawId, "PvId", nPVPartId)
|
||||||
|
Dim nId2 As Integer = EgtGetFirstInGroup(EgtGetFirstInGroup(nPVPartId))
|
||||||
|
Dim sName As String = ""
|
||||||
|
EgtGetName(nId2, sName)
|
||||||
|
While nId2 <> GDB_ID.NULL
|
||||||
|
If String.Compare(sName, NAME_PV_CUT) = 0 Then
|
||||||
|
EgtSetColor(nId2, EgtCol)
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nId2 = EgtGetNext(nId2)
|
||||||
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
||||||
@@ -764,6 +906,15 @@ Public Class SplitPageUC
|
|||||||
OnOffCut()
|
OnOffCut()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MachiningLsBx_MouseRightButtonDown(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.PreviewMouseRightButtonDown
|
||||||
|
' se disabilitata la modifica allora esco
|
||||||
|
If m_bShow Then Return
|
||||||
|
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
|
||||||
|
Dim Index As Integer = MachiningLsBx.SelectedIndex
|
||||||
|
If Index = -1 Then Return
|
||||||
|
ChangeMachinig(m_MachiningList(Index).m_nId)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||||
MoveItem(-1)
|
MoveItem(-1)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2666,6 +2817,10 @@ Public Class SplitPageUC
|
|||||||
Private m_sName As String
|
Private m_sName As String
|
||||||
Private m_bIsActive As Boolean
|
Private m_bIsActive As Boolean
|
||||||
Private m_nType As Integer
|
Private m_nType As Integer
|
||||||
|
' Posizione porta utensile (parametro non obbligatorio)
|
||||||
|
Private m_sTCPos As String = ""
|
||||||
|
Private m_cSawColor As SolidColorBrush
|
||||||
|
Private m_bMachiningTCPosVisibility As Visibility = Visibility.Hidden
|
||||||
|
|
||||||
Private m_IsSelected As Boolean
|
Private m_IsSelected As Boolean
|
||||||
|
|
||||||
@@ -2690,6 +2845,31 @@ Public Class SplitPageUC
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'!!!!!!!!!!!!!!!!!!!!
|
||||||
|
Public Property TCPos As String
|
||||||
|
Get
|
||||||
|
Return m_sTCPos
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
If value <> m_sTCPos Then
|
||||||
|
m_sTCPos = value
|
||||||
|
NotifyPropertyChanged("TCPos")
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'!!!!!!!!!!!!!!!!!!!!
|
||||||
|
Public Property SawColor As SolidColorBrush
|
||||||
|
Get
|
||||||
|
Return m_cSawColor
|
||||||
|
End Get
|
||||||
|
Set(value As SolidColorBrush)
|
||||||
|
m_cSawColor = value
|
||||||
|
NotifyPropertyChanged("SawColor")
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Public Property bIsActive As Boolean
|
Public Property bIsActive As Boolean
|
||||||
Get
|
Get
|
||||||
Return m_bIsActive
|
Return m_bIsActive
|
||||||
@@ -2720,11 +2900,34 @@ Public Class SplitPageUC
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Property MachiningTCPosVisibility As Visibility
|
||||||
|
Get
|
||||||
|
Return m_bMachiningTCPosVisibility
|
||||||
|
End Get
|
||||||
|
Set(value As Visibility)
|
||||||
|
If value <> m_bMachiningTCPosVisibility Then
|
||||||
|
m_bMachiningTCPosVisibility = value
|
||||||
|
NotifyPropertyChanged("MachiningTCPosVisibility")
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer)
|
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer)
|
||||||
Me.m_sName = Name
|
Me.m_sName = Name
|
||||||
Me.m_nInd = Ind
|
Me.m_nInd = Ind
|
||||||
Me.m_bIsActive = bIsActive
|
Me.m_bIsActive = bIsActive
|
||||||
Me.m_nType = nType
|
Me.m_nType = nType
|
||||||
|
Me.m_bMachiningTCPosVisibility = Visibility.Hidden
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String, cSawColor As SolidColorBrush)
|
||||||
|
Me.m_sName = Name
|
||||||
|
Me.m_nInd = Ind
|
||||||
|
Me.m_bIsActive = bIsActive
|
||||||
|
Me.m_nType = nType
|
||||||
|
Me.m_sTCPos = sTCPos
|
||||||
|
Me.m_cSawColor = cSawColor
|
||||||
|
Me.m_bMachiningTCPosVisibility = Visibility.Visible
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub NotifyPropertyChanged(propName As String)
|
Public Sub NotifyPropertyChanged(propName As String)
|
||||||
|
|||||||
@@ -324,6 +324,8 @@ Module ConstGen
|
|||||||
Public Const INFO_START As String = "Start"
|
Public Const INFO_START As String = "Start"
|
||||||
' Nome dei tagli diretti inseriti in fase di Splitting
|
' Nome dei tagli diretti inseriti in fase di Splitting
|
||||||
Public Const SPLIT_CUT As String = "SplitCut"
|
Public Const SPLIT_CUT As String = "SplitCut"
|
||||||
|
' Forzo specifica lavorazione
|
||||||
|
Public Const DEF_MACHINING As String = "Def_Machining"
|
||||||
|
|
||||||
' Nome di pezzo che è una cornice
|
' Nome di pezzo che è una cornice
|
||||||
Public Const NAME_FRAME As String = "Frame"
|
Public Const NAME_FRAME As String = "Frame"
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
|
|
||||||
Public Const S_MACH_MACH As String = "Mach"
|
Public Const S_MACH_MACH As String = "Mach"
|
||||||
Public Const K_CURRSAW As String = "CurrSaw"
|
Public Const K_CURRSAW As String = "CurrSaw"
|
||||||
|
Public Const K_CURRSAWTILTED As String = "CurrSawTilted"
|
||||||
Public Const K_CURRDRILL As String = "CurrDrill"
|
Public Const K_CURRDRILL As String = "CurrDrill"
|
||||||
Public Const K_CURRMILL As String = "CurrMill"
|
Public Const K_CURRMILL As String = "CurrMill"
|
||||||
Public Const K_CURRMILLNOTIP As String = "CurrMillNoTip"
|
Public Const K_CURRMILLNOTIP As String = "CurrMillNoTip"
|
||||||
@@ -320,6 +321,8 @@
|
|||||||
Public Const K_CURRDRIPDRILL As String = "CurrDripDrill"
|
Public Const K_CURRDRIPDRILL As String = "CurrDripDrill"
|
||||||
Public Const K_CURRWATERJET As String = "CurrWaterJet"
|
Public Const K_CURRWATERJET As String = "CurrWaterJet"
|
||||||
Public Const K_CURRSAWING As String = "CurrSawing"
|
Public Const K_CURRSAWING As String = "CurrSawing"
|
||||||
|
Public Const K_CURRSAWINGTILTED As String = "CurrSawingTilted"
|
||||||
|
Public Const K_APPLYSAWINGTILTED As String = "ApplySawingTilted"
|
||||||
Public Const K_CURRDRILLING As String = "CurrDrilling"
|
Public Const K_CURRDRILLING As String = "CurrDrilling"
|
||||||
Public Const K_CURRMILLING As String = "CurrMilling"
|
Public Const K_CURRMILLING As String = "CurrMilling"
|
||||||
Public Const K_CURRPOCKETING As String = "CurrPocketing"
|
Public Const K_CURRPOCKETING As String = "CurrPocketing"
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ Public Class ControlsDirectCutUC
|
|||||||
FlatteningCut
|
FlatteningCut
|
||||||
Polishing
|
Polishing
|
||||||
CopyTemplate
|
CopyTemplate
|
||||||
SawTest
|
|
||||||
SingleCutAuto
|
SingleCutAuto
|
||||||
SingleDrill
|
SingleDrill
|
||||||
Squaring
|
Squaring
|
||||||
|
|||||||
@@ -1074,8 +1074,9 @@ Public Class ImportPageUC
|
|||||||
' Passo al pezzo successivo
|
' Passo al pezzo successivo
|
||||||
nId = EgtGetNextPart(nId)
|
nId = EgtGetNextPart(nId)
|
||||||
End While
|
End While
|
||||||
Dim x As Double = GlobBBox.DimX
|
Dim DimX As Double = GlobBBox.DimX
|
||||||
Dim Y As Double = GlobBBox.DimY
|
Dim DimY As Double = GlobBBox.DimY
|
||||||
|
Dim BBoxMaxPt As Point3d = GlobBBox.Max
|
||||||
|
|
||||||
' Ciclo sui pezzi inseriti
|
' Ciclo sui pezzi inseriti
|
||||||
nId = nFirstId
|
nId = nFirstId
|
||||||
@@ -1114,7 +1115,7 @@ Public Class ImportPageUC
|
|||||||
' Inserisco in parcheggio
|
' Inserisco in parcheggio
|
||||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||||
' Mantengo la posizione relativa tra i pezzi
|
' Mantengo la posizione relativa tra i pezzi
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, x, Y)
|
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, DimX, DimY, BBoxMaxPt)
|
||||||
Else
|
Else
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
|
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -226,6 +226,10 @@ Module SideAngle
|
|||||||
EgtSetInfo(EntId, INFO_SIDE_ANGLE, dAng)
|
EgtSetInfo(EntId, INFO_SIDE_ANGLE, dAng)
|
||||||
EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng)
|
EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng)
|
||||||
EgtSetInfo(EntId, INFO_HEEL, dHeel)
|
EgtSetInfo(EntId, INFO_HEEL, dHeel)
|
||||||
|
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||||
|
If Not String.IsNullOrEmpty(sSawingTilted) Then
|
||||||
|
EgtSetInfo(EntId, DEF_MACHINING, sSawingTilted)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1303,10 +1303,15 @@ Public Class SideAngleUC
|
|||||||
If dSideAngle <> 0 Then
|
If dSideAngle <> 0 Then
|
||||||
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
|
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
|
||||||
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
||||||
' Cancello inclinazione nell'apposito campo info
|
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||||
|
If Not String.IsNullOrEmpty(sSawingTilted) Then
|
||||||
|
EgtSetInfo(CurrEntity.nGeomId, DEF_MACHINING, sSawingTilted)
|
||||||
|
End If
|
||||||
|
' Cancello inclinazione nell'apposito campo info
|
||||||
Else
|
Else
|
||||||
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
|
||||||
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
|
||||||
|
EgtRemoveInfo(CurrEntity.nGeomId, DEF_MACHINING)
|
||||||
End If
|
End If
|
||||||
' Aggiorno lista entità con nuova inclinazione
|
' Aggiorno lista entità con nuova inclinazione
|
||||||
CurrEntity.dSideAngle = dSideAngle
|
CurrEntity.dSideAngle = dSideAngle
|
||||||
|
|||||||
+13
-14
@@ -92,21 +92,20 @@
|
|||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>-->
|
</Button>-->
|
||||||
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
|
||||||
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
|
||||||
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
|
||||||
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
|
||||||
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
|
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
|
||||||
</UniformGrid>
|
|
||||||
</UniformGrid>
|
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<Grid>
|
||||||
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
<ToggleButton Name="SelRawSideBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
|
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
</UniformGrid>
|
||||||
|
</Grid>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
|
|||||||
+90
-256
@@ -23,10 +23,6 @@ Public Class FrameCutPageUC
|
|||||||
' Importazione guida in corso
|
' Importazione guida in corso
|
||||||
Private m_bGuide As Boolean = False
|
Private m_bGuide As Boolean = False
|
||||||
|
|
||||||
' Linea selezionata dal contorno del grezzo
|
|
||||||
Private m_LineDir As Integer = -1
|
|
||||||
Private m_ptMidLineDir As New Point3d
|
|
||||||
|
|
||||||
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Creazione delle Page UserControl
|
' Creazione delle Page UserControl
|
||||||
m_ProjectMgr = New ProjectMgrUC
|
m_ProjectMgr = New ProjectMgrUC
|
||||||
@@ -65,10 +61,9 @@ Public Class FrameCutPageUC
|
|||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
||||||
If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CURVED_FRAME) Then
|
m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.CURVED_FRAME) Then
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida
|
||||||
m_AlongAx.Add("Raw side")
|
|
||||||
End If
|
End If
|
||||||
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
|
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
|
||||||
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
|
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
|
||||||
@@ -80,7 +75,6 @@ Public Class FrameCutPageUC
|
|||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
||||||
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
||||||
SelRawSideBtn.Content = "Sel raw side"
|
|
||||||
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
|
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
|
||||||
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
|
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
|
||||||
Dim sItems As String() = sChBxToolTip.Split("£")
|
Dim sItems As String() = sChBxToolTip.Split("£")
|
||||||
@@ -144,26 +138,25 @@ Public Class FrameCutPageUC
|
|||||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||||
AlongAxCmBx.IsEnabled = False
|
AlongAxCmBx.IsEnabled = False
|
||||||
' Se cornice arco o curva, disabilito scelta nuova sezione
|
' Se cornice arco o curva, disabilito scelta nuova sezione
|
||||||
SelSectionBtn.IsEnabled = (m_CurrAx = 0 Or m_CurrAx = 1)
|
SelSectionBtn.IsEnabled = ( m_CurrAx = 0 Or m_CurrAx = 1)
|
||||||
' Se cornice curva, verifico se disabilitare scelta guida
|
' Se cornice curva, verifico se disabilitare scelta guida
|
||||||
Dim bIsEnable As Boolean = (EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL)
|
If m_CurrAx = 3 Then
|
||||||
If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = bIsEnable
|
SelGuideBtn.IsEnabled = ( EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL)
|
||||||
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = bIsEnable
|
End If
|
||||||
' Se cornice su arco ne leggo i dati
|
' Se cornice su arco ne leggo i dati
|
||||||
If m_CurrAx = 2 Then
|
If m_CurrAx = 2 Then
|
||||||
Dim dExtRad As Double
|
Dim dExtRad As Double
|
||||||
If EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString(dExtRad, 3)
|
if EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString( dExtRad, 3)
|
||||||
Dim dAngCenDeg As Double
|
Dim dAngCenDeg As Double
|
||||||
If EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString(dAngCenDeg, 3)
|
if EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString( dAngCenDeg, 3)
|
||||||
End If
|
End If
|
||||||
' Altrimenti
|
' Altrimenti
|
||||||
Else
|
Else
|
||||||
' Abilito cambio direzione e scelta sezione
|
' Abilito cambio direzione e scelta sezione
|
||||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||||
AlongAxCmBx.IsEnabled = True
|
AlongAxCmBx.IsEnabled = True
|
||||||
SelSectionBtn.IsEnabled = True
|
SelSectionBtn.IsEnabled = True
|
||||||
If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = True
|
SelGuideBtn.IsEnabled = True
|
||||||
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = True
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -175,7 +168,6 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
|
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
|
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
|
||||||
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
Case 2 'Arco
|
Case 2 'Arco
|
||||||
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -183,7 +175,6 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Visible
|
ArcGrid.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
||||||
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
||||||
Case 3 'Guida
|
Case 3 'Guida
|
||||||
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -192,16 +183,6 @@ Public Class FrameCutPageUC
|
|||||||
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
||||||
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
|
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
|
||||||
Case 4
|
|
||||||
SelSectionBtn.Visibility = Windows.Visibility.Visible
|
|
||||||
SelGuideBtn.Visibility = Windows.Visibility.Collapsed
|
|
||||||
ArcGrid.Visibility = Windows.Visibility.Collapsed
|
|
||||||
OffsYyTxBl.Visibility = Windows.Visibility.Visible
|
|
||||||
OffsYyTxBx.Visibility = Windows.Visibility.Visible
|
|
||||||
SelRawSideBtn.Visibility = Windows.Visibility.Visible
|
|
||||||
SelRawSideBtn.IsEnabled = False
|
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
@@ -228,58 +209,11 @@ Public Class FrameCutPageUC
|
|||||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Verifico se selezionato indicativo di pezzo
|
' Verifico se selezionato indicativo di pezzo
|
||||||
Dim nSel As Integer = GDB_ID.NULL
|
EgtSetObjFilterForSelWin(False, False, True, False, False)
|
||||||
Dim nId As Integer = GDB_ID.NULL
|
Dim nSel As Integer
|
||||||
|
|
||||||
If SelRawSideBtn.IsChecked Then
|
|
||||||
' Verifico se selezionato indicativo di pezzo
|
|
||||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
|
||||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
|
||||||
nId = EgtGetFirstObjInSelWin()
|
|
||||||
Dim ptPrev As Point3d
|
|
||||||
' Verifico cosa selezionato
|
|
||||||
Dim nSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
|
|
||||||
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
|
||||||
' Acquisisco punto da disegno
|
|
||||||
EgtUnProjectPoint(e.Location, ptPrev)
|
|
||||||
Dim sName As String = String.Empty
|
|
||||||
While nId <> GDB_ID.NULL
|
|
||||||
sName = String.Empty
|
|
||||||
EgtGetName(nId, sName)
|
|
||||||
If sName = NAME_KERF Then
|
|
||||||
' la sottoentità del Kerf selezionato
|
|
||||||
EgtUnProjectPoint(e.Location, ptPrev)
|
|
||||||
Dim dDist, dU As Double
|
|
||||||
EgtPointCurveDist(ptPrev.Loc(nKerfId), nKerfId, nKerfId, dDist, dU)
|
|
||||||
Dim ptStart As New Point3d
|
|
||||||
EgtAtParamPoint(nKerfId, CInt(Math.Floor(dU)), GDB_ID.ROOT, ptStart)
|
|
||||||
Dim ptEnd As New Point3d
|
|
||||||
EgtAtParamPoint(nKerfId, CInt(Math.Ceiling(dU)), GDB_ID.ROOT, ptEnd)
|
|
||||||
Dim nParentLineGuide As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
|
||||||
' creo la linea a partire dall'entita sopra
|
|
||||||
m_LineDir = EgtCreateLine(EgtCreateGroup(nParentLineGuide), ptStart, ptEnd, GDB_RT.GLOB)
|
|
||||||
m_ptMidLineDir = New Point3d(ptStart)
|
|
||||||
EgtMidPoint(m_LineDir, GDB_RT.GLOB, m_ptMidLineDir)
|
|
||||||
EgtExtendCurveStartByLen(m_LineDir, 3500)
|
|
||||||
EgtSetMark(m_LineDir)
|
|
||||||
EgtDraw()
|
|
||||||
m_bGuide = True
|
|
||||||
If MyCreateFrame(nParentLineGuide) Then SelRawSideBtn.IsChecked = False
|
|
||||||
' Privilegio il kerf, pertanto esco
|
|
||||||
Exit While
|
|
||||||
End If
|
|
||||||
nId = EgtGetNextObjInSelWin()
|
|
||||||
End While
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Verifico se selezionato indicativo di pezzo
|
|
||||||
EgtSetObjFilterForSelWin(False, True, True, False, False)
|
|
||||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||||
nId = EgtGetFirstObjInSelWin()
|
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
' Recupero l'identificativo del layer e del pezzo cui appartiene
|
' Recupero l'identificativo del layer e del pezzo cui appartiene
|
||||||
Dim nLayId As Integer = EgtGetParent(nId)
|
Dim nLayId As Integer = EgtGetParent(nId)
|
||||||
@@ -440,14 +374,14 @@ Public Class FrameCutPageUC
|
|||||||
' Cerco pezzo in grezzo
|
' Cerco pezzo in grezzo
|
||||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo
|
' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo
|
||||||
If m_CurrAx = 3 And EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL Then
|
If m_CurrAx = 3 And EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL
|
||||||
If EgtRemovePartFromRawPart(nPartId) Then
|
If EgtRemovePartFromRawPart(nPartId) Then
|
||||||
' Rimuovo le lavorazioni
|
' Rimuovo le lavorazioni
|
||||||
EraseMachinings(nPartId)
|
EraseMachinings(nPartId)
|
||||||
' Cancello
|
' Cancello
|
||||||
EgtErase(nPartId)
|
EgtErase(nPartId)
|
||||||
End If
|
End If
|
||||||
' Altrimenti esco subito
|
' Altrimenti esco subito
|
||||||
Else
|
Else
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -544,14 +478,14 @@ Public Class FrameCutPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||||
If Not MyCreateFrame(nPartId) Then
|
If Not MyCreateFrame( nPartId) Then
|
||||||
EgtErase(nPartId)
|
EgtErase( nPartId)
|
||||||
If m_CurrAx <> 2 Then
|
If m_CurrAx <> 2 Then
|
||||||
' Errore : creazione cornice non riuscita
|
' Errore : creazione cornice non riuscita
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 20))
|
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 20))
|
||||||
Else
|
Else
|
||||||
' Errore : raggio più piccolo della larghezza della sezione
|
' Errore : raggio più piccolo della larghezza della sezione
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 19))
|
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 19))
|
||||||
End If
|
End If
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -567,12 +501,12 @@ Public Class FrameCutPageUC
|
|||||||
' Sistemo la sezione o la guida della cornice
|
' Sistemo la sezione o la guida della cornice
|
||||||
If Not m_bGuide Then
|
If Not m_bGuide Then
|
||||||
If Not AdjustSection(nPartId) Then
|
If Not AdjustSection(nPartId) Then
|
||||||
EgtOutLog("Error in CreateFrame : problems with Section")
|
EgtOutLog( "Error in CreateFrame : problems with Section")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Not AdjustGuide(nPartId) Then
|
If Not AdjustGuide(nPartId) Then
|
||||||
EgtOutLog("Error in CreateFrame : problems with Guide")
|
EgtOutLog( "Error in CreateFrame : problems with Guide")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -584,49 +518,48 @@ Public Class FrameCutPageUC
|
|||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
|
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase(nPartId)
|
EgtErase( nPartId)
|
||||||
EgtOutLog("Error in CreateFrame : Surface not constructible")
|
EgtOutLog( "Error in CreateFrame : Surface not constructible")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' se cornice su arco
|
' se cornice su arco
|
||||||
ElseIf m_CurrAx = 2 Then
|
ElseIf m_CurrAx = 2 Then
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Porto l'inizio della curva a X0 locale
|
' Porto l'inizio della curva a X0 locale
|
||||||
ChangeCurveStartToX0(nSectId)
|
ChangeCurveStartToX0( nSectId)
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
|
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase(nPartId)
|
EgtErase( nPartId)
|
||||||
EgtOutLog("Error in CreateFrame : radius too small for the section")
|
EgtOutLog( "Error in CreateFrame : radius too small for the section")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' altrimenti cornice su guida
|
' altrimenti cornice su guida
|
||||||
Else
|
Else
|
||||||
If Not m_bGuide Then
|
If not m_bGuide Then
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
If nSectId = GDB_ID.NULL Then Return False
|
If nSectId = GDB_ID.NULL Then Return False
|
||||||
' Porto l'inizio della curva a X0 locale
|
' Porto l'inizio della curva a X0 locale
|
||||||
ChangeCurveStartToX0(nSectId)
|
ChangeCurveStartToX0( nSectId)
|
||||||
Else
|
Else
|
||||||
' Porto la guida nel pezzo con la sezione
|
' Porto la guida nel pezzo con la sezione
|
||||||
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart( m_nRawId)
|
||||||
|
|
||||||
If nTruePartId = GDB_ID.NULL Then
|
If nTruePartId = GDB_ID.NULL Then
|
||||||
EgtOutLog("Error in CreateFrame : Section not found")
|
EgtOutLog( "Error in CreateFrame : Section not found")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Parcheggio il pezzo trovato
|
' Parcheggio il pezzo trovato
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nTruePartId)
|
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart( nTruePartId)
|
||||||
' Recupero layer e curva della sezione
|
' Recupero layer e curva della sezione
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
||||||
@@ -636,17 +569,17 @@ Public Class FrameCutPageUC
|
|||||||
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
||||||
If nGuideId = GDB_ID.NULL Then Return False
|
If nGuideId = GDB_ID.NULL Then Return False
|
||||||
' Sposto la guida in questo pezzo
|
' Sposto la guida in questo pezzo
|
||||||
EgtRelocate(nGuideLayId, nTruePartId)
|
EgtRelocate( nGuideLayId, nTruePartId)
|
||||||
' Cancello il pezzo
|
' Cancello il pezzo
|
||||||
EgtErase(nPartId)
|
EgtErase( nPartId)
|
||||||
' Creazione cornice
|
' Creazione cornice
|
||||||
nPartId = nTruePartId
|
nPartId = nTruePartId
|
||||||
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
||||||
m_bGuide = False
|
m_bGuide = False
|
||||||
' Se non creata superficie, reset di tutto e segnalazione errore
|
' Se non creata superficie, reset di tutto e segnalazione errore
|
||||||
If nSurfId = GDB_ID.NULL Then
|
If nSurfId = GDB_ID.NULL Then
|
||||||
EgtErase(nPartId)
|
EgtErase( nPartId)
|
||||||
EgtOutLog("Error in CreateFrame : Surface not constructible")
|
EgtOutLog( "Error in CreateFrame : Surface not constructible")
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -690,17 +623,17 @@ Public Class FrameCutPageUC
|
|||||||
Dim nSurfId As Integer = GDB_ID.NULL
|
Dim nSurfId As Integer = GDB_ID.NULL
|
||||||
' Se cornice rettilinea
|
' Se cornice rettilinea
|
||||||
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
||||||
nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
|
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId)
|
||||||
' se cornice su arco
|
' se cornice su arco
|
||||||
ElseIf m_CurrAx = 2 Then
|
ElseIf m_CurrAx = 2 Then
|
||||||
nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
|
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId)
|
||||||
' altrimenti cornice su curva
|
' altrimenti cornice su curva
|
||||||
Else
|
Else
|
||||||
' Recupero layer e curva della guida
|
' Recupero layer e curva della guida
|
||||||
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
|
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
|
||||||
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
||||||
If nGuideId = GDB_ID.NULL Then Return False
|
If nGuideId = GDB_ID.NULL Then Return False
|
||||||
nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
|
||||||
End If
|
End If
|
||||||
' Assegno nome e direzione a pezzo
|
' Assegno nome e direzione a pezzo
|
||||||
EgtSetName(nPartId, NAME_FRAME)
|
EgtSetName(nPartId, NAME_FRAME)
|
||||||
@@ -766,7 +699,7 @@ Public Class FrameCutPageUC
|
|||||||
ptStart = ptTmp
|
ptStart = ptTmp
|
||||||
End If
|
End If
|
||||||
' Se cornice rettilinea
|
' Se cornice rettilinea
|
||||||
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
If m_CurrAx = 0 Or m_CurrAx = 1 Then
|
||||||
' Se linea orizzontale, aggiungo tratti verticali
|
' Se linea orizzontale, aggiungo tratti verticali
|
||||||
If b3Box.DimY() < EPS_SMALL Then
|
If b3Box.DimY() < EPS_SMALL Then
|
||||||
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
|
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
|
||||||
@@ -807,7 +740,7 @@ Public Class FrameCutPageUC
|
|||||||
EgtAddCurveCompoLine(nCrvId, ptEnd)
|
EgtAddCurveCompoLine(nCrvId, ptEnd)
|
||||||
b3Box.Add(ptEnd)
|
b3Box.Add(ptEnd)
|
||||||
End If
|
End If
|
||||||
' Altrimenti cornice curva
|
' Altrimenti cornice curva
|
||||||
Else
|
Else
|
||||||
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
|
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
|
||||||
If ptStart.y > ptEnd.y Then
|
If ptStart.y > ptEnd.y Then
|
||||||
@@ -834,15 +767,7 @@ Public Class FrameCutPageUC
|
|||||||
EgtSelectLayerObjs(nLayerId)
|
EgtSelectLayerObjs(nLayerId)
|
||||||
Dim nCrvIds(0) As Integer
|
Dim nCrvIds(0) As Integer
|
||||||
nCrvIds(0) = GDB_ID.SEL
|
nCrvIds(0) = GDB_ID.SEL
|
||||||
' ---- INIZIO ---- NUOVA GESTIONE ---- Verifico che il segmento passato è una linea ricavata dal contorno del grezzo
|
Dim nCrvId As Integer = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True)
|
||||||
Dim nCrvId As Integer = GDB_ID.NULL
|
|
||||||
If m_CurrAx = 4 And m_LineDir <> GDB_ID.NULL Then
|
|
||||||
nCrvId = m_LineDir
|
|
||||||
Else
|
|
||||||
nCrvId = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True)
|
|
||||||
End If
|
|
||||||
' ---- FINE ---- NUOVA GESTIONE ----
|
|
||||||
' Se non è stata creata esco
|
|
||||||
If nCrvId = GDB_ID.NULL Then Return False
|
If nCrvId = GDB_ID.NULL Then Return False
|
||||||
' Elimino eventuali curve oltre la prima
|
' Elimino eventuali curve oltre la prima
|
||||||
Dim nId As Integer = EgtGetNext(nCrvId)
|
Dim nId As Integer = EgtGetNext(nCrvId)
|
||||||
@@ -867,17 +792,17 @@ Public Class FrameCutPageUC
|
|||||||
' Elimino vecchio layer
|
' Elimino vecchio layer
|
||||||
EgtErase(nLayerId)
|
EgtErase(nLayerId)
|
||||||
' Impongo rotazione guida CCW
|
' Impongo rotazione guida CCW
|
||||||
Dim bClosed As Boolean = EgtCurveIsClosed(nCrvId)
|
Dim bClosed As Boolean = EgtCurveIsClosed( nCrvId)
|
||||||
If Not bClosed Then EgtCloseCurveCompo(nCrvId)
|
If Not bClosed Then EgtCloseCurveCompo( nCrvId)
|
||||||
Dim dArea As Double = 0
|
Dim dArea As Double = 0
|
||||||
EgtCurveAreaXY(nCrvId, dArea)
|
EgtCurveAreaXY( nCrvId, dArea)
|
||||||
If Not bClosed Then EgtRemoveCurveCompoCurve(nCrvId)
|
If Not bClosed Then EgtRemoveCurveCompoCurve( nCrvId)
|
||||||
If dArea < -1 Then EgtInvertCurve(nCrvId)
|
If dArea < -1 Then EgtInvertCurve( nCrvId)
|
||||||
' Se curva chiusa, impongo inizio a metà del lato a X max
|
' Se curva chiusa, impongo inizio a metà del lato a X max
|
||||||
If bClosed Then
|
If bClosed Then
|
||||||
Dim b3Guide As New BBox3d
|
Dim b3Guide As New BBox3d
|
||||||
EgtGetBBox(nCrvId, GDB_BB.STANDARD, b3Guide)
|
EgtGetBBox( nCrvId, GDB_BB.STANDARD, b3Guide)
|
||||||
Dim ptStart As New Point3d(b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
|
Dim ptStart As New Point3d( b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
|
||||||
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
|
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
@@ -903,7 +828,7 @@ Public Class FrameCutPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateLineFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateLineFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione
|
' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione
|
||||||
Dim vtExtr As Vector3d
|
Dim vtExtr As Vector3d
|
||||||
If m_CurrAx = 0 Then
|
If m_CurrAx = 0 Then
|
||||||
@@ -944,7 +869,7 @@ Public Class FrameCutPageUC
|
|||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateArcFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateArcFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Recupero ingombro locale della sezione
|
' Recupero ingombro locale della sezione
|
||||||
Dim b3Sect As New BBox3d
|
Dim b3Sect As New BBox3d
|
||||||
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
||||||
@@ -987,22 +912,22 @@ Public Class FrameCutPageUC
|
|||||||
' Creo la superficie swept
|
' Creo la superficie swept
|
||||||
Dim dSectRotDeg As Double = 90 + dAngIniDeg
|
Dim dSectRotDeg As Double = 90 + dAngIniDeg
|
||||||
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC)
|
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC)
|
||||||
Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateCurveFrame(nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer
|
Private Function CreateCurveFrame( nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer
|
||||||
' Recupero flag lavorazione da lato opposto
|
' Recupero flag lavorazione da lato opposto
|
||||||
Dim bOthSide As Boolean = False
|
Dim bOthSide As Boolean = False
|
||||||
EgtGetInfo(nPartId, INFO_FRAME_OTHSIDE, bOthSide)
|
EgtGetInfo( nPartId, INFO_FRAME_OTHSIDE, bOthSide)
|
||||||
' Recupero dati inizio guida
|
' Recupero dati inizio guida
|
||||||
Dim ptStart As Point3d
|
Dim ptStart As Point3d
|
||||||
EgtStartPoint(nGuideId, nPartId, ptStart)
|
EgtStartPoint(nGuideId, nPartId, ptStart)
|
||||||
Dim vtStart As Vector3d
|
Dim vtStart As Vector3d
|
||||||
EgtStartVector(nGuideId, nPartId, vtStart)
|
EgtStartVector(nGuideId, nPartId, vtStart)
|
||||||
' Creo riferimento per sezione
|
' Creo riferimento per sezione
|
||||||
Dim frSect As New Frame3d
|
dim frSect As New Frame3d
|
||||||
frSect.Setup(ptStart, -vtStart)
|
frSect.Setup( ptStart, -vtStart)
|
||||||
' Porto la sezione in questo riferimento
|
' Porto la sezione in questo riferimento
|
||||||
EgtChangeGroupFrame(nSectLayId, frSect)
|
EgtChangeGroupFrame(nSectLayId, frSect)
|
||||||
' Recupero ingombro locale della sezione
|
' Recupero ingombro locale della sezione
|
||||||
@@ -1010,16 +935,16 @@ Public Class FrameCutPageUC
|
|||||||
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
|
||||||
' Recupero ingombro locale della guida
|
' Recupero ingombro locale della guida
|
||||||
Dim b3Guide As New BBox3d
|
Dim b3Guide As New BBox3d
|
||||||
EgtGetBBox(nGuideId, GDB_BB.STANDARD, b3Guide)
|
EgtGetBBox( nGuideId, GDB_BB.STANDARD, b3Guide)
|
||||||
b3Guide.ToLoc(frSect)
|
b3Guide.ToLoc( frSect)
|
||||||
' Muovo sezione dalla parte interna della curva
|
' Muovo sezione dalla parte interna della curva
|
||||||
If (Not bOthSide And Math.Abs(b3Guide.Min().x) > Math.Abs(b3Guide.Max().x)) OrElse
|
If ( Not bOthSide And Math.Abs( b3Guide.Min().x) > Math.Abs( b3Guide.Max().x)) OrElse
|
||||||
(bOthSide And Math.Abs(b3Guide.Min().x) <= Math.Abs(b3Guide.Max().x)) Then
|
( bOthSide And Math.Abs( b3Guide.Min().x) <= Math.Abs( b3Guide.Max().x)) Then
|
||||||
Dim vtMove As New Vector3d(-b3Sect.Max().x, -b3Sect.Min().y, 0)
|
Dim vtMove As New Vector3d( - b3Sect.Max().x, -b3Sect.Min().y, 0)
|
||||||
EgtMove(nSectId, vtMove)
|
EgtMove( nSectId, vtMove)
|
||||||
Else
|
Else
|
||||||
Dim vtMove As New Vector3d(-b3Sect.Min().x, -b3Sect.Min().y, 0)
|
Dim vtMove As New Vector3d( - b3Sect.Min().x, -b3Sect.Min().y, 0)
|
||||||
EgtMove(nSectId, vtMove)
|
EgtMove( nSectId, vtMove)
|
||||||
End If
|
End If
|
||||||
' Recupero o creo layer per la superficie
|
' Recupero o creo layer per la superficie
|
||||||
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
|
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
|
||||||
@@ -1031,12 +956,25 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
EgtSetColor(nSurfLayId, COL_FRAME())
|
EgtSetColor(nSurfLayId, COL_FRAME())
|
||||||
' Creo la superficie swept
|
' Creo la superficie swept
|
||||||
Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM)
|
||||||
Return nSurfId
|
Return nSurfId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
|
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
|
||||||
' Determino distanza (interasse cornici) da spessore lama oppure offset
|
' Determino ingombro del pezzo
|
||||||
|
Dim PartBox As New BBox3d
|
||||||
|
EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox)
|
||||||
|
' Determino ingombro di eventuali pezzi già presenti
|
||||||
|
Dim OtherBox As New BBox3d
|
||||||
|
Dim nId2 As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||||
|
While nId2 <> GDB_ID.NULL
|
||||||
|
Dim TmpBox As New BBox3d
|
||||||
|
If EgtGetBBoxGlob(nId2, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, TmpBox) Then
|
||||||
|
OtherBox.Add(TmpBox)
|
||||||
|
End If
|
||||||
|
nId2 = EgtGetNextPartInRawPart(nId2)
|
||||||
|
End While
|
||||||
|
' Determino distanza da spessore lama
|
||||||
Dim dMinDist As Double = 0
|
Dim dMinDist As Double = 0
|
||||||
Dim dSawThick As Double = 0
|
Dim dSawThick As Double = 0
|
||||||
Dim dOffsXIntery As Double = 0
|
Dim dOffsXIntery As Double = 0
|
||||||
@@ -1053,36 +991,16 @@ Public Class FrameCutPageUC
|
|||||||
Else
|
Else
|
||||||
dMinDist = dSawThick + 5 * EPS_SMALL
|
dMinDist = dSawThick + 5 * EPS_SMALL
|
||||||
End If
|
End If
|
||||||
|
'If dOffsXIntery <= dSawThick Then
|
||||||
|
' dMinDist = dSawThick + 5 * EPS_SMALL
|
||||||
|
' EgtOutLog("WARNINGS: Saw tickness is more width then interaxis")
|
||||||
|
'Else
|
||||||
|
' dMinDist = dOffsXIntery + 5 * EPS_SMALL
|
||||||
|
'End If
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Not found current saw for frames mindist")
|
EgtOutLog("Not found current saw for frames mindist")
|
||||||
dMinDist = dOffsXIntery
|
dMinDist = dOffsXIntery
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If m_CurrAx = 4 Then
|
|
||||||
Dim nCountFrame As Integer = 0
|
|
||||||
Dim nIdOtherFrame As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
|
||||||
While nIdOtherFrame <> GDB_ID.NULL
|
|
||||||
nCountFrame += 1
|
|
||||||
nIdOtherFrame = EgtGetNextPartInRawPart(nIdOtherFrame)
|
|
||||||
End While
|
|
||||||
EgtAddPartToRawPart(nPartId, New Point3d(0, 0, 0), EgtGetFirstRawPart())
|
|
||||||
Return AdjustPartInGenericRawPart(nCountFrame, dMinDist)
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Determino ingombro del pezzo
|
|
||||||
Dim PartBox As New BBox3d
|
|
||||||
EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox)
|
|
||||||
' Determino ingombro di eventuali pezzi già presenti
|
|
||||||
Dim OtherBox As New BBox3d
|
|
||||||
Dim nId2 As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
|
||||||
While nId2 <> GDB_ID.NULL
|
|
||||||
Dim TmpBox As New BBox3d
|
|
||||||
If EgtGetBBoxGlob(nId2, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, TmpBox) Then
|
|
||||||
OtherBox.Add(TmpBox)
|
|
||||||
End If
|
|
||||||
nId2 = EgtGetNextPartInRawPart(nId2)
|
|
||||||
End While
|
|
||||||
|
|
||||||
' Inserisco il pezzo nel grezzo
|
' Inserisco il pezzo nel grezzo
|
||||||
Dim ptIns As Point3d
|
Dim ptIns As Point3d
|
||||||
If OtherBox.IsEmpty() Then
|
If OtherBox.IsEmpty() Then
|
||||||
@@ -1109,95 +1027,11 @@ Public Class FrameCutPageUC
|
|||||||
ptIns.y = m_dKerf
|
ptIns.y = m_dKerf
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim dOffsZ As Double = 0
|
Dim dOffsZ As Double = 0
|
||||||
StringToLen(OffsZTxBx.Text, dOffsZ)
|
StringToLen(OffsZTxBx.Text, dOffsZ)
|
||||||
ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ
|
ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ
|
||||||
ptIns.z = Math.Max(ptIns.z, 0)
|
ptIns.z = Math.Max(ptIns.z, 0)
|
||||||
Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart())
|
Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart())
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function AdjustPartInGenericRawPart(Optional nCountOtherFrame As Integer = 0, Optional dMinDist As Double = 0) As Boolean
|
|
||||||
' --- Eseguo una traslazione per portare il FRAME sul punto iniziale della guida (NON NEL PUNTO MINIMO DEL BOX!) ---
|
|
||||||
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
|
||||||
|
|
||||||
' Recupero layer e curva della guida
|
|
||||||
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_GUIDE)
|
|
||||||
If nGuideLayId = GDB_ID.NULL Then Return True
|
|
||||||
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
|
|
||||||
' Recupero il layer e il contorno della sezione
|
|
||||||
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
|
|
||||||
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
|
|
||||||
|
|
||||||
' Aggiusto la poszione del pezzo: punto medio della guida sul punto medio del lato selezionato
|
|
||||||
Dim ptMid As Point3d
|
|
||||||
EgtMidPoint(nGuideId, GDB_RT.GLOB, ptMid)
|
|
||||||
Dim vtTrasl As Vector3d = m_ptMidLineDir - ptMid
|
|
||||||
vtTrasl.z = 0
|
|
||||||
EgtMove(nTruePartId, vtTrasl)
|
|
||||||
|
|
||||||
' Porto il pezzo dentro al grezzo
|
|
||||||
Dim vtPerp As New Vector3d
|
|
||||||
EgtStartVector(nGuideId, GDB_RT.GLOB, vtPerp)
|
|
||||||
vtPerp.Rotate(Vector3d.Z_AX, 90)
|
|
||||||
' Definisco il frame su cui iniziare a lavorare
|
|
||||||
Dim ptS As New Point3d
|
|
||||||
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptS)
|
|
||||||
Dim vtDir As New Vector3d
|
|
||||||
EgtStartVector(nGuideId, GDB_RT.GLOB, vtDir)
|
|
||||||
Dim frSect As New Frame3d(ptS, vtDir, vtPerp, Vector3d.Z_AX)
|
|
||||||
' Costruisco il BBox nel riferimento indicato
|
|
||||||
Dim BBoxRef As New BBox3d
|
|
||||||
EgtGetBBoxRef(nTruePartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRef)
|
|
||||||
' Nella grafica i nomi dei parametri di offset devono diventare "Perp" e "Orto" oppure un solo parametro "Orto"?
|
|
||||||
Dim dOffsXy As Double = 0
|
|
||||||
StringToLen(OffsXyTxBx.Text, dOffsXy)
|
|
||||||
dOffsXy = (dOffsXy + BBoxRef.DimY) + (dMinDist + BBoxRef.DimY) * nCountOtherFrame
|
|
||||||
EgtMove(nTruePartId, vtPerp * dOffsXy)
|
|
||||||
|
|
||||||
' Ritaglio il volume del pezzo per occupare il grezzo
|
|
||||||
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, "Surf")
|
|
||||||
Dim nSurfId As Integer = EgtGetFirstInGroup(nSurfLayId)
|
|
||||||
' Recupero una copia del grezzo
|
|
||||||
Dim nCopyRawId As Integer = EgtCopyGlob(EgtGetFirstNameInGroup(m_nRawId, "RawSolid"), nSurfLayId)
|
|
||||||
EgtSetName(nCopyRawId, "SurfTrimmed")
|
|
||||||
EgtSurfTmIntersect(nCopyRawId, nSurfId)
|
|
||||||
' Assegno colori e trasparenza
|
|
||||||
EgtSetColor(nCopyRawId, COL_FRAME)
|
|
||||||
EgtSetAlpha(nCopyRawId, 100)
|
|
||||||
EgtErase(nSurfId)
|
|
||||||
|
|
||||||
|
|
||||||
' Recupero il box in coordinate locali dell'ingombro del pezzo
|
|
||||||
Dim ptSlast As New Point3d
|
|
||||||
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptSlast)
|
|
||||||
Dim frSectLast As New Frame3d(ptSlast, vtDir, vtPerp, Vector3d.Z_AX)
|
|
||||||
Dim BBoxRefLast As New BBox3d
|
|
||||||
EgtGetBBoxRef(nCopyRawId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRefLast)
|
|
||||||
|
|
||||||
' Ricalcolo la lunghezza della guida
|
|
||||||
Dim dLenGUide As Double = 0
|
|
||||||
EgtCurveLength(nGuideId, dLenGUide)
|
|
||||||
Dim pt1 As New Point3d
|
|
||||||
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt1)
|
|
||||||
EgtTrimExtendCurveByLen(nGuideId, -BBoxRefLast.Min.x, pt1)
|
|
||||||
|
|
||||||
Dim pt2 As New Point3d
|
|
||||||
EgtEndPoint(nGuideId, GDB_RT.GLOB, pt2)
|
|
||||||
EgtTrimExtendCurveByLen(nGuideId, BBoxRefLast.Max.x - dLenGUide, pt2)
|
|
||||||
|
|
||||||
|
|
||||||
' riposizione l'origine della sezione
|
|
||||||
Dim pt3 As New Point3d
|
|
||||||
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt3)
|
|
||||||
EgtMove(nSectId, New Vector3d(pt3 - pt1), GDB_RT.GLOB)
|
|
||||||
|
|
||||||
EgtDraw()
|
|
||||||
|
|
||||||
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\BOB.nge", NGE.BIN)
|
|
||||||
|
|
||||||
Return True
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
+537
-517
File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,7 @@ Public Class AlarmsPageUC
|
|||||||
|
|
||||||
' Imposto i messaggi letti dal file dei messaggi
|
' Imposto i messaggi letti dal file dei messaggi
|
||||||
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
|
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
|
||||||
|
CurrSawTiltedTxBl.Text = EgtMsg(91049) ' Current saw tilted
|
||||||
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
|
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
|
||||||
CurrDrillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 3)
|
CurrDrillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 3)
|
||||||
CurrCupWheelTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 20)
|
CurrCupWheelTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 20)
|
||||||
@@ -120,6 +121,7 @@ Public Class AlarmsPageUC
|
|||||||
CfrPercTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 48) ' Riduzione %
|
CfrPercTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 48) ' Riduzione %
|
||||||
MachiningsGpBx.Header = EgtMsg(MSG_ALARMS2PAGEUC + 1) ' Lavorazioni
|
MachiningsGpBx.Header = EgtMsg(MSG_ALARMS2PAGEUC + 1) ' Lavorazioni
|
||||||
CurrSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 2) ' Taglio lama
|
CurrSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 2) ' Taglio lama
|
||||||
|
CurrSawingTiltedTxBl.Text = EgtMsg(91050) ' Taglio inclinato
|
||||||
CurrDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 3) ' Foratura
|
CurrDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 3) ' Foratura
|
||||||
CurrMillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 4) ' Fresatura
|
CurrMillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 4) ' Fresatura
|
||||||
CurrPocketingTxBl.Text = EgtMsg(91069) ' Svuotatura
|
CurrPocketingTxBl.Text = EgtMsg(91069) ' Svuotatura
|
||||||
@@ -159,7 +161,7 @@ Public Class AlarmsPageUC
|
|||||||
HolesGpBx.Visibility = Windows.Visibility.Hidden
|
HolesGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||||
'Non faccio alcunchè
|
'Non faccio alcunchè
|
||||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
'Da implementare
|
'Da implementare
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
@@ -292,6 +294,59 @@ Public Class AlarmsPageUC
|
|||||||
' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio
|
' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio
|
||||||
SetUpBtn.Visibility = Windows.Visibility.Visible
|
SetUpBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
|
||||||
|
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
|
' Aggiorno la lista delle lame con quelle montate sul portautensile automatico
|
||||||
|
Dim m_SawOnHolderList As New ObservableCollection(Of String)
|
||||||
|
Dim bOnHolder As Boolean = False
|
||||||
|
For Each sNameTool As String In m_SawList
|
||||||
|
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||||
|
' Verifico che sia montata su un portautensile
|
||||||
|
EgtTdbSetCurrTool(sNameTool)
|
||||||
|
Dim sTCPos As String = String.Empty
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||||
|
If Not String.IsNullOrEmpty(sTCPos) Then
|
||||||
|
' Cerco nel porta utensili automaitico
|
||||||
|
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
|
If sNameTool = ToolPosition.sTool Then
|
||||||
|
m_SawOnHolderList.Add(sNameTool)
|
||||||
|
' Se il nome dell'utensile è lo stesso di quello impostato nella combo allora lo setto
|
||||||
|
If sNameTool = m_CurrentMachine.sCurrSaw Then
|
||||||
|
bOnHolder = True
|
||||||
|
End If
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
m_SawList = m_SawOnHolderList
|
||||||
|
CurrSawCmBx.ItemsSource = m_SawList
|
||||||
|
If bOnHolder Then
|
||||||
|
' reimposto la lavorazione di lama e la lama impostate in macchina
|
||||||
|
EgtTdbSetCurrTool(m_CurrentMachine.sCurrSaw)
|
||||||
|
' Seleziono lama corrente
|
||||||
|
CurrSawCmBx.SelectedItem = m_CurrentMachine.sCurrSaw
|
||||||
|
Else
|
||||||
|
m_CurrentMachine.sCurrSawing = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
CurrSawTiltedCmBx.ItemsSource = m_SawList
|
||||||
|
If m_SawList.IndexOf(m_CurrentMachine.sCurrSawTilted) > -1 Then
|
||||||
|
' Seleziono lama corrente
|
||||||
|
CurrSawTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawTilted
|
||||||
|
Else
|
||||||
|
m_CurrentMachine.sCurrSawingTilted = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
' attivo la selezione della lama per il taglio in inlinato
|
||||||
|
CurrSawTiltedTxBl.Visibility = Visibility.Visible
|
||||||
|
CurrSawTiltedCmBx.Visibility = Visibility.Visible
|
||||||
|
|
||||||
|
' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio
|
||||||
|
SetUpBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
' aggiorno le TextBlock con le lavorazioni correnti
|
' aggiorno le TextBlock con le lavorazioni correnti
|
||||||
@@ -441,6 +496,21 @@ Public Class AlarmsPageUC
|
|||||||
CurrSawingTxBl.Visibility = Windows.Visibility.Hidden
|
CurrSawingTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
CurrSawingTxBx.Visibility = Windows.Visibility.Hidden
|
CurrSawingTxBx.Visibility = Windows.Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
|
If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then
|
||||||
|
If Not m_CurrentMachine.bApplySawingTilted Then
|
||||||
|
CurrSawingTiltedTxBx.Foreground = Brushes.Gray
|
||||||
|
CurrSawingTiltedTxBx.TextDecorations = TextDecorations.Strikethrough
|
||||||
|
Else
|
||||||
|
CurrSawingTiltedTxBx.Foreground = Brushes.White
|
||||||
|
CurrSawingTiltedTxBx.TextDecorations = Nothing
|
||||||
|
End If
|
||||||
|
CurrSawingTiltedTxBx.Text = m_CurrentMachine.sCurrSawingTilted
|
||||||
|
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible
|
||||||
|
CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Visible
|
||||||
|
Else
|
||||||
|
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
|
CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Hidden
|
||||||
|
End If
|
||||||
If m_CurrentMachine.sCurrDrilling <> String.Empty Then
|
If m_CurrentMachine.sCurrDrilling <> String.Empty Then
|
||||||
CurrDrillingTxBx.Text = m_CurrentMachine.sCurrDrilling
|
CurrDrillingTxBx.Text = m_CurrentMachine.sCurrDrilling
|
||||||
CurrDrillingTxBl.Visibility = Windows.Visibility.Visible
|
CurrDrillingTxBl.Visibility = Windows.Visibility.Visible
|
||||||
@@ -641,6 +711,42 @@ Public Class AlarmsPageUC
|
|||||||
RefreschMachining()
|
RefreschMachining()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' -- SAW TILTED --
|
||||||
|
Private Sub CurrSawTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawTiltedCmBx.SelectionChanged
|
||||||
|
If IsNothing(CurrSawTiltedCmBx.SelectedItem) Then Return
|
||||||
|
' Assegno
|
||||||
|
m_CurrentMachine.sCurrSawTilted = CurrSawTiltedCmBx.SelectedItem.ToString()
|
||||||
|
' Se nuova lama incompatibile con lavorazione di taglio corrente, resetto quest'ultima
|
||||||
|
Dim sMchTuuid As String = String.Empty
|
||||||
|
Dim sMchTool As String = String.Empty
|
||||||
|
If Not EgtMdbSetCurrMachining(m_CurrentMachine.sCurrSawingTilted) Or
|
||||||
|
Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sMchTuuid) Or
|
||||||
|
Not EgtTdbGetToolFromUUID(sMchTuuid, sMchTool) Or
|
||||||
|
String.Compare(sMchTool, m_CurrentMachine.sCurrSawTilted, True) <> 0 Then
|
||||||
|
m_CurrentMachine.sCurrSawingTilted = String.Empty
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Dim sVal As String = String.Empty
|
||||||
|
' Dim dVal As Double = 0
|
||||||
|
' If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
|
||||||
|
' StringToDouble(sVal, dVal)
|
||||||
|
' m_CurrentMachine.SetFsevLength(dVal)
|
||||||
|
' End If
|
||||||
|
' If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
|
||||||
|
' StringToDouble(sVal, dVal)
|
||||||
|
' m_CurrentMachine.SetFsevPerc(dVal)
|
||||||
|
' End If
|
||||||
|
'
|
||||||
|
' ' Leggo parametri per variazione feed in tagli aggiornati in funzione della lama
|
||||||
|
' CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
|
||||||
|
' CfrPercTxBx.Text = DoubleToString(m_CurrentMachine.dFsevPerc, 0)
|
||||||
|
|
||||||
|
' Aggiorno utensili per lavoro in corso
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||||
|
' aggiorno la lista delle lavorazioni
|
||||||
|
RefreschMachining()
|
||||||
|
End Sub
|
||||||
|
|
||||||
' -- DRILL --
|
' -- DRILL --
|
||||||
Private Sub CurrDrillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillCmBx.SelectionChanged
|
Private Sub CurrDrillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillCmBx.SelectionChanged
|
||||||
If IsNothing(CurrDrillCmBx.SelectedItem) Then Return
|
If IsNothing(CurrDrillCmBx.SelectedItem) Then Return
|
||||||
@@ -1375,7 +1481,7 @@ Public Class AlarmsPageUC
|
|||||||
Select Case m_CurrentMachine.MountedToolConfig
|
Select Case m_CurrentMachine.MountedToolConfig
|
||||||
Case CurrentMachine.MountedToolConfigs.SAW
|
Case CurrentMachine.MountedToolConfigs.SAW
|
||||||
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
|
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
|
||||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
||||||
If ChooseTool.ShowDialog Then
|
If ChooseTool.ShowDialog Then
|
||||||
Return ChooseTool.GetSelectedTool
|
Return ChooseTool.GetSelectedTool
|
||||||
|
|||||||
@@ -76,6 +76,18 @@ Public Class ChooseToolWD
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Return True
|
Return True
|
||||||
|
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
|
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||||
|
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||||
|
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||||
|
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
Case Else
|
Case Else
|
||||||
Return False
|
Return False
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
+54
-12
@@ -107,6 +107,7 @@ Public Class CurrentMachine
|
|||||||
|
|
||||||
' Variabili che contengono il nome degli utensili disponibili per tipo
|
' Variabili che contengono il nome degli utensili disponibili per tipo
|
||||||
Private m_sCurrSaw As String = String.Empty
|
Private m_sCurrSaw As String = String.Empty
|
||||||
|
Private m_sCurrSawTilted As String = String.Empty
|
||||||
Private m_sCurrDrill As String = String.Empty
|
Private m_sCurrDrill As String = String.Empty
|
||||||
Private m_sCurrMill As String = String.Empty
|
Private m_sCurrMill As String = String.Empty
|
||||||
Private m_sCurrMillNoTip As String = String.Empty
|
Private m_sCurrMillNoTip As String = String.Empty
|
||||||
@@ -116,6 +117,8 @@ Public Class CurrentMachine
|
|||||||
|
|
||||||
' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
|
' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
|
||||||
Private m_sCurrSawing As String = String.Empty
|
Private m_sCurrSawing As String = String.Empty
|
||||||
|
Private m_sCurrSawingTilted As String = String.Empty
|
||||||
|
Private m_bApplySawingTilted As Boolean = False
|
||||||
Private m_sCurrDrilling As String = String.Empty
|
Private m_sCurrDrilling As String = String.Empty
|
||||||
Private m_sCurrMilling As String = String.Empty
|
Private m_sCurrMilling As String = String.Empty
|
||||||
Private m_sCurrPocketing As String = String.Empty
|
Private m_sCurrPocketing As String = String.Empty
|
||||||
@@ -193,6 +196,7 @@ Public Class CurrentMachine
|
|||||||
SAWANDAUXTOOL = 1
|
SAWANDAUXTOOL = 1
|
||||||
MANUALTOOLCHANGER = 2
|
MANUALTOOLCHANGER = 2
|
||||||
TOOLCHANGER = 3
|
TOOLCHANGER = 3
|
||||||
|
TOOLCHANGERWITHSAW = 4
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' Massimo numero di utensili su Tc
|
' Massimo numero di utensili su Tc
|
||||||
@@ -573,6 +577,18 @@ Public Class CurrentMachine
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend Property sCurrSawTilted As String
|
||||||
|
Get
|
||||||
|
Return m_sCurrSawTilted
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, value, sMachIniFile) Then
|
||||||
|
m_sCurrSawTilted = value
|
||||||
|
' m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Property sCurrDrill As String
|
Friend Property sCurrDrill As String
|
||||||
Get
|
Get
|
||||||
Return m_sCurrDrill
|
Return m_sCurrDrill
|
||||||
@@ -647,18 +663,32 @@ Public Class CurrentMachine
|
|||||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
|
||||||
m_sCurrSawing = value
|
m_sCurrSawing = value
|
||||||
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||||
'' aggiorno il file ini della macchina con i valori correnti della lavorazione
|
End If
|
||||||
'Dim sVal As String = String.Empty
|
End Set
|
||||||
'Dim dVal As Double = m_dFsevLength
|
End Property
|
||||||
'If GetUserNote("FsevLength", sVal, m_sCurrSawing, False) Then
|
|
||||||
' StringToDouble(sVal, dVal)
|
Friend Property sCurrSawingTilted As String
|
||||||
' SetFsevLength(dVal)
|
Get
|
||||||
'End If
|
Return m_sCurrSawingTilted
|
||||||
'dVal = m_dFsevPerc
|
End Get
|
||||||
'If GetUserNote("FsevPerc", sVal, m_sCurrSawing, False) Then
|
Set(value As String)
|
||||||
' StringToDouble(sVal, m_dFsevPerc)
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, value, sMachIniFile) Then
|
||||||
' SetFsevPerc(dVal)
|
m_sCurrSawingTilted = value
|
||||||
'End If
|
'm_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Friend Property bApplySawingTilted As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bApplySawingTilted
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
m_bApplySawingTilted = value
|
||||||
|
If m_bApplySawingTilted Then
|
||||||
|
WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "1", sMachIniFile)
|
||||||
|
Else
|
||||||
|
WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "0", sMachIniFile)
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -1273,6 +1303,14 @@ Public Class CurrentMachine
|
|||||||
' Leggo utensili correnti
|
' Leggo utensili correnti
|
||||||
' lama
|
' lama
|
||||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile)
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile)
|
||||||
|
' lama inclinata
|
||||||
|
If m_nShowToolChanger = 4 Then
|
||||||
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, Nothing, m_sCurrSawTilted, sMachIniFile)
|
||||||
|
Else
|
||||||
|
' se non è configurato il cambio utensile e allora imposto l'unica lama disponibile per i tagli inclinati
|
||||||
|
m_sCurrSawTilted = m_sCurrSaw
|
||||||
|
End If
|
||||||
|
|
||||||
' foretto
|
' foretto
|
||||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile)
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile)
|
||||||
' fresa
|
' fresa
|
||||||
@@ -1289,6 +1327,10 @@ Public Class CurrentMachine
|
|||||||
' Leggo lavorazioni correnti
|
' Leggo lavorazioni correnti
|
||||||
' lama
|
' lama
|
||||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile)
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile)
|
||||||
|
' lama inlicnata
|
||||||
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, Nothing, m_sCurrSawingTilted, sMachIniFile)
|
||||||
|
' applica lavorazione di lama inclinata
|
||||||
|
m_bApplySawingTilted = (GetPrivateProfileInt(S_MACH_MACH, K_APPLYSAWINGTILTED, 0, sMachIniFile) <> 0)
|
||||||
' foretto
|
' foretto
|
||||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile)
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile)
|
||||||
' fresa
|
' fresa
|
||||||
|
|||||||
+90
-37
@@ -3,6 +3,8 @@ Imports System.ComponentModel
|
|||||||
Imports OmagCUT.TreeViewItem
|
Imports OmagCUT.TreeViewItem
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Imports FXServer
|
||||||
|
|
||||||
Public Class SetUpPage
|
Public Class SetUpPage
|
||||||
|
|
||||||
@@ -13,6 +15,7 @@ Public Class SetUpPage
|
|||||||
Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
|
Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||||
|
|
||||||
Private m_ToolTreeList As New ObservableCollection(Of CathegoryItem)
|
Private m_ToolTreeList As New ObservableCollection(Of CathegoryItem)
|
||||||
|
Private m_SawsList As CathegoryItem
|
||||||
Private m_DrillbitsList As CathegoryItem
|
Private m_DrillbitsList As CathegoryItem
|
||||||
Private m_MillsList As CathegoryItem
|
Private m_MillsList As CathegoryItem
|
||||||
Private m_CupsList As CathegoryItem
|
Private m_CupsList As CathegoryItem
|
||||||
@@ -26,10 +29,10 @@ Public Class SetUpPage
|
|||||||
' Assegno la lista utensili come sorgente dell'albero
|
' Assegno la lista utensili come sorgente dell'albero
|
||||||
ToolTree.ItemsSource = m_ToolTreeList
|
ToolTree.ItemsSource = m_ToolTreeList
|
||||||
|
|
||||||
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
'' Cambio utensile macchina
|
'' Cambio utensile macchina
|
||||||
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
|
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
|
||||||
Dim ColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ToolChangerNbr / 5.0))
|
Dim ColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ToolChangerNbr / 5.0))
|
||||||
If ColNum > 12 Then
|
If ColNum > 12 Then
|
||||||
EgtOutLog("TC warning : too many tools (max 12 * 5)")
|
EgtOutLog("TC warning : too many tools (max 12 * 5)")
|
||||||
ColNum = 12
|
ColNum = 12
|
||||||
@@ -59,11 +62,11 @@ Public Class SetUpPage
|
|||||||
|
|
||||||
'' Cambio utensile manuale
|
'' Cambio utensile manuale
|
||||||
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
|
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
|
||||||
Dim ManColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ManualToolChangerNbr / 5.0))
|
Dim ManColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ManualToolChangerNbr / 5.0))
|
||||||
If ManColNum > 12 Then
|
If ManColNum > 12 Then
|
||||||
EgtOutLog("ManTC warning : too many tools (max 12 * 5)")
|
EgtOutLog("ManTC warning : too many tools (max 12 * 5)")
|
||||||
ManColNum = 12
|
ManColNum = 12
|
||||||
End If
|
End If
|
||||||
For Index As Integer = 12 To ManColNum + 1 Step -1
|
For Index As Integer = 12 To ManColNum + 1 Step -1
|
||||||
For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1
|
For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1
|
||||||
ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index2))
|
ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index2))
|
||||||
@@ -85,7 +88,7 @@ Public Class SetUpPage
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
' Se portautensili della macchina presente
|
' Se portautensili della macchina presente
|
||||||
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
' Apro quello
|
' Apro quello
|
||||||
TlChScVw.Visibility = Windows.Visibility.Visible
|
TlChScVw.Visibility = Windows.Visibility.Visible
|
||||||
ToolChangerBtn.IsChecked = True
|
ToolChangerBtn.IsChecked = True
|
||||||
@@ -106,15 +109,25 @@ Public Class SetUpPage
|
|||||||
Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
' Inizializzo le famiglie di utensili nell'albero
|
' Inizializzo le famiglie di utensili nell'albero
|
||||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
InitializeToolGroup( m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg( 90752), m_DrillbitsList)
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then InitializeToolGroup(m_CurrMachine.bSaw, MCH_TY.SAW_STD, EgtMsg(90751), m_SawsList)
|
||||||
InitializeToolGroup( m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg( 90753), m_MillsList)
|
InitializeToolGroup(m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg(90752), m_DrillbitsList)
|
||||||
InitializeToolGroup( m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg( 90754), m_CupsList)
|
InitializeToolGroup(m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg(90753), m_MillsList)
|
||||||
InitializeToolGroup( m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg( 90756), m_PolishingsList)
|
InitializeToolGroup(m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg(90754), m_CupsList)
|
||||||
|
InitializeToolGroup(m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg(90756), m_PolishingsList)
|
||||||
|
|
||||||
' Posiziono utensili già posizionati sul portautensili
|
' Posiziono utensili già posizionati sul portautensili
|
||||||
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger
|
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger
|
||||||
If ToolPosition.sTool <> String.Empty Then
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
If Not IsNothing( m_DrillbitsList) Then
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso Not IsNothing(m_SawsList) Then
|
||||||
|
For Each Item As CustomItem In m_SawsList.Items
|
||||||
|
If Item.Name = ToolPosition.sTool Then
|
||||||
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
|
m_SawsList.Items.Remove(Item)
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
If Not IsNothing(m_DrillbitsList) Then
|
||||||
For Each Item As CustomItem In m_DrillbitsList.Items
|
For Each Item As CustomItem In m_DrillbitsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -123,7 +136,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_MillsList) Then
|
If Not IsNothing(m_MillsList) Then
|
||||||
For Each Item As CustomItem In m_MillsList.Items
|
For Each Item As CustomItem In m_MillsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -132,7 +145,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_CupsList) Then
|
If Not IsNothing(m_CupsList) Then
|
||||||
For Each Item As CustomItem In m_CupsList.Items
|
For Each Item As CustomItem In m_CupsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -141,7 +154,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_PolishingsList) Then
|
If Not IsNothing(m_PolishingsList) Then
|
||||||
For Each Item As CustomItem In m_PolishingsList.Items
|
For Each Item As CustomItem In m_PolishingsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -158,7 +171,7 @@ Public Class SetUpPage
|
|||||||
' Posiziono utensili già posizionati sul portautensili manuale
|
' Posiziono utensili già posizionati sul portautensili manuale
|
||||||
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger
|
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger
|
||||||
If ToolPosition.sTool <> String.Empty Then
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
If Not IsNothing( m_DrillbitsList) Then
|
If Not IsNothing(m_DrillbitsList) Then
|
||||||
For Each Item As CustomItem In m_DrillbitsList.Items
|
For Each Item As CustomItem In m_DrillbitsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -167,7 +180,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_MillsList) Then
|
If Not IsNothing(m_MillsList) Then
|
||||||
For Each Item As CustomItem In m_MillsList.Items
|
For Each Item As CustomItem In m_MillsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -176,7 +189,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_CupsList) Then
|
If Not IsNothing(m_CupsList) Then
|
||||||
For Each Item As CustomItem In m_CupsList.Items
|
For Each Item As CustomItem In m_CupsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -185,7 +198,7 @@ Public Class SetUpPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
If Not IsNothing( m_PolishingsList) Then
|
If Not IsNothing(m_PolishingsList) Then
|
||||||
For Each Item As CustomItem In m_PolishingsList.Items
|
For Each Item As CustomItem In m_PolishingsList.Items
|
||||||
If Item.Name = ToolPosition.sTool Then
|
If Item.Name = ToolPosition.sTool Then
|
||||||
m_SetUpToolsList.Items.Add(Item)
|
m_SetUpToolsList.Items.Add(Item)
|
||||||
@@ -710,16 +723,16 @@ Public Class SetUpPage
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' Funzione che carica gli utensili del Db nell'albero
|
' Funzione che carica gli utensili del Db nell'albero
|
||||||
Friend Sub InitializeToolGroup( bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
|
Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
|
||||||
If Not bEnabled Then Return
|
If Not bEnabled Then Return
|
||||||
' Inserisco categoria ed eventuali elementi
|
' Inserisco categoria ed eventuali elementi
|
||||||
ToolCathegory = New CathegoryItem( sFName, nTType)
|
ToolCathegory = New CathegoryItem(sFName, nTType)
|
||||||
Dim nType As Integer = 0
|
Dim nType As Integer = 0
|
||||||
Dim ToolName As String = String.Empty
|
Dim ToolName As String = String.Empty
|
||||||
Dim bFound As Boolean = EgtTdbGetFirstTool( nTType, ToolName, nType)
|
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
||||||
While bFound
|
While bFound
|
||||||
If nType = nTType Then ToolCathegory.Items.Add( New CustomItem( ToolName, nType))
|
If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||||
bFound = EgtTdbGetNextTool( nTType, ToolName, nType)
|
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
|
||||||
End While
|
End While
|
||||||
m_ToolTreeList.Add(ToolCathegory)
|
m_ToolTreeList.Add(ToolCathegory)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -761,7 +774,7 @@ Public Class SetUpPage
|
|||||||
ToolHolderClicked.Tool.IsChecked = False
|
ToolHolderClicked.Tool.IsChecked = False
|
||||||
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
||||||
End If
|
End If
|
||||||
' altrimenti da levare
|
' altrimenti da levare
|
||||||
Else
|
Else
|
||||||
RestoreToolInList(GetTxBxFromTlChPos(ToolHolderClicked.Name).Text)
|
RestoreToolInList(GetTxBxFromTlChPos(ToolHolderClicked.Name).Text)
|
||||||
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
||||||
@@ -771,14 +784,17 @@ Public Class SetUpPage
|
|||||||
|
|
||||||
' Funzione che rimuove l'utensile selezionato dall'albero
|
' Funzione che rimuove l'utensile selezionato dall'albero
|
||||||
Private Sub RemoveToolFromList()
|
Private Sub RemoveToolFromList()
|
||||||
If Not IsNothing( m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains( ToolTree.SelectedItem) Then
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso
|
||||||
m_DrillbitsList.Items.Remove( ToolTree.SelectedItem)
|
Not IsNothing(m_SawsList) AndAlso m_SawsList.Items.Contains(ToolTree.SelectedItem) Then
|
||||||
ElseIf Not IsNothing( m_MillsList) AndAlso m_MillsList.Items.Contains( ToolTree.SelectedItem) Then
|
m_SawsList.Items.Remove(ToolTree.SelectedItem)
|
||||||
m_MillsList.Items.Remove( ToolTree.SelectedItem)
|
ElseIf Not IsNothing(m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains(ToolTree.SelectedItem) Then
|
||||||
ElseIf Not IsNothing( m_CupsList) AndAlso m_CupsList.Items.Contains( ToolTree.SelectedItem) Then
|
m_DrillbitsList.Items.Remove(ToolTree.SelectedItem)
|
||||||
m_CupsList.Items.Remove( ToolTree.SelectedItem)
|
ElseIf Not IsNothing(m_MillsList) AndAlso m_MillsList.Items.Contains(ToolTree.SelectedItem) Then
|
||||||
ElseIf Not IsNothing( m_PolishingsList) AndAlso m_PolishingsList.Items.Contains( ToolTree.SelectedItem) Then
|
m_MillsList.Items.Remove(ToolTree.SelectedItem)
|
||||||
m_PolishingsList.Items.Remove( ToolTree.SelectedItem)
|
ElseIf Not IsNothing(m_CupsList) AndAlso m_CupsList.Items.Contains(ToolTree.SelectedItem) Then
|
||||||
|
m_CupsList.Items.Remove(ToolTree.SelectedItem)
|
||||||
|
ElseIf Not IsNothing(m_PolishingsList) AndAlso m_PolishingsList.Items.Contains(ToolTree.SelectedItem) Then
|
||||||
|
m_PolishingsList.Items.Remove(ToolTree.SelectedItem)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -786,7 +802,9 @@ Public Class SetUpPage
|
|||||||
Private Sub RestoreToolInList(sToolName As String)
|
Private Sub RestoreToolInList(sToolName As String)
|
||||||
For Each Tool As CustomItem In m_SetUpToolsList.Items
|
For Each Tool As CustomItem In m_SetUpToolsList.Items
|
||||||
If Tool.Name = sToolName Then
|
If Tool.Name = sToolName Then
|
||||||
If Tool.nType = MCH_TY.DRILL_STD Then
|
If Tool.nType = MCH_TY.SAW_STD Then
|
||||||
|
m_SawsList.Items.Add(Tool)
|
||||||
|
ElseIf Tool.nType = MCH_TY.DRILL_STD Then
|
||||||
m_DrillbitsList.Items.Add(Tool)
|
m_DrillbitsList.Items.Add(Tool)
|
||||||
ElseIf Tool.nType = MCH_TY.MILL_STD Then
|
ElseIf Tool.nType = MCH_TY.MILL_STD Then
|
||||||
m_MillsList.Items.Add(Tool)
|
m_MillsList.Items.Add(Tool)
|
||||||
@@ -1084,6 +1102,39 @@ Public Class SetUpPage
|
|||||||
EgtTdbSave()
|
EgtTdbSave()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Funzione che genera il file di setup corrente (per Cam5 e Office)
|
||||||
|
Private Sub SaveSetUpFile()
|
||||||
|
If m_CurrMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return
|
||||||
|
Dim sContentFile As String = "; this file has been created by program OmagCUT by current setup" & vbCrLf
|
||||||
|
sContentFile &= "[General]" & vbCrLf
|
||||||
|
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger
|
||||||
|
Dim sToolName As String = ToolPosition.sTool
|
||||||
|
Dim sPositionName As String = ToolPosition.sName
|
||||||
|
Dim sPosition As Integer = ToolPosition.nPosition
|
||||||
|
If Not String.IsNullOrEmpty(sToolName) Then
|
||||||
|
EgtTdbSetCurrTool(sToolName)
|
||||||
|
' Recupero l'uscita
|
||||||
|
Dim nExit As Integer = 1
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExit)
|
||||||
|
' Recupero la testa
|
||||||
|
Dim sHead As String = ""
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sHead)
|
||||||
|
' Recupero nome file nge dell'utensile
|
||||||
|
Dim sUUID As String = ""
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.UUID, sUUID)
|
||||||
|
'local sRaw='Pos'..tostring(Index)..'='..TcPos..';'..EgtTdbGetCurrToolParam( MCH_TP.HEAD)..';'..EgtTdbGetCurrToolParam( MCH_TP.EXIT)..'/'..EgtTdbGetCurrToolParam( MCH_TP.UUID)..'/'..ToolName
|
||||||
|
sContentFile &= "Pos" & sPosition.ToString & "=" & sPositionName & ";" & sHead & ";" & nExit.ToString & "/" & sUUID & "/" & sToolName & vbCrLf
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' Apro il file e lo sovrascrivo
|
||||||
|
Dim sFileOmagCutSetUp As String = m_CurrMachine.sMachDir & "\SetUp\CurrOmagCUT.stu"
|
||||||
|
Try
|
||||||
|
My.Computer.FileSystem.WriteAllText(sFileOmagCutSetUp, sContentFile, False)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error in creatinf file CurrOmagCUT.stu: " & ex.ToString)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
' Evento che permette di aprire le cartelle degli utensili con un click singolo
|
' Evento che permette di aprire le cartelle degli utensili con un click singolo
|
||||||
Private Sub ToolTree_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseUp
|
Private Sub ToolTree_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseUp
|
||||||
If TypeOf ToolTree.SelectedItem Is CathegoryItem Then
|
If TypeOf ToolTree.SelectedItem Is CathegoryItem Then
|
||||||
@@ -1095,6 +1146,8 @@ Public Class SetUpPage
|
|||||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
' Eseguo salvataggio (DB utensili + attrezzaggio)
|
' Eseguo salvataggio (DB utensili + attrezzaggio)
|
||||||
SaveToolChangerStatus()
|
SaveToolChangerStatus()
|
||||||
|
' Salvo nel file di setup l'attuale configurazione
|
||||||
|
SaveSetUpFile()
|
||||||
' Esco
|
' Esco
|
||||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC)
|
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC)
|
||||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me)
|
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me)
|
||||||
@@ -1131,7 +1184,7 @@ Public Class SetUpPage
|
|||||||
RemoveToolFromList()
|
RemoveToolFromList()
|
||||||
Else
|
Else
|
||||||
' Altrimenti segnalo che la posizione è già occupata
|
' Altrimenti segnalo che la posizione è già occupata
|
||||||
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -1149,7 +1202,7 @@ Public Class SetUpPage
|
|||||||
RemoveToolFromList()
|
RemoveToolFromList()
|
||||||
Else
|
Else
|
||||||
' Altrimenti segnalo che la posizione è già occupata
|
' Altrimenti segnalo che la posizione è già occupata
|
||||||
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter Property="Fill" TargetName="Ellipse" Value="#FFB4B4B4"/>
|
<Setter Property="Fill" TargetName="Ellipse" Value="#414141"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|||||||
+69
-38
@@ -1,12 +1,12 @@
|
|||||||
<UserControl x:Class="ToolsDbPageUC"
|
<UserControl x:Class="ToolsDbPageUC"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
|
xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="768" d:DesignWidth="1280" Initialized="ToolsDbPage_Initialized" Loaded="ToolsDbPage_Loaded">
|
d:DesignHeight="768" d:DesignWidth="1280" Initialized="ToolsDbPage_Initialized" Loaded="ToolsDbPage_Loaded">
|
||||||
|
|
||||||
<!-- Definizione della ImportPage -->
|
<!-- Definizione della ImportPage -->
|
||||||
<Border Style="{DynamicResource OmagCut_PageBorder}">
|
<Border Style="{DynamicResource OmagCut_PageBorder}">
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<TreeView Name="ToolTreeView" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}" >
|
<TreeView Name="ToolTreeView" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}" >
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||||
<!--renderlo apribile con un solo click -->
|
<!--renderlo apribile con un solo click -->
|
||||||
<HierarchicalDataTemplate DataType="{x:Type self:CathegoryItem}" ItemsSource="{Binding Items}">
|
<HierarchicalDataTemplate DataType="{x:Type self:CathegoryItem}" ItemsSource="{Binding Items}">
|
||||||
|
|
||||||
@@ -224,12 +224,12 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="NameTxBl" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3"
|
<TextBlock Name="NameTxBl" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NameTxBx" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"
|
<EgtWPFLib:EgtTextBox Name="NameTxBx" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
|
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
|
||||||
|
|
||||||
<Border Name="TCPosBrd" Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3"
|
<Border Name="TCPosBrd" Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3"
|
||||||
BorderThickness="0" BorderBrush="Black" CornerRadius="3">
|
BorderThickness="0" BorderBrush="Black" CornerRadius="3">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -237,17 +237,27 @@
|
|||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="TCPosTxBl" Grid.Column="0"
|
<TextBlock Name="TCPosTxBl" Grid.Column="0">
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock.Style>
|
||||||
|
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
|
||||||
|
<Setter Property="Margin" Value="10,0,0,0"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="ToolTip" Value="">
|
||||||
|
<Setter Property="ToolTipService.IsEnabled" Value="False" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
<EgtWPFLib:EgtTextBox Name="TCPosTxBx" Grid.Column="1" Grid.Row="0" Margin="0,0,15,0"
|
<EgtWPFLib:EgtTextBox Name="TCPosTxBx" Grid.Column="1" Grid.Row="0" Margin="0,0,15,0"
|
||||||
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
|
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border Name="HeadExitBrd" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="3"
|
<Border Name="HeadExitBrd" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_NoNameGroupBorder}">
|
Style="{DynamicResource OmagCut_NoNameGroupBorder}">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -259,18 +269,18 @@
|
|||||||
|
|
||||||
<TextBlock Name="HeadTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock Name="HeadTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="HeadTxBx" Grid.Column="1"
|
<EgtWPFLib:EgtTextBox Name="HeadTxBx" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />
|
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />
|
||||||
|
|
||||||
<TextBlock Name="ExitTxBl" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock Name="ExitTxBl" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="ExitTxBx" Grid.Column="3"
|
<EgtWPFLib:EgtTextBox Name="ExitTxBx" Grid.Column="3"
|
||||||
Style="{DynamicResource OmagCut_RightCalculatorTextBoxInBorder}" />
|
Style="{DynamicResource OmagCut_RightCalculatorTextBoxInBorder}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<GroupBox Name="SpeedGpBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="4" Grid.RowSpan="4"
|
<GroupBox Name="SpeedGpBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="4" Grid.RowSpan="4"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -282,19 +292,19 @@
|
|||||||
|
|
||||||
<TextBlock Name="SpeedTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock Name="SpeedTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" IsLength="False"
|
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
<TextBlock Name="MaxSpeedTxBl" Grid.Column="2"
|
<TextBlock Name="MaxSpeedTxBl" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="MaxSpeedTxBx" Grid.Column="3" IsLength="False"
|
<EgtWPFLib:EgtTextBox Name="MaxSpeedTxBx" Grid.Column="3" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="FeedGpBx" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="4" Grid.RowSpan="6"
|
<GroupBox Name="FeedGpBx" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="4" Grid.RowSpan="6"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -309,23 +319,23 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
|
<TextBlock Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Grid.Row="0"
|
<EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
<TextBlock Name="TipFeedTxBl" Grid.Column="2" Grid.Row="0"
|
<TextBlock Name="TipFeedTxBl" Grid.Column="2" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="TipFeedTxBx" Grid.Column="3" Grid.Row="0"
|
<EgtWPFLib:EgtTextBox Name="TipFeedTxBx" Grid.Column="3" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
<TextBlock Name="StartFeedTxBl" Grid.Column="0" Grid.Row="1"
|
<TextBlock Name="StartFeedTxBl" Grid.Column="0" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="StartFeedTxBx" Grid.Column="1" Grid.Row="1"
|
<EgtWPFLib:EgtTextBox Name="StartFeedTxBx" Grid.Column="1" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
<TextBlock Name="EndFeedTxBl" Grid.Column="2" Grid.Row="1"
|
<TextBlock Name="EndFeedTxBl" Grid.Column="2" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="EndFeedTxBx" Grid.Column="3" Grid.Row="1"
|
<EgtWPFLib:EgtTextBox Name="EndFeedTxBx" Grid.Column="3" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -336,7 +346,7 @@
|
|||||||
<ComboBox Name="CoolantCmBx" Grid.Column="1" Grid.Row="16" Grid.RowSpan="3" Style="{StaticResource OmagCut_LeftComboBoxNoBorder}">
|
<ComboBox Name="CoolantCmBx" Grid.Column="1" Grid.Row="16" Grid.RowSpan="3" Style="{StaticResource OmagCut_LeftComboBoxNoBorder}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding}" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
<TextBlock Text="{Binding}" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
@@ -420,11 +430,32 @@
|
|||||||
<CheckBox Name="EndLifeChBx" Grid.Column="3" Grid.Row="31" Grid.RowSpan="3"
|
<CheckBox Name="EndLifeChBx" Grid.Column="3" Grid.Row="31" Grid.RowSpan="3"
|
||||||
Style="{StaticResource OmagCut_CheckBox_Single}" Margin="0,8,0,0"/>
|
Style="{StaticResource OmagCut_CheckBox_Single}" Margin="0,8,0,0"/>
|
||||||
|
|
||||||
<TextBlock Name="UserNotesTxBl" Grid.Column="0" Grid.Row="33" Grid.RowSpan="3"
|
<Grid Grid.Column="0" Grid.Row="33" Grid.RowSpan="3" Grid.ColumnSpan="4">
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<Grid.RowDefinitions>
|
||||||
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx" Grid.Column="1" Grid.Row="33"
|
<RowDefinition Height="1*"/>
|
||||||
Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,0,15,0"
|
</Grid.RowDefinitions>
|
||||||
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
<TextBlock Name="UserNotesTxBl"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx"
|
||||||
|
Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,0,15,0"
|
||||||
|
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,12,0">
|
||||||
|
<TextBlock Name="ColorTxBl" Margin="0,0,15,0"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
|
||||||
|
<Button Name="ColorBtn"
|
||||||
|
Style="{StaticResource Color_Button}" />
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -445,7 +476,7 @@
|
|||||||
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||||
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports OmagCUT.TreeViewItem
|
Imports OmagCUT.TreeViewItem
|
||||||
Imports System.ComponentModel
|
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
@@ -84,6 +83,7 @@ Public Class ToolsDbPageUC
|
|||||||
CodeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 27) ' Code
|
CodeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 27) ' Code
|
||||||
SupplierTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 28) ' Supplier
|
SupplierTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 28) ' Supplier
|
||||||
EndLifeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 29) ' End Life
|
EndLifeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 29) ' End Life
|
||||||
|
ColorTxBl.Text = EgtMsg(91018) ' Colore lavorazione
|
||||||
|
|
||||||
' Associo TextBox e Label
|
' Associo TextBox e Label
|
||||||
Dim TempLabel1 As New Label
|
Dim TempLabel1 As New Label
|
||||||
@@ -122,7 +122,6 @@ Public Class ToolsDbPageUC
|
|||||||
Dim TempLabel12 As New Label
|
Dim TempLabel12 As New Label
|
||||||
TempLabel12.Content = MaxMatTxBl.Text
|
TempLabel12.Content = MaxMatTxBl.Text
|
||||||
MaxMatTxBx.Tag = TempLabel12
|
MaxMatTxBx.Tag = TempLabel12
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ToolsDbPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub ToolsDbPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
@@ -568,6 +567,15 @@ Public Class ToolsDbPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ColorBtn_Click(sender As Object, e As RoutedEventArgs) Handles ColorBtn.Click
|
||||||
|
' Il click sul bottone aprirà la finestra ChooseColor che permetterà la scelta del colore
|
||||||
|
m_MainWindow.m_brCurrentColor = ColorBtn.Background
|
||||||
|
Dim ChooseColor As New ChooseColor(m_MainWindow)
|
||||||
|
If ChooseColor.ShowDialog() Then
|
||||||
|
ColorBtn.Background = m_MainWindow.m_brCurrentColor
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function AlreadyExist(ToolName As String) As Boolean
|
Private Function AlreadyExist(ToolName As String) As Boolean
|
||||||
Dim ToolFamily As CathegoryItem
|
Dim ToolFamily As CathegoryItem
|
||||||
For Each ToolFamily In ToolsList
|
For Each ToolFamily In ToolsList
|
||||||
@@ -766,6 +774,50 @@ Public Class ToolsDbPageUC
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
|
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
|
||||||
UserNotesTxBx.Text = ToolString
|
UserNotesTxBx.Text = ToolString
|
||||||
End If
|
End If
|
||||||
|
' Inizializzo colore di default
|
||||||
|
Dim EgtCol As Color3d = Utility.GetColorPV()
|
||||||
|
ColorBtn.Background = New SolidColorBrush(Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B))
|
||||||
|
' Eventualmente verifico se inserito nel setup
|
||||||
|
VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub VerifyToolInSetUp(sNameTool As String, sTCPos As String)
|
||||||
|
' Se configurato cambio utensile lama
|
||||||
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return
|
||||||
|
Dim bFound As Boolean = False
|
||||||
|
Dim sCurrTCPos As String = String.Empty
|
||||||
|
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||||
|
If ToolPosition.sTool <> String.Empty Then
|
||||||
|
If sNameTool = ToolPosition.sTool Then
|
||||||
|
sCurrTCPos = ToolPosition.sName
|
||||||
|
bFound = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If Not bFound Then
|
||||||
|
TCPosTxBl.Foreground = Brushes.Red
|
||||||
|
If String.IsNullOrEmpty(sTCPos) Then
|
||||||
|
TCPosTxBl.ToolTip = EgtMsg(91019)
|
||||||
|
Else
|
||||||
|
TCPosTxBl.ToolTip = EgtMsg(91020)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If String.IsNullOrEmpty(sTCPos) Then
|
||||||
|
TCPosTxBl.Foreground = Brushes.Gold
|
||||||
|
TCPosTxBl.ToolTip = EgtMsg(91021) & " " & sCurrTCPos
|
||||||
|
Else
|
||||||
|
If sTCPos <> sCurrTCPos Then
|
||||||
|
TCPosTxBl.Foreground = Brushes.Gold
|
||||||
|
TCPosTxBl.ToolTip = EgtMsg(91022) & " " & sCurrTCPos
|
||||||
|
Else
|
||||||
|
TCPosTxBl.Foreground = Brushes.White
|
||||||
|
TCPosTxBl.ToolTip = ""
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetToolParams()
|
Private Sub SetToolParams()
|
||||||
@@ -821,8 +873,40 @@ Public Class ToolsDbPageUC
|
|||||||
If Not SetSpecials() Then
|
If Not SetSpecials() Then
|
||||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
|
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
|
||||||
End If
|
End If
|
||||||
|
EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString()))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function ColorToString(color As String) As String
|
||||||
|
Dim colorCut As Color = HexToRbgNew(color)
|
||||||
|
Return colorCut.R & "," & colorCut.G & "," & colorCut.B
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function HexToRbgNew(ByVal Hex As String) As Color
|
||||||
|
If Hex.StartsWith("#") Then
|
||||||
|
Hex = Hex.Remove(0, 3)
|
||||||
|
End If
|
||||||
|
Dim red As Byte = CByte(HexadecimalToDecimal(Hex.Substring(0, 2)))
|
||||||
|
Dim green As Byte = CByte(HexadecimalToDecimal(Hex.Substring(2, 2)))
|
||||||
|
Dim blue As Byte = CByte(HexadecimalToDecimal(Hex.Substring(4, 2)))
|
||||||
|
Return Color.FromArgb(255, red, green, blue)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Shared Function HexadecimalToDecimal(hex As String) As Integer
|
||||||
|
hex = hex.ToUpper()
|
||||||
|
Dim hexLength As Integer = hex.Length
|
||||||
|
Dim dec As Double = 0
|
||||||
|
For i As Integer = 0 To hexLength - 1
|
||||||
|
Dim b As Byte = CByte(AscW(hex(i)))
|
||||||
|
If b >= 48 AndAlso b <= 57 Then
|
||||||
|
b -= 48
|
||||||
|
ElseIf b >= 65 AndAlso b <= 70 Then
|
||||||
|
b -= 55
|
||||||
|
End If
|
||||||
|
dec += b * Math.Pow(16, ((hexLength - i) - 1))
|
||||||
|
Next
|
||||||
|
Return CInt(Math.Truncate(dec))
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub ViewToolParams()
|
Private Sub ViewToolParams()
|
||||||
NameTxBl.Visibility = Windows.Visibility.Visible
|
NameTxBl.Visibility = Windows.Visibility.Visible
|
||||||
NameTxBx.Visibility = Windows.Visibility.Visible
|
NameTxBx.Visibility = Windows.Visibility.Visible
|
||||||
@@ -863,6 +947,9 @@ Public Class ToolsDbPageUC
|
|||||||
SupplierTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
SupplierTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
|
|
||||||
|
ColorTxBl.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden)
|
||||||
|
ColorBtn.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub HideToolParams()
|
Private Sub HideToolParams()
|
||||||
@@ -890,6 +977,9 @@ Public Class ToolsDbPageUC
|
|||||||
SupplierTxBx.Visibility = Windows.Visibility.Hidden
|
SupplierTxBx.Visibility = Windows.Visibility.Hidden
|
||||||
EndLifeTxBl.Visibility = Windows.Visibility.Hidden
|
EndLifeTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
EndLifeChBx.Visibility = Windows.Visibility.Hidden
|
EndLifeChBx.Visibility = Windows.Visibility.Hidden
|
||||||
|
|
||||||
|
ColorTxBl.Visibility = Visibility.Hidden
|
||||||
|
ColorBtn.Visibility = Visibility.Hidden
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ToolTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTreeView.PreviewMouseUp
|
Private Sub ToolTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTreeView.PreviewMouseUp
|
||||||
@@ -1338,4 +1428,8 @@ Public Class ToolsDbPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub TCPosTxBx_EgtClosed(sender As Object, e As EventArgs) Handles TCPosTxBx.EgtClosed
|
||||||
|
VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text)
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
+8
-4
@@ -26,7 +26,7 @@ Class MainWindow
|
|||||||
' Variabile che definisce l'avvio forzato in modalità FRAME
|
' Variabile che definisce l'avvio forzato in modalità FRAME
|
||||||
Friend m_OnlyFrame As Boolean = False
|
Friend m_OnlyFrame As Boolean = False
|
||||||
|
|
||||||
Public Shared m_bShowSVGParkInd As Boolean = True
|
Public Shared m_bShowSVGParkInd As Boolean = False
|
||||||
|
|
||||||
' Dichiarazione delle Page UserControl
|
' Dichiarazione delle Page UserControl
|
||||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||||
@@ -345,8 +345,8 @@ Class MainWindow
|
|||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2704, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2705, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2704, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2705, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||||
@@ -1218,13 +1218,17 @@ Class MainWindow
|
|||||||
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
|
||||||
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
|
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
|
||||||
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
|
||||||
|
End Select
|
||||||
|
|
||||||
|
Select Case m_DirectCutPageUC.m_ControlsDirectCutUC1.m_ActiveDirectCutPage
|
||||||
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
|
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
|
||||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
|
||||||
Case ControlsDirectCutUC.DirectCutPages.Polishing
|
Case ControlsDirectCutUC.DirectCutPages.Polishing
|
||||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
|
||||||
Case ControlsDirectCutUC.DirectCutPages.SawTest
|
Case ControlsDirectCutUC1.DirectCutPages.SawTest
|
||||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.7.4.1")>
|
<Assembly: AssemblyVersion("2.7.5.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.7.4.1")>
|
<Assembly: AssemblyFileVersion("2.7.5.1")>
|
||||||
|
|||||||
@@ -177,6 +177,9 @@
|
|||||||
<Compile Include="CadCuts\ChooseTestToolWD.xaml.vb">
|
<Compile Include="CadCuts\ChooseTestToolWD.xaml.vb">
|
||||||
<DependentUpon>ChooseTestToolWD.xaml</DependentUpon>
|
<DependentUpon>ChooseTestToolWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="CadCuts\ChangeToolWD.xaml.vb">
|
||||||
|
<DependentUpon>ChangeToolWD.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
||||||
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -454,6 +457,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="CadCuts\ChangeToolWD.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
|
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
+49
-2
@@ -338,7 +338,36 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="OmagCut_Button_Wrap" TargetType="{x:Type Button}" BasedOn="{StaticResource OmagCut_Button}">
|
<Style x:Key="Color_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||||
|
<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
|
||||||
|
<Setter Property="project:ButtonExtensions.CornerRadius" Value="{StaticResource Button_CornerRadius}"/>
|
||||||
|
<Setter Property="Margin" Value="{StaticResource Button_MarginThickness}"/>
|
||||||
|
<Setter Property="Padding" Value="5"/>
|
||||||
|
<Setter Property="Width" Value="60"/>
|
||||||
|
<Setter Property="Height" Value="35"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="#FFB8C3CD"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="OpacityMask" Value="#33FF0000"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||||
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Background" Value="#FFF4F4F4"/>
|
||||||
|
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
|
||||||
|
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
|
||||||
|
<Style x:Key="OmagCut_Button_Wrap" TargetType="{x:Type Button}" BasedOn="{StaticResource OmagCut_Button}">
|
||||||
<Setter Property="ContentTemplate" Value="{StaticResource Button_DataTemplate_Wrap}" />
|
<Setter Property="ContentTemplate" Value="{StaticResource Button_DataTemplate_Wrap}" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}" />
|
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}" />
|
||||||
</Style>
|
</Style>
|
||||||
@@ -1198,7 +1227,14 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- ______________________________________________________________________________________________________________________ -->
|
<Style x:Key="OmagCut_ErrorTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_UpperCaseCharacterTextBlock}">
|
||||||
|
<Setter Property="Foreground" Value="White"/>
|
||||||
|
<Setter Property="FontStyle" Value="Italic"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- ______________________________________________________________________________________________________________________ -->
|
||||||
|
|
||||||
<!--TextBox-->
|
<!--TextBox-->
|
||||||
|
|
||||||
@@ -2747,4 +2783,15 @@
|
|||||||
|
|
||||||
<!-- *************************************************************************** -->
|
<!-- *************************************************************************** -->
|
||||||
|
|
||||||
|
<!--Stile Rettangolo in SplitPaceUC-->
|
||||||
|
<Style x:Key="Rect_SplitPage" TargetType="{x:Type Rectangle}">
|
||||||
|
<Setter Property="Fill" Value="{Binding SawColor}"/>
|
||||||
|
<Setter Property="Stroke" Value="Black"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Height" Value="20"/>
|
||||||
|
<Setter Property="Width" Value="5"/>
|
||||||
|
<Setter Property="StrokeThickness" Value="0.5"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -43,9 +43,30 @@
|
|||||||
|
|
||||||
<ToggleButton Name="RegisterBtn"
|
<ToggleButton Name="RegisterBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowToggleButton}"></ToggleButton>
|
Style="{DynamicResource OmagCut_YellowToggleButton}"></ToggleButton>
|
||||||
<Button Name="ResetCutBtn"
|
|
||||||
|
<Button Name="ResetCutBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
|
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
|
||||||
<!--Abilito la selezione delle linee da disegno-->
|
|
||||||
|
<Popup Name="ResetCutPopUp"
|
||||||
|
IsOpen="False"
|
||||||
|
AllowsTransparency="False"
|
||||||
|
PopupAnimation="Scroll"
|
||||||
|
StaysOpen="False"
|
||||||
|
Placement="Top"
|
||||||
|
PlacementTarget="{Binding ElementName=ResetCutBtn}">
|
||||||
|
<WrapPanel Orientation="Vertical"
|
||||||
|
Background="{DynamicResource OmagCut_Gray}">
|
||||||
|
<Button x:Name="ResetCut1Btn"
|
||||||
|
Width ="78" Height="78"
|
||||||
|
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
|
||||||
|
<Button x:Name="ResetCut2Btn"
|
||||||
|
Width ="78" Height="78"
|
||||||
|
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
|
||||||
|
</WrapPanel>
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
|
||||||
|
<!--Abilito la selezione delle linee da disegno-->
|
||||||
<ToggleButton Name="TestBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
<ToggleButton Name="TestBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource Test-lamaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Test-lamaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ Public Class ProjectMgrUC
|
|||||||
|
|
||||||
RegisterBtn.Content = "REG" 'Shape Registration
|
RegisterBtn.Content = "REG" 'Shape Registration
|
||||||
ResetCutBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
ResetCutBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
||||||
|
ResetCut2Btn.Content = EgtMsg(91024) 'Reset lavorazioni
|
||||||
|
ResetCut1Btn.Content = EgtMsg(91025) 'Aggiorna feed/speed
|
||||||
SimulateBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1) 'Simulate - Simula
|
SimulateBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1) 'Simulate - Simula
|
||||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 10) 'Export - Esporta
|
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 10) 'Export - Esporta
|
||||||
@@ -33,7 +35,7 @@ Public Class ProjectMgrUC
|
|||||||
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
||||||
End If
|
End If
|
||||||
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
||||||
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
|
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Other Reset (Shift)"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -287,11 +289,58 @@ Public Class ProjectMgrUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
||||||
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
|
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
|
||||||
' eseguo il ricalcolo delle sole FEED di lavorazione
|
If ResetCutPopUp.IsOpen Then
|
||||||
UpdateFeedAllMachining()
|
ResetCutPopUp.IsOpen = False
|
||||||
Return
|
Else
|
||||||
|
ResetCutPopUp.IsOpen = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ResetCut3Btn_Click()
|
||||||
End If
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Reimposto le feed di tutte le lavorazioni
|
||||||
|
Private Sub ResetCut1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut1Btn.Click
|
||||||
|
' eseguo il ricalcolo delle sole FEED di lavorazione
|
||||||
|
UpdateFeedAllMachining()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Reimposto le lavorazioni di default e ripristino i parametri
|
||||||
|
Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click
|
||||||
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
|
' Cancello eventuali messaggi
|
||||||
|
m_CurrProjPage.ClearMessage()
|
||||||
|
' cancello tutti i tagli di separazione (Waterjet)
|
||||||
|
ResetAllSplitCurv()
|
||||||
|
' cancello tutti i punti di inizio (Waterjet)
|
||||||
|
ResetAllStartCurv()
|
||||||
|
' cancello tutti i ponticelli disegnati
|
||||||
|
ResetAllBRidges()
|
||||||
|
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||||
|
ResetAllSplitCut()
|
||||||
|
|
||||||
|
' assegno la lavorazione corrente per i tagli di lama inclinati (solo se specificato nella ComboBox della ChooseMachinig)
|
||||||
|
RestoreDef_Machinig(True)
|
||||||
|
' assegno la lavorazione corrente per i tagli verticali
|
||||||
|
RestoreDef_Machinig(False)
|
||||||
|
|
||||||
|
' Ricalcolo tutte le lavorazioni
|
||||||
|
Dim nWarn As Integer = 0
|
||||||
|
ResetAllMachinings(nWarn)
|
||||||
|
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
||||||
|
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||||
|
ResetAllRawPart()
|
||||||
|
' Aggiorno Info C Home
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
|
||||||
|
' Aggiorno visualizzazione
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Resetta i valori dei parametri (ma non le lavorazioni)
|
||||||
|
Private Sub ResetCut3Btn_Click()
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Cancello eventuali messaggi
|
' Cancello eventuali messaggi
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
|
|||||||
@@ -35,7 +35,42 @@
|
|||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<!--LAVORAZIONE SECONDARIA-->
|
<!--TAGLIO TILTED-->
|
||||||
|
<Grid Grid.Column="1" Grid.Row="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="9*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<CheckBox Name ="ApplySawingTiltedChBx" Grid.Column="0"
|
||||||
|
Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
|
Margin="1.5,0,0,0"/>
|
||||||
|
<TextBlock Name="CurrSawingTiltedTxBl" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ComboBox Name="CurrSawingTiltedCmBx" Grid.Column="1" Grid.Row="1">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" FontSize="20">
|
||||||
|
<TextBlock.Style>
|
||||||
|
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding ElementName=ApplySawingTiltedChBx, Path=IsChecked}" Value="False">
|
||||||
|
<Setter Property="TextDecorations" Value="Strikethrough"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding ElementName=ApplySawingTiltedChBx, Path=IsChecked}" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<!--LAVORAZIONE SECONDARIA-->
|
||||||
<TextBlock Name="AuxiliaryMachiningTxBl" Grid.Column="1" Grid.Row="2"
|
<TextBlock Name="AuxiliaryMachiningTxBl" Grid.Column="1" Grid.Row="2"
|
||||||
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" Visibility="Hidden"/>
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" Visibility="Hidden"/>
|
||||||
<ComboBox Name="AuxiliaryMachiningCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
<ComboBox Name="AuxiliaryMachiningCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Public Class ChooseMachining
|
|||||||
Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
|
Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||||
' Liste che contengono gli elementi appartenenti alle ComboBox
|
' Liste che contengono gli elementi appartenenti alle ComboBox
|
||||||
Private m_SawingList As New List(Of String)
|
Private m_SawingList As New List(Of String)
|
||||||
|
Private m_SawingTiltedList As New List(Of String)
|
||||||
Private m_AuxMachTypeList As New List(Of StringIdCmBx)
|
Private m_AuxMachTypeList As New List(Of StringIdCmBx)
|
||||||
Private m_DrillingList As New List(Of String)
|
Private m_DrillingList As New List(Of String)
|
||||||
Private m_MillingList As New List(Of String)
|
Private m_MillingList As New List(Of String)
|
||||||
@@ -36,6 +37,7 @@ Public Class ChooseMachining
|
|||||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height
|
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height
|
||||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||||
CurrSawingCmBx.ItemsSource = m_SawingList
|
CurrSawingCmBx.ItemsSource = m_SawingList
|
||||||
|
CurrSawingTiltedCmBx.ItemsSource = m_SawingTiltedList
|
||||||
AuxiliaryMachiningCmBx.ItemsSource = m_AuxMachTypeList
|
AuxiliaryMachiningCmBx.ItemsSource = m_AuxMachTypeList
|
||||||
CurrDrillingCmBx.ItemsSource = m_DrillingList
|
CurrDrillingCmBx.ItemsSource = m_DrillingList
|
||||||
CurrMillingCmBx.ItemsSource = m_MillingList
|
CurrMillingCmBx.ItemsSource = m_MillingList
|
||||||
@@ -44,6 +46,7 @@ Public Class ChooseMachining
|
|||||||
CurrWJettingQualityCmBx.ItemsSource = m_CurrentMachine.Qualities
|
CurrWJettingQualityCmBx.ItemsSource = m_CurrentMachine.Qualities
|
||||||
|
|
||||||
CurrSawingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 1)
|
CurrSawingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 1)
|
||||||
|
CurrSawingTiltedTxBl.Text = EgtMsg(91023) ' Lavorazione inclinata
|
||||||
AuxiliaryMachiningTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 2)
|
AuxiliaryMachiningTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 2)
|
||||||
CurrDrillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 3)
|
CurrDrillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 3)
|
||||||
CurrMillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 4)
|
CurrMillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 4)
|
||||||
@@ -69,7 +72,13 @@ Public Class ChooseMachining
|
|||||||
' -- TAGLIO --
|
' -- TAGLIO --
|
||||||
CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSaw, m_SawingList)
|
CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSaw, m_SawingList)
|
||||||
' aggiungo un campo vuoto
|
' aggiungo un campo vuoto
|
||||||
m_SawingList.Add( "")
|
m_SawingList.Add("")
|
||||||
|
' -- TAGLIO TILTED --
|
||||||
|
CurrSawingTiltedCmBx.IsEnabled = m_MainWindow.m_CurrentMachine.bApplySawingTilted
|
||||||
|
ApplySawingTiltedChBx.IsChecked = m_MainWindow.m_CurrentMachine.bApplySawingTilted
|
||||||
|
CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSawTilted, m_SawingTiltedList)
|
||||||
|
' aggiungo un campo vuoto
|
||||||
|
m_SawingTiltedList.Add("")
|
||||||
|
|
||||||
' Verifico la configurazione della macchina per creare i combobox
|
' Verifico la configurazione della macchina per creare i combobox
|
||||||
Select Case m_CurrentMachine.MountedToolConfig
|
Select Case m_CurrentMachine.MountedToolConfig
|
||||||
@@ -78,7 +87,7 @@ Public Class ChooseMachining
|
|||||||
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl)
|
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl)
|
||||||
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx)
|
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx)
|
||||||
|
|
||||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||||
' Creo lista lavorazioni foretto e fresa
|
' Creo lista lavorazioni foretto e fresa
|
||||||
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
|
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
|
||||||
CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
|
CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
|
||||||
@@ -114,7 +123,10 @@ Public Class ChooseMachining
|
|||||||
|
|
||||||
' ---- MACCHINA CON CAMBIO UTENSILE ----
|
' ---- MACCHINA CON CAMBIO UTENSILE ----
|
||||||
ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
||||||
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or
|
||||||
|
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
|
' -- TAGLIO --
|
||||||
|
' Il taglio è aggiunto sempre (all'inizio di questo metodo)
|
||||||
' -- FORATURA --
|
' -- FORATURA --
|
||||||
CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
|
CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
|
||||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||||
@@ -206,7 +218,8 @@ Public Class ChooseMachining
|
|||||||
m_AuxMachTypeList.Add(New StringIdCmBx(4, EgtMsg(91069)))
|
m_AuxMachTypeList.Add(New StringIdCmBx(4, EgtMsg(91069)))
|
||||||
End If
|
End If
|
||||||
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
||||||
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or
|
||||||
|
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
m_AuxMachTypeList.Add(New StringIdCmBx(3, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 8)))
|
m_AuxMachTypeList.Add(New StringIdCmBx(3, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 8)))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -490,6 +503,8 @@ Public Class ChooseMachining
|
|||||||
Dim nDeltaRow As Integer = 4
|
Dim nDeltaRow As Integer = 4
|
||||||
Dim nNewRow As Integer = 2
|
Dim nNewRow As Integer = 2
|
||||||
' nascondo tutte le CmBx e TxBl
|
' nascondo tutte le CmBx e TxBl
|
||||||
|
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
|
CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Hidden
|
||||||
CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden
|
CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden
|
CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden
|
||||||
CurrMillingTxBl.Visibility = Windows.Visibility.Hidden
|
CurrMillingTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
@@ -499,6 +514,33 @@ Public Class ChooseMachining
|
|||||||
CurrWJettingTxBl.Visibility = Windows.Visibility.Hidden
|
CurrWJettingTxBl.Visibility = Windows.Visibility.Hidden
|
||||||
CurrWJettingCmBx.Visibility = Windows.Visibility.Hidden
|
CurrWJettingCmBx.Visibility = Windows.Visibility.Hidden
|
||||||
|
|
||||||
|
' -- LAMA TILTED -- se definito il cambio utensile con lama
|
||||||
|
'If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
|
If Not String.IsNullOrEmpty(m_CurrentMachine.sCurrSawTilted) Then
|
||||||
|
' Definizione di due righe della tabella con la giusta altezza
|
||||||
|
For Index As Integer = 1 To nNewRow
|
||||||
|
Dim Row As New RowDefinition
|
||||||
|
Row.Height = New GridLength(0.5, GridUnitType.Star)
|
||||||
|
ChooseMachiningGrid.RowDefinitions.Add(Row)
|
||||||
|
Next
|
||||||
|
m_RowNumber = m_RowNumber + nNewRow
|
||||||
|
' titolo della ComboBox
|
||||||
|
CurrSawingTiltedTxBl.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow)
|
||||||
|
' ComboBox (nella riga successiva al titolo)
|
||||||
|
CurrSawingTiltedCmBx.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow + 1)
|
||||||
|
'ButtonsGrid.SetValue(Grid.RowProperty, 5)
|
||||||
|
If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then
|
||||||
|
CurrSawingTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawingTilted
|
||||||
|
End If
|
||||||
|
' verifico che la selezione sia andata a buon fine, altrimenti comunico l'avvenuta modifica
|
||||||
|
If String.IsNullOrEmpty(CurrSawingTiltedCmBx.SelectedItem) Then
|
||||||
|
' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica
|
||||||
|
If CurrSawingTiltedCmBx.SelectedItem <> m_CurrentMachine.sCurrSawingTilted Then m_MachIsModified = True
|
||||||
|
End If
|
||||||
|
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible
|
||||||
|
CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Visible
|
||||||
|
End If
|
||||||
|
|
||||||
' -- FORATURA -- se foretto presente
|
' -- FORATURA -- se foretto presente
|
||||||
If m_CurrentMachine.bDrill And m_DrillingList.Count() > 0 Then
|
If m_CurrentMachine.bDrill And m_DrillingList.Count() > 0 Then
|
||||||
' Definizione di due righe della tabella con la giusta altezza
|
' Definizione di due righe della tabella con la giusta altezza
|
||||||
@@ -621,6 +663,20 @@ Public Class ChooseMachining
|
|||||||
m_MainWindow.m_CurrentMachine.sCurrSawing = CurrSawingCmBx.SelectedItem.ToString()
|
m_MainWindow.m_CurrentMachine.sCurrSawing = CurrSawingCmBx.SelectedItem.ToString()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ApplySawingTiltedChBx_Checked() Handles ApplySawingTiltedChBx.Click
|
||||||
|
If ApplySawingTiltedChBx.IsChecked Then
|
||||||
|
CurrSawingTiltedCmBx.IsEnabled = True
|
||||||
|
m_MainWindow.m_CurrentMachine.bApplySawingTilted = True
|
||||||
|
Else
|
||||||
|
CurrSawingTiltedCmBx.IsEnabled = False
|
||||||
|
m_MainWindow.m_CurrentMachine.bApplySawingTilted = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CurrSawingTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawingTiltedCmBx.SelectionChanged
|
||||||
|
m_MainWindow.m_CurrentMachine.sCurrSawingTilted = CurrSawingTiltedCmBx.SelectedItem.ToString()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub CurrDrillingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillingCmBx.SelectionChanged
|
Private Sub CurrDrillingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillingCmBx.SelectionChanged
|
||||||
m_MainWindow.m_CurrentMachine.sCurrDrilling = CurrDrillingCmBx.SelectedItem.ToString()
|
m_MainWindow.m_CurrentMachine.sCurrDrilling = CurrDrillingCmBx.SelectedItem.ToString()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Imports EgtWPFLib
|
|||||||
Public Class RawPartPageUC
|
Public Class RawPartPageUC
|
||||||
|
|
||||||
' Dati generali CN
|
' Dati generali CN
|
||||||
Friend m_CN As CN_generico
|
' Friend m_CN As CN_generico
|
||||||
|
|
||||||
' Riferimento alla MainWindow
|
' Riferimento alla MainWindow
|
||||||
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ Public Class SimulationPageUC
|
|||||||
Friend Sub ResetSimulation()
|
Friend Sub ResetSimulation()
|
||||||
' Termino la simulazione
|
' Termino la simulazione
|
||||||
SetStatus(MCH_SIM_ST.UI_STOP)
|
SetStatus(MCH_SIM_ST.UI_STOP)
|
||||||
|
System.Threading.Thread.Sleep(250)
|
||||||
EgtSimExit()
|
EgtSimExit()
|
||||||
' Salvo valore dello slider
|
' Salvo valore dello slider
|
||||||
Dim sVal As String = DoubleToString(SpeedSlider.Value, 1)
|
Dim sVal As String = DoubleToString(SpeedSlider.Value, 1)
|
||||||
@@ -86,6 +87,7 @@ Public Class SimulationPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
|
EgtOutLog(" -- PREPARE SIMUL --")
|
||||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
' Elimino eventuale attrezzaggio da OmagOFFICE
|
||||||
@@ -110,9 +112,9 @@ Public Class SimulationPageUC
|
|||||||
If bOk Then m_CurrProjPage.SetOrderMachiningFlag()
|
If bOk Then m_CurrProjPage.SetOrderMachiningFlag()
|
||||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
||||||
If bModif Then
|
If bModif Then
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
|
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
@@ -130,7 +132,7 @@ Public Class SimulationPageUC
|
|||||||
' Se errore in setup, lo segnalo
|
' Se errore in setup, lo segnalo
|
||||||
If Not bSetup Then
|
If Not bSetup Then
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
|
||||||
' Se errore in generazione, segnalo l'errore
|
' Se errore in generazione, segnalo l'errore
|
||||||
ElseIf Not bOk Then
|
ElseIf Not bOk Then
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
End If
|
End If
|
||||||
@@ -170,7 +172,7 @@ Public Class SimulationPageUC
|
|||||||
' Nascondo eventuale contorno da foto
|
' Nascondo eventuale contorno da foto
|
||||||
m_CurrProjPage.ShowContour(False)
|
m_CurrProjPage.ShowContour(False)
|
||||||
' Nascondo eventuali testi con dati su aree
|
' Nascondo eventuali testi con dati su aree
|
||||||
m_CurrProjPage.SetAreasStatus( false)
|
m_CurrProjPage.SetAreasStatus(False)
|
||||||
' Recupero eventuale fase di ripartenza
|
' Recupero eventuale fase di ripartenza
|
||||||
m_nRestart = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart()
|
m_nRestart = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart()
|
||||||
' Imposto prima fase
|
' Imposto prima fase
|
||||||
@@ -483,7 +485,8 @@ Public Class SimulationPageUC
|
|||||||
|
|
||||||
Private Function LoadCurrTools() As Boolean
|
Private Function LoadCurrTools() As Boolean
|
||||||
' Se macchina senza cambio utensile automatico devo caricare gli utensili
|
' Se macchina senza cambio utensile automatico devo caricare gli utensili
|
||||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
|
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER And
|
||||||
|
m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
If Not EgtLoadTool("H1", 1, sSaw) Then Return False
|
If Not EgtLoadTool("H1", 1, sSaw) Then Return False
|
||||||
|
|||||||
@@ -453,6 +453,27 @@ Module Utility
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' Restituisce il colore dell'utensile correntemente settato, se non trova l'utesile o il colore ritorna il default (0,255,0)
|
||||||
|
Friend Function GetColorPV() As Color3d
|
||||||
|
Dim ToolString As String = String.Empty
|
||||||
|
Dim ToolColor As String = String.Empty
|
||||||
|
'EgtTdbGetCurrToolParam(MCH_MP.SYSNOTES, ToolString)
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.SYSNOTES, ToolString)
|
||||||
|
EgtTdbGetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ToolColor)
|
||||||
|
Dim sItems As String() = ToolColor.Split(","c)
|
||||||
|
' Verifico che siano almeno 3 campi
|
||||||
|
If sItems.Count < 3 Then
|
||||||
|
Return New Color3d(0, 255, 0, 100)
|
||||||
|
Else
|
||||||
|
' Verifico che tutti i campi siano numerici
|
||||||
|
If IsNumeric(sItems(0)) And IsNumeric(sItems(1)) And IsNumeric(sItems(2)) Then
|
||||||
|
Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2)), 100)
|
||||||
|
Else
|
||||||
|
Return New Color3d(0, 255, 0, 100)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------------------------
|
||||||
Public Class Language
|
Public Class Language
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user