Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 141522fccb | |||
| ab283a3efa | |||
| 45948e7004 | |||
| e710c55c2c | |||
| dbcd4ca7a0 | |||
| 88ff42a8c6 | |||
| daeaec3b6b | |||
| 6173e1dc15 | |||
| 70177a4a0e | |||
| b6f4e0e2d7 | |||
| 34fe2b1810 | |||
| 0e42d59e21 | |||
| d962c43e0c | |||
| 55bb27e40f | |||
| eed9b0a81d | |||
| 1dba739917 | |||
| 283dc6d188 | |||
| 325cecf91b | |||
| 5e3fbbaaaa | |||
| fc7edae5f8 | |||
| 4277434fce | |||
| c0e8838394 | |||
| bd006a197f | |||
| 82a99ff2b0 | |||
| 21f7f23c3f | |||
| 3c2c0a48ff | |||
| fadb601732 | |||
| 2d385229d2 | |||
| cfcde65bd7 | |||
| 6c72457108 | |||
| a7d89047bd | |||
| 6c7d27d9e9 | |||
| 95bfb04511 | |||
| faddb8bbad | |||
| be97eb2b80 | |||
| e06e721c65 | |||
| f51b990674 | |||
| f79cffb414 | |||
| 76f4ef1732 | |||
| 79eddf4628 | |||
| ae2e64bcb0 | |||
| 7a1cbbeb82 | |||
| 7d647fd1c4 | |||
| 97836125a7 | |||
| 908cc381db | |||
| 8436250574 | |||
| 7d0c63e92b | |||
| 0569f3b0ad | |||
| e01b93a76b | |||
| f0f6c4484e | |||
| 3740ec6de7 | |||
| 6feae32493 | |||
| 1ca93f2943 | |||
| bcba126741 | |||
| 7c9a26b3af | |||
| 5263813253 | |||
| 7182059818 | |||
| 09f3b0b534 | |||
| 37adc352a1 | |||
| 2708670d9a | |||
| 737366ba27 | |||
| d10588867f | |||
| 54158406b7 | |||
| 5c3c231729 | |||
| d3c0b1c2c6 | |||
| ad04e5d916 | |||
| db623544e9 | |||
| 3075c2f4af | |||
| 045e7cba61 | |||
| 57d4a29b74 | |||
| b045f0ce7b | |||
| 41767f4f3a | |||
| 85f05f280f | |||
| b4338ef88e | |||
| 9d6236b767 | |||
| d946c39a9d | |||
| 55bd41ca4c | |||
| 5e6208a9c4 | |||
| 29ecd7c780 | |||
| 6ca56d3a12 | |||
| b4ef388603 | |||
| aebfb05b94 | |||
| 04a7c05e99 | |||
| 8cc0d88600 |
@@ -36,7 +36,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="LogoBrd" Grid.Column="1">
|
||||
<Image Source="../Resources/NewIcons/Logo-Egalware (3).png" Stretch="Uniform"/>
|
||||
<Image Source="../Resources/NewIcons/Logo-Egalware.png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
|
||||
@@ -32,7 +32,7 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function AddSawMachining(nOperId As Integer, ByRef nNewOperation As Integer) As Boolean
|
||||
Friend Function UpdateSawing(nOperId As Integer, ByRef nNewOperation As Integer) As Boolean
|
||||
EgtLuaCreateGlobTable("CAM")
|
||||
SetLuaStandardCamParams()
|
||||
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
|
||||
@@ -89,7 +89,6 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
' versione CamAuto 2.6l1: gestione tagli con ridotto affondamento
|
||||
Friend Function AddWaterJetMachining(LocaList As List(Of Integer), ByRef nWarn As Integer) As Boolean
|
||||
EgtLuaCreateGlobTable("CAM")
|
||||
SetLuaStandardCamParams()
|
||||
@@ -149,11 +148,30 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function InvertWaterjet(nOperId As Integer) As Boolean
|
||||
EgtLuaCreateGlobTable("CAM")
|
||||
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.InvertWaterjet")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllMachinings() As Boolean
|
||||
Dim nWarn As Integer = 0
|
||||
Return ResetAllMachinings(nWarn)
|
||||
End Function
|
||||
|
||||
' Ricalcola tutte le lavorazioni
|
||||
Friend Function ResetAllMachinings(ByRef nWarn As Integer) As Boolean
|
||||
' Cancello tutte le lavorazioni
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
@@ -162,7 +180,7 @@ Friend Module CamAuto
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
|
||||
' Reinserisco tutte le lavorazioni piane
|
||||
AddMachinings(GDB_ID.NULL, nWarn)
|
||||
' Se altrimenti progetto con cornici
|
||||
' Se altrimenti progetto con cornici
|
||||
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
|
||||
' Reinserisco tutte le lavorazioni delle cornici
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||
@@ -170,56 +188,61 @@ Friend Module CamAuto
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Elimina da ogni entità il nome della lavorazione asseganta
|
||||
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
|
||||
' Controllo le geometrie dei pezzi in parcheggio
|
||||
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)
|
||||
RestoreDefaultTiltedSawing(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
|
||||
nIdPart = EgtGetNextPart(nIdPart)
|
||||
End While
|
||||
' Controllo le geometrie dei pezzi inseriti nei grezzi
|
||||
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)
|
||||
RestoreDefaultTiltedSawing(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
|
||||
nIdLayerOutLoop = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP & ".orig")
|
||||
If nIdLayerOutLoop <> GDB_ID.NULL Then
|
||||
nEntId = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||
RestoreDefaultTiltedSawing(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
|
||||
End If
|
||||
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||
End While
|
||||
Return bOk
|
||||
Return True
|
||||
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)
|
||||
Private Sub RestoreDefaultTiltedSawing(nEntId As Integer, sSawingTilted As String, bApply As Boolean, bOnlySideAng As Boolean)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
Dim sInfoOrigSideAng As String = String.Empty
|
||||
EgtGetInfo(nEntId, INFO_ORIG_SIDE_ANGLE, sInfoOrigSideAng)
|
||||
' Se è un'entità associata ad una lavorazione inclinata
|
||||
If Not String.IsNullOrEmpty(sInfoOrigSideAng) AndAlso sInfoOrigSideAng <> "0" Then
|
||||
If bApplySawingTilted Then
|
||||
' forzo la lavorazione inclinata
|
||||
Dim dOrigSideAng As Double = 0
|
||||
EgtGetInfo(nEntId, INFO_ORIG_SIDE_ANGLE, dOrigSideAng)
|
||||
' Se è un'entità con lavorazione inclinata
|
||||
If Math.Abs( dOrigSideAng) > EPS_ANG_SMALL Then
|
||||
' Se richiesta applicazione
|
||||
If bApply Then
|
||||
' Se non definita lavorazione specifica applico qualla standard
|
||||
If String.IsNullOrEmpty(sSawingTilted) Then
|
||||
' ma se non esiste nessuna lavorezione specifica applico qualla standard
|
||||
EgtRemoveInfo(nEntId, DEF_MACHINING_TILTED)
|
||||
' altrimenti applico quella specifica
|
||||
Else
|
||||
' Applico quella specificata
|
||||
EgtSetInfo(nEntId, DEF_MACHINING_TILTED, sSawingTilted)
|
||||
End If
|
||||
' altrimenti rimuovo la lavorazione specifica (verrà poi applicata quella standard)
|
||||
Else
|
||||
' Rimuovo la lavorazione e applico quella standard
|
||||
EgtRemoveInfo(nEntId, DEF_MACHINING_TILTED)
|
||||
End If
|
||||
|
||||
' altrimenti se richiesta modifica anche delle altre
|
||||
ElseIf Not bOnlySideAng Then
|
||||
Dim sInfo As String = String.Empty
|
||||
EgtGetInfo(nEntId, DEF_MACHINING, sInfo)
|
||||
' se esiste una lavorazione specificata allora la rimuovo
|
||||
If Not String.IsNullOrEmpty(sInfo) Then
|
||||
' se esiste una lavorazione specificata allora la rimuovo
|
||||
EgtRemoveInfo(nEntId, DEF_MACHINING)
|
||||
End If
|
||||
End If
|
||||
@@ -232,7 +255,7 @@ Friend Module CamAuto
|
||||
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, LAY_AUX_SPLIT_WJ)
|
||||
EgtErase(IdAuxLayer)
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
@@ -247,7 +270,7 @@ Friend Module CamAuto
|
||||
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
|
||||
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, LAY_AUX_SPLIT_WJ)
|
||||
EgtErase(IdAuxLayer)
|
||||
' accedo al Layer OutLoop
|
||||
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||
@@ -281,12 +304,9 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllBRidges() As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
Dim nMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
|
||||
bOk = EgtErase(nBridgesGroup)
|
||||
Return bOk
|
||||
Friend Function ResetAllBridges() As Boolean
|
||||
Dim nBridgesGroupId As Integer = EgtGetFirstNameInGroup(EgtGetCurrMachGroup(), "Bridges")
|
||||
Return EgtErase(nBridgesGroupId)
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllSplitCut() As Boolean
|
||||
@@ -305,7 +325,7 @@ Friend Module CamAuto
|
||||
Dim nNextParId As Integer = EgtGetNextPartInRawPart(nParId)
|
||||
' verifico se il pezzo passato è un taglio di sepatazione (il nome deve contenere "SpliCut")
|
||||
Dim sName As String = String.Empty
|
||||
If EgtGetName(nParId, sName) AndAlso sName.Contains(SPLIT_CUT) Then
|
||||
If EgtGetName(nParId, sName) AndAlso sName.Contains(NAME_SPLIT_CUT) Then
|
||||
' Rimuovo il pezzo dal grezzo
|
||||
If EgtRemovePartFromRawPart(nParId) Then
|
||||
' Salvo l'indice del pezzo se non è stato già inserito
|
||||
@@ -583,18 +603,20 @@ Friend Module CamAuto
|
||||
' Verifico che per tutte le lavorazioni sia attrezzato l'utensile
|
||||
Friend Function VerifySetup(ByRef sMissingTools As String) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
Dim CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||
sMissingTools = ""
|
||||
Dim bIsMultiCut = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
sMissingTools = String.Empty
|
||||
Dim nId As Integer = EgtGetFirstOperation()
|
||||
While nId <> GDB_ID.NULL
|
||||
If IsValidMachining(nId) Then
|
||||
Dim nType As Integer = MCH_OY.NONE
|
||||
EgtGetMachiningParam(MCH_MP.TYPE, nType)
|
||||
Dim sTuuid As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
Dim sTool2 As String = String.Empty
|
||||
EgtGetMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
Dim sTool As String = String.Empty
|
||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
Dim nToolType As Integer = MCH_TY.NONE
|
||||
if EgtTdbSetCurrTool( sTool) Then EgtTdbGetCurrToolParam( MCH_TP.TYPE, nToolType)
|
||||
If String.IsNullOrWhiteSpace(sTool) Then
|
||||
Dim sMchTool As String = ""
|
||||
EgtGetMachiningParam(MCH_MP.TOOL, sMchTool)
|
||||
@@ -603,6 +625,7 @@ Friend Module CamAuto
|
||||
sMissingTools = sMissingTools & sMchTool & ", "
|
||||
End If
|
||||
ElseIf nType = MCH_OY.SAWING Or nType = MCH_OY.SAWROUGHING Or nType = MCH_OY.SAWFINISHING Then
|
||||
Dim sTool2 As String = String.Empty
|
||||
If bIsMultiCut Then
|
||||
' L'utensile sulla seconda testa ha lo stesso nome di quello sulla prima con suffisso "-2"
|
||||
If sTool.Substring(sTool.Length() - 2) = "-2" Then
|
||||
@@ -610,33 +633,25 @@ Friend Module CamAuto
|
||||
End If
|
||||
sTool2 = sTool & "-2"
|
||||
End If
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
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
|
||||
If CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
Dim bOnTC As Boolean = FindToolOnChanger( sTool)
|
||||
If Not bOnTC 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
|
||||
ElseIf String.Compare(sTool, CurrMachine.sCurrSaw) <> 0 AndAlso
|
||||
(String.IsNullOrWhiteSpace(sTool2) OrElse String.Compare(sTool2, CurrMachine.sCurrSaw) <> 0) AndAlso
|
||||
String.Compare(sTool, CurrMachine.sCurrDripSaw) <> 0 Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.DRILLING Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDrill) <> 0 And
|
||||
String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDripDrill) <> 0 And
|
||||
If String.Compare(sTool, CurrMachine.sCurrDrill) <> 0 And
|
||||
String.Compare(sTool, CurrMachine.sCurrDripDrill) <> 0 And
|
||||
Not FindToolOnChanger(sTool) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
@@ -644,17 +659,56 @@ Friend Module CamAuto
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.MILLING Then
|
||||
' Verifico anche le lame perchè il taglio di lama singolo sulle cornici è una lavorazione di fresatura
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrMill) <> 0 And
|
||||
Not FindToolOnChanger(sTool) And
|
||||
String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0 Then
|
||||
' Se lucidatura e frese manuali, non deve essere attrezzato l'utensile ausiliario
|
||||
If nToolType = MCH_TY.MILL_POLISHING AndAlso
|
||||
( CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Or
|
||||
CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER) Then
|
||||
If Not String.IsNullOrWhiteSpace(CurrMachine.sCurrDrill) OrElse
|
||||
Not String.IsNullOrWhiteSpace(CurrMachine.sCurrMill) OrElse
|
||||
Not String.IsNullOrWhiteSpace(CurrMachine.sCurrMillNoTip) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
EgtOutLog("-->Remove Auxiliary Tool (Polishing needs None)")
|
||||
End If
|
||||
End If
|
||||
' Verifico sia la fresa corrente, oppure sia attrezzato oppure la lama corrente
|
||||
' Accetto comunque le mole per lucidatura (al momento non vengono attrezzate)
|
||||
ElseIf String.Compare(sTool, CurrMachine.sCurrMill) <> 0 AndAlso
|
||||
Not FindToolOnChanger(sTool) AndAlso
|
||||
String.Compare(sTool, CurrMachine.sCurrSaw) <> 0 AndAlso
|
||||
nToolType <> MCH_TY.MILL_POLISHING Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.POCKETING Then
|
||||
' Se lucidatura e frese manuali, non deve essere attrezzato l'utensile ausiliario
|
||||
If nToolType = MCH_TY.MILL_POLISHING AndAlso
|
||||
( CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Or
|
||||
CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER) Then
|
||||
If Not String.IsNullOrWhiteSpace(CurrMachine.sCurrDrill) OrElse
|
||||
Not String.IsNullOrWhiteSpace(CurrMachine.sCurrMill) OrElse
|
||||
Not String.IsNullOrWhiteSpace(CurrMachine.sCurrMillNoTip) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
EgtOutLog("-->Remove Auxiliary Tool (Polishing needs None)")
|
||||
End If
|
||||
End If
|
||||
' Verifico sia la mola da scasso corrente, oppure sia attrezzato
|
||||
' Accetto comunque le mole per lucidatura (al momento non vengono attrezzate)
|
||||
ElseIf String.Compare(sTool, CurrMachine.sCurrMillNoTip) <> 0 AndAlso
|
||||
Not FindToolOnChanger(sTool) AndAlso
|
||||
nToolType <> MCH_TY.MILL_POLISHING Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.WATERJETTING Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrWaterJet) <> 0 And
|
||||
If String.Compare(sTool, CurrMachine.sCurrWaterJet) <> 0 And
|
||||
Not FindToolOnChanger(sTool) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
@@ -687,6 +741,34 @@ Friend Module CamAuto
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function CanChangeSaw() As Boolean
|
||||
' Se non è TC anche per lama, non è possibile
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
Return False
|
||||
End If
|
||||
' Se è nei TC manuali con posizione T0, non è possibile
|
||||
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||
If m_MainWindow.m_CurrentMachine.sCurrSaw = ToolPosition.sTool And ToolPosition.sName = "T0" Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
' Si può cambiare
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CanChangeTool() As Boolean
|
||||
' Se solo lama, non è possibile
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAW Then
|
||||
Return False
|
||||
End If
|
||||
' Se non è TC anche per lama, sempre possibile
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
Return True
|
||||
End If
|
||||
' Altrimenti possibile solo se si può cambiare lama
|
||||
Return CanChangeSaw()
|
||||
End Function
|
||||
|
||||
Friend Function TestAllMachiningsForStrict() As Boolean
|
||||
Dim bModified As Boolean = False
|
||||
' Affondamento ridotto
|
||||
@@ -1026,6 +1108,8 @@ Friend Module CamAuto
|
||||
Dim bMillingOnCorners As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
Dim bMillingOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||
Dim bWaterjetOptimize As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
Dim bWaterjetOnSinks As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
|
||||
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
|
||||
EgtLuaSetGlobStringVar("CAM.SAWTILTEDMCH", sSawTiltedMch)
|
||||
@@ -1045,6 +1129,8 @@ Friend Module CamAuto
|
||||
EgtLuaSetGlobBoolVar("CAM.MILLINGONCORNERS", bMillingOnCorners)
|
||||
EgtLuaSetGlobBoolVar("CAM.MILLINGONSINKS", bMillingOnSinks)
|
||||
EgtLuaSetGlobNumVar("CAM.MILLINGSHORT", dMillingShort)
|
||||
EgtLuaSetGlobBoolVar("CAM.WATERJETOPTIMIZE", bWaterjetOptimize)
|
||||
EgtLuaSetGlobBoolVar("CAM.WATERJETONSINKS", bWaterjetOnSinks)
|
||||
EgtLuaSetGlobNumVar("CAM.RAWHEIGHT", GetRawHeight())
|
||||
EgtLuaSetGlobNumVar("CAM.REGROT", GetRegistrationRotation())
|
||||
Return True
|
||||
@@ -1467,14 +1553,14 @@ Friend Module CamAuto
|
||||
dStartDist = dEndDist
|
||||
dEndDist = dTemp
|
||||
End If
|
||||
' altrimenti
|
||||
' altrimenti
|
||||
Else
|
||||
Dim vtSide As Vector3d
|
||||
' Se faccia non limitata da altre o sopra la limitante
|
||||
If bFree Then
|
||||
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_DOWN)
|
||||
vtSide = Vector3d.Z_AX()
|
||||
' altrimenti è stata trovata una faccia adiacente limitante
|
||||
' altrimenti è stata trovata una faccia adiacente limitante
|
||||
Else
|
||||
If vtAdjN.x > 10 * EPS_SMALL Then
|
||||
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_LEFT)
|
||||
@@ -1537,7 +1623,7 @@ Friend Module CamAuto
|
||||
EgtSetMachiningParam(MCH_MP.STEPTYPE, If(nStepType = MCH_SAW_ST.ONEWAY, MCH_MIL_ST.ONEWAY, MCH_MIL_ST.ZIGZAG))
|
||||
If dStep >= EPS_SMALL And dStep < dElev Then
|
||||
EgtSetMachiningParam(MCH_MP.STEP_, dStep)
|
||||
EgtSetMachiningParam(MCH_MP.USERNOTES, "SideElev=" & dElev.ToString() & ";")
|
||||
EgtSetMachiningParam(MCH_MP.USERNOTES, "SideElev=" & DoubleToString( dElev, 1) & ";")
|
||||
End If
|
||||
' Recupero la distanza di sicurezza
|
||||
Dim dSafeZ As Double = m_MainWindow.m_CurrentMachine.dSafeZ()
|
||||
|
||||
@@ -149,13 +149,13 @@ Public Class CSVPage
|
||||
Dim sRefGroup As String = String.Empty
|
||||
EgtGetInfo(m_nIdToSel, INFO_REFGROUP, sRefGroup)
|
||||
' deseleziono il pezzo corrente
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectPartInFaimily(sRefGroup)
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectPartInFamily(sRefGroup)
|
||||
Select Case SelectWD.NumberOfSelection
|
||||
Case 0 ' Annulla
|
||||
' continuo senza eseguire niente
|
||||
Case Else
|
||||
' seleziono il numero di pezzi indicati
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectPartInFaimily(sRefGroup, SelectWD.NumberOfSelection)
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectPartInFamily(sRefGroup, SelectWD.NumberOfSelection)
|
||||
End Select
|
||||
m_bIsCounterLy = False
|
||||
' disassegno il riferimento all'oggetto appena creato
|
||||
|
||||
@@ -109,7 +109,7 @@ Public Class CadCutPageUC
|
||||
|
||||
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
@@ -145,7 +145,7 @@ Public Class CadCutPageUC
|
||||
|
||||
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
@@ -173,7 +173,7 @@ Public Class CadCutPageUC
|
||||
|
||||
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
@@ -183,7 +183,7 @@ Public Class CadCutPageUC
|
||||
|
||||
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
@@ -207,7 +207,7 @@ Public Class CadCutPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.15*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.15*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
|
||||
@@ -4,7 +4,7 @@ Imports EgtUILib
|
||||
Public Class ChangeToolWD
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Private m_SetUpMachiningList As New ObservableCollection(Of ItemMachining)
|
||||
Private m_MachiningList As New ObservableCollection(Of ItemMachining)
|
||||
|
||||
Sub New(Owner As Window)
|
||||
Me.Owner = Owner
|
||||
@@ -68,25 +68,25 @@ Public Class ChangeToolWD
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
Private Sub ChangeToolWD_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
|
||||
SetUpToolListBox.ItemsSource = m_MachiningList
|
||||
' Seleziona lavorazione
|
||||
FilePathTxBl.Text = EgtMsg(90378)
|
||||
End Sub
|
||||
|
||||
Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
Private Sub ChangeToolWD_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)
|
||||
Dim Item As ItemMachining = m_MachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing)
|
||||
Dim Index As Integer = m_MachiningList.IndexOf(Item)
|
||||
If Index < 0 Then
|
||||
' Imposto lavorazione di default
|
||||
EgtMdbSetCurrMachining(m_CurrSawing)
|
||||
@@ -97,8 +97,8 @@ Public Class ChangeToolWD
|
||||
Index = 0
|
||||
End If
|
||||
' se presente seleziono il primo elemento
|
||||
If m_SetUpMachiningList.Count > 0 Then
|
||||
SetUpToolListBox.SelectedItem = m_SetUpMachiningList(Index)
|
||||
If m_MachiningList.Count > 0 Then
|
||||
SetUpToolListBox.SelectedItem = m_MachiningList(Index)
|
||||
OkBtn.IsEnabled = True
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
@@ -109,54 +109,55 @@ Public Class ChangeToolWD
|
||||
|
||||
' 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
|
||||
' Pulisco la lista delle lavorazioni di lama
|
||||
m_MachiningList.Clear()
|
||||
' 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()
|
||||
Dim SawingList As List(Of String) = GetAllSawing()
|
||||
' 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)
|
||||
|
||||
If SawingList.Count() = 0 Then Return False
|
||||
' Carico le lavorazioni di lama compatibili
|
||||
CreateSawingList(SawingList)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Creo la lista delle delle lavorazioni di lama da proporre
|
||||
Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem)
|
||||
Private Sub CreateSawingList(SawingList As List(Of String))
|
||||
' Recupero le info della lama montata di default
|
||||
GetDiamAndThickDefaultSaw()
|
||||
' Verifico se lama fissa
|
||||
Dim bFixedSaw As Boolean = Not CamAuto.CanChangeSaw()
|
||||
' recupero la prima lavorazione
|
||||
For Each Item As TreeViewItem.CustomItem In SawingFam.Items
|
||||
Dim sNameTool As String = String.Empty
|
||||
For Each sSawingName As String In SawingList
|
||||
Dim sToolName As String = ""
|
||||
' Imposto la lavorazione corrente
|
||||
EgtMdbSetCurrMachining(Item.Name)
|
||||
EgtMdbSetCurrMachining(sSawingName)
|
||||
' 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
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sToolName)
|
||||
If String.IsNullOrWhiteSpace( sToolName) Then Continue For
|
||||
' Se lama fissa
|
||||
If bFixedSaw Then
|
||||
' Sono ammesse solo altre lavorazioni con la stessa lama
|
||||
If sToolName = m_DefaultSaw_Name AndAlso VerifyCurrMachiningMaterial() Then
|
||||
' recupero eventuale posizione
|
||||
EgtTdbSetCurrTool(sToolName)
|
||||
Dim sTCPos As String = ""
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||
' inserisco in lista
|
||||
m_MachiningList.Add(New ItemMachining(sSawingName, sToolName, sTCPos, New Color3d(0, 0, 0, 100)))
|
||||
End If
|
||||
' altrimenti (ammessa solo se da TC)
|
||||
Else
|
||||
' Verifico compatibilità nelle dimensioni lama e nei materiali ammessi dalla lavorazione
|
||||
If Not( VerifyCurrSawTolerance(sToolName) AndAlso VerifyCurrMachiningMaterial()) Then Continue For
|
||||
' Cerco la lama nel TC
|
||||
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If sToolName = ToolPosition.sTool Then
|
||||
m_MachiningList.Add(New ItemMachining(sSawingName, sToolName, ToolPosition.sName, Utility.GetColorPV()))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
' reimposto la lavorazione di lama e la lama impostate in macchina
|
||||
@@ -164,54 +165,44 @@ Public Class ChangeToolWD
|
||||
EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing)
|
||||
End Sub
|
||||
|
||||
' verifico l'utensile corrente (impostato nella funzione chiamante) se può lavorare il grezzo corrente
|
||||
' Verifico se la lavorazione impostata nella chiamante e quindi corrente 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))
|
||||
' Stringa identificativa del materiale corrente
|
||||
Dim sCurrMatId As String = m_MainWindow.m_CurrentMachine.CurrMat.nId.ToString()
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||
sCurrMatId &= "." & m_MainWindow.m_CurrentMachine.CurrMat.SubId.ToString()
|
||||
End If
|
||||
' Recupero elenco materiali della lavorazione
|
||||
Dim sSysNotes As String = ""
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, sSysNotes)
|
||||
If String.IsNullOrWhiteSpace( sSysNotes) Then Return False
|
||||
' Cerco un materiale compatibile con il corrente
|
||||
Dim sItems() As String = sSysNotes.Split(";".ToCharArray)
|
||||
For Ind As Integer = 0 To sItems.Count() - 1
|
||||
' Divido il materiale nei suoi parametri
|
||||
Dim sParams() = sItems(Ind).Split(",".ToCharArray)
|
||||
' Se è il materiale del grezzo corrente
|
||||
If sParams.Count() >= 3 AndAlso Trim(sParams(0)) = sCurrMatId Then
|
||||
' Verifico rientri nello spessore ammesso
|
||||
Dim dMinTh As Double = 0
|
||||
Dim dMaxTh As Double = 0
|
||||
StringToDouble(sParams(1), dMinTh)
|
||||
StringToDouble(sParams(2), dMaxTh)
|
||||
If dMinTh < dMaxTh - 10 * EPS_SMALL And
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight >= dMinTh And
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight <= dMaxTh Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
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
|
||||
' Non ho trovato niente
|
||||
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
|
||||
Private Function VerifyCurrSawTolerance(sNameTool As String) As Boolean
|
||||
If m_DefaultSaw_Exists Then
|
||||
If EgtTdbSetCurrTool(sNameTool) Then
|
||||
' Diametro nuova lama
|
||||
@@ -220,42 +211,41 @@ Public Class ChangeToolWD
|
||||
' Spessore lama
|
||||
Dim NewThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, NewThick)
|
||||
' Verifico che la nuova lama possa essere applicata: diametro minore, uguale spessore
|
||||
' Verifico che la nuova lama possa essere applicata: diametro max 1.25*prec, 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
|
||||
If Delta_Diam < 0.25 * m_DefaultSaw_Diam 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))
|
||||
EgtOutLog(String.Format("New saw {0} can not replace 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)
|
||||
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!")
|
||||
EgtOutLog("There is no machine CurrSaw!")
|
||||
Else
|
||||
EgtOutLog("Impossible to find in tooldb currsaw setted in machine: " & m_DefaultSaw_Name)
|
||||
EgtOutLog("Impossible to find in toolDB machine CurrSaw: " & 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
|
||||
' Restituisce tutto l'elenco delle lavorazioni di taglio di lama disponibili in macchina
|
||||
Private Function GetAllSawing() As List(Of String)
|
||||
Dim sFName As String = EgtMsg(90771) ' Uscita
|
||||
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 SawingList As New List(Of String)
|
||||
Dim nFType As Integer = MCH_MY.SAWING
|
||||
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
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(nFType, MachiningName)
|
||||
While bFound
|
||||
SawingList.Add( MachiningName)
|
||||
bFound = EgtMdbGetNextMachining(nFType, MachiningName)
|
||||
End While
|
||||
Return SawingList
|
||||
End Function
|
||||
|
||||
#End Region ' Set up machinining
|
||||
@@ -266,12 +256,12 @@ Public Class ChangeToolWD
|
||||
' Recupero item selezionato
|
||||
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
Else
|
||||
m_NewSawing = m_MachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_MachiningList(SetUpToolListBox.SelectedIndex).FootprintToolColor
|
||||
m_TCPos = m_MachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
OkBtn.IsEnabled = True
|
||||
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
|
||||
@@ -281,9 +271,9 @@ Public Class ChangeToolWD
|
||||
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
|
||||
m_NewSawing = m_MachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_MachiningList(SetUpToolListBox.SelectedIndex).FootprintToolColor
|
||||
m_TCPos = m_MachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
OkBtn.IsEnabled = True
|
||||
End If
|
||||
End Sub
|
||||
@@ -301,7 +291,7 @@ Public Class ItemMachining
|
||||
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_FootprintToolColor As New Color3d(0, 255, 0, 100)
|
||||
Private m_cSawColor As SolidColorBrush
|
||||
|
||||
' Posizione porta utensile
|
||||
@@ -352,12 +342,12 @@ Public Class ItemMachining
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PrintFootToolColor As Color3d
|
||||
Public Property FootprintToolColor As Color3d
|
||||
Get
|
||||
Return m_PrintFootToolColor
|
||||
Return m_FootprintToolColor
|
||||
End Get
|
||||
Set(value As Color3d)
|
||||
m_PrintFootToolColor = value
|
||||
m_FootprintToolColor = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -374,8 +364,8 @@ Public Class ItemMachining
|
||||
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))
|
||||
m_FootprintToolColor = cColor
|
||||
m_cSawColor = New SolidColorBrush(Color.FromRgb(m_FootprintToolColor.R, m_FootprintToolColor.G, m_FootprintToolColor.B))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -40,25 +40,8 @@ Public Class ChooseTestToolWD
|
||||
End Sub
|
||||
|
||||
Private Function LoadSetUpTool() As Boolean
|
||||
Dim sNameTool As String = String.Empty
|
||||
Dim sHeadTool As String = String.Empty
|
||||
Dim nExitTool As Integer = 0
|
||||
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto la lama
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, True))
|
||||
'End If
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto la fresa
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, False))
|
||||
'End If
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto il foretto
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, False))
|
||||
'End If
|
||||
Dim sNameTool As String = String.Empty
|
||||
|
||||
sNameTool = "Laser point"
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
@@ -79,6 +62,7 @@ Public Class ChooseTestToolWD
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
Return True
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
@@ -95,7 +79,7 @@ Public Class ChooseTestToolWD
|
||||
' Imposto il foretto
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
|
||||
Return True
|
||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
@@ -112,7 +96,6 @@ Public Class ChooseTestToolWD
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
||||
' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger)
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
@@ -141,7 +124,6 @@ Public Class ChooseTestToolWD
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||
@@ -164,12 +146,9 @@ Public Class ChooseTestToolWD
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -405,9 +405,9 @@ Public Class MoveRawPartPage
|
||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
' Aggiorno i dati
|
||||
m_bRawWithCups = False
|
||||
If VacuumCups.bOverWeight Then
|
||||
If VacuumCups.m_bOverWeight Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90364)) ' Pezzo troppo pesante : non si può muovere
|
||||
ElseIf VacuumCups.bExtraStroke Then
|
||||
ElseIf VacuumCups.m_bExtraStroke Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90365)) ' Pezzo oltre le corse : non si può muovere
|
||||
Else
|
||||
' Messaggio di avvertimento
|
||||
@@ -469,16 +469,16 @@ Public Class MoveRawPartPage
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' Veririfica che il grezzo non entri in colliosione con altri pezzi - versione 2.6c3 -
|
||||
' Verifica che il grezzo non entri in collisione con altri pezzi - versione 2.6c3 -
|
||||
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer, Optional IsTaking As Boolean = False) As Boolean
|
||||
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
|
||||
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalare errori per pezzi ricavati interni al grezzo...)
|
||||
If m_SplitPage.m_bOnAuxTab Then Return False
|
||||
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
||||
' Creo gruppo temporaneo in cui generare le superfici per la verifica di collisione
|
||||
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
If m_nTempId = GDB_ID.NULL Then Return False
|
||||
EgtSetName(m_nTempId, "RawTemp")
|
||||
' recupero il contorno del'ID attaccato alle ventose e da questo genero una superificie
|
||||
' recupero le regioni del grezzo attaccato alle ventose e da questo genero una superficie
|
||||
Dim nIdUpRegionOnVac As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawUpReg")
|
||||
Dim nIdDwnRegionOnVac As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawDwnReg")
|
||||
' recupero gli ID di tutti i grezzi della fase corrente
|
||||
@@ -489,38 +489,37 @@ Public Class MoveRawPartPage
|
||||
While nIdRaw <> GDB_ID.NULL
|
||||
' verifico la fase del grezzo
|
||||
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
||||
' recupero il contorno del pezzo e genero la sua sueperificie
|
||||
' recupero le regioni del grezzo
|
||||
Dim nIdUpRegion As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawUpReg")
|
||||
Dim nIdDwnRegion As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawDwnReg")
|
||||
' creo la copia delle superifici
|
||||
' creo la copia delle regioni
|
||||
Dim nCopy_IdDwnRegionOnVac As Integer = EgtCopyGlob(nIdDwnRegionOnVac, m_nTempId)
|
||||
Dim nCopy_nIdUpRegion As Integer = EgtCopyGlob(nIdUpRegion, m_nTempId)
|
||||
' PRELIEVO
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nCopy_nIdUpRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nIdUpRegion) Then
|
||||
' se esiste la regione risultato, allora c'è intersezione
|
||||
If EgtExistsObj(nCopy_IdDwnRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
' Esco: Intersezione TROVATA -> true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
' DEPOSITO : devono essere eseguiti due controlli ulteriori
|
||||
If Not IsTaking Then
|
||||
' DEPOSITO : devono essere esguiti due controlli ulteririori
|
||||
Dim nCopy_IdUpRegionOnVac As Integer = EgtCopyGlob(nIdUpRegionOnVac, m_nTempId)
|
||||
Dim nCopy_nIdDwnRegion As Integer = EgtCopyGlob(nIdDwnRegion, m_nTempId)
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nCopy_nIdDwnRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
nCopy_IdDwnRegionOnVac = EgtCopyGlob(nIdDwnRegionOnVac, m_nTempId)
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nIdDwnRegion) Then
|
||||
' se esiste la regione risultato, allora c'è intersezione
|
||||
If EgtExistsObj(nCopy_IdDwnRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
' Esco: Intersezione TROVATA -> true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
If EgtSurfFrIntersect(nCopy_IdUpRegionOnVac, nCopy_nIdUpRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
Dim nCopy_IdUpRegionOnVac As Integer = EgtCopyGlob(nIdUpRegionOnVac, m_nTempId)
|
||||
If EgtSurfFrIntersect(nCopy_IdUpRegionOnVac, nIdUpRegion) Then
|
||||
' se esiste la regione risultato, allora c'è intersezione
|
||||
If EgtExistsObj(nCopy_IdUpRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
' Esco: Intersezione TROVATA -> true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
@@ -536,7 +535,7 @@ Public Class MoveRawPartPage
|
||||
Dim nVal As Integer = 0
|
||||
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
|
||||
If nVal = 1 Or nVal = 2 Then
|
||||
' 1 → è stato definito come nuovo grezzo oppure, 2 → è stato definito come nuovo grezzo ed è stato inserito nel DB delle lastre
|
||||
' 1 -> definito come nuovo grezzo oppure, 2 -> definito come nuovo grezzo ed inserito nel DB delle lastre
|
||||
ScrapsBtn.Content = EgtMsg(91228) ' Remove Scrap
|
||||
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
|
||||
Return True
|
||||
@@ -579,13 +578,13 @@ Public Class MoveRawPartPage
|
||||
Dim vtMove As New Vector3d(0, m_dStep, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
m_CurrProjPage.ClearMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
VerifyReleasePositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||
VacuumCups.m_ptStartPointLift.y -= vtMove.y
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) 'Pezzo troppo piccolo : non si può muovere
|
||||
@@ -622,13 +621,13 @@ Public Class MoveRawPartPage
|
||||
Dim vtMove As New Vector3d(0, -m_dStep, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
m_CurrProjPage.ClearMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
VerifyReleasePositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||
VacuumCups.m_ptStartPointLift.y -= vtMove.y
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) 'Pezzo troppo piccolo : non si può muovere
|
||||
@@ -648,13 +647,13 @@ Public Class MoveRawPartPage
|
||||
Dim vtMove As New Vector3d(m_dStep, 0, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
m_CurrProjPage.ClearMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
VerifyReleasePositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||
VacuumCups.m_ptStartPointLift.x -= vtMove.x
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) 'Pezzo troppo piccolo : non si può muovere
|
||||
@@ -673,13 +672,13 @@ Public Class MoveRawPartPage
|
||||
Dim vtMove As New Vector3d(-m_dStep, 0, 0)
|
||||
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
|
||||
m_CurrProjPage.ClearMessage()
|
||||
VerifyReleasdPositionIsValid(vtMove)
|
||||
VerifyReleasePositionIsValid(vtMove)
|
||||
' ----------- FINE verifica di essere entro i limiti macchina -----------
|
||||
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||
VacuumCups.m_ptStartPointLift.x -= vtMove.x
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) ' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -691,15 +690,15 @@ Public Class MoveRawPartPage
|
||||
|
||||
#End Region 'Move Up/Down/Left/Right
|
||||
|
||||
' verifica che la poszione da raggiungere sia nei limiti delle corse
|
||||
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
|
||||
' verifica che la posizione da raggiungere sia nei limiti delle corse
|
||||
Private Function VerifyReleasePositionIsValid(ByRef vtMove As Vector3d) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
' determino il punto finale dello spostamento
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.m_ptStartPointLift
|
||||
ptEndPointLift.x += vtMove.x
|
||||
ptEndPointLift.y += vtMove.y
|
||||
Dim sInfo As String = String.Empty
|
||||
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
|
||||
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.m_dDegRotStartAng)
|
||||
Case 1
|
||||
' extra corsa sulla x-: devo ridurre del valore di extra corsa
|
||||
EgtGetOutstrokeInfo(sInfo)
|
||||
@@ -754,7 +753,7 @@ Public Class MoveRawPartPage
|
||||
bOk = False
|
||||
End Select
|
||||
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||
VacuumCups.m_ptStartPointLift = ptEndPointLift
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -783,8 +782,8 @@ Public Class MoveRawPartPage
|
||||
' Memorizzo
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.dDegRotStartAng -= dAng
|
||||
VacuumCups.m_ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.m_dDegRotStartAng -= dAng
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) ' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -817,8 +816,8 @@ Public Class MoveRawPartPage
|
||||
' Memorizzo
|
||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||
Else
|
||||
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.dDegRotStartAng -= dAng
|
||||
VacuumCups.m_ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||
VacuumCups.m_dDegRotStartAng -= dAng
|
||||
End If
|
||||
Else
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90362)) ' Pezzo troppo piccolo : non si può muovere
|
||||
@@ -834,8 +833,8 @@ Public Class MoveRawPartPage
|
||||
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
' determino il punto finale dello spostamento
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
|
||||
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
|
||||
Dim ptEndPointLift As Point3d = VacuumCups.m_ptStartPointLift
|
||||
Dim dDegRotEndAng As Double = VacuumCups.m_dDegRotStartAng + dAngDeg
|
||||
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
|
||||
Dim sInfo As String = String.Empty
|
||||
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
|
||||
@@ -861,8 +860,8 @@ Public Class MoveRawPartPage
|
||||
bOk = False
|
||||
End Select
|
||||
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
|
||||
VacuumCups.ptStartPointLift = ptEndPointLift
|
||||
VacuumCups.dDegRotStartAng = dDegRotEndAng
|
||||
VacuumCups.m_ptStartPointLift = ptEndPointLift
|
||||
VacuumCups.m_dDegRotStartAng = dDegRotEndAng
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -1030,7 +1029,7 @@ Public Class MoveRawPartPage
|
||||
Next
|
||||
If Not bOkRotate Then Return
|
||||
Else
|
||||
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
|
||||
' sposto il pezzo in centro tavola, perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
|
||||
Dim b3Area As New BBox3d
|
||||
EgtGetTableArea(1, b3Area)
|
||||
Dim b3RawTemp As New BBox3d
|
||||
|
||||
@@ -100,31 +100,6 @@
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
<!--Comandi attivi solo in madalità REG-->
|
||||
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
|
||||
<ToggleButton Name="AddPointRegBtn" Visibility="Hidden"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource RefTabImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Move-Spot-RegImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource RefTabImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<!--Comandi attivi solo in madalità REG-->
|
||||
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
|
||||
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Muovi-grezzoImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource ON_OFF-REGImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
|
||||
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
@@ -137,18 +112,37 @@
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<!--Comandi attivi solo in madalità REG-->
|
||||
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
|
||||
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Muovi-grezzoImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource ON_OFF-REGImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" >
|
||||
<Button Name="RemovePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="DragRettanleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Drag_RettangleImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
<ToggleButton Name="DragRectangleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Drag_RectangleImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="SplitCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource SplitWJImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<!--Comandi attivi solo in madalità REG-->
|
||||
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
|
||||
<Button Visibility="Hidden"/>
|
||||
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Move-Spot-RegImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<Button Visibility="Hidden"/>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Name ="UG2" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="3" >
|
||||
<Button Name="SelectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Seleziona-tuttoImg}" Style="{DynamicResource OmagCut_ArrowButtonIcon}"/>
|
||||
|
||||
@@ -320,7 +320,7 @@ Public Class SelParkIndWD
|
||||
System.IO.File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
|
||||
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non riuscita")
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
@@ -470,15 +470,14 @@ Public Class ParkInd
|
||||
m_Ind = Ind
|
||||
m_Name = Name
|
||||
m_Status = Stat
|
||||
Dim MyMainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
' Costruisco il percorso immagine
|
||||
If m_Ind = 0 Then
|
||||
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
|
||||
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.png"
|
||||
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.svg"
|
||||
m_Img = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.png"
|
||||
m_Svg = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.svg"
|
||||
ElseIf m_Ind = 999 Then
|
||||
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
|
||||
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.png"
|
||||
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.svg"
|
||||
m_Img = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.png"
|
||||
m_Svg = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.svg"
|
||||
Else
|
||||
m_Img = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".png"
|
||||
m_Svg = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".svg"
|
||||
@@ -850,7 +849,7 @@ Public Module XMLReader
|
||||
End While
|
||||
' Libero il file dalla lettura
|
||||
m_xmlr.Close()
|
||||
' popolo la canvas con le Ptah che ho caricato
|
||||
' popolo la canvas con le Path che ho caricato
|
||||
Canv.LoadCanvas()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="Title" Grid.Row="1" Grid.Column="1"
|
||||
<TextBlock Name="TableListMsg" Grid.Row="1" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ItemsControl Name="TableList"
|
||||
|
||||
@@ -20,7 +20,7 @@ Public Class SelectTableWD
|
||||
|
||||
Private Sub ChangeTable_Initialized() Handles Me.Initialized
|
||||
|
||||
Title.Text = EgtUILib.EgtMsg(91234) ' Seleziona la tavola da usare
|
||||
TableListMsg.Text = EgtUILib.EgtMsg(91234) ' Seleziona la tavola da usare
|
||||
' recuepero l'inidce della tavola corrente
|
||||
Dim nIndeXCurrTab As Integer = GetCurrentTable()
|
||||
' creo la lista delle tavole disponibili (attivo il bottone della tavola attualmente in uso)
|
||||
|
||||
@@ -52,14 +52,14 @@ Public Module SplitAuto
|
||||
' verifico sia una lavorazione valida della fase corrente
|
||||
If IsValidMachining(nOperId) And EgtGetOperationPhase(nOperId) = nCurrPhase Then
|
||||
Dim Mach As New SplitMach
|
||||
If CreateMach(Mach, nOperId) Then MachSplitList.Add(Mach)
|
||||
If CreateMach(nOperId, Mach) Then MachSplitList.Add(Mach)
|
||||
End If
|
||||
nOperId = EgtGetNextOperation(nOperId)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function CreateMach(ByRef Mach As SplitMach, nOperId As Integer) As Boolean
|
||||
Friend Function CreateMach(nOperId As Integer, ByRef Mach As SplitMach) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
' se appartiene ad un grezzo attivo la inserisco in lista
|
||||
If IsMachiningInActiveRaw(nOperId) Then
|
||||
@@ -173,7 +173,7 @@ Public Module SplitAuto
|
||||
Mach.m_bStartAll = False
|
||||
Mach.m_bEndAll = False
|
||||
End If
|
||||
' Waterjet
|
||||
' Waterjet
|
||||
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
|
||||
Mach.m_nInterf = FMI_TYPE.NONE
|
||||
' recupero l'angolo di fianco
|
||||
@@ -182,7 +182,7 @@ Public Module SplitAuto
|
||||
Mach.m_bCanEndAll = False
|
||||
Mach.m_bStartAll = False
|
||||
Mach.m_bEndAll = False
|
||||
' Forature e fresature
|
||||
' Forature e fresature
|
||||
Else
|
||||
Mach.m_nInterf = FMI_TYPE.NONE
|
||||
Mach.m_dSideAng = 0
|
||||
@@ -241,18 +241,20 @@ Public Module SplitAuto
|
||||
Dim bEnabled As Boolean = MachSplit.m_bEnabled
|
||||
Dim nInterf As Integer = If(bReset, FMI_TYPE.NONE, MachSplit.m_nInterf)
|
||||
' Colore della lavorazione principale
|
||||
ColorSingleMachining(MachSplit.m_nId, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf)
|
||||
ColorSingleMachining(MachSplit.m_nId, MachSplit.m_nType, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf)
|
||||
' Colore delle lavorazioni inglobate
|
||||
For Each nId As Integer In MachSplit.m_vOthId
|
||||
ColorSingleMachining(nId, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf)
|
||||
ColorSingleMachining(nId, MachSplit.m_nType, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf)
|
||||
Next
|
||||
EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
|
||||
Private Sub ColorSingleMachining(nOperId As Integer, nOperType As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
|
||||
' Verifico se è un taglio da sopra o da sotto
|
||||
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or (sLay = NAME_INLOOP AndAlso EgtExistsInfo(nOperId, INFO_FILOTOP)))
|
||||
Dim bDrip As Boolean = (sLay = NAME_DRIPCUT Or sLay = NAME_UNDERDRILL)
|
||||
' Verifico se macchina con cambio utensile per lama
|
||||
Dim bSawTc As Boolean = ( m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW)
|
||||
' Recupero il preview della lavorazione
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
@@ -287,20 +289,23 @@ Public Module SplitAuto
|
||||
colCut = COL_MCH_ONCUT()
|
||||
ElseIf bDrip Then
|
||||
colCut = COL_MCH_DRIPCUT()
|
||||
ElseIf Math.Abs(dSideAng) > EPS_ANG_SMALL Then
|
||||
ElseIf nOperType = MCH_OY.WATERJETTING Then
|
||||
If Math.Abs(dSideAng) > EPS_ANG_SMALL then
|
||||
colCut = COL_MCH_WJ_ANG()
|
||||
Else
|
||||
colCut = COL_MCH_WJ()
|
||||
End If
|
||||
ElseIf nOperType = MCH_OY.SAWING AndAlso bSawTc Then
|
||||
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
|
||||
m_MainWindow.m_CadCutPageUC.m_SplitPage.GetMachiningAndTool(nOperId, sSawing, sSaw)
|
||||
' Setto l'utensile corrente
|
||||
EgtTdbSetCurrTool(sSaw)
|
||||
' recupero il colore della lavorazione direttamente dall'utensile
|
||||
colCut = Utility.GetColorPV()
|
||||
ElseIf nOperType = MCH_OY.SAWING AndAlso Math.Abs(dSideAng) > EPS_ANG_SMALL Then
|
||||
colCut = COL_MCH_CUT_ANG()
|
||||
Else
|
||||
' 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
|
||||
colCut = COL_MCH_CUT()
|
||||
End If
|
||||
|
||||
For Each nId In vCutId
|
||||
|
||||
@@ -18,14 +18,14 @@ Module VacuumCups
|
||||
Private m_RawWeight As Double = 0
|
||||
Private m_MaxWeightSinglePlugger As Double = 250
|
||||
Private m_MaxWeightDoublePlugger As Double = 750
|
||||
Public bOverWeight As Boolean = False
|
||||
' dati per rotazione ventose vicono al fine corsa Y e X
|
||||
Private bRotateVacuumNearExtraStrokeY As Boolean = False
|
||||
Private bRotateVacuumNearExtraStrokeX As Boolean = False
|
||||
Public m_bOverWeight As Boolean = False
|
||||
' dati per rotazione ventose vicino al fine corsa Y e X
|
||||
Private m_bRotateVacuumNearExtraStrokeY As Boolean = False
|
||||
Private m_bRotateVacuumNearExtraStrokeX As Boolean = False
|
||||
' dati stroke
|
||||
Public bExtraStroke As Boolean = False
|
||||
Public ptStartPointLift As Point3d
|
||||
Public dDegRotStartAng As Double
|
||||
Public m_bExtraStroke As Boolean = False
|
||||
Public m_ptStartPointLift As Point3d
|
||||
Public m_dDegRotStartAng As Double
|
||||
|
||||
' Nome del gruppo temporaneo per le ventose
|
||||
Private Const VACTMP_GRP As String = "VacTmp"
|
||||
@@ -85,12 +85,12 @@ Module VacuumCups
|
||||
m_MaxWeightDoublePlugger = MaxDouble
|
||||
End Sub
|
||||
|
||||
Friend Sub SetRotationForExtraStrokeY(Rotate As Boolean)
|
||||
bRotateVacuumNearExtraStrokeY = Rotate
|
||||
Friend Sub SetRotationForExtraStrokeY(bRotate As Boolean)
|
||||
m_bRotateVacuumNearExtraStrokeY = bRotate
|
||||
End Sub
|
||||
|
||||
Friend Sub SetRotationForExtraStrokeX(Rotate As Boolean)
|
||||
bRotateVacuumNearExtraStrokeX = Rotate
|
||||
Friend Sub SetRotationForExtraStrokeX(bRotate As Boolean)
|
||||
m_bRotateVacuumNearExtraStrokeX = bRotate
|
||||
End Sub
|
||||
Friend Function GetVacuumId() As Integer
|
||||
Return m_nVacId
|
||||
@@ -328,7 +328,7 @@ Module VacuumCups
|
||||
Dim sCups() As String = Nothing
|
||||
Dim sCups2() As String = Nothing
|
||||
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
||||
bExtraStroke = False
|
||||
m_bExtraStroke = False
|
||||
' Determino validità soluzioni della configurazione
|
||||
Dim vtMove As New Vector3d
|
||||
Dim ptRotCen As New Point3d
|
||||
@@ -337,6 +337,8 @@ Module VacuumCups
|
||||
Dim ptRotCen2 As New Point3d
|
||||
Dim dRotAngDeg2 As Double = 0
|
||||
Dim dDist = TestVacuumCupSelection(sCups, b3Kerf, ptKerfCen, nOutlineId, nRKerfId, vtMove, ptRotCen, dRotAngDeg)
|
||||
Dim ptStartPointLift_1 As New Point3d( m_ptStartPointLift)
|
||||
Dim dDegRotStartAng_1 As Double = m_dDegRotStartAng
|
||||
Dim dDist2 = TestVacuumCupSelection(sCups2, b3Kerf, ptKerfCen, nOutlineId, nRKerfId, vtMove2, ptRotCen2, dRotAngDeg2)
|
||||
If dDist > INFINITO - 1 And dDist2 > INFINITO - 1 Then Continue For
|
||||
If dDist2 < dDist Then
|
||||
@@ -344,6 +346,9 @@ Module VacuumCups
|
||||
vtMove = vtMove2
|
||||
ptRotCen = ptRotCen2
|
||||
dRotAngDeg = dRotAngDeg2
|
||||
Else
|
||||
m_ptStartPointLift = ptStartPointLift_1
|
||||
m_dDegRotStartAng = dDegRotStartAng_1
|
||||
End If
|
||||
' Eseguo il movimento
|
||||
EgtMove(m_nVacId, vtMove, GDB_RT.GLOB)
|
||||
@@ -433,18 +438,18 @@ Module VacuumCups
|
||||
' Se box maggiore di quello del pezzo, scarto soluzione
|
||||
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
||||
'-------------------- INIZIO VERIFICA PESO --------------------
|
||||
bOverWeight = False
|
||||
m_bOverWeight = False
|
||||
Select Case GetPluggerFromCameras(sCups)
|
||||
Case 2
|
||||
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||
If m_RawWeight > m_MaxWeightDoublePlugger Then
|
||||
bOverWeight = True
|
||||
m_bOverWeight = True
|
||||
Return INFINITO
|
||||
End If
|
||||
Case 1
|
||||
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
|
||||
If m_RawWeight > m_MaxWeightSinglePlugger Then
|
||||
bOverWeight = True
|
||||
m_bOverWeight = True
|
||||
Return INFINITO
|
||||
End If
|
||||
End Select
|
||||
@@ -466,14 +471,14 @@ Module VacuumCups
|
||||
Dim dPreferredRot As Double = m_dPreferredRot
|
||||
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
|
||||
' verifico l'orientamento del pezzo
|
||||
If bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
|
||||
If m_bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
|
||||
' se l'orientamento è verticale
|
||||
If frMinRect.Orig().x < b3Tab.Center().x Then
|
||||
dPreferredRot = m_dPrefVertRotXMinus
|
||||
Else
|
||||
dPreferredRot = m_dPrefVertRotXPlus
|
||||
End If
|
||||
ElseIf bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
|
||||
ElseIf m_bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
|
||||
' se l'orientemanto è orizzontale e la macchina è stata abilitata
|
||||
If frMinRect.Orig().y < b3Tab.Center().y Then
|
||||
dPreferredRot = m_dPrefVertRotYPlus
|
||||
@@ -541,12 +546,12 @@ Module VacuumCups
|
||||
|
||||
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
|
||||
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
|
||||
bExtraStroke = True
|
||||
m_bExtraStroke = True
|
||||
Return INFINITO
|
||||
End If
|
||||
' se la posizione è accettbaile allora salvo i dati
|
||||
ptStartPointLift = ptRef
|
||||
dDegRotStartAng = dRotAngDeg
|
||||
m_ptStartPointLift = ptRef
|
||||
m_dDegRotStartAng = dRotAngDeg
|
||||
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
|
||||
|
||||
' Ne calcolo la distanza dal centro della tavola
|
||||
|
||||
@@ -228,6 +228,7 @@ Module ConstGen
|
||||
Public Const INFO_ROUNDOFF As String = "RoundOff"
|
||||
Public Const INFO_DIRECTCUT As String = "DirectCut"
|
||||
Public Const INFO_STEP_TYPE As String = "StepType"
|
||||
Public Const INFO_ENGR_MILL As String = "EngravingWithMill"
|
||||
' Info in entità da tagliare per taglio ristretto
|
||||
Public Const INFO_STRICT As String = "Strict"
|
||||
' Info in entità da tagliare per angolo di lato e tallone
|
||||
@@ -319,12 +320,12 @@ Module ConstGen
|
||||
Public Const INFO_PARTROT As String = "ROT"
|
||||
' Info in entità in OutLoop per indicare se è separata WaterJet
|
||||
Public Const INFO_JOINENTITY As String = "JoinEntity"
|
||||
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
|
||||
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||
' Nome layer per "*" indicanti un lato separato nel taglio WaterJet
|
||||
Public Const LAY_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||
' Info in OutLoop per punto inizio lavorazione WaterJet
|
||||
Public Const INFO_START As String = "Start"
|
||||
' Nome dei tagli diretti inseriti in fase di Splitting
|
||||
Public Const SPLIT_CUT As String = "SplitCut"
|
||||
Public Const NAME_SPLIT_CUT As String = "SplitCut"
|
||||
' Forzo specifica lavorazione
|
||||
Public Const DEF_MACHINING As String = "Def_Machining"
|
||||
' Forzo specifica lavorazione solo per tagli con inclinazione
|
||||
@@ -365,6 +366,16 @@ Module ConstGen
|
||||
Public Const BRIDGES As String = "Bridges"
|
||||
' Nome dell'entità ponticello contenuta nel gruppo BRIDGES
|
||||
Public Const BRIDGELINE As String = "BridgeLine"
|
||||
' Info dell'Id pezzo di partenza del ponticello
|
||||
Public Const INFO_BRIDGE_PARTSTART As String = "PartStart"
|
||||
' Info dell'Id entita' di partenza del ponticello
|
||||
Public Const INFO_BRIDGE_ENTSTART As String = "EntStart"
|
||||
' Info dell'Id pezzo di arrivo del ponticello
|
||||
Public Const INFO_BRIDGE_PARTEND As String = "PartEnd"
|
||||
' Info dell'Id entita' di arrivo del ponticello
|
||||
Public Const INFO_BRIDGE_ENTEND As String = "EntEnd"
|
||||
' Info con la fase di appartenenza del ponticello
|
||||
Public Const INFO_BRIDGE_PHASE As String = "Ph"
|
||||
|
||||
' utensile per le lavorazioni manuali
|
||||
Public Const DUMMY_SAW As String = "DummySAW"
|
||||
@@ -406,6 +417,12 @@ Module ConstGen
|
||||
Public Function COL_MCH_ONFREE() As Color3d
|
||||
Return New Color3d(192, 128, 0)
|
||||
End Function
|
||||
Public Function COL_MCH_WJ() As Color3d
|
||||
Return New Color3d(0, 128, 128)
|
||||
End Function
|
||||
Public Function COL_MCH_WJ_ANG() As Color3d
|
||||
Return New Color3d(255, 0, 255)
|
||||
End Function
|
||||
Public Function COL_MCH_DRIPCUT() As Color3d
|
||||
Return New Color3d(255, 0, 165)
|
||||
End Function
|
||||
|
||||
@@ -35,6 +35,7 @@ Module ConstIni
|
||||
Public Const K_IMAGEDIR As String = "ImageDir"
|
||||
Public Const K_CAMERALINK As String = "CameraLink"
|
||||
Public Const K_CNLINK As String = "CNLink"
|
||||
Public Const K_STEPBYSTEPSEND As String = "StepByStepSend"
|
||||
Public Const K_TESTINGPAGE As String = "TestingPage"
|
||||
Public Const K_SHOWTIPAXES As String = "ShowTipAxes"
|
||||
Public Const K_LASTPROJFINISHED As String = "LastProjFinished"
|
||||
@@ -48,6 +49,7 @@ Module ConstIni
|
||||
Public Const K_THEME As String = "Theme"
|
||||
Public Const K_MANUAL_CUT As String = "ManualCut"
|
||||
Public Const K_TEST As String = "Test"
|
||||
Public Const K_ADD_TAB_BY_PROJ As String = "AdditionalTableByProj"
|
||||
Public Const K_SMARTMACHININGPAGE As String = "SmartMachiningPage"
|
||||
Public Const K_STARTPROGRAM As String = "StartProgram"
|
||||
Public Const K_GENERATECN As String = "GenerateCN"
|
||||
@@ -165,7 +167,7 @@ Module ConstIni
|
||||
Public Const K_TEXTCOLOR As String = "TextColor"
|
||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||
Public Const K_DRAG_RETTANGLE As String = "DragRectangle"
|
||||
Public Const K_DRAG_RECTANGLE As String = "DragRectangle"
|
||||
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
|
||||
|
||||
Public Const S_SPLIT As String = "Split"
|
||||
@@ -240,7 +242,6 @@ Module ConstIni
|
||||
Public Const K_REFTAB As String = "RefTab"
|
||||
Public Const K_CURRENTREFTAB As String = "CurrRefTab"
|
||||
|
||||
|
||||
Public Const S_RAWMOVE As String = "RawMove"
|
||||
Public Const K_RAWSTEP As String = "Step"
|
||||
Public Const K_EXTRASTEP As String = "ExtraStep"
|
||||
@@ -261,17 +262,11 @@ Module ConstIni
|
||||
Public Const K_REGANGSTEP As String = "AngStep"
|
||||
|
||||
Public Const S_CAMERA As String = "Camera"
|
||||
Public Const K_CAM_COUNT As String = "Count"
|
||||
Public Const K_CAM_EXEPATH As String = "ExePath"
|
||||
Public Const K_CAM_IMAGE As String = "Image"
|
||||
Public Const K_CAM_INFO As String = "Info"
|
||||
Public Const K_CAM_RESULT As String = "Result"
|
||||
Public Const K_CAM_CONTOUR As String = "Contour"
|
||||
Public Const K_CAM_EXEPATH2 As String = "ExePath2"
|
||||
Public Const K_CAM_IMAGE2 As String = "Image2"
|
||||
Public Const K_CAM_INFO2 As String = "Info2"
|
||||
Public Const K_CAM_RESULT2 As String = "Result2"
|
||||
Public Const K_CAM_CONTOUR2 As String = "Contour2"
|
||||
Public Const K_CAM_THRESHOLD As String = "Threshold"
|
||||
Public Const K_CAM_TOLERANCE As String = "Tolerance"
|
||||
Public Const K_CAM_TIMEOUT As String = "Timeout"
|
||||
@@ -285,7 +280,6 @@ Module ConstIni
|
||||
Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
|
||||
Public Const K_CURRMACH As String = "CurrMach"
|
||||
Public Const K_ENABLEFINALSAWCUT As String = "EnableFinalSawCut"
|
||||
Public Const K_FINALDEPTH As String = "FinalDepth"
|
||||
|
||||
Public Const S_SIMUL As String = "Simul"
|
||||
Public Const K_SLIDERX As String = "SliderX"
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
Public Const S_NUMERICALCONTROL As String = "NumericalControl"
|
||||
Public Const K_TYPE As String = "Type"
|
||||
Public Const K_SPECIALSEND As String = "SpecialSend"
|
||||
Public Const K_SPECIALAREAS As String = "SpecialAreas"
|
||||
Public Const K_SPECIALDEST As String = "SpecialDest"
|
||||
Public Const K_SPECIALEXEC As String = "SpecialExec"
|
||||
|
||||
Public Const S_PARTPROGRAM As String = "PartProgram"
|
||||
Public Const K_EXTENSION As String = "Extension"
|
||||
@@ -12,24 +16,34 @@
|
||||
Public Const K_SIMULATIONAXESNUM As String = "SimulationAxesNum"
|
||||
Public Const K_L1NAME As String = "L1Name"
|
||||
Public Const K_L1ID As String = "L1Id"
|
||||
Public Const K_L1TYPE As String = "L1Type"
|
||||
Public Const K_L2NAME As String = "L2Name"
|
||||
Public Const K_L2ID As String = "L2Id"
|
||||
Public Const K_L2TYPE As String = "L2Type"
|
||||
Public Const K_L3NAME As String = "L3Name"
|
||||
Public Const K_L3ID As String = "L3Id"
|
||||
Public Const K_L3TYPE As String = "L3Type"
|
||||
Public Const K_R1NAME As String = "R1Name"
|
||||
Public Const K_R1ID As String = "R1Id"
|
||||
Public Const K_R1TYPE As String = "R1Type"
|
||||
Public Const K_R2NAME As String = "R2Name"
|
||||
Public Const K_R2ID As String = "R2Id"
|
||||
Public Const K_R2TYPE As String = "R2Type"
|
||||
Public Const K_A6NAME As String = "A6Name"
|
||||
Public Const K_A6ID As String = "A6Id"
|
||||
Public Const K_A6TYPE As String = "A6Type"
|
||||
Public Const K_A7NAME As String = "A7Name"
|
||||
Public Const K_A7ID As String = "A7Id"
|
||||
Public Const K_A7TYPE As String = "A7Type"
|
||||
Public Const K_A8NAME As String = "A8Name"
|
||||
Public Const K_A8ID As String = "A8Id"
|
||||
Public Const K_A8TYPE As String = "A8Type"
|
||||
Public Const K_A9NAME As String = "A9Name"
|
||||
Public Const K_A9ID As String = "A9Id"
|
||||
Public Const K_A9TYPE As String = "A9Type"
|
||||
Public Const K_A10NAME As String = "A10Name"
|
||||
Public Const K_A10ID As String = "A10Id"
|
||||
Public Const K_A10TYPE As String = "A10Type"
|
||||
Public Const K_DELTA_C As String = "DeltaC"
|
||||
Public Const K_ININCHES As String = "InInches"
|
||||
Public Const K_CPOS As String = "CPos"
|
||||
@@ -177,6 +191,10 @@
|
||||
Public Const K_TAB4_ADDITIONALTABLE As String = "Tab4AdditionalTable"
|
||||
Public Const K_CENTER_RAW_ONX As String = "CenterRawOnX"
|
||||
Public Const K_CHANGETABWD As String = "ChangeTabWD"
|
||||
Public Const K_ALLTABORIGTAB1 As String = "AllTabOrigTab1"
|
||||
Public Const K_TABX As String = "TabX"
|
||||
Public Const K_TABY As String = "TabY"
|
||||
Public Const K_USELASERORIGIN As String = "UseLaserOrigin"
|
||||
|
||||
Public Const S_PHOTO As String = "Photo"
|
||||
Public Const K_PHOTO_CAMERACOUNTER As String = "CameraCounter"
|
||||
@@ -192,7 +210,7 @@
|
||||
Public Const K_PHOTO_HQ_OFFSETY As String = "HQOffsetY"
|
||||
Public Const K_CAMERA_DIRECT_CMD As String = "CameraDirectCmd"
|
||||
Public Const K_CAMERA_STATE_VAR As String = "CameraStateVar"
|
||||
Public Const K_ENABELE_GOHOME_FOR_PHOTO As String = "EnableGoHomeForPhoto"
|
||||
Public Const K_ENABLE_GOHOME_FOR_PHOTO As String = "EnableGoHomeForPhoto"
|
||||
Public Const K_PENDIG_TIME_FOR_PHOTO As String = "PendigTimeForPhoto"
|
||||
|
||||
Public Const S_TOOLS As String = "Tools"
|
||||
@@ -243,9 +261,11 @@
|
||||
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
||||
Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening"
|
||||
Public Const K_MACH_ENGRAVING_WITHMILL As String = "EngravingWithMill"
|
||||
Public Const K_MACH_STARTCENERTOOLPATH As String = "StartCenterToolPath"
|
||||
Public Const K_MACH_STARTCENTERTOOLPATH As String = "StartCenterToolPath"
|
||||
Public Const K_MACH_ENGRAVING_DEPTH As String = "EngravingDepth"
|
||||
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
|
||||
Public Const K_MACH_WATERJET_OPTIMIZE As String = "WjOptimize"
|
||||
Public Const K_MACH_WATERJET_ON_SINKS As String = "WjOnSinks"
|
||||
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
||||
Public Const K_MACH_NEST_GHIGLIOTTINA As String = "Guillotine"
|
||||
Public Const K_MACH_WASHING As String = "Washing"
|
||||
@@ -255,17 +275,8 @@
|
||||
Public Const K_MACH_CUTFSEVENABLE As String = "CutFsevEnable"
|
||||
Public Const K_MACH_CUTFSEVLEN As String = "CutFsevLen"
|
||||
Public Const K_MACH_CUTFSEVPERC As String = "CutFsevPerc"
|
||||
Public Const K_USELASERORIGIN As String = "UseLaserOrigin"
|
||||
Public Const K_HOLES_DIAMITERWJ As String = "HolesDiameterWJ"
|
||||
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
||||
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
||||
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
||||
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
|
||||
Public Const K_MACH_DRILL_MILL_C90 As String = "DrillMillC90"
|
||||
' CutLongDxSx
|
||||
' AngRotMultiCut
|
||||
' MinDistHeadsMultiCut
|
||||
' MinSawRbHeight
|
||||
Public Const K_USEBAXISLOCK As String = "UseBAxisLock"
|
||||
|
||||
Public Const S_MACH_FRAME As String = "Frame"
|
||||
Public Const K_MACH_PAUSE As String = "Pause"
|
||||
|
||||
@@ -4,11 +4,9 @@ Public Class ControlsDirectCutUC
|
||||
|
||||
' Dichiarazione delle Page UserControl
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
' ---- MAI USATA ---- nuova finestra per i comandi per il taglio manuale nuovo
|
||||
Friend m_SingleCutAuto As SingleCutAuto
|
||||
' ---- MAI USATA ----
|
||||
Friend m_MachineButtons As MachineButtonsUC
|
||||
Friend m_ManualAxesMove As ManualAxesMoveUC
|
||||
Friend m_SingleCutAuto As SingleCutAuto
|
||||
Friend m_SingleCut As SingleCutUC
|
||||
Friend m_SingleDrill As SingleDrillUC
|
||||
Friend m_MultipleCut As MultipleCut
|
||||
@@ -36,7 +34,7 @@ Public Class ControlsDirectCutUC
|
||||
' Variabile che indica se sono attivi i bottoni macchina nuovi o vecchi
|
||||
Friend m_NewMachineButtonsType As Boolean
|
||||
' Indica che la finestra del talio Singolo deve essere di tipo manuale
|
||||
Friend m_bManulaCut As Boolean = False
|
||||
Friend m_bManualCut As Boolean = False
|
||||
|
||||
' elenco dei nuovi bottoni
|
||||
Private m_ButtonJogList As New List(Of MachineButton)
|
||||
@@ -60,13 +58,15 @@ Public Class ControlsDirectCutUC
|
||||
End Enum
|
||||
|
||||
Private Sub ControlsDirectCutUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' leggo la configurazione del programma per i nuovi tagli manuali
|
||||
m_bManulaCut = GetPrivateProfileInt(S_GENERAL, K_MANUAL_CUT, 0, m_MainWindow.GetIniFile()) <> 0
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
' leggo la configurazione del programma per i nuovi tagli manuali
|
||||
m_bManualCut = ( GetPrivateProfileInt(S_GENERAL, K_MANUAL_CUT, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
|
||||
' Creazione delle Page UserControl
|
||||
m_MachineButtons = New MachineButtonsUC
|
||||
m_ManualAxesMove = New ManualAxesMoveUC
|
||||
m_SingleCut = New SingleCutUC
|
||||
m_SingleCutAuto = New SingleCutAuto
|
||||
m_SingleDrill = New SingleDrillUC
|
||||
m_MultipleCut = New MultipleCut
|
||||
m_GridCut = New GridCut
|
||||
@@ -74,17 +74,14 @@ Public Class ControlsDirectCutUC
|
||||
m_Squaring = New SquaringUC
|
||||
m_ControlsMachineButton = New ControlsMachineButtonUC
|
||||
m_VacuumMachineButton = New VacuumMachineButtonUC
|
||||
' reiferimento alla pagina succesiva
|
||||
' Riferimento alla pagina succesiva
|
||||
m_ControlDirectCutPage1 = New ControlsDirectCutUC1
|
||||
' Costruisco la finestra per il nuovo tipo di taglio manuale
|
||||
m_SingleCutAuto = New SingleCutAuto
|
||||
|
||||
|
||||
'Posizionemento nella griglia delle Page UserControl DirectCutPageUC
|
||||
' Posizionemento nella griglia delle Page UserControl DirectCutPageUC
|
||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
|
||||
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||
If m_bManulaCut Then
|
||||
If m_bManualCut Then
|
||||
m_SingleCutAuto.SetValue(Grid.RowProperty, 1)
|
||||
Else
|
||||
m_SingleCut.SetValue(Grid.RowProperty, 1)
|
||||
@@ -97,22 +94,14 @@ Public Class ControlsDirectCutUC
|
||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
' ManualBtn.Content = EgtMsg(90201)
|
||||
ManualTxt.Text = EgtMsg(90201) ' Movimento manuale
|
||||
'SingleCutBtn.Content = EgtMsg(90202)
|
||||
SingleCutTxt.Text = EgtMsg(90202) ' Taglio singolo
|
||||
'SingleDrillBtn.Content = "Foro singolo"
|
||||
SingleDrillTxt.Text = EgtMsg(90258) ' Foro singolo
|
||||
'MultipleCutBtn.Content = EgtMsg(90203)
|
||||
MultipleCutTxt.Text = EgtMsg(90203) ' Taglio multiplo
|
||||
'GridCutBtn.Content = EgtMsg(90204)
|
||||
GridCutTxt.Text = EgtMsg(90204) ' Taglio griglia
|
||||
'FlatteningCutBtn.Content = EgtMsg(90206)
|
||||
FlatteningCutTxt.Text = EgtMsg(90206) ' Spianatura
|
||||
' 90261=Squaring
|
||||
SquaringTxt.Text = EgtMsg(90261)
|
||||
' 90409=Others
|
||||
ChangeUCTxBl.Text = EgtMsg(90409)
|
||||
SquaringTxt.Text = EgtMsg(90261) ' Squadratura
|
||||
ChangeUCTxBl.Text = EgtMsg(90409) ' Altri
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -149,11 +138,11 @@ Public Class ControlsDirectCutUC
|
||||
|
||||
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||
Dim bH1Exists As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||
Dim bH1Exists As Boolean = m_MainWindow.m_CurrentMachine.ExistsSawHead()
|
||||
|
||||
ManualBtn.IsEnabled = bH1Exists
|
||||
' sviluppo rimasto in sospeso
|
||||
If m_bManulaCut Then
|
||||
If m_bManualCut Then
|
||||
' anche se non è presente un grezzo mantengo abilitato il bottone
|
||||
SingleCutBtn.IsEnabled = True
|
||||
Else
|
||||
@@ -200,7 +189,7 @@ Public Class ControlsDirectCutUC
|
||||
End Sub
|
||||
|
||||
Private Sub SingleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleCutBtn.Click
|
||||
If m_bManulaCut Then
|
||||
If m_bManualCut Then
|
||||
LeftButtonGrid.Children.Add(m_SingleCutAuto)
|
||||
m_ActiveDirectCutPage = DirectCutPages.SingleCutAuto
|
||||
Else
|
||||
|
||||
@@ -73,13 +73,13 @@ Public Class ControlsDirectCutUC1
|
||||
' Caso standard
|
||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut1
|
||||
|
||||
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa per lama (H1)
|
||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||
Dim bH1Exists As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||
Dim bSawHeadOk As Boolean = m_MainWindow.m_CurrentMachine.ExistsSawHead()
|
||||
|
||||
PolishingBtn.IsEnabled = (bRawOk And m_MainWindow.m_CurrentMachine.bPolishing)
|
||||
SawTestBtn.IsEnabled = (bRawOk And bH1Exists)
|
||||
CopyTemplateBtn.IsEnabled = bH1Exists
|
||||
SawTestBtn.IsEnabled = (bRawOk And bSawHeadOk)
|
||||
CopyTemplateBtn.IsEnabled = bSawHeadOk
|
||||
|
||||
' aggiorno la visualizzazione dei parametri
|
||||
ReloadParam()
|
||||
|
||||
@@ -551,256 +551,6 @@ Public MustInherit Class MachineButton
|
||||
m_StateFlag = StateFlag
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub ExecuteMDICommand(sLuaFileName As String)
|
||||
If String.IsNullOrWhiteSpace(sLuaFileName) Then Return
|
||||
Dim CmdString As String = String.Empty
|
||||
Dim b2Start As Boolean = False
|
||||
Dim EActive As Boolean = False
|
||||
Dim ENumber As String = String.Empty
|
||||
Dim EValue As String = String.Empty
|
||||
Dim EType As String = 0
|
||||
Dim ENumber2 As String = String.Empty
|
||||
Dim EValue2 As String = String.Empty
|
||||
Dim EType2 As String = 0
|
||||
' eseguo la lettura del file .lua associato al comando
|
||||
ExecuteDirectCmdLua(sLuaFileName, CmdString, b2Start, EActive, ENumber, EValue, EType, ENumber2, EValue2, EType2)
|
||||
'--------------------------------------------------------- PLC ---------------------------------------------------------
|
||||
If EActive Then
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
' se scrittura delle varibili PLC
|
||||
If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
||||
' solo per Flexium
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber, EValue)
|
||||
If Not String.IsNullOrEmpty(ENumber2) And Not String.IsNullOrEmpty(EValue2) Then
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2)
|
||||
End If
|
||||
' altrimenti scrittura delle variabili E
|
||||
Else
|
||||
m_CN.DVariables_WriteVariables2(ENumber, EValue)
|
||||
End If
|
||||
Return
|
||||
Case 3
|
||||
' scrivo prima variabile
|
||||
Select Case CShort(EType)
|
||||
Case 1
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), CInt(EValue), 0, 0, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & CInt(EValue))
|
||||
Case 2
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, CLng(EValue), 0, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & CLng(EValue))
|
||||
Case 3
|
||||
Dim d As Double = 0
|
||||
StringToDouble(EValue, d)
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, 0, d, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & d)
|
||||
Case 4
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, 0, 0, EValue)
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & EValue)
|
||||
End Select
|
||||
EgtOutLog("dopo scrittura prima variabile")
|
||||
If Not IsNothing(EType2) AndAlso CShort(EType) > 0 Then
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' scrivo seconda variabile
|
||||
Select Case CShort(EType2)
|
||||
Case 1
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), CInt(EValue2), 0, 0, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & CInt(EValue2))
|
||||
Case 2
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, CLng(EValue2), 0, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & CLng(EValue2))
|
||||
Case 3
|
||||
Dim d As Double = 0
|
||||
StringToDouble(EValue2, d)
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, 0, d, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & d)
|
||||
Case 4
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, 0, 0, EValue2)
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & EValue2)
|
||||
End Select
|
||||
EgtOutLog("dopo scrittura seconda variabile")
|
||||
End If
|
||||
Return
|
||||
Case 4
|
||||
' ------------------------------------ FANUC ------------------------------------
|
||||
' eventuale scrittura di linea di comando MDI
|
||||
If Not String.IsNullOrEmpty(CmdString) Then
|
||||
' attivo mpdalità MDI
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' salvo la stringa di comando ricevuta dal file lua
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||
m_CN.MDI_command()
|
||||
End If
|
||||
' attivo modalità AUTO
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If String.IsNullOrEmpty(EValue) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
m_CN.NC_pulse_bit(ENumber)
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If ENumber.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue As Boolean
|
||||
If EValue.Trim = "1" Then bEValue = True
|
||||
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||
Else
|
||||
' D#####
|
||||
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||
End If
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||
End If
|
||||
' eventale caricamento seconda variabile
|
||||
If String.IsNullOrEmpty(EValue2) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
m_CN.NC_pulse_bit(ENumber2)
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If ENumber2.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue2 As Boolean
|
||||
If EValue2.Trim = "1" Then bEValue2 = True
|
||||
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||
Else
|
||||
' D#####
|
||||
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||
End If
|
||||
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||
End If
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
||||
Dim nResult As Short
|
||||
' assegno la modalità di funzionamento
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2, 4
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
End Select
|
||||
' salvo la stringa di comando ricevuta dal file lua
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||
m_CN.MDI_command()
|
||||
' avvio l'esecuzione del comando
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
System.Threading.Thread.Sleep(500)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
End Select
|
||||
' se richiesto ripeto l'operazione
|
||||
If b2Start Then
|
||||
EgtOutLog("Avvio secondo cliclo start")
|
||||
System.Threading.Thread.Sleep(800)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
End If
|
||||
System.Threading.Thread.Sleep(300)
|
||||
' ripristino la modalità manuale..?? siucuri ??
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
End Sub
|
||||
|
||||
' lettura delle variavili scritte nel file Lua
|
||||
Friend Sub ExecuteDirectCmdLua(LuaFileName As String, ByRef CmdString As String, ByRef b2Start As Boolean, ByRef EActive As Boolean, ByRef ENumber As String, ByRef EValue As String, ByRef EType As String, ByRef ENumber2 As String, ByRef EValue2 As String, ByRef EType2 As String)
|
||||
Dim sBaseDir As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||
If EgtLuaExecFile(sBaseDir & LuaFileName) Then
|
||||
EgtOutLog("Lua " & sBaseDir & LuaFileName & " eseguito")
|
||||
Else
|
||||
EgtOutLog("Lua " & sBaseDir & LuaFileName & " non eseguito")
|
||||
End If
|
||||
|
||||
Dim dFeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text) Then
|
||||
StringToLen(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text, dFeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||
|
||||
Dim dSpeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||
|
||||
' versione 2.5e1
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
Dim sToolPos As String = String.Empty
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||
End If
|
||||
Dim dToolDiam As Double = 0
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||
End If
|
||||
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dL2)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dL3)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
|
||||
' versione 2.6h1
|
||||
Dim sCurrTable As String = String.Empty
|
||||
Dim nCuttTable As Integer = 1
|
||||
EgtGetTableName(sCurrTable)
|
||||
If sCurrTable <> "MainTab" Then nCuttTable = 2
|
||||
EgtLuaSetGlobIntVar("CMD.TABLE", nCuttTable)
|
||||
|
||||
EgtLuaCallFunction("CmdString")
|
||||
|
||||
' Leggo variabili da file Lua
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
EgtLuaGetGlobBoolVar("CMD.DOUBLESTART", b2Start)
|
||||
EActive = False
|
||||
EgtLuaGetGlobBoolVar("CMD.EACTIVE", EActive)
|
||||
ENumber = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER", ENumber)
|
||||
EValue = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE", EValue)
|
||||
EType = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE", EType)
|
||||
EgtOutLog("ENUMBER: " & ENumber & " EVALUE: " & EValue & " ETYPE: " & EType)
|
||||
ENumber2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER2", ENumber2)
|
||||
EValue2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE2", EValue2)
|
||||
EType2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE2", EType2)
|
||||
EgtOutLog("ENUMBER2: " & ENumber2 & " EVALUE2: " & EValue2 & " ETYPE2: " & EType2)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
' Log del comando
|
||||
EgtOutLog("CmdString=" & If(Not String.IsNullOrEmpty(CmdString), CmdString, "") &
|
||||
" b2Start=" & b2Start.ToString() &
|
||||
" EActive=" & EActive.ToString &
|
||||
" ENumber=" & If(Not String.IsNullOrEmpty(ENumber), ENumber, "") &
|
||||
" EValue=" & If(Not String.IsNullOrEmpty(EValue), EValue, "") &
|
||||
" EType=" & If(Not String.IsNullOrEmpty(EType), CInt(EType).ToString, "") &
|
||||
" ENumber2=" & If(Not String.IsNullOrEmpty(ENumber2), ENumber2, "") &
|
||||
" EValue2=" & If(Not String.IsNullOrEmpty(EValue2), EValue2, "") &
|
||||
" EType2=" & If(Not String.IsNullOrEmpty(EType2), CInt(EType2).ToString, ""))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
@@ -831,8 +581,7 @@ Public Class TwoStateButton
|
||||
End If
|
||||
|
||||
Dim IsPressedShiftKey As Boolean = False
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift And
|
||||
GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_MainWindow.GetIniFile()) > 4 Then IsPressedShiftKey = True
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 AndAlso m_MainWindow.GetDebug() > 4 Then IsPressedShiftKey = True
|
||||
' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta)
|
||||
If IsPressedShiftKey Then
|
||||
Try
|
||||
|
||||
@@ -4,6 +4,9 @@ Module DirectCut
|
||||
' Riferimenti a pagine
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
' Polishing attivo
|
||||
Friend m_bPolishingOn As Boolean = False
|
||||
|
||||
Friend Function CreateDirectCutPart() As Integer
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
@@ -27,4 +30,8 @@ Module DirectCut
|
||||
Return EgtGetFirstNameInGroup(m_MainWindow.m_CurrentProjectPageUC.m_nRawId, NAME_DIRECTCUT)
|
||||
End Function
|
||||
|
||||
Friend Function IsDirectCutOn() As Boolean
|
||||
Return ( GetDirectCutPart() <> GDB_ID.NULL OrElse m_bPolishingOn)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -267,7 +267,7 @@ Public Class DirectCutPageUC
|
||||
Next
|
||||
If IsNothing(XYJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
XYJogButton.ExecuteMDICommand(XYJogButton.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(XYJogButton.TLuaScriptName)
|
||||
' che comunica al PLC di cambiare lo stato, la modifica dello stato è intercettata dalla funzione Refresh che avvia il metodo Changed
|
||||
End Sub
|
||||
|
||||
@@ -299,7 +299,7 @@ Public Class DirectCutPageUC
|
||||
Next
|
||||
If IsNothing(ZJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
ZJogButton.ExecuteMDICommand(ZJogButton.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(ZJogButton.TLuaScriptName)
|
||||
End Sub
|
||||
|
||||
Friend Sub ZCJogChanged(bZAxes As Boolean)
|
||||
@@ -329,7 +329,7 @@ Public Class DirectCutPageUC
|
||||
Next
|
||||
If IsNothing(ZBJogButton) Then Return
|
||||
' eseguo lo script lua associato
|
||||
ZBJogButton.ExecuteMDICommand(ZBJogButton.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(ZBJogButton.TLuaScriptName)
|
||||
End Sub
|
||||
|
||||
Friend Sub ZBJogChanged(bBCAxes As Boolean)
|
||||
@@ -366,7 +366,7 @@ Public Class DirectCutPageUC
|
||||
Else
|
||||
sLuaFileName = RemoteButton.FLuaScriptName
|
||||
End If
|
||||
RemoteButton.ExecuteMDICommand(sLuaFileName)
|
||||
VarMdiCommand.ExecuteMDICommand(sLuaFileName)
|
||||
End Sub
|
||||
|
||||
Friend Sub RemoteChanged(bRemote As Boolean)
|
||||
@@ -403,7 +403,7 @@ Public Class DirectCutPageUC
|
||||
Else
|
||||
sLuaFileName = ParkingButton.FLuaScriptName
|
||||
End If
|
||||
ParkingButton.ExecuteMDICommand(sLuaFileName)
|
||||
VarMdiCommand.ExecuteMDICommand(sLuaFileName)
|
||||
End Sub
|
||||
|
||||
Friend Sub ParkingStateChanged(bParkingState As Boolean)
|
||||
|
||||
@@ -110,7 +110,7 @@ Public Class FlatteningCut
|
||||
OkBtn.ToolTip = EgtMsg(90230) ' Esegui
|
||||
' tipo di utensile in uso per la lavorazione
|
||||
m_ToolsArray(TOOL.SAW) = EgtMsg(90224) ' Lama
|
||||
m_ToolsArray(TOOL.MILL) = EgtMsg(91237) ' Mill
|
||||
m_ToolsArray(TOOL.MILL) = EgtMsg(91237) ' Fresa
|
||||
SelToolCmBx.ItemsSource = m_ToolsArray
|
||||
' Carico i dati dell'ultimo taglio
|
||||
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
||||
@@ -186,7 +186,7 @@ Public Class FlatteningCut
|
||||
TypeCmBx.SelectedIndex = m_nMachType
|
||||
RotLockChBx.IsChecked = m_bRotLock
|
||||
ChainedPathChBx.IsChecked = m_bChainedPath
|
||||
' Assegno l'utensile in definito in macchina per la fresatura
|
||||
' Assegno l'utensile definito in macchina per la fresatura
|
||||
SelToolCmBx.SelectedIndex = m_nTool
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
@@ -339,7 +339,7 @@ Public Class FlatteningCut
|
||||
m_dAngO = dTAngO + 90
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
|
||||
' Altrimenti da disegno
|
||||
' Altrimenti da disegno
|
||||
Else
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||
m_ptTipP1 = m_ptPrev
|
||||
@@ -493,11 +493,9 @@ Public Class FlatteningCut
|
||||
' Recupero il valore di larghezza impostato
|
||||
Dim dWidth As Double = 0
|
||||
StringToLen(WidthTxBx.Text, dWidth)
|
||||
' Recupero lo spessore della lama corrente
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
Dim dThick As Double = GetFootPrintTool()
|
||||
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
' La larghezza della spianatura nono può essere inferiore allo spessore della lama
|
||||
' Recupero l'impronta dell'utensile corrente
|
||||
Dim dThick As Double = GetToolFootprint()
|
||||
' La larghezza della spianatura non può essere inferiore all'impronta dell'utensile (spessore per lama, diametro per fresa)
|
||||
m_dWid = Math.Max(dWidth, dThick)
|
||||
WidthTxBx.Text = LenToString(m_dWid, 2)
|
||||
' Disegno il taglio
|
||||
@@ -523,8 +521,7 @@ Public Class FlatteningCut
|
||||
|
||||
Private Sub OverlapTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OverlapTxBx.EgtClosed
|
||||
' Recupero spessore della lama correntemente attiva
|
||||
Dim dThick As Double = GetFootPrintTool()
|
||||
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
Dim dThick As Double = GetToolFootprint()
|
||||
' Verifico che la sovrapposizione non sia superiore allo spessore della lama (meno 1mm di offset)
|
||||
Dim dOverlap As Double = 0
|
||||
Const MIN_OFFSET As Double = 1.0
|
||||
@@ -684,23 +681,26 @@ Public Class FlatteningCut
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||
End Sub
|
||||
|
||||
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
||||
Private Function GetFootPrintTool() As Double
|
||||
' vedere nella pagina Allarm il capito "Incisioni"
|
||||
Dim bForceUseMill As Boolean = (m_nTool = TOOL.MILL)
|
||||
' ricavo impronta di lavorazione (in larghezza) in funzione dell'utensile selezionato
|
||||
Private Function GetToolFootprint() As Double
|
||||
Dim dFootPrint As Double = 0
|
||||
' verifico quale lavorazione è attiva
|
||||
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) AndAlso Not bForceUseMill Then
|
||||
Dim bSetTool As Boolean = EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
If Not bSetTool Then EgtOutLog("Erro nel settaggio utensile lama " & m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
||||
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
||||
' se richiesta lama
|
||||
If m_nTool <> TOOL.MILL Then
|
||||
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) Then
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
||||
Else
|
||||
EgtOutLog("In ToolDB missing saw " & m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
End If
|
||||
' altrimenti è richiesta fresa
|
||||
Else
|
||||
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||
'GetDrillFromDrilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling)
|
||||
GetMillFromMilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling)
|
||||
If String.IsNullOrWhiteSpace( sCurrMill) Then sCurrMill = GetMillFromMilling(m_MainWindow.m_CurrentMachine.sCurrMilling)
|
||||
' recupero informazioni della fresa in uso
|
||||
EgtTdbSetCurrTool(sCurrMill)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint)
|
||||
If EgtTdbSetCurrTool(sCurrMill) Then
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint)
|
||||
Else
|
||||
EgtOutLog("In ToolDB missing mill " & m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
End If
|
||||
End If
|
||||
Return dFootPrint
|
||||
End Function
|
||||
@@ -718,35 +718,39 @@ Public Class FlatteningCut
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
' EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_ONPATH)
|
||||
' Creo il taglio
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
ptStart.z = 0
|
||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||
' Inidico che è un taglio Diretto di tipo Flattening
|
||||
Dim nCutId As Integer = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||
' Indico che è un taglio Diretto di tipo Flattening
|
||||
EgtSetInfo(nCutId, INFO_DIRECTCUT, FlagDirectCuts.Flattening)
|
||||
EgtSetInfo(nCutId, INFO_ENGR_MILL, m_nTool)
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||
If (m_nTool = TOOL.MILL) Then
|
||||
EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool)
|
||||
End If
|
||||
Dim dThick As Double = GetToolFootprint()
|
||||
EgtSetInfo(nCutId, INFO_WIDTH, dThick)
|
||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, 0)
|
||||
' Imposto prima direzione
|
||||
EgtSetInfo(nCutId, INFO_DIR, 1)
|
||||
' Imposto se iniziare la fresatura dal punto indicato
|
||||
Dim bReducePath As Boolean = Not GetPrivateProfileInt(S_MACH_NEST, K_MACH_STARTCENERTOOLPATH, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
If Not bReducePath Then EgtSetInfo(nCutId, INFO_STRICT, 0)
|
||||
|
||||
' Eventuale riduzione lavorazione
|
||||
Dim bReducePath As Boolean = ( GetPrivateProfileInt(S_MACH_NEST, K_MACH_STARTCENTERTOOLPATH, 0, m_MainWindow.GetMachIniFile()) = 0)
|
||||
' Per fresatura eventuale riduzione della geometria
|
||||
If m_nTool = TOOL.MILL Then
|
||||
If bReducePath Then ExtendLenghtMillPath(nCutId, -dThick / 2)
|
||||
EgtSetInfo(nCutId, INFO_STRICT, 0)
|
||||
' per tagli con lama eventuale riduzione della lavorazione
|
||||
Else
|
||||
EgtSetInfo(nCutId, INFO_STRICT, If( bReducePath, 3, 0))
|
||||
End If
|
||||
' Eventuale bloccaggio rotazione asse C tra le passate
|
||||
If RotLockChBx.IsChecked Then
|
||||
EgtSetInfo(nCutId, INFO_ENABLE_INVERT, False)
|
||||
End If
|
||||
EgtSetInfo(nCutId, INFO_STEP_TYPE, m_nMachType)
|
||||
' Funzione che crea i tagli successivi al primo
|
||||
' Funzione che crea eventuali tagli successivi al primo
|
||||
MultiplyCut(nLayerId, nCutId)
|
||||
' Creo layer per crocetta di riferimento
|
||||
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
||||
@@ -778,131 +782,78 @@ Public Class FlatteningCut
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer) As Boolean
|
||||
Dim bEngWithMill As Boolean = (m_nTool = TOOL.MILL)
|
||||
Dim bReducePath As Boolean = Not GetPrivateProfileInt(S_MACH_NEST, K_MACH_STARTCENERTOOLPATH, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
|
||||
' Recupero spessore della lama (utensile) correntemente attiva
|
||||
Dim dThick As Double = GetFootPrintTool()
|
||||
' Recupero impronta della lama o fresa utilizzata
|
||||
Dim dThick As Double = GetToolFootprint()
|
||||
If dThick = 0 Then Return False
|
||||
|
||||
' Salvo la prima curva nella lista dei percorsi da concatenare
|
||||
' Salvo la curva originale nella lista dei percorsi da concatenare
|
||||
Dim CutsList As New List(Of Integer)
|
||||
CutsList.Add(nCutId)
|
||||
|
||||
' Imposto angolo di rotazione a seconda del lato dei tagli
|
||||
Dim dRotAngO As Double = If(SideChBx.IsChecked(), -90, 90)
|
||||
' Definisco vettore di spostamento
|
||||
Dim vtDelta As Vector3d
|
||||
vtDelta = Vector3d.FromPolar(1, m_dAngO)
|
||||
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
|
||||
|
||||
' Calcolo numero di iterazioni necessarie a coprire l'area impostata e lunghezza vettore delta
|
||||
Dim nStepNum As Integer
|
||||
Dim dDelta As Double
|
||||
Dim dWidth As Double = m_dWid
|
||||
dDelta = dThick - m_dOverlap
|
||||
dWidth -= dThick
|
||||
nStepNum = CInt(Math.Ceiling(dWidth / dDelta)) + 1
|
||||
If nStepNum > 1 Then
|
||||
dDelta = dWidth / (nStepNum - 1)
|
||||
End If
|
||||
' definisco la larghezza dell'utensile (solo per la fresa)
|
||||
EgtSetInfo(nCutId, INFO_WIDTH, dThick)
|
||||
' definisco il tipo di utensile da utilizzare
|
||||
EgtSetInfo(nCutId, "EngravingWithMill", m_nTool)
|
||||
' Creo vettore delta
|
||||
vtDelta *= dDelta
|
||||
' Creo indice per impostare info che indica tipologia di spianatura
|
||||
Dim nTypeIndex As Integer = 1
|
||||
' Calcolo numero di passate necessarie a coprire l'area impostata e lunghezza vettore delta
|
||||
Dim dDelta As Double = dThick - m_dOverlap
|
||||
Dim dWidth As Double = m_dWid - dThick
|
||||
Dim nStepNum As Integer = CInt(Math.Ceiling(dWidth / dDelta)) + 1
|
||||
If nStepNum > 1 Then dDelta = dWidth / (nStepNum - 1)
|
||||
' Definisco vettore di spostamento
|
||||
Dim vtDelta As Vector3d = Vector3d.FromPolar(dDelta, m_dAngO)
|
||||
vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
|
||||
' Creo le ripetizioni
|
||||
For Index As Integer = 1 To nStepNum - 1
|
||||
Dim vtPerpMove As Vector3d = Index * vtDelta
|
||||
' Creo copie
|
||||
Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
|
||||
EgtSetInfo(nCut2Id, INFO_WIDTH, dThick)
|
||||
EgtSetInfo(nCutId, "EngravingWithMill", m_nTool)
|
||||
' Assegno info direzione a seconda del tipo di spianatura
|
||||
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG Then
|
||||
If nTypeIndex = 1 Then
|
||||
EgtSetInfo(nCut2Id, INFO_DIR, 2)
|
||||
nTypeIndex = 2
|
||||
Else
|
||||
EgtSetInfo(nCut2Id, INFO_DIR, 1)
|
||||
nTypeIndex = 1
|
||||
End If
|
||||
Else
|
||||
EgtSetInfo(nCut2Id, INFO_DIR, 1)
|
||||
End If
|
||||
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
|
||||
|
||||
' ----------------------- CREO SEGMENTI PER CONCATENAMENTO CURVE -----------------------
|
||||
If m_bChainedPath And bEngWithMill Then
|
||||
If bReducePath Then
|
||||
If Index < nStepNum - 1 Then
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2)
|
||||
ElseIf Index = nStepNum - 1 Then
|
||||
If nStepNum Mod 2 = 0 Then
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2, False, True)
|
||||
Else
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2, True, False)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
CutsList.Add(nCut2Id)
|
||||
End If
|
||||
' ----------------------- CREO SEGMENTI PER CONCATENAMENTO CURVE -----------------------
|
||||
|
||||
' Assegno info direzione a seconda del tipo di spianatura
|
||||
Dim nDir As Integer = 1
|
||||
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG And Index Mod 2 <> 0 Then nDir = 2
|
||||
EgtSetInfo(nCut2Id, INFO_DIR, nDir)
|
||||
' Inserisco nell'elenco delle curve eventualmente da concatenare
|
||||
CutsList.Add(nCut2Id)
|
||||
Next
|
||||
|
||||
' ----------------------- CREO UN UNICO PERCORSO CONCATENATO -----------------------
|
||||
If m_bChainedPath And bEngWithMill Then
|
||||
' Decidere se accorciare i tagli del valore del raggio utensile!
|
||||
If bReducePath Then
|
||||
ExtendLenghtMillPath(CutsList(0), -dThick / 2, False, True)
|
||||
End If
|
||||
For Index As Integer = 0 To CutsList.Count - 2
|
||||
If Index Mod 2 <> 0 Then
|
||||
' Costruisco la linea di collegamento tra due curve adiacenti
|
||||
Dim PtStart_1 As Point3d
|
||||
EgtStartPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1)
|
||||
Dim PtStart_2 As Point3d
|
||||
EgtStartPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2)
|
||||
CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2))
|
||||
Else
|
||||
' Costruisco la linea di collegamento tra due curve adiacenti
|
||||
Dim PtStart_1 As Point3d
|
||||
EgtEndPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1)
|
||||
Dim PtStart_2 As Point3d
|
||||
EgtEndPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2)
|
||||
CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2))
|
||||
End If
|
||||
' Se fresatura e richiesto percorso concatenato
|
||||
If m_nTool = TOOL.MILL And m_bChainedPath Then
|
||||
' Trasformo la prima curva in composita (copiando tutte le info)
|
||||
Dim vsInfo As String() = Nothing
|
||||
EgtGetAllInfo( CutsList(0), vsInfo)
|
||||
Dim nCompoCrv As Integer = EgtCreateCurveCompo(nLayerId, CutsList(0), True)
|
||||
For Each sInfo As String In vsInfo
|
||||
Dim KeyAndVal As String() = sInfo.Split( "=".ToCharArray)
|
||||
If KeyAndVal.Count() >= 2 Then EgtSetInfo( nCompoCrv, KeyAndVal(0), KeyAndVal(1))
|
||||
Next
|
||||
' Accodo opportunamente le curve successive
|
||||
For Index As Integer = 1 To CutsList.Count - 1
|
||||
' Inverto le curve di ritorno (di indice dispari in lista)
|
||||
If Index Mod 2 <> 0 Then EgtInvertCurve( CutsList(Index))
|
||||
' Aggiungo il collegamento
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(CutsList(Index), CutsList(Index), ptStart)
|
||||
EgtAddCurveCompoLine( nCompoCrv, ptStart)
|
||||
' Aggiungo la curva
|
||||
EgtAddCurveCompoCurve( nCompoCrv, CutsList(Index), true)
|
||||
Next
|
||||
Dim ptNear As Point3d
|
||||
EgtStartPoint(CutsList(0), ptNear)
|
||||
Dim IdJointCurv As Integer = EgtCreateCurveCompoByChain(nLayerId, CutsList.ToArray, ptNear, True)
|
||||
' Inidico che è un taglio Diretto di tipo Flattening
|
||||
EgtSetInfo(IdJointCurv, INFO_DIRECTCUT, FlagDirectCuts.Flattening)
|
||||
EgtSetInfo(IdJointCurv, INFO_STEP_TYPE, m_nMachType)
|
||||
EgtSetInfo(IdJointCurv, INFO_WIDTH, dThick)
|
||||
' Se unisco il percorso devo per forza usare la fresa!
|
||||
EgtSetInfo(IdJointCurv, "EngravingWithMill", 1)
|
||||
If Not bReducePath Then EgtSetInfo(IdJointCurv, INFO_STRICT, 0)
|
||||
End If
|
||||
' ----------------------- CREO UN UNICO PERCORSO CONCATENATO -----------------------
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub ExtendLenghtMillPath(ByVal IdCurv As Integer, ByVal ReduceVal As Double,
|
||||
ByVal Optional bStart As Boolean = True, ByVal Optional bEnd As Boolean = True)
|
||||
Dim PtStart As Point3d
|
||||
EgtStartPoint(IdCurv, GDB_RT.GLOB, PtStart)
|
||||
Dim PtEnd As Point3d
|
||||
EgtEndPoint(IdCurv, GDB_RT.GLOB, PtEnd)
|
||||
If bStart Then EgtTrimExtendCurveByLen(IdCurv, ReduceVal, PtStart, GDB_RT.GLOB)
|
||||
If bEnd Then EgtTrimExtendCurveByLen(IdCurv, ReduceVal, PtEnd, GDB_RT.GLOB)
|
||||
Dim dLenLine As Double
|
||||
EgtCurveLength(IdCurv, dLenLine)
|
||||
EgtOutLog("Lunghezza segmento ridotto: " & dLenLine.ToString)
|
||||
Private Sub ExtendLenghtMillPath(IdCurv As Integer, dExtend As Double,
|
||||
Optional bStart As Boolean = True, Optional bEnd As Boolean = True)
|
||||
If bStart Then
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(IdCurv, IdCurv, ptStart)
|
||||
EgtTrimExtendCurveByLen(IdCurv, dExtend, ptStart)
|
||||
End If
|
||||
If bEnd Then
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(IdCurv, IdCurv, ptEnd)
|
||||
EgtTrimExtendCurveByLen(IdCurv, dExtend, ptEnd)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
|
||||
@@ -267,6 +267,7 @@ Public Class GridCut
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
EgtSetCurrPhase(1)
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
@@ -729,9 +730,8 @@ Public Class GridCut
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio parallelo alla lama
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
@@ -763,10 +763,37 @@ Public Class GridCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
' Se richiesta gestione tagli finali
|
||||
OrderFinalSawCuts()
|
||||
' Aggiorno stato bottoni
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
Private Function OrderFinalSawCuts() As Boolean
|
||||
' Se gestione tagli finali non richiesta, esco
|
||||
If Not m_MainWindow.m_CurrentMachine.bEnableFinalSawCut Then Return False
|
||||
' Sposto i tagli finali alla fine, conservando l'ordine relativo
|
||||
Dim nFirstMovedId As Integer = GDB_ID.NULL
|
||||
Dim nRefId As Integer = EgtGetLastActiveOperation()
|
||||
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
If nOpeId = nFirstMovedId Then Exit While
|
||||
Dim nNextOpeId As Integer = EgtGetNextActiveOperation( nOpeId)
|
||||
If EgtGetOperationType( nOpeId) = MCH_OY.SAWING Then
|
||||
Dim bFinalCut As Boolean = False
|
||||
IF EgtGetInfo( nOpeId, "FinalCut", bFinalCut) AndAlso bFinalCut Then
|
||||
EgtRelocateGlob( nOpeId, nRefId, GDB_POS.AFTER)
|
||||
nRefId = nOpeId
|
||||
If nFirstMovedId = GDB_ID.NULL Then nFirstMovedId = nOpeId
|
||||
End If
|
||||
End If
|
||||
nOpeId = nNextOpeId
|
||||
End While
|
||||
' Esco
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut(nLayerId As Integer) As Boolean
|
||||
If m_bCustomGrid Then
|
||||
Return MultiplyCut_1(nLayerId)
|
||||
|
||||
@@ -154,46 +154,39 @@ Public Class MachineButtonsUC
|
||||
' recupero l'inidce del bottone selezionato
|
||||
Dim nIndex As Integer = GetToggleButtonIndex(CurrentBtn) - 1
|
||||
|
||||
Dim sBaseDir As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||
Dim sLuaFileName As String = String.Empty
|
||||
|
||||
' Se il bottone chiamantè quello delle porte allora devo eseguire due comandi MDI
|
||||
' Se il bottone chiamante è quello delle porte allora devo eseguire due comandi MDI
|
||||
If nIndex = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_OPENED) OrElse
|
||||
nIndex = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_CLOSED) Then
|
||||
Dim sTLuaFile As String = sBaseDir & CommandArrayY(nIndex)
|
||||
Dim sFLuaFile As String = sBaseDir & CommandArrayN(nIndex)
|
||||
ExecuteMDICommand(CurrentBtn, sTLuaFile)
|
||||
ExecuteMDICommand(CurrentBtn, sFLuaFile)
|
||||
VarMdiCommand.ExecuteMDICommand(CommandArrayY(nIndex))
|
||||
VarMdiCommand.ExecuteMDICommand(CommandArrayN(nIndex))
|
||||
CurrentBtn.IsChecked = False
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se il bottone chiamantè quello per la selezione del pannello di controllo
|
||||
' Se il bottone chiamante è quello per la selezione del pannello di controllo
|
||||
If nIndex = Array.IndexOf(StateFlagArray, BTN_ENABLE_PC) Then
|
||||
Dim sTLuaFile As String = sBaseDir & CommandArrayY(nIndex)
|
||||
Dim sFLuaFile As String = sBaseDir & CommandArrayN(nIndex)
|
||||
If m_CN.nEnablePc = 1 Then
|
||||
ExecuteMDICommand(CurrentBtn, sTLuaFile)
|
||||
VarMdiCommand.ExecuteMDICommand(CommandArrayY(nIndex))
|
||||
ElseIf m_CN.nEnablePc = 2 Then
|
||||
ExecuteMDICommand(CurrentBtn, sFLuaFile)
|
||||
VarMdiCommand.ExecuteMDICommand(CommandArrayN(nIndex))
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim sLuaFileName As String = ""
|
||||
If CurrentBtn.IsChecked() Then
|
||||
'EgtLuaExecFile(sBaseDir & CommandArrayY(nIndex))
|
||||
sLuaFileName = sBaseDir & CommandArrayY(nIndex)
|
||||
sLuaFileName = CommandArrayY(nIndex)
|
||||
Else
|
||||
If Not (StateFlagArray(nIndex) = BTN_STATE_THREEAXIS Or
|
||||
StateFlagArray(nIndex) = BTN_STATE_FIVEAXIS) Then
|
||||
'EgtLuaExecFile(sBaseDir & CommandArrayN(nIndex))
|
||||
sLuaFileName = sBaseDir & CommandArrayN(nIndex)
|
||||
sLuaFileName = CommandArrayN(nIndex)
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
|
||||
ExecuteMDICommand(CurrentBtn, sLuaFileName)
|
||||
VarMdiCommand.ExecuteMDICommand(sLuaFileName)
|
||||
|
||||
' se non ha stato e quindi è un bottone normale, tolgo il check
|
||||
If StateFlagArray(nIndex) = BTN_STATE_NOTHING Then
|
||||
@@ -202,241 +195,6 @@ Public Class MachineButtonsUC
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub ExecuteMDICommand(CurrentBtn As Primitives.ToggleButton, sLuaFileName As String)
|
||||
If String.IsNullOrWhiteSpace(sLuaFileName) Then Return
|
||||
Dim CmdString As String = String.Empty
|
||||
Dim b2Start As Boolean = False
|
||||
Dim EActive As Boolean = False
|
||||
Dim ENumber As String = String.Empty
|
||||
Dim EValue As String = String.Empty
|
||||
Dim EType As String = 0
|
||||
Dim ENumber2 As String = String.Empty
|
||||
Dim EValue2 As String = String.Empty
|
||||
Dim EType2 As String = 0
|
||||
' eseguo la lettura del file .lua associato al comando
|
||||
ExecuteDirectCmdLua(sLuaFileName, CmdString, b2Start, EActive, ENumber, EValue, EType, ENumber2, EValue2, EType2)
|
||||
' comunico i dati calcolati al PLC (quidni ignoro eventuali comandi MDI), scrivo messaggio MDI
|
||||
If EActive Then
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
||||
' solo per Flexium
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber, EValue)
|
||||
If Not IsNothing(ENumber2) And Not IsNothing(EValue2) Then
|
||||
m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2)
|
||||
End If
|
||||
' altrimenti scrittura delle variabili E
|
||||
Else
|
||||
m_CN.DVariables_WriteVariables2(ENumber, EValue)
|
||||
End If
|
||||
Return
|
||||
Case 3
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
' scrivo prima variabile
|
||||
Select Case CShort(EType)
|
||||
Case 1
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), CInt(EValue), 0, 0, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & CInt(EValue))
|
||||
Case 2
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, CLng(EValue), 0, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & CLng(EValue))
|
||||
Case 3
|
||||
Dim d As Double = 0
|
||||
StringToDouble(EValue, d)
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, 0, d, "")
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & d)
|
||||
Case 4
|
||||
m_CN.DVariables_WriteVariables3(ENumber, CShort(EType), 0, 0, 0, EValue)
|
||||
EgtOutLog("ENumber= " & ENumber & "EType= " & CShort(EType) & "EValue= " & EValue)
|
||||
End Select
|
||||
EgtOutLog("dopo scrittura prima variabile")
|
||||
If Not IsNothing(EType2) AndAlso CShort(EType) > 0 Then
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' scrivo seconda variabile
|
||||
Select Case CShort(EType2)
|
||||
Case 1
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), CInt(EValue2), 0, 0, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & CInt(EValue2))
|
||||
Case 2
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, CLng(EValue2), 0, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & CLng(EValue2))
|
||||
Case 3
|
||||
Dim d As Double = 0
|
||||
StringToDouble(EValue2, d)
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, 0, d, "")
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & d)
|
||||
Case 4
|
||||
m_CN.DVariables_WriteVariables3(ENumber2, CShort(EType2), 0, 0, 0, EValue2)
|
||||
EgtOutLog("ENumber2= " & ENumber2 & "EType2= " & CShort(EType2) & "EValue2= " & EValue2)
|
||||
End Select
|
||||
EgtOutLog("dopo scrittura seconda variabile")
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' CONTROLLO FANUC
|
||||
Case 4
|
||||
' ------------------------------------ FANUC ------------------------------------
|
||||
' eventuale scrittura di linea di comando MDI
|
||||
If Not String.IsNullOrEmpty(CmdString) Then
|
||||
' attivo mpdalità MDI
|
||||
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' salvo la stringa di comando ricevuta dal file lua
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||
m_CN.MDI_command()
|
||||
End If
|
||||
' attivo modalità AUTO
|
||||
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If String.IsNullOrEmpty(EValue) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
m_CN.NC_pulse_bit(ENumber)
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If ENumber.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue As Boolean
|
||||
If EValue.Trim = "1" Then bEValue = True
|
||||
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||
Else
|
||||
' D#####
|
||||
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||
End If
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||
End If
|
||||
' eventale caricamento seconda variabile
|
||||
If String.IsNullOrEmpty(EValue2) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
m_CN.NC_pulse_bit(ENumber2)
|
||||
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If ENumber2.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue2 As Boolean
|
||||
If EValue2.Trim = "1" Then bEValue2 = True
|
||||
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||
Else
|
||||
' D#####
|
||||
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||
End If
|
||||
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||
End If
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
Dim nResult As Short
|
||||
' Imposto modalità MDI per controlli num
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
End Select
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
m_CN.MDI_command()
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
System.Threading.Thread.Sleep(300)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
Case 4
|
||||
' Nicola: 27/03/2023 attivazione della funzione M# indicata?
|
||||
End Select
|
||||
|
||||
If b2Start Then
|
||||
System.Threading.Thread.Sleep(800)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
End If
|
||||
System.Threading.Thread.Sleep(300)
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
End Sub
|
||||
|
||||
' questa è una copia della funzione presente nel codice ControlsMachineButtonUC.xaml.vb
|
||||
Friend Sub ExecuteDirectCmdLua(LuaFileName As String, ByRef CmdString As String, ByRef b2Start As Boolean, ByRef EActive As Boolean, ByRef ENumber As String, ByRef EValue As String, ByRef EType As String, ByRef ENumber2 As String, ByRef EValue2 As String, ByRef EType2 As String)
|
||||
'Dim sBaseDir As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||
If EgtLuaExecFile(LuaFileName) Then
|
||||
EgtOutLog("Lua " & LuaFileName & " eseguito")
|
||||
Else
|
||||
EgtOutLog("Lua " & LuaFileName & " non eseguito")
|
||||
End If
|
||||
Dim dFeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text) Then
|
||||
StringToLen(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text, dFeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||
Dim dSpeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||
' versione 2.5e1
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
Dim sToolPos As String = String.Empty
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||
End If
|
||||
Dim dToolDiam As Double = 0
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||
End If
|
||||
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dL2)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dL3)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
EgtLuaCallFunction("CmdString")
|
||||
' Leggo variabili
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
EgtLuaGetGlobBoolVar("CMD.DOUBLESTART", b2Start)
|
||||
EActive = False
|
||||
EgtLuaGetGlobBoolVar("CMD.EACTIVE", EActive)
|
||||
ENumber = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER", ENumber)
|
||||
EValue = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE", EValue)
|
||||
EType = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE", EType)
|
||||
EgtOutLog("ENUMBER: " & ENumber & " EVALUE: " & EValue & " ETYPE: " & EType)
|
||||
ENumber2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER2", ENumber2)
|
||||
EValue2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE2", EValue2)
|
||||
EType2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE2", EType2)
|
||||
EgtOutLog("ENUMBER2: " & ENumber2 & " EVALUE2: " & EValue2 & " ETYPE2: " & EType2)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
' Log del comando
|
||||
EgtOutLog("CmdString=" & If(Not String.IsNullOrEmpty(CmdString), CmdString, "") &
|
||||
" b2Start=" & b2Start.ToString() &
|
||||
" EActive=" & EActive.ToString &
|
||||
" ENumber=" & If(Not String.IsNullOrEmpty(ENumber), ENumber, "") &
|
||||
" EValue=" & If(Not String.IsNullOrEmpty(EValue), EValue, "") &
|
||||
" EType=" & If(Not String.IsNullOrEmpty(EType), CInt(EType).ToString, "") &
|
||||
" ENumber2=" & If(Not String.IsNullOrEmpty(ENumber2), ENumber2, "") &
|
||||
" EValue2=" & If(Not String.IsNullOrEmpty(EValue2), EValue2, "") &
|
||||
" EType2=" & If(Not String.IsNullOrEmpty(EType2), CInt(EType2).ToString, ""))
|
||||
End Sub
|
||||
|
||||
#Region "STATE CHANGED"
|
||||
|
||||
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||
|
||||
@@ -163,7 +163,7 @@ Public Class ManualAxesMoveUC
|
||||
Private m_MoveClicked As Boolean = False
|
||||
Private Sub XXBtn_Click(sender As Object, e As MouseButtonEventArgs) Handles L1Btn.PreviewMouseDown, L2Btn.PreviewMouseDown, L3Btn.PreviewMouseDown, R1Btn.PreviewMouseDown, R2Btn.PreviewMouseDown
|
||||
If e.ClickCount > 1 OrElse m_MoveClicked Then
|
||||
EgtOutLog(" → Hold on! Do not click compulsively.")
|
||||
EgtOutLog(" -> Hold on! Do not click compulsively.")
|
||||
Return
|
||||
End If
|
||||
m_MoveClicked = True
|
||||
|
||||
@@ -636,10 +636,8 @@ Public Class MultipleCut
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
' Creo layer di taglio
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
|
||||
@@ -78,16 +78,18 @@ Public Class Polishing
|
||||
m_refControlDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC1.DirectCutPages.DirectCut
|
||||
' Cancello eventuali lucidature
|
||||
RemovePolishings()
|
||||
' Dichiaro polishing non più attivo
|
||||
DirectCut.m_bPolishingOn = False
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
' Ripristino opacità del grezzo
|
||||
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
|
||||
EgtSetAlpha( nRawSolidId, 100)
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End If
|
||||
@@ -211,6 +213,8 @@ Public Class Polishing
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup( m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
m_bPoliOk = AddPolishings( sKitName, nKerfId)
|
||||
EgtSetCurrPhase( 1)
|
||||
' Dichiaro polishing attivo
|
||||
DirectCut.m_bPolishingOn = True
|
||||
Return m_bPoliOk
|
||||
End Function
|
||||
|
||||
|
||||
@@ -514,9 +514,8 @@ Public Class SawTestUC
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
|
||||
@@ -783,8 +783,8 @@ Public Class SingleCutAuto
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = CreateDirectCutPart()
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
|
||||
@@ -657,8 +657,8 @@ Public Class SingleCutUC
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = CreateDirectCutPart()
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
|
||||
@@ -72,13 +72,14 @@ Public Class SingleDrillUC
|
||||
|
||||
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
GetDrillFromDrilling(m_sCurrDrill, m_CurrentMachine.sCurrDrilling)
|
||||
If String.IsNullOrWhiteSpace(m_sCurrDrill) Then m_sCurrDrill = GetDrillFromDrilling(m_CurrentMachine.sCurrDrilling)
|
||||
' rimuovo utensile su uscite 1
|
||||
EgtSetCalcTool("", "H1", 1)
|
||||
' imposto utensile su uscita 2
|
||||
EgtSetCalcTool(m_sCurrDrill, "H1", 2)
|
||||
' recupero informazioni del foretto usato
|
||||
EgtTdbSetCurrTool(m_sCurrDrill)
|
||||
m_dDiameter = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||
|
||||
' Attivo la pagina
|
||||
@@ -412,34 +413,34 @@ Public Class SingleDrillUC
|
||||
EgtEmptyGroup(m_nTempLay)
|
||||
' Spessore grezzo
|
||||
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||
' Recupero spessore lama corrente
|
||||
' Recupero diametro foretto corrente
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
GetDrillFromDrilling(sDrill, m_MainWindow.m_CurrentMachine.sCurrDrilling)
|
||||
If String.IsNullOrWhiteSpace( sDrill) Then sDrill = GetDrillFromDrilling(m_MainWindow.m_CurrentMachine.sCurrDrilling)
|
||||
EgtTdbSetCurrTool(sDrill)
|
||||
Dim dDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
m_dDiameter = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||
' Rimuovo eventuale vecchio pezzo per taglio diretto
|
||||
EraseDirectCutPart()
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = CreateDirectCutPart()
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_INLOOP)
|
||||
' Creo il Drill
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
ptStart.z = 0
|
||||
|
||||
' Creo layer per crocetta di riferimento
|
||||
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nCrossLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
' Aggiungo crocetta/e
|
||||
If m_bPointP1Ok Then
|
||||
CreateCross(nCrossLayerId, ptStart)
|
||||
End If
|
||||
|
||||
Dim nCutId = EgtCreateCircle(nLayerId, ptStart, m_dDiameter / 2)
|
||||
' Inidico che è un taglio Diretto di tipo SingleDrill
|
||||
' Indico che è un taglio Diretto di tipo SingleDrill
|
||||
EgtSetInfo(nCutId, INFO_DIRECTCUT, FlagDirectCuts.SingleDrill)
|
||||
' Calcolo punto di inserimento nel grezzo
|
||||
Dim ptMin, ptMax As Point3d
|
||||
|
||||
@@ -317,9 +317,8 @@ Public Class SquaringUC
|
||||
' Disattivo eventuali lavorazioni presenti
|
||||
DeactivateAllMachinings()
|
||||
' Creo nuovo pezzo per il taglio diretto
|
||||
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||
Dim nPartId As Integer = CreateDirectCutPart()
|
||||
Dim nLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||
' Creo il taglio parallelo alla lama
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
Imports EgtUILib.EgtInterface
|
||||
|
||||
Module VarMdiCommand
|
||||
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Public Sub ExecuteMDICommand(sLuaFileName As String)
|
||||
|
||||
' Verifica esistenza pagina DirectCut e ne recupero CN corrente
|
||||
If IsNothing( m_MainWindow.m_DirectCutPageUC) Then Return
|
||||
Dim CurrCN As CN_generico = m_MainWindow.m_DirectCutPageUC.m_CN
|
||||
|
||||
' Verifico esistenza nome script lua
|
||||
If String.IsNullOrWhiteSpace(sLuaFileName) Then Return
|
||||
|
||||
' Eseguo script
|
||||
Dim CmdString As String = String.Empty
|
||||
Dim b2Start As Boolean = False
|
||||
Dim bEActive As Boolean = False
|
||||
Dim sENumber As String = String.Empty
|
||||
Dim sEValue As String = String.Empty
|
||||
Dim sEType As String = 0
|
||||
Dim sENumber2 As String = String.Empty
|
||||
Dim sEValue2 As String = String.Empty
|
||||
Dim sEType2 As String = 0
|
||||
If Not ExecDirectCmdLua(sLuaFileName, CmdString, b2Start, bEActive, sENumber, sEValue, sEType, sENumber2, sEValue2, sEType2) Then
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se richiesta scrittura variabili
|
||||
If bEActive Then
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2 ' Num Axium e Flexium
|
||||
' se Flexium e abilitata scrittura variabili PLC
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType = 2 And CurrCN.m_NewVariable Then
|
||||
CurrCN.DPlcVariables_WriteVariables(sENumber, sEValue)
|
||||
If Not String.IsNullOrWhiteSpace(sENumber2) AndAlso Not String.IsNullOrWhiteSpace(sEValue2) Then
|
||||
CurrCN.DPlcVariables_WriteVariables(sENumber2, sEValue2)
|
||||
End If
|
||||
' altrimenti scrittura della variabile E
|
||||
Else
|
||||
CurrCN.DVariables_WriteVariables2(sENumber, sEValue)
|
||||
End If
|
||||
Return
|
||||
Case 3 ' Siemens
|
||||
' Scrivo prima variabile
|
||||
Dim nEType As Integer = 0
|
||||
StringToInt( sEType, nEType)
|
||||
Select Case nEType
|
||||
Case 1
|
||||
Dim nEvalue As Integer = 0
|
||||
StringToInt( sEvalue, nEvalue)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber, 1, nEValue, 0, 0, "")
|
||||
EgtOutLog("ENumber=" & sENumber & " EType=1 " & " EValue=" & nEValue.ToString())
|
||||
Case 2
|
||||
Dim lEvalue As Long = 0
|
||||
Long.TryParse(sEValue, lEvalue)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber, 2, 0, lEvalue, 0, "")
|
||||
EgtOutLog("ENumber=" & sENumber & " EType=2 " & " EValue=" & lEvalue.ToString())
|
||||
Case 3
|
||||
Dim dEValue As Double = 0
|
||||
StringToDouble(sEValue, dEValue)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber, 3, 0, 0, dEValue, "")
|
||||
EgtOutLog("ENumber=" & sENumber & " EType=3 " & " EValue=" & dEValue.ToString())
|
||||
Case 4
|
||||
CurrCN.DVariables_WriteVariables3(sENumber, 4, 0, 0, 0, sEValue)
|
||||
EgtOutLog("ENumber=" & sENumber & " EType=4 " & " EValue=" & sEValue)
|
||||
Case Else
|
||||
EgtOutLog("EType wrong : ENumber=" & sENumber & " EType=" & sEType & " EValue= " & sEValue)
|
||||
End Select
|
||||
If Not String.IsNullOrWhiteSpace(sEType2) AndAlso sEType2 <> "0" Then
|
||||
' Pausa
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' Scrivo seconda variabile
|
||||
Dim nEType2 As Integer = 0
|
||||
StringToInt( sEType2, nEType2)
|
||||
Select Case nEType2
|
||||
Case 1
|
||||
Dim nEvalue2 As Integer = 0
|
||||
StringToInt( sEvalue2, nEvalue2)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber2, 1, nEValue2, 0, 0, "")
|
||||
EgtOutLog("ENumber2=" & sENumber2 & " EType2=1" & " EValue2=" & nEValue2.ToString())
|
||||
Case 2
|
||||
Dim lEvalue2 As Long = 0
|
||||
Long.TryParse(sEValue2, lEvalue2)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber2, 2, 0, lEValue2, 0, "")
|
||||
EgtOutLog("ENumber2=" & sENumber2 & " EType2=2" & " EValue2=" & lEValue2.ToString())
|
||||
Case 3
|
||||
Dim dEValue2 As Double = 0
|
||||
StringToDouble(sEValue2, dEValue2)
|
||||
CurrCN.DVariables_WriteVariables3(sENumber2, 3, 0, 0, dEValue2, "")
|
||||
EgtOutLog("ENumber2=" & sENumber2 & " EType2=3" & " EValue2=" & dEValue2.ToString())
|
||||
Case 4
|
||||
CurrCN.DVariables_WriteVariables3(sENumber2, 4, 0, 0, 0, sEValue2)
|
||||
EgtOutLog("ENumber2=" & sENumber2 & " EType2=4" & " EValue2=" & sEValue2)
|
||||
Case Else
|
||||
EgtOutLog("EType2 wrong : ENumber2=" & sENumber2 & " EType2=" & sEType2 & " EValue2=" & sEValue2)
|
||||
End Select
|
||||
End If
|
||||
Return
|
||||
Case 4 ' Fanuc
|
||||
' eventuale scrittura di linea di comando MDI
|
||||
If Not String.IsNullOrWhiteSpace(CmdString) Then
|
||||
' attivo mpdalità MDI
|
||||
CurrCN.DGeneralFunctions_WriteCncMode(2)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' salvo la stringa di comando ricevuta dal file lua
|
||||
CurrCN.sz_ManualDataInput = CmdString
|
||||
' eseguo la funzione che ha il compito di scrivere il comando MDI
|
||||
CurrCN.MDI_command()
|
||||
End If
|
||||
' attivo modalità Manuale
|
||||
CurrCN.DGeneralFunctions_WriteCncMode(7)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' eventuale caricamento prima variabile
|
||||
If Not String.IsNullOrEmpty(sENumber) Then
|
||||
If String.IsNullOrWhiteSpace(sEValue) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
CurrCN.NC_pulse_bit(sENumber)
|
||||
EgtOutLog("Fanuc : DNumber=" & sENumber)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If sENumber.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue As Boolean = ( sEValue.Trim <> "0")
|
||||
CurrCN.NC_write_var_bit(sENumber, bEValue)
|
||||
Else
|
||||
' D#####
|
||||
CurrCN.NC_write_var_short(sENumber, CShort(sEValue))
|
||||
End If
|
||||
EgtOutLog("Fanuc : DNumber=" & sENumber & " DValue=" & sEValue)
|
||||
End If
|
||||
Else
|
||||
EgtOutLog("Fanuc : DNumber=NullOrEmpty")
|
||||
End If
|
||||
' eventale caricamento seconda variabile
|
||||
If Not String.IsNullOrEmpty(sENumber2) Then
|
||||
If String.IsNullOrWhiteSpace(sEValue2) Then
|
||||
' EActive: impulsivo "D#####"
|
||||
CurrCN.NC_pulse_bit(sENumber2)
|
||||
EgtOutLog("Fanuc : DNumber2=" & sENumber2)
|
||||
Else
|
||||
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||
If sENumber2.Contains(".") Then
|
||||
' D#####.#
|
||||
Dim bEValue2 As Boolean = ( sEValue2.Trim <> "0")
|
||||
CurrCN.NC_write_var_bit(sENumber2, bEValue2)
|
||||
Else
|
||||
' D#####
|
||||
CurrCN.NC_write_var_short(sENumber2, CShort(sEValue2))
|
||||
End If
|
||||
EgtOutLog("Fanuc : DNumber2=" & sENumber2 & " DValue2=" & sEValue2)
|
||||
End If
|
||||
Else
|
||||
EgtOutLog("Fanuc : DNumber2=NullOrEmpty")
|
||||
End If
|
||||
Return
|
||||
Case Else ' Demo
|
||||
EgtOutLog("Demo : ENumber=" & sENumber & " EType=" & sEType & " EValue=" & sEValue)
|
||||
EgtOutLog("Demo : ENumber2=" & sENumber2 & " EType2=" & sEType2 & " EValue2=" & sEValue2)
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
|
||||
' Esecuzione comando MDI
|
||||
Dim nResult As Short
|
||||
' assegno la modalità di funzionamento
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2, 4
|
||||
nResult = CurrCN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||
Case 3
|
||||
'Per Siemens non devo fare nulla
|
||||
End Select
|
||||
' salvo la stringa di comando ricevuta dal file lua
|
||||
CurrCN.sz_ManualDataInput = CmdString
|
||||
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||
CurrCN.MDI_command()
|
||||
' avvio l'esecuzione del comando
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
System.Threading.Thread.Sleep(500)
|
||||
CurrCN.DGeneralFunctions_CycleStart()
|
||||
Case 3, 4
|
||||
'Per Siemens e Fanuc non devo fare nulla
|
||||
End Select
|
||||
' se richiesto ripeto l'operazione
|
||||
If b2Start Then
|
||||
EgtOutLog("Avvio secondo cliclo start")
|
||||
System.Threading.Thread.Sleep(800)
|
||||
CurrCN.DGeneralFunctions_CycleStart()
|
||||
End If
|
||||
System.Threading.Thread.Sleep(300)
|
||||
' ripristino la modalità Manuale
|
||||
nResult = CurrCN.DGeneralFunctions_WriteCncMode(7)
|
||||
End Sub
|
||||
|
||||
' Esecuzione dello script lua per impostazione dati del comando diretto
|
||||
Private Function ExecDirectCmdLua(sLuaFileName As String,
|
||||
ByRef CmdString As String, ByRef b2Start As Boolean, ByRef bEActive As Boolean,
|
||||
ByRef sENumber As String, ByRef sEValue As String, ByRef sEType As String,
|
||||
ByRef sENumber2 As String, ByRef sEValue2 As String, ByRef sEType2 As String) As Boolean
|
||||
' Esecuzione script
|
||||
Dim sLuaPath As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\" & sLuaFileName
|
||||
Dim bOk As Boolean = EgtLuaExecFile(sLuaPath)
|
||||
EgtOutLog("DirectCmd Script " & sLuaPath & If(bOk, " completed", " stopped with errors"))
|
||||
If Not bOk Then Return False
|
||||
|
||||
' Assegnazione valori a variabili lua
|
||||
Dim ManualAxesMove As ManualAxesMoveUC = m_MainWindow.m_DirectCutPageUC.m_ManualAxesMove
|
||||
|
||||
Dim dFeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(ManualAxesMove.FeedTxBx.Text) Then
|
||||
StringToLen(ManualAxesMove.FeedTxBx.Text, dFeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||
|
||||
Dim dSpeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(ManualAxesMove.SpeedTxBx.Text) Then
|
||||
StringToDouble(ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
Dim sToolPos As String = String.Empty
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||
End If
|
||||
Dim dToolDiam As Double = 0
|
||||
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||
End If
|
||||
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dL2)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dL3)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
|
||||
Dim sCurrTable As String = String.Empty
|
||||
Dim nCurrTable As Integer = 1
|
||||
EgtGetTableName(sCurrTable)
|
||||
If sCurrTable <> "MainTab" Then nCurrTable = 2
|
||||
EgtLuaSetGlobIntVar("CMD.TABLE", nCurrTable)
|
||||
|
||||
' Esecuzione funzione
|
||||
bOk = EgtLuaCallFunction("CmdString")
|
||||
EgtOutLog(" CmdString function" & If(bOk, " completed", " stopped with errors"))
|
||||
If Not bOk Then Return False
|
||||
|
||||
' Leggo variabili da file Lua
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
EgtLuaGetGlobBoolVar("CMD.DOUBLESTART", b2Start)
|
||||
bEActive = False
|
||||
EgtLuaGetGlobBoolVar("CMD.EACTIVE", bEActive)
|
||||
sENumber = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER", sENumber)
|
||||
sEValue = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE", sEValue)
|
||||
sEType = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE", sEType)
|
||||
sENumber2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ENUMBER2", sENumber2)
|
||||
sEValue2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.EVALUE2", sEValue2)
|
||||
sEType2 = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.ETYPE2", sEType2)
|
||||
' Reset variabili lua
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
' Log del comando
|
||||
EgtOutLog(" CmdString=" & If(Not String.IsNullOrEmpty(CmdString), CmdString, "") &
|
||||
" DOUBLESTART=" & b2Start.ToString() &
|
||||
" EActive=" & bEActive.ToString() &
|
||||
" ENumber=" & If(Not String.IsNullOrEmpty(sENumber), sENumber, "") &
|
||||
" EValue=" & If(Not String.IsNullOrEmpty(sEValue), sEValue, "") &
|
||||
" EType=" & If(Not String.IsNullOrEmpty(sEType), sEType, "") &
|
||||
" ENumber2=" & If(Not String.IsNullOrEmpty(sENumber2), sENumber2, "") &
|
||||
" EValue2=" & If(Not String.IsNullOrEmpty(sEValue2), sEValue2, "") &
|
||||
" EType2=" & If(Not String.IsNullOrEmpty(sEType2), sEType2, ""))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
Title="ChooseMachining" Height="276.5" Width="426.5">
|
||||
Title="CompoCsvData" Height="276.5" Width="426.5">
|
||||
|
||||
<!--Definizione della pagina di impostazione dati Trf su componenti-->
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
Title="ChooseMachining" Height="426.5" Width="426.5">
|
||||
Title="CompoTrfData" Height="426.5" Width="426.5">
|
||||
|
||||
<!--Definizione della pagina di impostazione dati Trf su componenti-->
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
|
||||
@@ -1188,7 +1188,7 @@ Public Class DrawPageUC
|
||||
ActivateParkIndZero()
|
||||
Dim bExitPage As Boolean = GetPrivateProfileInt(S_GENERAL, K_QUITDRAWPAGE, 1, m_MainWindow.GetIniFile) <> 0
|
||||
' Se Shift premuto eseguo il contrario
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
|
||||
bExitPage = Not bExitPage
|
||||
End If
|
||||
If bExitPage Then
|
||||
@@ -1563,10 +1563,15 @@ Public Class DrawPageUC
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
|
||||
End Select
|
||||
|
||||
' Pulisco l'ambiente lua
|
||||
ResetLuaVariables()
|
||||
|
||||
Try
|
||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||
Catch ex As Exception
|
||||
Dim x As Boolean = True
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Class CompoVar
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2"
|
||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2"
|
||||
ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
ItemsSource="{Binding ItemList}"/>
|
||||
|
||||
|
||||
@@ -867,12 +867,11 @@ Public Class ImportPageUC
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
' Genero l'immagine solo se è abilitata la modalità
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then Print()
|
||||
If m_MainWindow.EnabledDxfPark() Then Print()
|
||||
' Se import per pezzi piatti
|
||||
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||
' Eseguo importazione pezzi piatti
|
||||
LoadFlatParts()
|
||||
|
||||
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello indicato
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
@@ -888,7 +887,7 @@ Public Class ImportPageUC
|
||||
SelParkIndWD.SetStatusPartInParkInd(Item, False)
|
||||
Next
|
||||
|
||||
' altrimenti import per cornici
|
||||
' altrimenti import per cornici
|
||||
Else
|
||||
LoadFrame()
|
||||
End If
|
||||
@@ -903,9 +902,6 @@ Public Class ImportPageUC
|
||||
' recupero la lista degli indici di parcheggio
|
||||
NewParkInd = SelParkIndWD.NewParkInd()
|
||||
|
||||
Dim SM_Select As SM = SM.SHADING
|
||||
' SM_Select = SM.HIDDENLINE
|
||||
' SM_Select = SM.WIREFRAME
|
||||
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
|
||||
Dim sPath As String = SelParkIndWD.GetPathCurrProj() & NewParkInd.ToString & ".png"
|
||||
' Recupero le dimensioni dell'area di stampa
|
||||
@@ -920,13 +916,11 @@ Public Class ImportPageUC
|
||||
' Recupero le dimensioni correnti della pagina di disegno
|
||||
Dim nImgW As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualWidth()
|
||||
Dim nImgH As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualHeight()
|
||||
If Not EgtGetImage(SM_Select, colBackTopColor, colBackBottomColor, nImgW, nImgH, sPath) Then
|
||||
If Not EgtGetImage(SM.SHADING, colBackTopColor, colBackBottomColor, nImgW, nImgH, sPath) Then
|
||||
' Error in creating the print image
|
||||
EgtOutLog(EgtMsg(50181))
|
||||
EgtSetLineAttribs(1)
|
||||
Return
|
||||
End If
|
||||
EgtSetLineAttribs(1)
|
||||
'Metodo complesso di stampa che permette di rilasciare il file :
|
||||
'carico la bitmap e la metto in uno stream in memoria
|
||||
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
|
||||
@@ -944,9 +938,8 @@ Public Class ImportPageUC
|
||||
tmpImg.Source = bitImage
|
||||
tmpImg.Stretch = Stretch.Uniform
|
||||
tmpImg.EndInit()
|
||||
' eseguo la stampa
|
||||
Catch
|
||||
' Rrror in executing print
|
||||
' Error in executing print
|
||||
EgtOutLog(EgtMsg(50182))
|
||||
End Try
|
||||
Else
|
||||
@@ -1049,8 +1042,8 @@ Public Class ImportPageUC
|
||||
Dim dNewArea As Double = 0
|
||||
Dim nId As Integer = nFirstId
|
||||
While nId <> GDB_ID.NULL
|
||||
' Definisco l'indice di parcheggio asssganto al pezzo
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
' Definisco l'indice di parcheggio assegnato al pezzo
|
||||
If m_MainWindow.EnabledDxfPark() Then
|
||||
EgtSetInfo(nId, INFO_PARKIND, NewParkInd.ToString)
|
||||
' Imposto lo stato
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
@@ -1111,7 +1104,7 @@ Public Class ImportPageUC
|
||||
' Imposto path di provenienza
|
||||
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
|
||||
' Inserisco in parcheggio
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
If m_MainWindow.EnabledDxfPark() Then
|
||||
' Mantengo la posizione relativa tra i pezzi
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, DimX, DimY, BBoxMaxPt)
|
||||
Else
|
||||
|
||||
@@ -248,5 +248,5 @@ Public Class SecondaryComponentPageUC
|
||||
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Add(m_MainComponentPage)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -227,7 +227,7 @@ Module SideAngle
|
||||
EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng)
|
||||
EgtSetInfo(EntId, INFO_HEEL, dHeel)
|
||||
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||
If Not String.IsNullOrEmpty(sSawingTilted) Then
|
||||
If Not String.IsNullOrWhiteSpace(sSawingTilted) Then
|
||||
EgtSetInfo(EntId, DEF_MACHINING_TILTED, sSawingTilted)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -167,7 +167,43 @@ Public Class SideAngleUC
|
||||
End If
|
||||
|
||||
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
|
||||
TxBlChBxView()
|
||||
' Controllo se la checkbox SideAngle è attiva
|
||||
If SideAngleChBx.IsChecked Then
|
||||
Dim dSideAngle As Double = 0
|
||||
Dim dHell As Double = 0
|
||||
' Controllo se l'angolo della nuova entità non è nullo
|
||||
If Not String.IsNullOrEmpty(NewA1TxBx.Text) Then
|
||||
StringToDouble(NewA1TxBx.Text, dSideAngle)
|
||||
' Controllo se l'angolo è diverso da 0
|
||||
If dSideAngle <> 0 Then
|
||||
' Aggiorno l'angolo delle entità
|
||||
UpdateSideAngleAllEntities()
|
||||
End If
|
||||
End If
|
||||
' Controllo se il tallone della nuova entità non è nullo
|
||||
If Not String.IsNullOrEmpty(NewH1TxBx.Text) Then
|
||||
StringToDouble(NewH1TxBx.Text, dHell)
|
||||
' Controllo se il tallone è maggiore di 0
|
||||
If dHell > 0 Then
|
||||
' Aggiorno il tallone delle entità
|
||||
UpdateHeelAllEntities()
|
||||
End If
|
||||
End If
|
||||
' Elimino le righe per riposizionarle
|
||||
Dim nMyShow = Math.Max( m_nShow, 1)
|
||||
Grid.SetRow(NewEntity, MAX_LINES - nMyShow + 1)
|
||||
Grid.SetRow(NewA1TxBx, MAX_LINES - nMyShow + 1)
|
||||
Grid.SetRow(NewH1TxBx, MAX_LINES - nMyShow + 1)
|
||||
|
||||
Grid.SetRow(SideAngleBl, MAX_LINES - nMyShow)
|
||||
Grid.SetRow(HeelBl, MAX_LINES - nMyShow)
|
||||
Grid.SetRow(SideAngleGrid, MAX_LINES - nMyShow)
|
||||
' Rendo visibile solo la nuova entità
|
||||
CollapsedCheckAllTextSideAng()
|
||||
Else
|
||||
' Altrimenti eseguo impaginazione classica
|
||||
TxBlChBxView()
|
||||
End If
|
||||
|
||||
' Aggiorno valori
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
@@ -406,10 +442,16 @@ Public Class SideAngleUC
|
||||
Grid.SetRow(NewA1TxBx, MAX_LINES - m_nShow + 1)
|
||||
Grid.SetRow(NewH1TxBx, MAX_LINES - m_nShow + 1)
|
||||
|
||||
NewEntity.Text = "A#"
|
||||
' Se interrompo la creazione di un unico SideAng
|
||||
If Not GetSideAngleFromAllEntities() Then Return
|
||||
|
||||
CollapsedCheckAllTextSideAng()
|
||||
End Sub
|
||||
|
||||
' Rende visibile NewEntity quando si attiva la spunta sulla checkbox
|
||||
Private Sub CollapsedCheckAllTextSideAng()
|
||||
NewEntity.Text = "A#"
|
||||
|
||||
PrevBtn.Visibility = Visibility.Collapsed
|
||||
NextBtn.Visibility = Visibility.Collapsed
|
||||
|
||||
@@ -907,7 +949,7 @@ Public Class SideAngleUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' nuova funzione per gestire l'accorcaimento dei segmenti
|
||||
' nuova funzione per gestire l'accorciamento dei segmenti
|
||||
Friend Sub CreateDripGeom(nPartId As Integer)
|
||||
' Recupero Id layer di contorno esterno
|
||||
Dim nOutLoopId = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
|
||||
@@ -1104,7 +1146,7 @@ Public Class SideAngleUC
|
||||
EgtStartVector(nCrvId, vtAux)
|
||||
Dim vtExtrusion As Vector3d
|
||||
EgtCurveExtrusion(nCrvId, vtExtrusion)
|
||||
' ruoto il vetottore nella nuova direzione
|
||||
' ruoto il vettore nella nuova direzione
|
||||
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
|
||||
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
|
||||
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
|
||||
@@ -1465,7 +1507,7 @@ Public Class SideAngleUC
|
||||
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
|
||||
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
||||
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||
If Not String.IsNullOrEmpty(sSawingTilted) Then
|
||||
If Not String.IsNullOrEmpty(sSawingTilted) And m_MainWindow.m_CurrentMachine.bApplySawingTilted Then
|
||||
EgtSetInfo(CurrEntity.nGeomId, DEF_MACHINING_TILTED, sSawingTilted)
|
||||
End If
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
|
||||
@@ -65,7 +65,7 @@ Public Class FrameCutPageUC
|
||||
m_AlongAx.Add(EgtMsg(90614)) ' Guida
|
||||
End If
|
||||
SelSectionBtn.ToolTip = EgtMsg(90615) ' Sezione
|
||||
SelGuideBtn.Content = EgtMsg(906116) ' Guida
|
||||
SelGuideBtn.Content = EgtMsg(90616) ' Guida
|
||||
ArcRadTxBl.Text = EgtMsg(90617) ' Rad
|
||||
ArcAngTxBl.Text = EgtMsg(90618) ' Ang
|
||||
MirrorPartBtn.ToolTip = EgtMsg(90607) ' Mirror cornice
|
||||
@@ -468,7 +468,7 @@ Public Class FrameCutPageUC
|
||||
|
||||
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.DragRectangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
|
||||
@@ -93,6 +93,17 @@ Public Class FrameMachiningUC
|
||||
m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
End If
|
||||
m_DisableCalc = False
|
||||
' Lato opposto abilitato solo se cornice con linea guida
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart( EgtGetFirstRawPart())
|
||||
Dim nCurrAx As Integer = 0
|
||||
EgtGetInfo( nPartId, INFO_FRAME_DIR, nCurrAx)
|
||||
If nCurrAx = 3 Then
|
||||
OthSideTxBl.Visibility = Visibility.Visible
|
||||
OthSideChBx.Visibility = Visibility.Visible
|
||||
Else
|
||||
OthSideTxBl.Visibility = Visibility.Hidden
|
||||
OthSideChBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateMachiningList(MachiningType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.0*"/>
|
||||
<RowDefinition Height="1.0*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
@@ -27,7 +27,9 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="FinalSawCutGpBx" Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<!--Parametri Taglio Lama: 5 Parametri-->
|
||||
<GroupBox Name="SawGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.RowSpan="4" Margin="5,0,5,0">
|
||||
<!--definizione della grigli ainterna-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -36,20 +38,139 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="EnableFinalSawCutTxBl" Grid.Column="0" Grid.Row="0"
|
||||
<TextBlock Name="CutExtraLenTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<CheckBox Name="EnableFinalSawCutChBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right"/>
|
||||
|
||||
<TextBlock Name="FinalDepthTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="FinalDepthTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CutExtraLenTxBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ExtArcMinRadTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="IntArcMaxSideAngTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="IntArcMaxSideAngTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="PreCutExitTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<CheckBox Name="PreCutExitChBx" Grid.Column="1" Grid.Row="4" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri fori: 4 Parametri-->
|
||||
<GroupBox Name="HolesGpBx" Grid.Column="1" Grid.RowSpan="3" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="145*"/>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="169*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="HolesOffsetTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetTxBx" Grid.Column="2" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesOverlapTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOverlapTxBx" Grid.Column="2" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesToleranceTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesToleranceTxBx" Grid.Column="2" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="OneHoleInCornerTxBl" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="OneHoleInCornerChBx" Grid.Column="2" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri WaterJet: 2 Parametri-->
|
||||
<GroupBox Name="WjsParamGpBx" Grid.Column="1" Grid.RowSpan="2" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="145*"/>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="169*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="WjOptimizeTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="WjOptimizeChBx" Grid.Column="2" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
<TextBlock Name="WjIntCutsTxBl" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="WjIntCutsChBx" Grid.Column="2" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri Fresatura: 3 Parametri-->
|
||||
<GroupBox Name="MillingsParamGpBx" Grid.Column="2" Grid.RowSpan="3" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CornerCutsTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="CornerCutsChBx" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="InternalCutsTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,0,10" VerticalAlignment="Bottom" />
|
||||
<CheckBox Name="InternalCutsChBx" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="ShortTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ShortTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -1,30 +1,232 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class Alarms2PageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private m_CurrentMachine As CurrentMachine
|
||||
|
||||
' Properties
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
Private Sub Alarms2Page_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
FinalSawCutGpBx.Header = EgtMsg(91254) ' Taglio Finale
|
||||
EnableFinalSawCutTxBl.Text = EgtMsg(91255) ' Abilita
|
||||
FinalDepthTxBl.Text = EgtMsg(91256) ' Ultimo Spessore
|
||||
' Variabile che accorcia il riferimento alla macchina corrente
|
||||
m_CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||
|
||||
SawGpBx.Header = EgtMsg(90925) ' Parametri lama
|
||||
HolesGpBx.Header = EgtMsg(90917) ' Parametri fori
|
||||
WjsParamGpBx.Header = EgtMsg(91058) ' Parametri waterjet
|
||||
MillingsParamGpBx.Header = EgtMsg(90929) ' Parametri fresature
|
||||
|
||||
HolesOffsetTxBl.Text = EgtMsg(90909) ' Offset fori
|
||||
HolesOverlapTxBl.Text = EgtMsg(90910) ' Sovrapp. fori
|
||||
HolesToleranceTxBl.Text = EgtMsg(90911) ' Tolleranza fori
|
||||
OneHoleInCornerTxBl.Text = EgtMsg(90926) ' Un solo foro in angolo
|
||||
CutExtraLenTxBl.Text = EgtMsg(90906) ' Sicurezza tagli
|
||||
AngleCutExtraLenTxBl.Text = EgtMsg(90907) ' Sicur. angoli
|
||||
ExtArcMinRadTxBl.Text = EgtMsg(90918) ' Rmin archi est.
|
||||
IntArcMaxSideAngTxBl.Text = EgtMsg(90924) ' Amax archi int.
|
||||
PreCutExitTxBl.Text = EgtMsg(91065) ' PreTaglio uscite
|
||||
WjOptimizeTxBl.Text = EgtMsg(91043) ' Ottimizza
|
||||
WjIntCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
|
||||
CornerCutsTxBl.Text = EgtMsg(90944) ' Sempre sugli angoli
|
||||
InternalCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
|
||||
ShortTxBl.Text = EgtMsg(90949) ' Accorciamento
|
||||
End Sub
|
||||
|
||||
Private Sub Allarm2Page_Loaded() Handles Me.Loaded
|
||||
EnableFinalSawCutChBx.IsChecked = m_MainWindow.m_CurrentMachine.bEnableFinalSawCut
|
||||
FinalDepthTxBx.Text = m_MainWindow.m_CurrentMachine.dFinalDepth
|
||||
Private Sub Alarms2Page_Loaded() Handles Me.Loaded
|
||||
If m_bFirst Then
|
||||
' Se non previsti tagli di lama, nascondo i relativi parametri
|
||||
If Not m_CurrentMachine.bSawing Then
|
||||
SawGpBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Verifico la configurazione della macchina per creare i combobox
|
||||
Select Case m_CurrentMachine.MountedToolConfig
|
||||
Case CurrentMachine.MountedToolConfigs.SAW
|
||||
' Disattivo il gruppo dei parametri fori
|
||||
HolesGpBx.Visibility = Windows.Visibility.Hidden
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
' Non faccio alcunchè
|
||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
' Da implementare
|
||||
End Select
|
||||
|
||||
' Se non previste forature, nascondo relativo box
|
||||
If Not m_CurrentMachine.bDrilling Then
|
||||
HolesGpBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Se non previste fresature, nascondo relativo box e uso fresa con incisione
|
||||
If Not m_CurrentMachine.bMilling Then
|
||||
MillingsParamGpBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Se non previsto taglio ad acqua (waterjet), nascondo relativo box
|
||||
If Not m_CurrentMachine.bWaterJet Then
|
||||
WjsParamGpBx.Visibility = Visibility.Hidden
|
||||
' se altrimenti non c'è lama, nascondo il check e lo considero sempre vero
|
||||
ElseIf Not m_CurrentMachine.bSawing Then
|
||||
WjIntCutsTxBl.Visibility = Visibility.Hidden
|
||||
WjIntCutsChBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
m_bFirst = False
|
||||
End If
|
||||
|
||||
Dim dVal As Double
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, dVal)
|
||||
HolesOffsetTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo sovrapposizione fori
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, m_MainWindow.GetMachIniFile())
|
||||
HolesOverlapTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo tolleranza diametro fori
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, dVal)
|
||||
HolesToleranceTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo un solo foro in corner
|
||||
OneHoleInCornerChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo sicurezza su tagli
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, dVal)
|
||||
CutExtraLenTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo sicurezza su tagli in angoli interni
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 0, m_MainWindow.GetMachIniFile())
|
||||
AngleCutExtraLenTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo raggio minimo arco esterno
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_EXTARCMINRAD, 200, m_MainWindow.GetMachIniFile())
|
||||
If Not EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal) Then
|
||||
EgtMdbGetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal)
|
||||
End If
|
||||
ExtArcMinRadTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo angolo di fianco massimo arco interno
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, 45, m_MainWindow.GetMachIniFile())
|
||||
if Not EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal) Then
|
||||
EgtMdbGetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal)
|
||||
End If
|
||||
IntArcMaxSideAngTxBx.Text = DoubleToString(dVal, 2)
|
||||
' Leggo se PreCutExit attivo (per taglio ceramico)
|
||||
Dim nPreCutExit As Integer = GetPrivateProfileInt(S_MACH_NEST, K_MACH_PRECUTEXIT, -1, m_MainWindow.GetMachIniFile())
|
||||
If nPreCutExit = -1 Then
|
||||
PreCutExitTxBl.Visibility = Visibility.Hidden
|
||||
PreCutExitChBx.Visibility = Visibility.Hidden
|
||||
Else
|
||||
PreCutExitChBx.IsChecked = (nPreCutExit <> 0)
|
||||
End If
|
||||
' Salvo DB lavorazioni con aggiornamenti parametri generali
|
||||
EgtMdbSave()
|
||||
' Leggo lavorazione angoli con fresa
|
||||
CornerCutsChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo lavorazione interni con fresa
|
||||
InternalCutsChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo accorciamento angoli con fresa
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||
ShortTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo ottimizzazione lavorazione waterjet
|
||||
WjOptimizeChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo lavorazione interni con waterjet
|
||||
WjIntCutsChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
End Sub
|
||||
|
||||
Private Sub EnableFinalSawCutChBx_IsChecked() Handles EnableFinalSawCutChBx.Click
|
||||
m_MainWindow.m_CurrentMachine.bEnableFinalSawCut = EnableFinalSawCutChBx.IsChecked
|
||||
WritePrivateProfileString(S_MACH, K_ENABLEFINALSAWCUT, If(m_MainWindow.m_CurrentMachine.bEnableFinalSawCut, "1", "0"), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub FinalDepthTxBx_EgtClosed() Handles FinalDepthTxBx.EgtClosed
|
||||
Private Sub CutExtraLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles CutExtraLenTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(FinalDepthTxBx.Text, dVal)
|
||||
m_MainWindow.m_CurrentMachine.dFinalDepth = dVal
|
||||
WritePrivateProfileString(S_MACH, K_FINALDEPTH, DoubleToString(m_MainWindow.m_CurrentMachine.dFinalDepth, 3), m_MainWindow.GetMachIniFile())
|
||||
StringToLen(CutExtraLenTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub AngleCutExtraLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles AngleCutExtraLenTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(AngleCutExtraLenTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub ExtArcMinRadTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ExtArcMinRadTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(ExtArcMinRadTxBx.Text, dVal)
|
||||
If EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal) Then
|
||||
EgtMdbSave()
|
||||
Else
|
||||
EgtMdbGetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal)
|
||||
ExtArcMinRadTxBx.Text = LenToString(dVal, 2)
|
||||
End If
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_EXTARCMINRAD, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub IntArcMaxSideAngTxBx_EgtClosed(sender As Object, e As EventArgs) Handles IntArcMaxSideAngTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToDouble(IntArcMaxSideAngTxBx.Text, dVal)
|
||||
If EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal) Then
|
||||
EgtMdbSave()
|
||||
Else
|
||||
EgtMdbGetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal)
|
||||
IntArcMaxSideAngTxBx.Text = DoubleToString(dVal, 2)
|
||||
End If
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub PreCutExitChBx_Click(sender As Object, e As RoutedEventArgs) Handles PreCutExitChBx.Click
|
||||
If PreCutExitChBx.IsChecked Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_PRECUTEXIT, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_PRECUTEXIT, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub HolesOffsetTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesOffsetTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesOffsetTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OFFSET, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub HolesOverlapTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesOverlapTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesOverlapTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OVERLAP, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub HolesToleranceTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesToleranceTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesToleranceTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub OneHoleInCornerChBx_Click(sender As Object, e As RoutedEventArgs) Handles OneHoleInCornerChBx.Click
|
||||
Dim sVal As String = If( OneHoleInCornerChBx.IsChecked(), "1", "0")
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, sVal, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub CornerCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CornerCutsChBx.Click
|
||||
Dim sVal As String = If( CornerCutsChBx.IsChecked(), "1", "0")
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, sVal, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub ShortTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ShortTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(ShortTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_SHORTENING, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub InternalCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles InternalCutsChBx.Click
|
||||
Dim sVal As String = If( InternalCutsChBx.IsChecked(), "1", "0")
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, sVal, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub WjOptimizeChBx_Click(sender As Object, e As RoutedEventArgs) Handles WjOptimizeChBx.Click
|
||||
Dim sVal As String = If( WjOptimizeChBx.IsChecked(), "1", "0")
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_WATERJET_OPTIMIZE, sVal, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub WjIntCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles WjIntCutsChBx.Click
|
||||
Dim sVal As String = If( WjIntCutsChBx.IsChecked(), "1", "0")
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_WATERJET_ON_SINKS, sVal, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
@@ -30,254 +29,7 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Costruisco le riche per la colonna 3-->
|
||||
<Grid Grid.Column="2" Grid.RowSpan="9">
|
||||
<Grid.RowDefinitions>
|
||||
<!--GruopBox: taglio lama-->
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<!--GruopBoxs: Fresatura/>Foratura/WaterJet-->
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<!--GroupBox: vai ad Home-->
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.375*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Parametri Taglio Lama: 5 Parametri-->
|
||||
<GroupBox Name="SawGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.RowSpan="4">
|
||||
<!--definizione della grigli ainterna-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CutExtraLenTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CutExtraLenTxBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ExtArcMinRadTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="IntArcMaxSideAngTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="IntArcMaxSideAngTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="PreCutExitTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<CheckBox Name="PreCutExitChBx" Grid.Column="1" Grid.Row="4" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Grid Grid.Column="2" Grid.Row="4" Grid.RowSpan="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Parametri fori: 4 Parametri-->
|
||||
<GroupBox Name="HolesGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="145*"/>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="169*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="HolesOffsetTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetTxBx" Grid.Column="2" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesOverlapTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOverlapTxBx" Grid.Column="2" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesToleranceTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesToleranceTxBx" Grid.Column="2" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="OneHoleInCornerTxBl" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="OneHoleInCornerChBx" Grid.Column="2" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri Fresatura: 3 Parametri-->
|
||||
<GroupBox Name="MillingsParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Grid.RowSpan="2">
|
||||
<Grid Grid.Column="3" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CornerCutsTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="CornerCutsChBx" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="InternalCutsTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,0,10" VerticalAlignment="Bottom" />
|
||||
<CheckBox Name="InternalCutsChBx" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="ShortTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ShortTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri rettifica tagli sottosquadra: 1 Parametro -->
|
||||
<GroupBox Name="RectificationWJParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
|
||||
<Grid Grid.Column="3" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="EnableRectificationTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="EnableRectificationChBx" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<!--<TextBlock Name="OffsetRectificationTxBl" Grid.Row="1" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffsetRectificationTxBx" Grid.Row="1" Grid.Column="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>-->
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
||||
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid Grid.Column="3" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="145*"/>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="169*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="WjIntCutsTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="WjIntCutsChBx" Grid.Column="2" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
<TextBlock Name="HolesDiameterWJTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesDiameterWJTxBx" Grid.Column="2" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesOffsetWJTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetWJTxBx" Grid.Column="2" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="MinRadiusWJTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MinRadiusWJTxBx" Grid.Column="2" Grid.Row="3" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="OneHoleInCornerWJTxBl" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="OneHoleInCornerWJChBx" Grid.Column="2" Grid.Row="4"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--Parametri Taglio diretto: 1 Parametro-->
|
||||
<GroupBox Name="DirectCutsParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.Row="12" Grid.RowSpan="2">
|
||||
<Grid>
|
||||
<TextBlock Name="FinalHomeTxBl"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="FinalHomeChBx"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.RowSpan="3">
|
||||
<Grid Grid.RowSpan="3" Margin="6,0,6,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.75*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
@@ -383,116 +135,10 @@
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--<Grid Grid.Column="2" Grid.Row="2" Grid.RowSpan="6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="HolesGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="145*"/>
|
||||
<ColumnDefinition Width="23*"/>
|
||||
<ColumnDefinition Width="169*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="HolesOffsetTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOffsetTxBx" Grid.Column="2" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesOverlapTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesOverlapTxBx" Grid.Column="2" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="HolesToleranceTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HolesToleranceTxBx" Grid.Column="2" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="OneHoleInCornerTxBl" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||
<CheckBox Name="OneHoleInCornerChBx" Grid.Column="2" Grid.Row="3" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="MillingsParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Grid.RowSpan="2">
|
||||
<Grid Grid.Column="3" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CornerCutsTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="CornerCutsChBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="InternalCutsTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,0,10" VerticalAlignment="Bottom" />
|
||||
<CheckBox Name="InternalCutsChBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
|
||||
<TextBlock Name="ShortTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ShortTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="1"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid Grid.Column="3" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="WjIntCutsTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,0,10" VerticalAlignment="Bottom" />
|
||||
<CheckBox Name="WjIntCutsChBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>-->
|
||||
|
||||
<GroupBox Name="MaterialsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0"
|
||||
<GroupBox Name="MaterialsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Margin="5,0,5,0"
|
||||
Grid.Row="3" Grid.ColumnSpan="1" Grid.RowSpan="5">
|
||||
|
||||
<Grid>
|
||||
@@ -524,7 +170,7 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="MachiningsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="1"
|
||||
<GroupBox Name="MachiningsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="1" Margin="0,0,5,0"
|
||||
Grid.Row="0" Grid.ColumnSpan="1" Grid.RowSpan="3">
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Visible" Visibility="Visible"
|
||||
@@ -547,27 +193,27 @@
|
||||
|
||||
<TextBlock Name="CurrSawingTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrSawingTxBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrSawingTxBx" Grid.Column="1" Grid.Row="0" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrSawingTiltedTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrSawingTiltedTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrSawingTiltedTxBx" Grid.Column="1" Grid.Row="1" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrDrillingTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrDrillingTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrDrillingTxBx" Grid.Column="1" Grid.Row="2" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrMillingTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrMillingTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrMillingTxBx" Grid.Column="1" Grid.Row="3" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrPocketingTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrPocketingTxBx" Grid.Column="1" Grid.Row="4" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrPocketingTxBx" Grid.Column="1" Grid.Row="4" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
|
||||
<TextBlock Name="CurrWaterJettingTxBl" Grid.Column="0" Grid.Row="5"
|
||||
@@ -576,11 +222,11 @@
|
||||
<Grid Grid.Column="1" Grid.Row="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="1.6*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingTxBx" Grid.Column="0" Margin="10,0,5,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingTxBx" Grid.Column="0" Margin="5,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingQualityTxBx" Grid.Column="1" Margin="0,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="CurrWaterJettingQualityTxBx" Grid.Column="1" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" />
|
||||
</Grid>
|
||||
|
||||
@@ -601,45 +247,7 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<!--<GroupBox Name="SawGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.RowSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="CutExtraLenTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CutExtraLenTxBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ExtArcMinRadTxBx" Grid.Column="1" Grid.Row="2" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="IntArcMaxSideAngTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="IntArcMaxSideAngTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>-->
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="3" Grid.RowSpan="3">
|
||||
<Grid Grid.Column="1" Grid.Row="3" Grid.RowSpan="3" Margin="0,0,5,0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
@@ -651,49 +259,33 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="MachineParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="2">
|
||||
<Grid Grid.Column="2" Grid.Row="1">
|
||||
<GroupBox Name="MachineParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="SafeZTxBl" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="SafeZTxBx" Grid.Column="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Border Style="{DynamicResource OmagCut_NoNameGroupBorder}" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Grid.RowSpan="2">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Name="AdditionalTableTxBl" Grid.Column="0"
|
||||
<TextBlock Name="AdditionalTableTxBl" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<EgtWPFLib:EgtTextBox Name="AdditionalTableTxBx" Grid.Column="1" Margin="10,0,10,0"
|
||||
<EgtWPFLib:EgtTextBox Name="AdditionalTableTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
<!--<GroupBox Name="DirectCutsParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.Row="8">
|
||||
<Grid>
|
||||
<TextBlock Name="FinalHomeTxBl"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="FinalHomeChBx" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>-->
|
||||
|
||||
<GroupBox Name="NestingParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3">
|
||||
<GroupBox Name="NestingParamGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3">
|
||||
<Grid Name="NestingGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -736,7 +328,8 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="AutoRawImageParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="0" Grid.RowSpan="2">
|
||||
<GroupBox Name="AutoRawImageParamGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="0" Grid.RowSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -773,8 +366,9 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="CutFredGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3"
|
||||
Grid.Row="2" Grid.RowSpan="1">
|
||||
<GroupBox Name="CutFredGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2"
|
||||
Grid.Row="0" Grid.RowSpan="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -798,8 +392,8 @@
|
||||
</GroupBox>
|
||||
|
||||
<!--Incisioni-->
|
||||
<GroupBox Name="TopMillGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3"
|
||||
Grid.Row="3" Grid.RowSpan="3">
|
||||
<GroupBox Name="TopMillGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Margin="0,0,5,0"
|
||||
Grid.Row="1" Grid.RowSpan="3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -831,8 +425,27 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="FinalSawCutGpBx" Grid.Column="2" Grid.Row="4" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Name="SideAngCutProbeGpBx" Style="{DynamicResource OmagCut_NoNameGroupBorder}" Grid.Column="3" Grid.Row="6">
|
||||
<TextBlock Name="EnableFinalSawCutTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<CheckBox Name="EnableFinalSawCutChBx" Grid.Column="1" Grid.Row="0" Margin="10,0,10,0"
|
||||
Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="SideAngCutProbeGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="2">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -846,9 +459,11 @@
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</GroupBox>
|
||||
|
||||
<Border Name="WashingGpBx" Style="{DynamicResource OmagCut_NoNameGroupBorder}" Grid.Column="3" Grid.Row="7">
|
||||
<GroupBox Name="WashingGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}"
|
||||
Grid.Column="3" Grid.Row="3" Grid.RowSpan="2">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -862,10 +477,11 @@
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</GroupBox>
|
||||
|
||||
<!--Cornici-->
|
||||
<GroupBox Name="FrameGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="8">
|
||||
<GroupBox Name="FrameGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="5" Grid.RowSpan="2">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -881,7 +497,20 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="8">
|
||||
<!--Parametri Taglio diretto: 1 Parametro-->
|
||||
<GroupBox Name="DirectCutsParamGpBx" Margin="0,0,5,0"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="3" Grid.Row="7">
|
||||
<Grid>
|
||||
<TextBlock Name="FinalHomeTxBl"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="FinalHomeChBx"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="8" Margin="0,0,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
@@ -904,6 +533,18 @@
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="3" Grid.Row="8" Margin="0,0,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4.5*"/>
|
||||
<ColumnDefinition Width="1.8*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="UseBAxisLockTxBl" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||
<CheckBox Name="UseBAxisLockChBx"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}" Grid.Column="1"
|
||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
|
||||
' Se esiste un file lua valido allora mostro il pulsante per l'esecuzione dello script
|
||||
If Not String.IsNullOrEmpty(GetExecLuaFile()) And
|
||||
ExecLuaBtn.Visibility = Visibility.Visible Then
|
||||
If Not String.IsNullOrWhiteSpace(GetExecLuaFile()) Then
|
||||
ExecLuaBtn.Visibility = Visibility.Visible
|
||||
Else
|
||||
ExecLuaBtn.Visibility = Visibility.Hidden
|
||||
End If
|
||||
@@ -62,45 +62,19 @@ Public Class AlarmsPageUC
|
||||
CurrCupWheelTxBl.Text = EgtMsg(91070) ' Scasso corrente
|
||||
CurrMillTxBl.Text = EgtMsg(90904) ' Fresa corrente
|
||||
CurrWJetTxBl.Text = EgtMsg(90900) ' Waterjet corrente
|
||||
HolesOffsetTxBl.Text = EgtMsg(90909) ' Offset fori
|
||||
HolesOverlapTxBl.Text = EgtMsg(90910) ' Sovrapp. fori
|
||||
HolesToleranceTxBl.Text = EgtMsg(90911) ' Tolleranza fori
|
||||
OneHoleInCornerTxBl.Text = EgtMsg(90926) ' Un solo foro in angolo
|
||||
CutExtraLenTxBl.Text = EgtMsg(90906) ' Sicurezza tagli
|
||||
AngleCutExtraLenTxBl.Text = EgtMsg(90907) ' Sicur. angoli
|
||||
CompleteCutsTxBl.Text = EgtMsg(90908) ' Rispetta i tagli completi
|
||||
SafeZTxBl.Text = EgtMsg(90905) ' Z Sicura
|
||||
MaterialsGpBx.Header = EgtMsg(90913) ' Materiali
|
||||
NewMatBtn.Content = EgtMsg(90914) ' Aggiungi
|
||||
RemoveMatBtn.Content = EgtMsg(90915) ' Rimuovi
|
||||
SetUpGpBx.Header = EgtMsg(90916) ' Utensili correnti
|
||||
HolesGpBx.Header = EgtMsg(90917) ' Parametri fori
|
||||
ExtArcMinRadTxBl.Text = EgtMsg(90918) ' Rmin archi est.
|
||||
IntArcMaxSideAngTxBl.Text = EgtMsg(90924) ' Amax archi int.
|
||||
PreCutExitTxBl.Text = EgtMsg(91065) ' PreTaglio uscite
|
||||
MachineParamGpBx.Header = EgtMsg(90919) ' Parametri macchina
|
||||
SawGpBx.Header = EgtMsg(90925) ' Parametri lama
|
||||
DirectCutsParamGpBx.Header = EgtMsg(90927) ' Tagli diretti
|
||||
FinalHomeTxBl.Text = EgtMsg(90928) ' Home finale
|
||||
MillingsParamGpBx.Header = EgtMsg(90929) ' Parametri fresature
|
||||
CornerCutsTxBl.Text = EgtMsg(90944) ' Sempre sugli angoli
|
||||
InternalCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
|
||||
ShortTxBl.Text = EgtMsg(90949) ' Accorciamento
|
||||
TopMillGpBx.Header = EgtMsg( 91061) ' Parametri incisioni
|
||||
TopMillGpBx.Header = EgtMsg(91061) ' Parametri incisioni
|
||||
TmEnableTxBl.Text = EgtMsg( 91062) ' Con fresa
|
||||
TmDepthTxBl.Text = EgtMsg( 91063) ' Profondità
|
||||
TmWidthTxBl.Text = EgtMsg( 91064) ' Larghezza
|
||||
WJsParamGpBx.Header = EgtMsg( 91058) ' Parametri waterjet
|
||||
WjIntCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
|
||||
'-- INIZIO -- nuovi parametri per preforo lavello
|
||||
HolesDiameterWJTxBl.Text = EgtMsg(91044) ' Diametro
|
||||
HolesOffsetWJTxBl.Text = EgtMsg(91045) ' Offset
|
||||
MinRadiusWJTxBl.Text = EgtMsg(91046) ' Raggio Minimo
|
||||
OneHoleInCornerWJTxBl.Text = EgtMsg(90926) ' Un solo foro in angolo
|
||||
'-- INIZIO -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||
RectificationWJParamGpBx.Header = EgtMsg(91047) ' Rettifica
|
||||
EnableRectificationTxBl.Text = EgtMsg(91048) ' Abilita (sottosquadra)
|
||||
'-- FINE -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||
NestingParamGpBx.Header = EgtMsg(90931) ' Nesting
|
||||
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
||||
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
||||
@@ -113,8 +87,6 @@ Public Class AlarmsPageUC
|
||||
BackImageBtn.Content = EgtMsg(90938) ' Sfondo
|
||||
ThresholdTxBl.Text = EgtMsg(90939) ' Soglia
|
||||
ToleranceTxBl.Text = EgtMsg(90940) ' Tolleranza
|
||||
WashingTxBl.Text = EgtMsg(90941) ' Lavaggio
|
||||
SideAngCutProbeTxBl.Text = EgtMsg(90950) ' Tastatura tagli inclinati
|
||||
CutFredGpBx.Header = EgtMsg(90946) ' Tagli Feed inizio/fine
|
||||
CfrLenTxBl.Text = EgtMsg(90947) ' Lunghezza
|
||||
CfrPercTxBl.Text = EgtMsg(90948) ' Riduzione %
|
||||
@@ -130,16 +102,20 @@ Public Class AlarmsPageUC
|
||||
FrameGpBx.Header = EgtMsg(91068) ' Cornici
|
||||
FramePauseTxBl.Text = EgtMsg(91067) ' Inserisci pausa
|
||||
UseLaserOriginTxBl.Text = EgtMsg(91129) ' Usa laser per origine
|
||||
SideAngCutProbeGpBx.Header = EgtMsg(90950) ' Tastatura
|
||||
SideAngCutProbeTxBl.Text = EgtMsg(90950) ' Tastatura tagli inclinati
|
||||
WashingGpBx.Header = EgtMsg(90941) ' Lavaggio
|
||||
WashingTxBl.Text = EgtMsg(90941) ' Lavaggio
|
||||
FinalSawCutGpBx.Header = EgtMsg(91254) ' Taglio Finale
|
||||
EnableFinalSawCutTxBl.Text = EgtMsg(91255) ' Abilita
|
||||
UseBAxisLockTxBl.Text = EgtMsg(91257) ' Blocca Asse B
|
||||
AutoRawImageParamGpBx.Visibility = Windows.Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
|
||||
If m_bFirst Then
|
||||
|
||||
' in assenza dell'uscita H1 nascondo i parametri lama
|
||||
If EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
SawGpBx.Visibility = Visibility.Hidden
|
||||
' in assenza della testa lama (H1) nascondo i parametri lama
|
||||
If Not m_CurrentMachine.ExistsSawHead() Then
|
||||
TopMillGpBx.Visibility = Visibility.Hidden
|
||||
CurrSawTxBl.Visibility = Visibility.Hidden
|
||||
CurrSawCmBx.Visibility = Visibility.Hidden
|
||||
@@ -156,32 +132,16 @@ Public Class AlarmsPageUC
|
||||
EndRow.Height = New GridLength(0.25, GridUnitType.Star)
|
||||
CurrToolsGrid.RowDefinitions.Add(EndRow)
|
||||
SetUpGpBx.SetValue(Grid.RowSpanProperty, 1)
|
||||
' Disattivo il gruppo dei parametri fori
|
||||
HolesGpBx.Visibility = Windows.Visibility.Hidden
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
'Non faccio alcunchè
|
||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
'Da implementare
|
||||
Case Else
|
||||
'Non faccio alcunchè
|
||||
End Select
|
||||
|
||||
' Se non previste forature, disabilito relativo box
|
||||
If Not m_CurrentMachine.bDrilling Then
|
||||
HolesGpBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Se non previste fresature, disabilito relativo box e uso fresa con incisione
|
||||
If Not m_CurrentMachine.bMilling Then
|
||||
MillingsParamGpBx.Visibility = Visibility.Hidden
|
||||
TmEnableChBx.IsEnabled = False
|
||||
TmEnableChBx.IsChecked = False
|
||||
End If
|
||||
|
||||
' Se non previsti tagli waterjet, disabilito relativo box
|
||||
If Not m_CurrentMachine.bWaterJetting Then
|
||||
WjsParamGpBx.Visibility = Visibility.Hidden
|
||||
RectificationWJParamGpBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Abilitazione box per contorni grezzo da foto
|
||||
If m_MainWindow.m_Camera.GetCalcContour() Then
|
||||
AutoRawImageParamGpBx.Visibility = Windows.Visibility.Visible
|
||||
@@ -192,7 +152,7 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
|
||||
' Abilitazione Feed ridotta su inizio/fine tagli
|
||||
If m_CurrentMachine.bFsevEnable And EgtGetHeadId("H1") <> GDB_ID.NULL Then
|
||||
If m_CurrentMachine.bFsevEnable And m_CurrentMachine.ExistsSawHead() Then
|
||||
CutFredGpBx.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
CutFredGpBx.Visibility = Windows.Visibility.Hidden
|
||||
@@ -224,7 +184,7 @@ Public Class AlarmsPageUC
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
|
||||
m_AuxToolTypeList.Clear()
|
||||
' creo l'elenco degli utensili ausiliri
|
||||
' creo l'elenco degli utensili ausiliari
|
||||
If m_CurrentMachine.bDrill Then
|
||||
m_AuxToolTypeList.Add(New StringIdCmBx(1, EgtMsg(90921))) ' Foretto
|
||||
End If
|
||||
@@ -256,7 +216,7 @@ Public Class AlarmsPageUC
|
||||
CurrWJetTxBl.Visibility = Windows.Visibility.Hidden
|
||||
CurrWJetCmBx.Visibility = Windows.Visibility.Hidden
|
||||
|
||||
' verifico quale utensile è attulamente "montato sulla macchina"
|
||||
' verifico quale utensile è attualmente "montato sulla macchina"
|
||||
If m_CurrentMachine.sCurrDrill <> String.Empty Then
|
||||
CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
|
||||
m_DrillList.Add(NO_TOOL)
|
||||
@@ -294,9 +254,10 @@ Public Class AlarmsPageUC
|
||||
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
|
||||
' Determino la lista delle lame presenti nei TC automatico e manuale
|
||||
Dim SawOnAllTcList As New ObservableCollection(Of String)
|
||||
Dim SawOnAutoTcList As New ObservableCollection(Of String)
|
||||
Dim bSawFound As Boolean = False
|
||||
For Each sNameTool As String In m_SawList
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Verifico che sia montata su un portautensile
|
||||
@@ -304,15 +265,25 @@ Public Class AlarmsPageUC
|
||||
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
|
||||
' Cerco nel TC automatico
|
||||
For Each ToolPosition As ToolChangerPos In m_CurrentMachine.ToolChanger
|
||||
If ToolPosition.sTool <> String.Empty Then
|
||||
If sNameTool = ToolPosition.sTool Then
|
||||
m_SawOnHolderList.Add(sNameTool)
|
||||
SawOnAllTcList.Add(sNameTool)
|
||||
SawOnAutoTcList.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
|
||||
If sNameTool = m_CurrentMachine.sCurrSaw Then bSawFound = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Cerco nel TC manuale
|
||||
For Each ToolPosition As ToolChangerPos In m_CurrentMachine.ManualToolChanger
|
||||
If ToolPosition.sTool <> String.Empty Then
|
||||
If sNameTool = ToolPosition.sTool Then
|
||||
SawOnAllTcList.Add(sNameTool)
|
||||
' Se il nome dell'utensile è lo stesso di quello impostato nella combo allora lo setto
|
||||
If sNameTool = m_CurrentMachine.sCurrSaw Then bSawFound = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
@@ -320,9 +291,10 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
m_SawList = m_SawOnHolderList
|
||||
' Sostituisco la lista delle lame con quelle disponibili su TC automatico e manuale
|
||||
m_SawList = SawOnAllTcList
|
||||
CurrSawCmBx.ItemsSource = m_SawList
|
||||
If bOnHolder Then
|
||||
If bSawFound Then
|
||||
' reimposto la lavorazione di lama e la lama impostate in macchina
|
||||
EgtTdbSetCurrTool(m_CurrentMachine.sCurrSaw)
|
||||
' Seleziono lama corrente
|
||||
@@ -330,96 +302,39 @@ Public Class AlarmsPageUC
|
||||
Else
|
||||
m_CurrentMachine.sCurrSawing = ""
|
||||
End If
|
||||
|
||||
CurrSawTiltedCmBx.ItemsSource = m_SawList
|
||||
If m_SawList.IndexOf(m_CurrentMachine.sCurrSawTilted) > -1 Then
|
||||
' Per i tagli inclinati imposto solo le lame su TC automatico
|
||||
CurrSawTiltedCmBx.ItemsSource = SawOnAutoTcList
|
||||
If SawOnAutoTcList.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
|
||||
' Se abilitato TC, visualizzo la selezione della lama per il taglio inclinato
|
||||
If CamAuto.CanChangeSaw() Then
|
||||
CurrSawTiltedTxBl.Visibility = Visibility.Visible
|
||||
CurrSawTiltedCmBx.Visibility = Visibility.Visible
|
||||
End If
|
||||
|
||||
' 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 gli utensili nel TC
|
||||
SetUpBtn.Visibility = Windows.Visibility.Visible
|
||||
|
||||
End Select
|
||||
|
||||
' aggiorno le TextBlock con le lavorazioni correnti
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
|
||||
' Leggo offset fori
|
||||
Dim dVal As Double
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, dVal)
|
||||
HolesOffsetTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo sovrapposizione fori
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, m_MainWindow.GetMachIniFile())
|
||||
HolesOverlapTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo tolleranza diametro fori
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, dVal)
|
||||
HolesToleranceTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo un solo foro in corner
|
||||
OneHoleInCornerChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo sicurezza su tagli
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, 0, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, dVal)
|
||||
CutExtraLenTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo sicurezza su tagli in angoli interni
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 0, m_MainWindow.GetMachIniFile())
|
||||
AngleCutExtraLenTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo distanza di sicurezza
|
||||
dVal = 0
|
||||
EgtMdbGetGeneralParam(MCH_GP.SAFEZ, dVal)
|
||||
SafeZTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo raggio minimo arco esterno
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_EXTARCMINRAD, 200, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal)
|
||||
ExtArcMinRadTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo se PreCutExit attivo (per taglio ceramico)
|
||||
Dim nPreCutExit As Integer = GetPrivateProfileInt(S_MACH_NEST, K_MACH_PRECUTEXIT, -1, m_MainWindow.GetMachIniFile())
|
||||
If nPreCutExit = -1 Then
|
||||
PreCutExitTxBl.Visibility = Visibility.Hidden
|
||||
PreCutExitChBx.Visibility = Visibility.Hidden
|
||||
Else
|
||||
PreCutExitChBx.IsChecked = ( nPreCutExit <> 0)
|
||||
End If
|
||||
' Leggo angolo di fianco massimo arco interno
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, 45, m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal)
|
||||
IntArcMaxSideAngTxBx.Text = DoubleToString(dVal, 2)
|
||||
' Salvo DB lavorazioni con aggiornamenti parametri generali
|
||||
EgtMdbSave()
|
||||
' Leggo lavorazione angoli con fresa
|
||||
CornerCutsChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo lavorazione interni con fresa
|
||||
InternalCutsChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
WjIntCutsChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Lavorazione preforo lavello con WaterJet
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_HOLES_DIAMITERWJ, 0, m_MainWindow.GetMachIniFile())
|
||||
HolesDiameterWJTxBx.Text = LenToString(dVal, 2)
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_HOLES_OFFSETWJ, 0, m_MainWindow.GetMachIniFile())
|
||||
HolesOffsetWJTxBx.Text = LenToString(dVal, 2)
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MIN_RADIUSWJ, 0, m_MainWindow.GetMachIniFile())
|
||||
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
||||
OneHoleInCornerWJChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' leggo se attiva la rettifica degli angoli per WaterJet
|
||||
EnableRectificationChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo accorciamento angoli con fresa
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||
ShortTxBx.Text = LenToString(dVal, 2)
|
||||
' Leggo flag abilitazione incisioni con fresa
|
||||
TmEnableChBx.IsChecked =
|
||||
TmEnableChBx.IsChecked = m_CurrentMachine.bMilling AndAlso
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Leggo profondità e larghezza incisioni
|
||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_ENGRAVING_DEPTH, 0, m_MainWindow.GetMachIniFile())
|
||||
@@ -429,21 +344,23 @@ Public Class AlarmsPageUC
|
||||
' Flag per movimento in home alla fine dei tagli diretti
|
||||
FinalHomeChBx.IsChecked = m_CurrentMachine.bDirectCutsFinalHome
|
||||
' Leggo tagli ridotti per interferenza in nesting
|
||||
CompleteCutsChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0)
|
||||
CompleteCutsChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0)
|
||||
' Flag per nesting allineato
|
||||
AlignChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
AlignChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Flag per nesting a ghigliottina
|
||||
GhigliottinaChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_GHIGLIOTTINA, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
GhigliottinaChBx.IsChecked = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_GHIGLIOTTINA, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Flag per nesting automatico
|
||||
AutomaticChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
AutomaticChBx.IsChecked = (GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
AdjustGhigliottinaTextOnAutomaticOrCompleteCuts()
|
||||
' Flag per inserire la puasa dopo la sgrossatura delle cornici
|
||||
FramePauseChBx.IsChecked =
|
||||
(GetPrivateProfileInt(S_MACH_FRAME, K_MACH_PAUSE, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Flag per inserire la pausa dopo la sgrossatura delle cornici
|
||||
If m_CurrentMachine.bSawRoughing Then
|
||||
FrameGpBx.Visibility = Visibility.Visible
|
||||
FramePauseChBx.IsChecked = (GetPrivateProfileInt(S_MACH_FRAME, K_MACH_PAUSE, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
Else
|
||||
FrameGpBx.Visibility = Visibility.Hidden
|
||||
FramePauseChBx.IsChecked = False
|
||||
End If
|
||||
|
||||
' Aggiorno messaggio sovratavola con numero tavola
|
||||
If GetTableCount() > 1 Then
|
||||
AdditionalTableTxBl.Text = EgtMsg(90936) & " " & GetCurrentTable().ToString() ' Altezza sovratavola
|
||||
@@ -473,7 +390,7 @@ Public Class AlarmsPageUC
|
||||
CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
|
||||
CfrPercTxBx.Text = DoubleToString(m_CurrentMachine.dFsevPerc, 0)
|
||||
|
||||
' leggo flag per tavola definita da laser
|
||||
' leggo flag per origine pezzo definita da laser ( o lama)
|
||||
Dim nUseLaserOrigin As Integer = GetPrivateProfileInt(S_TABLE, K_USELASERORIGIN, -1, m_MainWindow.GetMachIniFile())
|
||||
If nUseLaserOrigin = -1 Then
|
||||
UseLaserOriginTxBl.Visibility = Visibility.Hidden
|
||||
@@ -483,10 +400,29 @@ Public Class AlarmsPageUC
|
||||
UseLaserOriginChBx.IsChecked = (nUseLaserOrigin <> 0)
|
||||
End If
|
||||
|
||||
' leggo flag per bloccaggio asse B con pistone o similare
|
||||
Dim nUseBAxisLock As Integer = GetPrivateProfileInt(S_MACH_NEST, K_USEBAXISLOCK, -1, m_MainWindow.GetMachIniFile())
|
||||
If nUseBAxisLock = -1 Then
|
||||
UseBAxisLockTxBl.Visibility = Visibility.Hidden
|
||||
UseBAxisLockChBx.Visibility = Visibility.Hidden
|
||||
Else
|
||||
UseBAxisLockTxBl.Visibility = Visibility.Visible
|
||||
UseBAxisLockChBx.IsChecked = (nUseBAxisLock <> 0)
|
||||
End If
|
||||
|
||||
' Taglio finale
|
||||
If m_CurrentMachine.bSawing Then
|
||||
FinalSawCutGpBx.Visibility = Visibility.Visible
|
||||
EnableFinalSawCutChBx.IsChecked = m_CurrentMachine.bEnableFinalSawCut
|
||||
Else
|
||||
FinalSawCutGpBx.Visibility = Visibility.Hidden
|
||||
EnableFinalSawCutChBx.IsChecked = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
' aggiorna le text delle lavorazioni (la selezione avviene nella pagina del grezzo o dalla pagina del progetto corrente)
|
||||
Private Sub RefreschMachining()
|
||||
Private Sub RefreshMachining()
|
||||
If m_CurrentMachine.sCurrSawing <> String.Empty Then
|
||||
CurrSawingTxBx.Text = m_CurrentMachine.sCurrSawing
|
||||
CurrSawingTxBl.Visibility = Windows.Visibility.Visible
|
||||
@@ -591,7 +527,13 @@ Public Class AlarmsPageUC
|
||||
Select Case SelectedItem.nId
|
||||
Case 0
|
||||
m_CurrentMachine.sCurrDrill = String.Empty
|
||||
m_CurrentMachine.sCurrDrilling = String.Empty
|
||||
m_CurrentMachine.sCurrMill = String.Empty
|
||||
m_CurrentMachine.sCurrMilling = String.Empty
|
||||
m_CurrentMachine.sCurrMillNoTip = String.Empty
|
||||
m_CurrentMachine.sCurrPocketing = String.Empty
|
||||
m_CurrentMachine.sCurrWaterJet = String.Empty
|
||||
m_CurrentMachine.sCurrWaterJetting = String.Empty
|
||||
Case 1
|
||||
CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
|
||||
m_DrillList.Add(NO_TOOL)
|
||||
@@ -657,8 +599,8 @@ Public Class AlarmsPageUC
|
||||
CurrWJetTxBl.Visibility = Windows.Visibility.Visible
|
||||
CurrWJetCmBx.Visibility = Windows.Visibility.Visible
|
||||
End Select
|
||||
' aggionro l'elenco delle lavoarzioni
|
||||
RefreschMachining()
|
||||
' aggiorno l'elenco delle lavorazioni
|
||||
RefreshMachining()
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -678,17 +620,6 @@ Public Class AlarmsPageUC
|
||||
m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
|
||||
'Dim sVal As String = String.Empty
|
||||
'Dim dVal As Double = 0
|
||||
'If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSawing, false) Then
|
||||
' StringToDouble(sVal, dVal)
|
||||
' m_CurrentMachine.SetFsevLength(dVal)
|
||||
'End If
|
||||
'If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSawing, false) Then
|
||||
' StringToDouble(sVal, dVal)
|
||||
' m_CurrentMachine.SetFsevPerc(dVal)
|
||||
'End If
|
||||
|
||||
Dim sVal As String = String.Empty
|
||||
Dim dVal As Double = 0
|
||||
If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
|
||||
@@ -707,7 +638,53 @@ Public Class AlarmsPageUC
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
|
||||
' Se è associata anche una lavorazione inclinata allora deve essere resettata
|
||||
If m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
m_CurrentMachine.sCurrSawTilted = CurrSawCmBx.SelectedItem.ToString()
|
||||
' Se nuova lama incompatibile con lavorazione di taglio corrente, resetto quest'ultima
|
||||
sMchTuuid = String.Empty
|
||||
sMchTool = 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
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreshMachining()
|
||||
End If
|
||||
|
||||
' Se TC anche con lame
|
||||
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
' Se in uso lama da TC
|
||||
If CamAuto.CanChangeSaw() Then
|
||||
CurrSawTiltedTxBl.Visibility = Visibility.Visible
|
||||
CurrSawTiltedCmBx.Visibility = Visibility.Visible
|
||||
If Not String.IsNullOrEmpty(m_CurrentMachine.sCurrSawTilted) Then
|
||||
For Each ToolPosition As ToolChangerPos In m_CurrentMachine.ManualToolChanger
|
||||
If m_CurrentMachine.sCurrSawTilted = ToolPosition.sTool And ToolPosition.sName = "T0" Then
|
||||
m_CurrentMachine.sCurrSawTilted = String.Empty
|
||||
m_CurrentMachine.sCurrSawingTilted = String.Empty
|
||||
CurrSawTiltedCmBx.SelectedItem = Nothing
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' altrimenti in uso lama manuale (non sono utilizzabili altri utensili)
|
||||
Else
|
||||
CurrSawTiltedTxBl.Visibility = Visibility.Hidden
|
||||
CurrSawTiltedCmBx.Visibility = Visibility.Hidden
|
||||
If m_CurrentMachine.sCurrSawTilted <> m_CurrentMachine.sCurrSaw Then
|
||||
m_CurrentMachine.sCurrSawTilted = m_CurrentMachine.sCurrSaw
|
||||
m_CurrentMachine.sCurrSawingTilted = String.Empty
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
' -- SAW TILTED --
|
||||
@@ -725,25 +702,10 @@ Public Class AlarmsPageUC
|
||||
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()
|
||||
RefreshMachining()
|
||||
End Sub
|
||||
|
||||
' -- DRILL --
|
||||
@@ -778,7 +740,7 @@ Public Class AlarmsPageUC
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
End Sub
|
||||
|
||||
' -- MILL --
|
||||
@@ -813,7 +775,7 @@ Public Class AlarmsPageUC
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
End Sub
|
||||
|
||||
' -- CUPWHEEL --
|
||||
@@ -848,7 +810,7 @@ Public Class AlarmsPageUC
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
End Sub
|
||||
|
||||
' -- WATERJET --
|
||||
@@ -881,7 +843,7 @@ Public Class AlarmsPageUC
|
||||
' Aggiorno utensili per lavoro in corso
|
||||
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
|
||||
' aggiorno la lista delle lavorazioni
|
||||
RefreschMachining()
|
||||
RefreshMachining()
|
||||
End Sub
|
||||
|
||||
#End Region 'Selection: SAW, DRILL, MILL, CUPWHEEL, WATERJET
|
||||
@@ -925,50 +887,6 @@ Public Class AlarmsPageUC
|
||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_SetUpPage)
|
||||
End Sub
|
||||
|
||||
Private Sub HolesOffsetTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesOffsetTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesOffsetTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OFFSET, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub HolesOverlapTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesOverlapTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesOverlapTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OVERLAP, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub HolesToleranceTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesToleranceTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesToleranceTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub OneHoleInCornerChBx_Click(sender As Object, e As RoutedEventArgs) Handles OneHoleInCornerChBx.Click
|
||||
If OneHoleInCornerChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CutExtraLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles CutExtraLenTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(CutExtraLenTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub AngleCutExtraLenTxBx_EgtClosed(sender As Object, e As EventArgs) Handles AngleCutExtraLenTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(AngleCutExtraLenTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub SafeZTxBx_EgtClosed(sender As Object, e As EventArgs) Handles SafeZTxBx.EgtClosed
|
||||
Dim dSafeZ As Double = 0
|
||||
StringToLen(SafeZTxBx.Text, dSafeZ)
|
||||
@@ -976,30 +894,6 @@ Public Class AlarmsPageUC
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub ExtArcMinRadTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ExtArcMinRadTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(ExtArcMinRadTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_EXTARCMINRAD, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub IntArcMaxSideAngTxBx_EgtClosed(sender As Object, e As EventArgs) Handles IntArcMaxSideAngTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToDouble(IntArcMaxSideAngTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal)
|
||||
EgtMdbSave()
|
||||
End Sub
|
||||
|
||||
Private Sub PreCutExitChBx_Click(sender As Object, e As RoutedEventArgs) Handles PreCutExitChBx.Click
|
||||
If PreCutExitChBx.IsChecked Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_PRECUTEXIT, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_PRECUTEXIT, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CompleteCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CompleteCutsChBx.Click
|
||||
Dim NestPage As NestPageUC = m_MainWindow.m_CadCutPageUC.m_NestPage
|
||||
If CompleteCutsChBx.IsChecked() Then
|
||||
@@ -1025,74 +919,6 @@ Public Class AlarmsPageUC
|
||||
AdjustGhigliottinaTextOnAutomaticOrCompleteCuts()
|
||||
End Sub
|
||||
|
||||
Private Sub CornerCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CornerCutsChBx.Click
|
||||
If CornerCutsChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ShortTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ShortTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(ShortTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_SHORTENING, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub InternalCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles InternalCutsChBx.Click
|
||||
If InternalCutsChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub WjIntCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles WjIntCutsChBx.Click
|
||||
If WjIntCutsChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' -- INIZIO -- nuovi parametri per prefori WaterJet
|
||||
Private Sub HolesDiameterWJTxBx_Click(sender As Object, e As EventArgs) Handles HolesDiameterWJTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesDiameterWJTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_HOLES_DIAMITERWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub HolesOffsetWJTxBx_Click(sender As Object, e As EventArgs) Handles HolesOffsetWJTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(HolesOffsetWJTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_HOLES_OFFSETWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub MinRadiusWJTxBx_Click(sender As Object, e As EventArgs) Handles MinRadiusWJTxBx.EgtClosed
|
||||
Dim dVal As Double = 0
|
||||
StringToLen(MinRadiusWJTxBx.Text, dVal)
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MIN_RADIUSWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub OneHoleInCornerWJChBx_Click(sender As Object, e As EventArgs) Handles OneHoleInCornerWJChBx.Click
|
||||
If OneHoleInCornerWJChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
' -- FINE -- nuovi parametri per prefori WaterJet
|
||||
|
||||
' -- INIZIO -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||
Private Sub EnableRectificationChBx_Click(sender As Object, e As EventArgs) Handles EnableRectificationChBx.Click
|
||||
If EnableRectificationChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "1", m_MainWindow.GetMachIniFile)
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "0", m_MainWindow.GetMachIniFile)
|
||||
End If
|
||||
End Sub
|
||||
' -- FINE -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||
|
||||
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
||||
If TmEnableChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
||||
@@ -1243,6 +1069,14 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UseBAxisLockChBx_Click() Handles UseBAxisLockChBx.Click
|
||||
If UseBAxisLockChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_USEBAXISLOCK, "1", m_MainWindow.GetMachIniFile())
|
||||
Else
|
||||
WritePrivateProfileString(S_MACH_NEST, K_USEBAXISLOCK, "0", m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub WashingChBx_Click(sender As Object, e As RoutedEventArgs) Handles WashingChBx.Click
|
||||
If WashingChBx.IsChecked() Then
|
||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_WASHING, "1", m_MainWindow.GetMachIniFile())
|
||||
@@ -1361,7 +1195,7 @@ Public Class AlarmsPageUC
|
||||
Return
|
||||
End If
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
' Se fanuc passo in modalità AUTO e attivo
|
||||
' Se Fanuc passo in modalità AUTO e attivo
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||
@@ -1372,9 +1206,9 @@ Public Class AlarmsPageUC
|
||||
' Creo MsgBox di attesa
|
||||
Dim MsgBoxStateInfo As New EgtMsgBox(m_MainWindow, String.Format(EgtMsg(90241), ToolForProbing.m_ToolName), EgtMsg(90242), True, EgtMsgBox.Buttons.CANCEL, EgtMsgBox.Icons.NULL)
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
' Definisco flag tastatura
|
||||
' Ciclo di verifica tastatura completata (attesa max 4 minuti)
|
||||
Dim bProbingOk As Boolean = False
|
||||
For I As Integer = 0 To 120
|
||||
For I As Integer = 0 To 240
|
||||
' Devo rileggere la variabile ad ogni ciclo
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(ProbingStateNameVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
@@ -1395,7 +1229,7 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
System.Threading.Thread.Sleep(900)
|
||||
' Incremento progressbar
|
||||
MsgBoxStateInfo.LoadingPrBr_Value += 100 / 120
|
||||
MsgBoxStateInfo.LoadingPrBr_Value += ( 100 - MsgBoxStateInfo.LoadingPrBr_Value) / 60
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Verifico se interrotto dall'utente
|
||||
@@ -1427,7 +1261,7 @@ Public Class AlarmsPageUC
|
||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
bRead = True
|
||||
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
||||
' Se fanuc il dato è in mm (NON MICRON)
|
||||
' Se Fanuc il dato è in mm (NON MICRON)
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType <> 4 Then
|
||||
dVal = dVal / 1000
|
||||
End If
|
||||
@@ -1480,7 +1314,8 @@ Public Class AlarmsPageUC
|
||||
Select Case m_CurrentMachine.MountedToolConfig
|
||||
Case CurrentMachine.MountedToolConfigs.SAW
|
||||
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER,
|
||||
CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
||||
If ChooseTool.ShowDialog Then
|
||||
Return ChooseTool.GetSelectedTool
|
||||
@@ -1557,4 +1392,9 @@ Public Class AlarmsPageUC
|
||||
Return String.Empty
|
||||
End Function
|
||||
|
||||
Private Sub EnableFinalSawCutChBx_IsChecked() Handles EnableFinalSawCutChBx.Click
|
||||
m_CurrentMachine.bEnableFinalSawCut = EnableFinalSawCutChBx.IsChecked
|
||||
WritePrivateProfileString(S_MACH, K_ENABLEFINALSAWCUT, If(m_CurrentMachine.bEnableFinalSawCut, "1", "0"), m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Security.Cryptography.X509Certificates
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ChooseToolWD
|
||||
@@ -78,12 +79,14 @@ Public Class ChooseToolWD
|
||||
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))
|
||||
Dim bIsSaw As Boolean = ToolIsSaw( ToolChangerPos.sTool)
|
||||
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, bIsSaw))
|
||||
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))
|
||||
Dim bIsSaw As Boolean = ToolIsSaw( ToolChangerPos.sTool)
|
||||
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, bIsSaw))
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
@@ -92,6 +95,13 @@ Public Class ChooseToolWD
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function ToolIsSaw( sToolName As String) As Boolean
|
||||
If Not EgtTdbSetCurrTool( sToolName) Then Return False
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||
Return ((nType And MCH_TF.SAWBLADE) <> 0)
|
||||
End Function
|
||||
|
||||
Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp
|
||||
' Disabilito Ok
|
||||
OkBtn.IsEnabled = False
|
||||
|
||||
@@ -30,8 +30,6 @@ Public Class CurrentMachine
|
||||
|
||||
' Dati su linea di produzione
|
||||
Private m_bDemo As Boolean = False
|
||||
Public nLastProjSentToViewDEMO As Integer = 0
|
||||
|
||||
Private m_bProdLine As Boolean = False
|
||||
Private m_sVarProg1 As String = "E80021"
|
||||
Private m_nProg1 As Integer = 901
|
||||
@@ -81,8 +79,8 @@ Public Class CurrentMachine
|
||||
Private m_bPolishingWheel As Boolean = False
|
||||
Private m_bWaterJet As Boolean = False
|
||||
|
||||
' Flag che indica se gesire l'inversione del taglio nei tagli singoli
|
||||
Private m_bEnableInvetrt As Boolean = True
|
||||
' Flag che indica se gestire l'inversione del taglio nei tagli singoli
|
||||
Private m_bEnableInvert As Boolean = True
|
||||
|
||||
' Abilitazione DB WaterJet
|
||||
Private m_bFromDBWaterJet As Boolean = False
|
||||
@@ -217,9 +215,6 @@ Public Class CurrentMachine
|
||||
' Massima altezza lavorabile con lama grande
|
||||
Private m_dHighPieceZ As Double = 200.0
|
||||
|
||||
'
|
||||
Private m_dFinalDepth As Double = 0.0
|
||||
|
||||
' Flag che abilita l'esecuzione del taglio finale
|
||||
Private m_bEnableFinalSawCut As Boolean = False
|
||||
|
||||
@@ -457,6 +452,10 @@ Public Class CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Function ExistsSawHead As Boolean
|
||||
Return ( EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||
End Function
|
||||
|
||||
Friend ReadOnly Property bSaw As Boolean
|
||||
Get
|
||||
Return m_bSaw
|
||||
@@ -582,7 +581,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSaw
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAW, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAW, value, sMachIniFile) Then
|
||||
m_sCurrSaw = value
|
||||
m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
|
||||
End If
|
||||
@@ -594,7 +593,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawTilted
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWTILTED, value, sMachIniFile) Then
|
||||
m_sCurrSawTilted = value
|
||||
' m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
|
||||
End If
|
||||
@@ -606,7 +605,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDrill
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRILL, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRILL, value, sMachIniFile) Then
|
||||
m_sCurrDrill = value
|
||||
End If
|
||||
End Set
|
||||
@@ -617,7 +616,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrMill
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRMILL, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRMILL, value, sMachIniFile) Then
|
||||
m_sCurrMill = value
|
||||
End If
|
||||
End Set
|
||||
@@ -628,7 +627,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrMillNoTip
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRMILLNOTIP, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRMILLNOTIP, value, sMachIniFile) Then
|
||||
m_sCurrMillNoTip = value
|
||||
End If
|
||||
End Set
|
||||
@@ -639,7 +638,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDripSaw
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPSAW, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRIPSAW, value, sMachIniFile) Then
|
||||
m_sCurrDripSaw = value
|
||||
End If
|
||||
End Set
|
||||
@@ -650,7 +649,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDripDrill
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILL, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRIPDRILL, value, sMachIniFile) Then
|
||||
m_sCurrDripDrill = value
|
||||
End If
|
||||
End Set
|
||||
@@ -661,7 +660,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrWaterJet
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJET, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRWATERJET, value, sMachIniFile) Then
|
||||
m_sCurrWaterJet = value
|
||||
End If
|
||||
End Set
|
||||
@@ -672,7 +671,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
|
||||
m_sCurrSawing = value
|
||||
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||
End If
|
||||
@@ -684,7 +683,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawingTilted
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWINGTILTED, value, sMachIniFile) Then
|
||||
m_sCurrSawingTilted = value
|
||||
'm_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||
End If
|
||||
@@ -697,11 +696,7 @@ Public Class CurrentMachine
|
||||
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
|
||||
EgtWriteStringUtf8toIni(S_MACH_MACH, K_APPLYSAWINGTILTED, If( m_bApplySawingTilted,"1","0"), sMachIniFile)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -710,7 +705,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDrilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRILLING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRILLING, value, sMachIniFile) Then
|
||||
m_sCurrDrilling = value
|
||||
End If
|
||||
End Set
|
||||
@@ -721,7 +716,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrMilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRMILLING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRMILLING, value, sMachIniFile) Then
|
||||
m_sCurrMilling = value
|
||||
End If
|
||||
End Set
|
||||
@@ -732,7 +727,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrPocketing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRPOCKETING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRPOCKETING, value, sMachIniFile) Then
|
||||
m_sCurrPocketing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -743,7 +738,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawRoughing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWROUGHING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWROUGHING, value, sMachIniFile) Then
|
||||
m_sCurrSawRoughing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -754,7 +749,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawFinishing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWFINISHING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWFINISHING, value, sMachIniFile) Then
|
||||
m_sCurrSawFinishing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -765,7 +760,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawSideFinishing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWSIDEFINISHING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWSIDEFINISHING, value, sMachIniFile) Then
|
||||
m_sCurrSawSideFinishing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -776,7 +771,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrSawSingle
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWSINGLE, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRSAWSINGLE, value, sMachIniFile) Then
|
||||
m_sCurrSawSingle = value
|
||||
End If
|
||||
End Set
|
||||
@@ -787,7 +782,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDripSawing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPSAWING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRIPSAWING, value, sMachIniFile) Then
|
||||
m_sCurrDripSawing = value
|
||||
End If
|
||||
End Set
|
||||
@@ -798,7 +793,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrDripDrilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRDRIPDRILLING, value, sMachIniFile) Then
|
||||
m_sCurrDripDrilling = value
|
||||
End If
|
||||
End Set
|
||||
@@ -809,12 +804,11 @@ Public Class CurrentMachine
|
||||
Return m_sCurrWaterJetting
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRWATERJETTING, value, sMachIniFile) Then
|
||||
m_sCurrWaterJetting = value
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
If m_bWaterJet And Not ExistsSawHead() Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||
End If
|
||||
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -824,7 +818,7 @@ Public Class CurrentMachine
|
||||
Return m_sCurrWaterJettingQuality
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, value, sMachIniFile) Then
|
||||
If EgtWriteStringUtf8toIni(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, value, sMachIniFile) Then
|
||||
m_sCurrWaterJettingQuality = value
|
||||
End If
|
||||
End Set
|
||||
@@ -838,7 +832,7 @@ Public Class CurrentMachine
|
||||
|
||||
Friend ReadOnly Property bEnableInvert As Boolean
|
||||
Get
|
||||
Return m_bEnableInvetrt
|
||||
Return m_bEnableInvert
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -994,8 +988,6 @@ Public Class CurrentMachine
|
||||
Set(value As Double)
|
||||
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
|
||||
m_dFsevLength = value
|
||||
' salvo il dato nelle UserNote della lavorazione
|
||||
'MdbSetCurrMachiningUserNote("FsevLength", m_dFsevLength.ToString, sCurrSawing, false)
|
||||
' salvo il dato nelle UserNote dell'utensile
|
||||
TdbSetCurrToolUserNote("FsevLength", m_dFsevLength.ToString, sCurrSaw)
|
||||
End If
|
||||
@@ -1014,8 +1006,6 @@ Public Class CurrentMachine
|
||||
Set(value As Double)
|
||||
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
|
||||
m_dFsevPerc = value
|
||||
'' salvo il dato nelle UserNote della lavorazione
|
||||
'MdbSetCurrMachiningUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSawing)
|
||||
' salvo il dato nelle UserNote dell'utensile
|
||||
TdbSetCurrToolUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSaw)
|
||||
End If
|
||||
@@ -1053,7 +1043,7 @@ Public Class CurrentMachine
|
||||
Set(value As String)
|
||||
If value <> m_ToolChanger(Index).sTool Then
|
||||
m_ToolChanger(Index).sTool = value
|
||||
WritePrivateProfileString(S_TOOLCHANGER, K_POS & Index + 1, value, sMachIniFile)
|
||||
EgtWriteStringUtf8toIni(S_TOOLCHANGER, K_POS & (Index + 1).ToString(), value, sMachIniFile)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -1084,7 +1074,7 @@ Public Class CurrentMachine
|
||||
Set(value As String)
|
||||
If value <> m_ManualToolChanger(Index).sTool Then
|
||||
m_ManualToolChanger(Index).sTool = value
|
||||
WritePrivateProfileString(S_TOOLCHANGER, K_MANUALPOS & Index + 1, value, sMachIniFile)
|
||||
EgtWriteStringUtf8toIni(S_TOOLCHANGER, K_MANUALPOS & (Index + 1).ToString(), value, sMachIniFile)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -1236,24 +1226,15 @@ Public Class CurrentMachine
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property dFinalDepth As Double
|
||||
Get
|
||||
Return m_dFinalDepth
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dFinalDepth = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New()
|
||||
' Leggo da file ini nome macchina corrente
|
||||
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sMachineName, m_MainWindow.GetIniFile())
|
||||
' Impostazione direttorio macchina
|
||||
m_sMachDir = m_MainWindow.GetMachinesRootDir & "\" & sMachineName
|
||||
m_sMachDir = m_MainWindow.GetMachinesRootDir & "\" & m_sMachineName
|
||||
' Impostazione path MachIni file
|
||||
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & m_sMachineName & "\" & m_sMachineName & ".ini"
|
||||
' Leggo estensione del file programma pezzo
|
||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
||||
' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1
|
||||
@@ -1290,12 +1271,12 @@ Public Class CurrentMachine
|
||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGSTATE2VAR, "", m_sProdLiProbingState2Var, sMachIniFile)
|
||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
|
||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, sMachIniFile)
|
||||
|
||||
' Leggo parametri per foto su linea di lucidatura
|
||||
GetPrivateProfileString(S_POLISHLINE, K_CLICKSTATE, "", m_sClickState, sMachIniFile)
|
||||
GetPrivateProfileString(S_POLISHLINE, k_CLICKDIR, "", m_sClickDir, sMachIniFile)
|
||||
If Not Directory.Exists(m_sClickDir) Then
|
||||
If Not String.IsNullOrEmpty( m_sClickState) AndAlso Not Directory.Exists(m_sClickDir) Then
|
||||
m_sClickState = ""
|
||||
EgtOutLog("Directory " & m_sClickDir & " does not exist")
|
||||
EgtOutLog("Polish Line Directory " & m_sClickDir & " does not exist")
|
||||
End If
|
||||
|
||||
' Leggo configurazione degli utensili in macchina
|
||||
@@ -1355,61 +1336,61 @@ Public Class CurrentMachine
|
||||
' possibilità di definire attacco speciale per materiali ceramici
|
||||
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
||||
' mantengo la direzione del taglio definita nel taglio diretto
|
||||
m_bEnableInvetrt = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
|
||||
m_bEnableInvert = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
|
||||
|
||||
' Leggo utensili correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAW, "", m_sCurrSaw, sMachIniFile)
|
||||
' lama inclinata
|
||||
If m_MountedToolConfig = 4 Then
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, Nothing, m_sCurrSawTilted, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWTILTED, "", 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
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRILL, "", m_sCurrDrill, sMachIniFile)
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRMILL, Nothing, m_sCurrMill, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRMILL, "", m_sCurrMill, sMachIniFile)
|
||||
' mola
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRMILLNOTIP, Nothing, m_sCurrMillNoTip, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRMILLNOTIP, "", m_sCurrMillNoTip, sMachIniFile)
|
||||
' lama da sotto
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPSAW, Nothing, m_sCurrDripSaw, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRIPSAW, "", m_sCurrDripSaw, sMachIniFile)
|
||||
' foretto da sotto
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILL, Nothing, m_sCurrDripDrill, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRIPDRILL, "", m_sCurrDripDrill, sMachIniFile)
|
||||
' waterjet
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJET, Nothing, m_sCurrWaterJet, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRWATERJET, "", m_sCurrWaterJet, sMachIniFile)
|
||||
|
||||
' Leggo lavorazioni correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWING, "", m_sCurrSawing, sMachIniFile)
|
||||
' lama inlicnata
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, Nothing, m_sCurrSawingTilted, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWINGTILTED, "", m_sCurrSawingTilted, sMachIniFile)
|
||||
' applica lavorazione di lama inclinata
|
||||
m_bApplySawingTilted = (GetPrivateProfileInt(S_MACH_MACH, K_APPLYSAWINGTILTED, 0, sMachIniFile) <> 0)
|
||||
' foretto
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRILLING, "", m_sCurrDrilling, sMachIniFile)
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRMILLING, Nothing, m_sCurrMilling, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRMILLING, "", m_sCurrMilling, sMachIniFile)
|
||||
' svuotatura
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRPOCKETING, Nothing, m_sCurrPocketing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRPOCKETING, "", m_sCurrPocketing, sMachIniFile)
|
||||
' sgrossatura con lama
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWROUGHING, Nothing, m_sCurrSawRoughing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWROUGHING, "", m_sCurrSawRoughing, sMachIniFile)
|
||||
' finitura con lama
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWFINISHING, Nothing, m_sCurrSawFinishing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWFINISHING, "", m_sCurrSawFinishing, sMachIniFile)
|
||||
' spatolatura con lama
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWSIDEFINISHING, Nothing, m_sCurrSawSideFinishing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWSIDEFINISHING, "", m_sCurrSawSideFinishing, sMachIniFile)
|
||||
' taglio singolo
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWSINGLE, Nothing, m_sCurrSawSingle, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRSAWSINGLE, "", m_sCurrSawSingle, sMachIniFile)
|
||||
' lama da sotto
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPSAWING, Nothing, m_sCurrDripSawing, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRIPSAWING, "", m_sCurrDripSawing, sMachIniFile)
|
||||
' foretto da sotto
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, Nothing, m_sCurrDripDrilling, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRDRIPDRILLING, "", m_sCurrDripDrilling, sMachIniFile)
|
||||
' waterjetting
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, Nothing, m_sCurrWaterJetting, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRWATERJETTING, "", m_sCurrWaterJetting, sMachIniFile)
|
||||
' waterjettingquality
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, Nothing, m_sCurrWaterJettingQuality, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_MACH_MACH, K_CURRWATERJETTINGQUALITY, "", m_sCurrWaterJettingQuality, sMachIniFile)
|
||||
|
||||
' Leggo numero di portautensili
|
||||
m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
|
||||
@@ -1419,8 +1400,8 @@ Public Class CurrentMachine
|
||||
For Index As Integer = 1 To m_ToolChangerNbr
|
||||
Dim sName As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
GetPrivateProfileString(S_TOOLCHANGER, K_NAME & Index, Nothing, sName, sMachIniFile)
|
||||
GetPrivateProfileString(S_TOOLCHANGER, K_POS & Index, Nothing, sTool, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_TOOLCHANGER, K_NAME & Index.ToString(), "", sName, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_TOOLCHANGER, K_POS & Index.ToString(), "", sTool, sMachIniFile)
|
||||
m_ToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
||||
Next
|
||||
|
||||
@@ -1432,8 +1413,8 @@ Public Class CurrentMachine
|
||||
For Index As Integer = 1 To m_ManualToolChangerNbr
|
||||
Dim sName As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
GetPrivateProfileString(S_TOOLCHANGER, K_MANUALNAME & Index, Nothing, sName, sMachIniFile)
|
||||
GetPrivateProfileString(S_TOOLCHANGER, K_MANUALPOS & Index, Nothing, sTool, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_TOOLCHANGER, K_MANUALNAME & Index.ToString(), "", sName, sMachIniFile)
|
||||
EgtGetStringUtf8FromIni(S_TOOLCHANGER, K_MANUALPOS & Index.ToString(), "", sTool, sMachIniFile)
|
||||
m_ManualToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
||||
Next
|
||||
|
||||
@@ -1542,9 +1523,6 @@ Public Class CurrentMachine
|
||||
|
||||
' Flag per abilitare taglio finale
|
||||
m_bEnableFinalSawCut = GetPrivateProfileInt(S_MACH, K_ENABLEFINALSAWCUT, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
|
||||
' Flag per abilitare taglio finale
|
||||
m_dFinalDepth = GetPrivateProfileDouble(S_MACH, K_FINALDEPTH, 0.0, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
||||
@@ -1681,7 +1659,7 @@ Public Class CurrentMachine
|
||||
' Imposto utensile lama corrente
|
||||
If Not String.IsNullOrWhiteSpace(Machining) AndAlso EgtMdbSetCurrMachining(Machining) Then
|
||||
Dim UserNotes As String = String.Empty
|
||||
' salvo nel db corrente della lavorazione questa info → devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
|
||||
' Aggiunge Key=Value; alle UserNotes della lavorazione
|
||||
EgtMdbSetCurrMachiningParam(MCH_MP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Machining))
|
||||
EgtMdbSaveCurrMachining()
|
||||
EgtMdbSave()
|
||||
@@ -1698,7 +1676,7 @@ Public Class CurrentMachine
|
||||
' Imposto utensile lama corrente
|
||||
If Not String.IsNullOrWhiteSpace(Tool) AndAlso EgtTdbSetCurrTool(Tool) Then
|
||||
Dim UserNotes As String = String.Empty
|
||||
' salvo nel db corrente della lavorazione questa info → devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
|
||||
' Aggiunge Key=Value; alle UserNotes dell'utensile
|
||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Tool))
|
||||
EgtTdbSaveCurrTool()
|
||||
EgtTdbSave()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7.5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
<GroupBox Name="PartProgTransferGpBx"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.ColumnSpan="3">
|
||||
Grid.ColumnSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -127,9 +127,24 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
|
||||
<GroupBox Name="SpecialSendGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.Column="2" Grid.ColumnSpan="1" Margin="5,0,5,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Name="SpecialSendChBx" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
Margin="0,0,0,0"/>
|
||||
<Button Name="SpecialSendBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.Column="3" Grid.ColumnSpan="1" Margin="5,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
|
||||
@@ -37,6 +37,19 @@ Public Class MachineCNPageUC
|
||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Se prevista, scelta invio speciale part program
|
||||
Dim nSpecialSend As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
||||
If nSpecialSend <> -1 Then
|
||||
SpecialSendChBx.IsChecked() = (nSpecialSend = 1)
|
||||
SpecialSendBtn.Content = "Run"
|
||||
SpecialSendGpBx.Header = "Special Send"
|
||||
SpecialSendGpBx.Visibility = Visibility.Visible
|
||||
Dim nSpecialAreas As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALAREAS, 4, m_MainWindow.GetMachIniFile())
|
||||
If nSpecialAreas <> 0 Then SpecialSendBtn.Visibility = Visibility.Collapsed
|
||||
else
|
||||
SpecialSendGpBx.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
' nuovi pulsanti
|
||||
If GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||
PowerONBtn.Content = "ON"
|
||||
@@ -85,7 +98,7 @@ Public Class MachineCNPageUC
|
||||
Dim m_nCount As Integer = 1
|
||||
Dim bFoundBtn As Boolean = True
|
||||
Dim sTestVal As String = String.Empty
|
||||
' se non trovo il primo pulsante della lista allora nascondo l'elenco dei pulasnti per accensione
|
||||
' se non trovo il primo pulsante della lista allora nascondo l'elenco dei pulsanti per accensione
|
||||
If GetPrivateProfileString("MachineButtons", K_BUTTON & "1", "", sTestVal, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
PowerGpBx.Visibility = Visibility.Collapsed
|
||||
Return
|
||||
@@ -323,17 +336,40 @@ Public Class MachineCNPageUC
|
||||
MDITxBx.Background = Brushes.LightGray
|
||||
End Sub
|
||||
|
||||
Private Sub SpecialSendChBx_Click(sender As Object, e As RoutedEventArgs) Handles SpecialSendChBx.Click
|
||||
m_MainWindow.m_CNCommunication.SpecialSend = If( SpecialSendChBx.IsChecked(), 1, 0)
|
||||
End Sub
|
||||
|
||||
Private Sub SpecialSendBtn_Click(sender As Object, e As RoutedEventArgs) Handles SpecialSendBtn.Click
|
||||
' Recupero path dell'eseguibile
|
||||
Dim sSpecialExec As String = ""
|
||||
GetPrivateProfileString(S_NUMERICALCONTROL, K_SPECIALEXEC, "", sSpecialExec, m_MainWindow.m_CurrentMachine.sMachIniFile)
|
||||
' Verifico validità
|
||||
If String.IsNullOrWhiteSpace( sSpecialExec) Then
|
||||
EgtOutLog( "Warning : SpecialExec with empty name")
|
||||
End If
|
||||
' Recupero il nome
|
||||
Dim sSpecialName As String = IO.Path.GetFileNameWithoutExtension(sSpecialExec)
|
||||
' Mando in esecuzione
|
||||
Dim ProcsSpecial As Process() = Process.GetProcessesByName(sSpecialName)
|
||||
If ProcsSpecial.Length() > 0 Then
|
||||
ShowWindow(ProcsSpecial(0).MainWindowHandle, 3)
|
||||
Else
|
||||
Process.Start(sSpecialExec)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PowerON_Click(sender As Object, e As RoutedEventArgs) Handles PowerONBtn.Click
|
||||
Dim PowerOnButton As MachineButton = m_ButtonPower(0)
|
||||
' eseguo lo script lua associato
|
||||
PowerOnButton.ExecuteMDICommand(PowerOnButton.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(PowerOnButton.TLuaScriptName)
|
||||
' che comunica al PLC di cambiare lo stato, la modifica dello stato è intercettata dalla funzione Refresh che avvia il metodo Changed
|
||||
End Sub
|
||||
|
||||
Private Sub PowerOFF_Click(sender As Object, e As RoutedEventArgs) Handles PowerOFFBtn.Click
|
||||
Dim PowerOffButton As MachineButton = m_ButtonPower(1)
|
||||
' eseguo lo script lua associato
|
||||
PowerOffButton.ExecuteMDICommand(PowerOffButton.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(PowerOffButton.TLuaScriptName)
|
||||
' che comunica al PLC di cambiare lo stato, la modifica dello stato è intercettata dalla funzione Refresh che avvia il metodo Changed
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="AlarmsBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource DatiMacchinaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
<Image Source="{DynamicResource DatiMacchinaImg1}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="Alarms2Btn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource DatiMacchinaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
<Image Source="{DynamicResource DatiMacchinaImg2}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="ToolsDBBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource DB-lavorazioniImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||
|
||||
@@ -236,6 +236,10 @@ Public Class MachineStatusUC
|
||||
End Sub
|
||||
|
||||
Sub DisplayPosition()
|
||||
Dim nNumDec As Integer = -3
|
||||
If m_MainWindow.m_CNCommunication.GetMachineInInches() Then
|
||||
nNumDec = -4
|
||||
End If
|
||||
' Recupero le posizioni macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
||||
@@ -247,33 +251,37 @@ Public Class MachineStatusUC
|
||||
dL3 = ptTip.z
|
||||
End If
|
||||
' Visualizzazione
|
||||
Axis1TxBx.Text = LenToString(dL1, -3, True)
|
||||
Axis2TxBx.Text = LenToString(dL2, -3, True)
|
||||
Axis3TxBx.Text = LenToString(dL3, -3, True)
|
||||
Axis1TxBx.Text = LenToString(dL1, nNumDec, True)
|
||||
Axis2TxBx.Text = LenToString(dL2, nNumDec, True)
|
||||
Axis3TxBx.Text = LenToString(dL3, nNumDec, True)
|
||||
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
||||
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
||||
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
||||
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3, True)
|
||||
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3, True)
|
||||
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3, True)
|
||||
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3, True)
|
||||
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, nNumDec, True)
|
||||
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, nNumDec, True)
|
||||
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, nNumDec, True)
|
||||
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, nNumDec, True)
|
||||
End Sub
|
||||
|
||||
Sub DisplayPositionDelta()
|
||||
Dim nNumDec As Integer = -3
|
||||
If m_MainWindow.m_CNCommunication.GetMachineInInches() Then
|
||||
nNumDec = -4
|
||||
End If
|
||||
' Recupero le posizioni macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
||||
' Visualizzazione
|
||||
DeltaAxis1TxBx.Text = LenToString(dL1, -3, True)
|
||||
DeltaAxis2TxBx.Text = LenToString(dL2, -3, True)
|
||||
DeltaAxis3TxBx.Text = LenToString(dL3, -3, True)
|
||||
DeltaAxis1TxBx.Text = LenToString(dL1, nNumDec, True)
|
||||
DeltaAxis2TxBx.Text = LenToString(dL2, nNumDec, True)
|
||||
DeltaAxis3TxBx.Text = LenToString(dL3, nNumDec, True)
|
||||
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
||||
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
||||
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
||||
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3, True)
|
||||
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3, True)
|
||||
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3, True)
|
||||
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3, True)
|
||||
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, nNumDec, True)
|
||||
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, nNumDec, True)
|
||||
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, nNumDec, True)
|
||||
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, nNumDec, True)
|
||||
End Sub
|
||||
|
||||
Sub DisplayFeed()
|
||||
@@ -335,16 +343,16 @@ Public Class MachineStatusUC
|
||||
|
||||
Sub DisplayActiveMode(Mode As Integer)
|
||||
Select Case Mode
|
||||
Case 0
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Auto.png", UriKind.Relative))
|
||||
Case 1
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Single.png", UriKind.Relative))
|
||||
Case 2
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Mdi.png", UriKind.Relative))
|
||||
Case 7
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Manual.png", UriKind.Relative))
|
||||
Case 8
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Home.png", UriKind.Relative))
|
||||
Case 0
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Auto.png", UriKind.Relative))
|
||||
Case 1
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Single.png", UriKind.Relative))
|
||||
Case 2
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Mdi.png", UriKind.Relative))
|
||||
Case 7
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Manual.png", UriKind.Relative))
|
||||
Case 8
|
||||
MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Home.png", UriKind.Relative))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -2221,7 +2221,7 @@ Public Class MachiningDbPageUC
|
||||
Friend Function SaveCurrMachining() As Boolean
|
||||
SetMachiningParams()
|
||||
If EgtMdbIsCurrMachiningModified() Then
|
||||
Dim SaveCurrMachiningWnd As New EgtMsgBox(m_MainWindow, "", EgtMsg(91003), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) ' Inclinazione
|
||||
Dim SaveCurrMachiningWnd As New EgtMsgBox(m_MainWindow, "", EgtMsg(91103), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) ' Inclinazione
|
||||
Select Case SaveCurrMachiningWnd.m_nPressedBtn
|
||||
Case 0 ' Annulla
|
||||
Return False
|
||||
|
||||
@@ -728,7 +728,12 @@ Public Class SetUpPage
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
||||
While bFound
|
||||
If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
If nType = nTType Then
|
||||
' non aggiungo le Frese di nome "PROBE"
|
||||
If nTType <> MCH_TY.MILL_STD OrElse ToolName.Trim.ToLower <> "probe" Then
|
||||
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
End If
|
||||
End If
|
||||
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
|
||||
End While
|
||||
m_ToolTreeList.Add(ToolCathegory)
|
||||
@@ -1099,34 +1104,44 @@ Public Class SetUpPage
|
||||
EgtTdbSave()
|
||||
End Sub
|
||||
|
||||
' Funzione di utilità per la successiva
|
||||
Private Sub AddOneSetUpPos( nPosInd As Integer, sPosName As String, sToolName As String, ByRef sFileContent As String)
|
||||
If String.IsNullOrEmpty(sToolName) Then
|
||||
' Aggiungo la posizione vuota
|
||||
sFileContent &= "Pos" & nPosInd.ToString & "=" & sPosName & vbCrLf
|
||||
Else
|
||||
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 identificativo UUID dell'utensile
|
||||
Dim sUUID As String = ""
|
||||
EgtTdbGetCurrToolParam(MCH_TP.UUID, sUUID)
|
||||
' Aggiungo la posizione con i dati utensile
|
||||
sFileContent &= "Pos" & nPosInd.ToString & "=" & sPosName & ";" & sHead & ";" & nExit.ToString & "/" & sUUID & "/" & sToolName & vbCrLf
|
||||
End If
|
||||
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 = EgtMsg(91239) & vbCrLf ' ; this file has been created by program OmagCUT by current setup
|
||||
sContentFile &= EgtMsg(91240) & vbCrLf ' [General]
|
||||
Dim sFileContent As String = "; this file has been created by program OmagCUT by current setup" & vbCrLf
|
||||
sFileContent &= "[General]" & vbCrLf
|
||||
Dim nPosition As Integer = 0
|
||||
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
|
||||
nPosition += 1
|
||||
AddOneSetUpPos( nPosition, ToolPosition.sName, ToolPosition.sTool, sFileContent)
|
||||
Next
|
||||
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger
|
||||
nPosition += 1
|
||||
AddOneSetUpPos( nPosition, ToolPosition.sName, ToolPosition.sTool, sFileContent)
|
||||
Next
|
||||
' Apro il file e lo sovrascrivo
|
||||
Dim sFileOmagCutSetUp As String = m_CurrMachine.sMachDir & "\SetUp\CurrOmagCUT.stu"
|
||||
Dim sSetUpFile As String = m_CurrMachine.sMachDir & "\SetUp\CurrOmagCUT.stu"
|
||||
Try
|
||||
My.Computer.FileSystem.WriteAllText(sFileOmagCutSetUp, sContentFile, False)
|
||||
My.Computer.FileSystem.WriteAllText(sSetUpFile, sFileContent, False)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error in creatinf file CurrOmagCUT.stu: " & ex.ToString)
|
||||
End Try
|
||||
|
||||
@@ -24,6 +24,7 @@ Public Class ToolsDbPageUC
|
||||
Private m_nToolType As Integer = MCH_TY.NONE
|
||||
Private m_sToolName As String = String.Empty
|
||||
Private m_sEndLife As String = String.Empty
|
||||
Private m_bShowColor As Boolean = False
|
||||
|
||||
' Array che contengono i tipi di Coolant
|
||||
Dim ToolCoolant() As String
|
||||
@@ -573,6 +574,12 @@ Public Class ToolsDbPageUC
|
||||
Dim ChooseColor As New ChooseColor(m_MainWindow)
|
||||
If ChooseColor.ShowDialog() Then
|
||||
ColorBtn.Background = m_MainWindow.m_brCurrentColor
|
||||
Dim nOldCtx As String = EgtGetCurrentContext()
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString()))
|
||||
EgtSetCurrentContext(nOldCtx)
|
||||
CreateToolDraw()
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -701,13 +708,12 @@ Public Class ToolsDbPageUC
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
||||
While bFound
|
||||
Dim nDebug As Integer = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
||||
If nType = nTType Then
|
||||
' se utensile diverso da MILL
|
||||
If nTType <> MCH_TY.MILL_STD Then
|
||||
' se utensile diverso da MILL
|
||||
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
ElseIf nTType = MCH_TY.MILL_STD And (ToolName.Trim.ToLower <> "probe" Or nDebug > 4) Then
|
||||
' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4
|
||||
' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4
|
||||
ElseIf nTType = MCH_TY.MILL_STD And (ToolName.Trim.ToLower <> "probe" Or m_MainWindow.GetDebug() > 4) Then
|
||||
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
End If
|
||||
End If
|
||||
@@ -772,28 +778,38 @@ Public Class ToolsDbPageUC
|
||||
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
|
||||
UserNotesTxBx.Text = ToolString
|
||||
End If
|
||||
' Inizializzo colore di default
|
||||
Dim EgtCol As Color3d = Utility.GetColorPV()
|
||||
ColorBtn.Background = New SolidColorBrush(Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B))
|
||||
' Determino se richiesta gestione colore
|
||||
m_bShowColor = (m_nToolType = MCH_TY.SAW_STD And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW)
|
||||
' Se necessario, inizializzo colore di default
|
||||
If m_bShowColor Then
|
||||
Dim EgtCol As Color3d = Utility.GetColorPV()
|
||||
ColorBtn.Background = New SolidColorBrush(Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B))
|
||||
End If
|
||||
' 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
|
||||
Private Sub VerifyToolInSetUp(sToolName As String, sTCPos As String)
|
||||
' Se non c'è cambio utensile per lama, esco subito
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return
|
||||
' Cerco la posizione di attrezzaggio della lama
|
||||
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
|
||||
If Not String.IsNullOrWhiteSpace( sToolName) AndAlso sToolName = ToolPosition.sTool Then
|
||||
sCurrTCPos = ToolPosition.sName
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||
If Not String.IsNullOrWhiteSpace( sToolName) AndAlso sToolName = ToolPosition.sTool Then
|
||||
sCurrTCPos = ToolPosition.sName
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' Se non trovata
|
||||
If Not bFound Then
|
||||
TCPosTxBl.Foreground = Brushes.Red
|
||||
If String.IsNullOrEmpty(sTCPos) Then
|
||||
@@ -871,7 +887,11 @@ Public Class ToolsDbPageUC
|
||||
If Not SetSpecials() Then
|
||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
|
||||
End If
|
||||
EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString()))
|
||||
If m_bShowColor Then
|
||||
EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString()))
|
||||
Else
|
||||
EgtTdbRemoveCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ColorToString(color As String) As String
|
||||
@@ -945,9 +965,8 @@ Public Class ToolsDbPageUC
|
||||
SupplierTxBx.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)
|
||||
|
||||
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)
|
||||
ColorTxBl.Visibility = If(m_bShowColor, Visibility.Visible, Visibility.Hidden)
|
||||
ColorBtn.Visibility = If(m_bShowColor, Visibility.Visible, Visibility.Hidden)
|
||||
End Sub
|
||||
|
||||
Private Sub HideToolParams()
|
||||
@@ -975,7 +994,6 @@ Public Class ToolsDbPageUC
|
||||
SupplierTxBx.Visibility = Windows.Visibility.Hidden
|
||||
EndLifeTxBl.Visibility = Windows.Visibility.Hidden
|
||||
EndLifeChBx.Visibility = Windows.Visibility.Hidden
|
||||
|
||||
ColorTxBl.Visibility = Visibility.Hidden
|
||||
ColorBtn.Visibility = Visibility.Hidden
|
||||
End Sub
|
||||
@@ -1013,8 +1031,6 @@ Public Class ToolsDbPageUC
|
||||
' Aggiorno visualizzazione
|
||||
EgtSetCurrentContext(ToolScene.GetCtx())
|
||||
EgtSetView(VT.TOP, False)
|
||||
'EgtSetGenericView(150, -150)
|
||||
'EgtSetView(VT.ISO_SE, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Name="LogoBrd" Background="Transparent">
|
||||
<Image Source="../Resources/NewIcons/logo-OmCut.png" Stretch="Uniform" Margin="1"/>
|
||||
<Image Source="../Resources/NewIcons/Logo-OmagCut.png" Stretch="Uniform" Margin="1"/>
|
||||
</Border>
|
||||
|
||||
<!-- ** Definizione della Grid delle tab ** -->
|
||||
|
||||
@@ -129,6 +129,9 @@ Class MainWindow
|
||||
' Variabile che indica il tipo di pc su cui gira il programma
|
||||
Private m_bIsSiemensPc As Boolean = False
|
||||
|
||||
' Abilitazione parcheggio dei pezzi
|
||||
Private m_bEnabledDxfPark As Boolean = False
|
||||
|
||||
' Variabile che indica il colore corrente di ColorToSIdeAng in OptionsPageUC
|
||||
Friend m_brCurrentColor As Brush
|
||||
|
||||
@@ -274,6 +277,10 @@ Class MainWindow
|
||||
Return m_bIsSiemensPc
|
||||
End Function
|
||||
|
||||
Public Function EnabledDxfPark() As Boolean
|
||||
Return m_bEnabledDxfPark
|
||||
End Function
|
||||
|
||||
Public Function GetDebug() As Integer
|
||||
Return m_nDebug
|
||||
End Function
|
||||
@@ -362,8 +369,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2707, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2707, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 3105, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 3105, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||
@@ -438,6 +445,8 @@ Class MainWindow
|
||||
' Inizializzazione della libreria EgtWPFLib
|
||||
EgtWPFInit()
|
||||
EgtTextBox.EnableKeybCalc = (GetPrivateProfileInt(S_GENERAL, K_VIRTUALKEYBOARD, 1, m_sIniFile) <> 0)
|
||||
' Abilitazione parcheggio pezzi
|
||||
m_bEnabledDxfPark = ( GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, GetIniFile) <> 0)
|
||||
' Inizializzo classe macchina corrente
|
||||
m_CurrentMachine = New CurrentMachine
|
||||
' Crezione della MachineStatusBar
|
||||
@@ -476,11 +485,11 @@ Class MainWindow
|
||||
End If
|
||||
End If
|
||||
|
||||
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
|
||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
||||
' Abilito il bottone per la gestione del comando di Check-Up-Start (posiziono utensile scelto prelavorazione)
|
||||
If GetPrivateProfileInt(S_GENERAL, "Test", 0, m_sIniFile) = 0 OrElse
|
||||
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||
EgtOutLog("Warning: Missing file 'TestWork.lua' in folder 'DirectCmd', buttun 'TEST' collapsed!")
|
||||
EgtOutLog("Warning: Missing file 'TestWork.lua' in folder 'DirectCmd', button 'TEST' collapsed!")
|
||||
Else
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
||||
End If
|
||||
@@ -651,12 +660,14 @@ Class MainWindow
|
||||
|
||||
Dim sVal As String = String.Empty
|
||||
If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
|
||||
StringToDouble(sVal, m_CurrentMachine.dFsevLength)
|
||||
m_CurrentMachine.SetFsevLength(m_CurrentMachine.dFsevLength)
|
||||
Dim dFsevLength As Double
|
||||
StringToDouble(sVal, dFsevLength)
|
||||
m_CurrentMachine.SetFsevLength(dFsevLength)
|
||||
End If
|
||||
If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
|
||||
StringToDouble(sVal, m_CurrentMachine.dFsevPerc)
|
||||
m_CurrentMachine.SetFsevPerc(m_CurrentMachine.dFsevPerc)
|
||||
Dim dFsevPerc As Double
|
||||
StringToDouble(sVal, dFsevPerc)
|
||||
m_CurrentMachine.SetFsevPerc(dFsevPerc)
|
||||
End If
|
||||
|
||||
' Se macchina fotografica abilitata, ne inizializzo il gestore
|
||||
@@ -699,7 +710,7 @@ Class MainWindow
|
||||
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
|
||||
Dim sItems As String() = sAssistance.Split(","c)
|
||||
For Each Item As String In sItems
|
||||
sMsg_RefAssistance &= " → " & Item.Trim & " /n"
|
||||
sMsg_RefAssistance &= " -> " & Item.Trim & " /n"
|
||||
Next
|
||||
' 91148=Grazie per la vostra collaborazione.
|
||||
Dim sMsg_ThankYou As String = EgtMsg(91148)
|
||||
@@ -711,14 +722,14 @@ Class MainWindow
|
||||
' inizializzo
|
||||
End Sub
|
||||
|
||||
#Region "Selezione dei bottoni IN LAVORO, TAGLII DIRETTI, TAGLI CAD, CORNICI, MACCHINA, OPZIONI"
|
||||
#Region "Selezione dei bottoni IN LAVORO, TAGLI DIRETTI, TAGLI CAD, CORNICI, MACCHINA, OPZIONI"
|
||||
|
||||
Private Sub WorkInProgressBtn_Click(sender As Object, e As RoutedEventArgs) Handles WorkInProgressBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
' disbilito Test
|
||||
TestOff()
|
||||
' disabilito DragRettangle
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
' disabilito SplitCurv
|
||||
SplitCurvWJOff()
|
||||
' disattivo StartCurv
|
||||
@@ -781,7 +792,7 @@ Class MainWindow
|
||||
EgtMdbGetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
@@ -839,7 +850,7 @@ Class MainWindow
|
||||
Private Sub CadCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CadCutBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
@@ -896,7 +907,7 @@ Class MainWindow
|
||||
Private Sub FrameCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles FrameCutBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
@@ -954,7 +965,7 @@ Class MainWindow
|
||||
Private Sub MachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachineBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
@@ -1007,7 +1018,7 @@ Class MainWindow
|
||||
Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
|
||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
DragRectangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
@@ -1073,7 +1084,7 @@ Class MainWindow
|
||||
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
||||
m_CurrentProjectPageUC.ClearMessage()
|
||||
' se è premuto il pulsante Shift allora provvedo ad aprire il file di Log
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
|
||||
' Genero file CNC (lancio anche se errore in precedenza)
|
||||
Dim sTemoDirect As String = GetTempDir() & "\OmagCUTLog.txt"
|
||||
Try
|
||||
@@ -1354,38 +1365,32 @@ Class MainWindow
|
||||
' Verifico presenza testa H1 per lama/fresa (nel contesto principale)
|
||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||
Dim bHeadH1 As Boolean = m_CurrentMachine.ExistsSawHead()
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
' Aggiorno interfaccia
|
||||
If m_OnlyFrame Then
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
m_ActivePage <> Pages.RawPart And m_ActivePage <> Pages.DirectCut And m_ActivePage <> Pages.Simulation Then
|
||||
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91141), EgtMsg(91142), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL) ' Attenzione! Licenza non abilitata per tagli CAD.
|
||||
'' Gestione stato FastGrid
|
||||
'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject()
|
||||
' Attenzione! Licenza non abilitata per tagli CAD.
|
||||
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91141), EgtMsg(91142), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
' Cancello progetto salvato con nome da file ini
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", GetIniFile())
|
||||
' Scelta tavola della macchina
|
||||
Dim nTabInd As Integer = m_CadCutPageUC.m_ProjectMgr.ChooseTable()
|
||||
' Creo nuovo progetto
|
||||
m_CurrentProjectPageUC.NewProject(nTabInd, False)
|
||||
'' Gestione stato FastGrid
|
||||
'm_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||
'
|
||||
FrameCutBtn_Click(Nothing, Nothing)
|
||||
CadCutBtn.IsEnabled = False
|
||||
Else
|
||||
FrameCutBtn.IsEnabled = True
|
||||
CadCutBtn.IsEnabled = False
|
||||
' Attivo il pulsante FRAME
|
||||
'FrameCutBtn.IsChecked = True
|
||||
'CadCutBtn.IsChecked = False
|
||||
End If
|
||||
Else
|
||||
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
||||
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
||||
End If
|
||||
|
||||
' DirectCutBtn.IsEnabled = bHeadH1
|
||||
End Sub
|
||||
|
||||
' Nomi dei file per OmagVIEW
|
||||
@@ -2143,18 +2148,16 @@ Class MainWindow
|
||||
End Sub
|
||||
|
||||
' spegne il comando per la mofica dei rettangoli
|
||||
Public Sub DragRettangleOff()
|
||||
m_CadCutPageUC.m_NestPage.DragRettanleBtn.IsChecked = False
|
||||
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedDragRettangle = False
|
||||
Public Sub DragRectangleOff()
|
||||
m_CadCutPageUC.m_NestPage.DragRectangleBtn.IsChecked = False
|
||||
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedDragRectangle = False
|
||||
ShowParkedParts()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub SplitCurvWJOff()
|
||||
m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.IsChecked = False
|
||||
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedSplitCurveWJ = False
|
||||
m_CadCutPageUC.m_NestPage.ResetSplitCurvWJParam()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub StartCurvWJOff()
|
||||
|
||||
@@ -22,7 +22,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagCUT")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2026 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.7.2")>
|
||||
<Assembly: AssemblyFileVersion("2.7.7.2")>
|
||||
<Assembly: AssemblyVersion("3.1.5.2")>
|
||||
<Assembly: AssemblyFileVersion("3.1.5.2")>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
Imports System.Windows.Threading
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Globalization
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib.EgtMsgBox
|
||||
Imports EgtWPFLib5
|
||||
Imports OmagCUT.CN_generico
|
||||
|
||||
Public Class CNCommunication
|
||||
@@ -20,6 +21,26 @@ Public Class CNCommunication
|
||||
' Variabile per tipologia CN
|
||||
Friend m_nNCType As Integer
|
||||
|
||||
' Modalità invio programmi step a step (attualmente solo per Siemens)
|
||||
Private m_bStepByStepSend As Boolean = False
|
||||
|
||||
' Modalità speciale invio programmi (attualmente solo per Fanuc, fino a 4 programmi)
|
||||
Private m_nSpecialSend As Integer = -1
|
||||
Friend Property SpecialSend As Integer
|
||||
Get
|
||||
Return m_nSpecialSend
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
value = Math.Max( Math.Min( value, 1), -1)
|
||||
If value <> m_nSpecialSend Then
|
||||
m_nSpecialSend = value
|
||||
WritePrivateProfileString( S_NUMERICALCONTROL, K_SPECIALSEND, value.ToString(), m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Private m_nSpecialAreas As Integer = 4
|
||||
Private m_sSpecialDest As String = ""
|
||||
|
||||
' Variabile che indica il Mode corrente
|
||||
Private m_nCurrMode As Integer = -1
|
||||
|
||||
@@ -73,6 +94,11 @@ Public Class CNCommunication
|
||||
Private m_nA10 As Integer = 9
|
||||
Private m_bInInches As Boolean = False ' Solo per comandi diretti (assi sempre in mm)
|
||||
|
||||
' NUVO! ver. 2.7h2: m_sA1=nome (in grafica), tipo (Linear/Rotary), m_nA1=indice (nel vettore CN)
|
||||
Private m_ListAxesData As New List(Of AxisData)
|
||||
Public Function GetListAxesData() As List(Of AxisData)
|
||||
Return m_ListAxesData
|
||||
End Function
|
||||
|
||||
Friend Sub CNCommunication_Initialization()
|
||||
|
||||
@@ -93,12 +119,24 @@ Public Class CNCommunication
|
||||
|
||||
EgtOutLog("NcLink=" & m_MainWindow.m_bNCLink.ToString & " type=" & m_nNCType)
|
||||
|
||||
' Leggo flag invio programma a step per debug (da Ini di OmagCUT)
|
||||
m_bStepByStepSend = (GetPrivateProfileInt(S_GENERAL, K_STEPBYSTEPSEND, 0, m_MainWindow.GetIniFile()) = 1)
|
||||
|
||||
' Leggo flag invio speciale programma di lavoro
|
||||
Dim nTemp As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
||||
m_nSpecialSend = Math.Max( Math.Min( nTemp, 1), -1)
|
||||
' Leggo numero di aree per invio speciale
|
||||
Dim nTemp2 As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALAREAS, 4, m_MainWindow.GetMachIniFile())
|
||||
m_nSpecialAreas = Math.Max( Math.Min( nTemp2, 16), 0)
|
||||
' Leggo il direttorio di destinazione (se Fanuc data server è "//DATA_SV/PROGRAM_DS/")
|
||||
GetPrivateProfileString(S_NUMERICALCONTROL, K_SPECIALDEST, "", m_sSpecialDest, m_MainWindow.GetMachIniFile())
|
||||
|
||||
' Se CN Siemens leggo dati programma intermedio di comunicazione
|
||||
If m_nNCType = 3 Then
|
||||
Dim sExeName As String = String.Empty
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_COMM_NAME, "", sExeName, m_MainWindow.m_CurrentMachine.sMachIniFile)
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_COMM_NAME, "", sExeName, m_MainWindow.GetMachIniFile())
|
||||
m_sCNSiemensPath = m_MainWindow.GetExeRootDir() & "\" & sExeName
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_PATH_HMI, "", m_sCNSiemensHMIPath, m_MainWindow.m_CurrentMachine.sMachIniFile)
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_PATH_HMI, "", m_sCNSiemensHMIPath, m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
|
||||
' Inizializzo la connessione
|
||||
@@ -164,84 +202,150 @@ Public Class CNCommunication
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "ver 2.7h2 NUOVA LETTURA ASSI"
|
||||
|
||||
' Dal nome della chiave cerca di estrarre la definizione del tipo di asse
|
||||
Private Sub GetDefaultTypeAxis(sKeyAxis As String, ByRef bIsLinear As Boolean)
|
||||
' non è stato definito il tipo asse: cerco di assegnarlo di default
|
||||
Dim sMsg As String = String.Empty
|
||||
If sKeyAxis.StartsWith("L") Then
|
||||
sMsg = "Linear"
|
||||
bIsLinear = True
|
||||
ElseIf sKeyAxis.StartsWith("R") Then
|
||||
sMsg = "Rotary"
|
||||
bIsLinear = False
|
||||
Else
|
||||
sMsg = "Linear"
|
||||
bIsLinear = True
|
||||
End If
|
||||
EgtOutLog("In file *.ini machine in section '[Axes]' axis type '" & sKeyAxis & "' has been defined by default as " & sMsg)
|
||||
End Sub
|
||||
|
||||
' Legge da file *.ini macchina la definizione del tipo di asse
|
||||
Private Function GetTypeAxis(sKeyAxis As String)
|
||||
Dim bIsLinear As Boolean = True
|
||||
Dim sValue As String = String.Empty
|
||||
GetPrivateProfileString(S_AXES, sKeyAxis, "", sValue, m_MainWindow.GetMachIniFile())
|
||||
If Not String.IsNullOrEmpty(sValue) Then
|
||||
If sValue.ToLower = "linear" Then
|
||||
bIsLinear = True
|
||||
ElseIf sValue.ToLower = "rotary" Then
|
||||
bIsLinear = False
|
||||
Else
|
||||
GetDefaultTypeAxis(sKeyAxis, bIsLinear)
|
||||
End If
|
||||
Else
|
||||
GetDefaultTypeAxis(sKeyAxis, bIsLinear)
|
||||
End If
|
||||
' Ritorno il booleano che definisce il tipo di asse che è stato letto
|
||||
Return bIsLinear
|
||||
End Function
|
||||
|
||||
' Imposto il vettore dei tipi asse macchina
|
||||
Private Sub SetArrayAxisIsLinear()
|
||||
For Each Item As AxisData In m_ListAxesData
|
||||
m_CN.b_axis_is_linear(Item.nIndex) = Item.bIsLinear
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' Legge da file *.ini macchina il nome dell'asse, se non esiste impone il valore di default e restituisce FALSE
|
||||
Private Function SetNameAxis(sKeyAxis As String, sAxisDefaultName As String, ByRef sAxisName As String) As Boolean
|
||||
Dim bAxisExist As Boolean = False
|
||||
Dim sValue As String = String.Empty
|
||||
bAxisExist = (GetPrivateProfileString(S_AXES, sKeyAxis, "", sValue, m_MainWindow.GetMachIniFile()) > 0)
|
||||
If String.IsNullOrEmpty(sValue) Then
|
||||
sAxisName = sAxisDefaultName
|
||||
Else
|
||||
sAxisName = sValue
|
||||
End If
|
||||
Return bAxisExist
|
||||
End Function
|
||||
|
||||
Private Function SetIndexAxis(sKeyAxis As String, nAxisDefaultIndex As Integer, ByRef nAxisIndex As String) As Boolean
|
||||
Dim bAxisExist As Boolean = True
|
||||
nAxisIndex = GetPrivateProfileInt(S_AXES, sKeyAxis, nAxisDefaultIndex, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(nAxisIndex) Then
|
||||
nAxisIndex = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on " & sKeyAxis)
|
||||
bAxisExist = False
|
||||
End If
|
||||
Return bAxisExist
|
||||
End Function
|
||||
|
||||
Private Sub ReadAxesData()
|
||||
' Nomi e indici degli assi macchina: definisco il nome degli assi da satampare nella pagina MachineStatusUC
|
||||
m_bAxesOk = True
|
||||
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
|
||||
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA1) Then
|
||||
m_nA1 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on L1ID")
|
||||
Dim bAxisExist As Boolean = False
|
||||
bAxisExist = SetNameAxis(K_L1NAME, "X", m_sA1)
|
||||
If SetIndexAxis(K_L1ID, 0, m_nA1) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_L1TYPE), m_sA1, m_nA1))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_L2NAME, "Y", m_sA2, m_MainWindow.GetMachIniFile())
|
||||
m_nA2 = GetPrivateProfileInt(S_AXES, K_L2ID, 1, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA2) Then
|
||||
m_nA2 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on L2ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_L2NAME, "Y", m_sA2)
|
||||
If SetIndexAxis(K_L2ID, 1, m_nA2) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_L2TYPE), m_sA2, m_nA2))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_L3NAME, "Z", m_sA3, m_MainWindow.GetMachIniFile())
|
||||
m_nA3 = GetPrivateProfileInt(S_AXES, K_L3ID, 2, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA3) Then
|
||||
m_nA3 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on L3ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_L3NAME, "Z", m_sA3)
|
||||
If SetIndexAxis(K_L3ID, 2, m_nA3) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_L3TYPE), m_sA3, m_nA3))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_R1NAME, "C", m_sA4, m_MainWindow.GetMachIniFile())
|
||||
m_nA4 = GetPrivateProfileInt(S_AXES, K_R1ID, 8, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA4) Then
|
||||
m_nA4 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on R1ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_R1NAME, "C", m_sA4)
|
||||
If SetIndexAxis(K_R1ID, 8, m_nA4) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_R1TYPE), m_sA4, m_nA4))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_R2NAME, "B", m_sA5, m_MainWindow.GetMachIniFile())
|
||||
m_nA5 = GetPrivateProfileInt(S_AXES, K_R2ID, 7, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA5) Then
|
||||
m_nA5 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on R2ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_R2NAME, "B", m_sA5)
|
||||
If SetIndexAxis(K_R2ID, 7, m_nA5) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_R2TYPE), m_sA5, m_nA5))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_A6NAME, "A", m_sA6, m_MainWindow.GetMachIniFile())
|
||||
m_nA6 = GetPrivateProfileInt(S_AXES, K_A6ID, 6, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA6) Then
|
||||
m_nA6 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on A6ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_A6NAME, "A", m_sA6)
|
||||
If SetIndexAxis(K_A6ID, 6, m_nA6) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_A6TYPE), m_sA6, m_nA6))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_A7NAME, "U", m_sA7, m_MainWindow.GetMachIniFile())
|
||||
m_nA7 = GetPrivateProfileInt(S_AXES, K_A7ID, 3, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA7) Then
|
||||
m_nA7 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on A7ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_A7NAME, "U", m_sA7)
|
||||
If SetIndexAxis(K_A7ID, 3, m_nA7) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_A7TYPE), m_sA7, m_nA7))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_A8NAME, "V", m_sA8, m_MainWindow.GetMachIniFile())
|
||||
m_nA8 = GetPrivateProfileInt(S_AXES, K_A8ID, 4, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA8) Then
|
||||
m_nA8 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on A8ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_A8NAME, "V", m_sA8)
|
||||
If SetIndexAxis(K_A8ID, 4, m_nA8) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_A8TYPE), m_sA8, m_nA8))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_A9NAME, "W", m_sA9, m_MainWindow.GetMachIniFile())
|
||||
m_nA9 = GetPrivateProfileInt(S_AXES, K_A9ID, 5, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA9) Then
|
||||
m_nA9 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on A9ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_A9NAME, "W", m_sA9)
|
||||
If SetIndexAxis(K_A9ID, 5, m_nA9) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_A9TYPE), m_sA9, m_nA9))
|
||||
End If
|
||||
GetPrivateProfileString(S_AXES, K_A10NAME, "P", m_sA10, m_MainWindow.GetMachIniFile())
|
||||
m_nA10 = GetPrivateProfileInt(S_AXES, K_A10ID, 5, m_MainWindow.GetMachIniFile())
|
||||
If Not m_CN.VerifyAxis(m_nA10) Then
|
||||
m_nA10 = -1
|
||||
m_bAxesOk = False
|
||||
EgtOutLog("Error on A10ID")
|
||||
|
||||
bAxisExist = SetNameAxis(K_A10NAME, "P", m_sA10)
|
||||
If SetIndexAxis(K_A10ID, 5, m_nA10) Then
|
||||
' aggiungo l'asse alla lista degli assi
|
||||
If bAxisExist Then m_ListAxesData.Add(New AxisData(GetTypeAxis(K_A10TYPE), m_sA10, m_nA10))
|
||||
End If
|
||||
|
||||
' Unità di misura
|
||||
m_bInInches = (GetPrivateProfileInt(S_AXES, K_ININCHES, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
' Crea il vettore che ad ogni posizione definisce il tipo di asse assegnato
|
||||
SetArrayAxisIsLinear()
|
||||
End Sub
|
||||
|
||||
Private Sub KillSimensCom(sProcessName As String)
|
||||
#End Region ' ver 2.7h2 nuova gestione
|
||||
|
||||
Private Sub KillSiemensCom(sProcessName As String)
|
||||
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
||||
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
||||
For Each proc As System.Diagnostics.Process In pList
|
||||
@@ -287,7 +391,7 @@ Public Class CNCommunication
|
||||
|
||||
' Recupero e imposto le variabili per i dati del CN (feed, speed,...)
|
||||
GetPrivateProfileString(S_NCDATA, K_COMM, "XIP01, 0, 10, 0, 0, 0", sVal, m_MainWindow.GetMachIniFile())
|
||||
EgtOutLog(" → Tipo di comunicazione: " & sVal)
|
||||
EgtOutLog(" -> Tipo di comunicazione: " & sVal)
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Comm, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_REFRESH, "200", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Refresh, sVal)
|
||||
@@ -457,7 +561,7 @@ Public Class CNCommunication
|
||||
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
KillSimensCom(m_sCNSiemensHMIPath)
|
||||
KillSiemensCom(m_sCNSiemensHMIPath)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
|
||||
@@ -576,13 +680,13 @@ Public Class CNCommunication
|
||||
End Select
|
||||
End If
|
||||
Else
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è indicato il tipo (0→Bool,1→Int,2→Long,3→Double,4→String,5→Bit)")
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è indicato il tipo (0=Bool,1=Int,2=Long,3=Double,4=String,5=Bit)")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Attraverso la funzione "RefreshNoEvents" rileggo i dati caricati
|
||||
|
||||
' Recupero il perocorso delle variabili PLC
|
||||
' Recupero il percorso delle variabili PLC
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||
|
||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||
@@ -750,7 +854,7 @@ Public Class CNCommunication
|
||||
'End If
|
||||
End If
|
||||
|
||||
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
|
||||
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE : vedere come esempio il NUM che assegna queste variabili
|
||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
@@ -923,7 +1027,7 @@ Public Class CNCommunication
|
||||
m_CN.nMachineMode = m_nCurrMode
|
||||
End If
|
||||
|
||||
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
|
||||
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE : vedere come esempio il NUM che assegna queste variabili
|
||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
@@ -1112,7 +1216,7 @@ Public Class CNCommunication
|
||||
'Laser = 16384
|
||||
End Enum
|
||||
|
||||
#Region "MASCHERA per conttrollo Bit a Bit"
|
||||
#Region "MASCHERA per controllo Bit a Bit"
|
||||
<Flags()>
|
||||
Public Enum Mask As Integer
|
||||
bit_Err = -1
|
||||
@@ -1497,10 +1601,6 @@ Public Class CNCommunication
|
||||
Optional bActivate As Boolean = True) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
' m_nNCType = 2
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
|
||||
' Download programma
|
||||
If m_MainWindow.m_bNCLink Then
|
||||
bOk = (m_nNCType > 0)
|
||||
@@ -1511,6 +1611,20 @@ Public Class CNCommunication
|
||||
Else
|
||||
sNumProg = nNumProg.ToString()
|
||||
End If
|
||||
' Se Fanuc con trasmissione speciale come copia in un direttorio opportuno
|
||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 AndAlso m_nSpecialAreas = 0 Then
|
||||
bOk = SpecialSendCopyProgram(sCncPath)
|
||||
If bOk Then
|
||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) ' Programma CN trasmesso con successo
|
||||
Else
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90315)) ' Errore nella trasmissione del programma CN
|
||||
End If
|
||||
Return bOk
|
||||
End If
|
||||
' Se Fanuc con trasmissione speciale, disabilito attivazione
|
||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 Then
|
||||
bActivate = False
|
||||
End If
|
||||
' Se richiesta successiva attivazione, faccio reset
|
||||
If bActivate Then
|
||||
EgtOutLog("Call function: DGeneralFunctions_Reset")
|
||||
@@ -1520,6 +1634,10 @@ Public Class CNCommunication
|
||||
End If
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
||||
' Se modalità invio a step per debug di Siemens
|
||||
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||
MessageBox.Show( "Reset Done, Press Ok to Continue", "Send Program Step by Step")
|
||||
End If
|
||||
If m_nNCType = 1 Then
|
||||
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
||||
EgtOutLog("Delete_NC_prog(sNumProg)")
|
||||
@@ -1529,42 +1647,51 @@ Public Class CNCommunication
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
ElseIf m_nNCType = 4 Then
|
||||
' FANUC: imposto modalità EDIT
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
' FANUC: imposto modalità EDIT se non special send
|
||||
If m_nSpecialSend <> 1 Then
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
End If
|
||||
EgtOutLog("Download_NC_prog(" & sCncPath & ", " & sNumProg.ToString & ")")
|
||||
' -------------- START DOWNLOAD --------------
|
||||
TimeSpanInit()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' FANUC: genero un file 901 vuoto da aspedire, attivare; poi rispedisco il file 900
|
||||
If m_nNCType = 4 And Not bOk Then
|
||||
bOk = True
|
||||
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||
Dim fs As FileStream = File.Create(sCncPath1)
|
||||
' Add text to the file.
|
||||
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
|
||||
fs.Write(info, 0, info.Length)
|
||||
fs.Close()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
|
||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 Then
|
||||
bOk = bOk AndAlso SpecialSendProgram(sCncPath, sNumProg)
|
||||
Else
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
If bActivate Then
|
||||
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' Se modalità invio a step per debug di Siemens
|
||||
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||
MessageBox.Show( "Download NC Prog Done, Press Ok to Continue", "Send Program Step by Step")
|
||||
End If
|
||||
' FANUC: genero un file 901 vuoto da spedire, attivare; poi rispedisco il file 900
|
||||
If m_nNCType = 4 And Not bOk Then
|
||||
bOk = True
|
||||
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||
Dim fs As FileStream = File.Create(sCncPath1)
|
||||
' Add text to the file.
|
||||
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
|
||||
fs.Write(info, 0, info.Length)
|
||||
fs.Close()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
If bActivate Then
|
||||
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
' riprovo ad eseguire il programma 900
|
||||
bOk = True
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
' riprovo ad eseguire il programma 900
|
||||
bOk = True
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
EgtOutLog("Nc Type : " & m_nNCType.ToString)
|
||||
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
|
||||
' AXIUM (NUM OLD): se DripFeed non eseguo attivazione programma)
|
||||
If m_nNCType = 1 AndAlso m_CN.bIsDripFeed Then
|
||||
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
|
||||
Return True
|
||||
@@ -1581,10 +1708,18 @@ Public Class CNCommunication
|
||||
EgtOutLog(TimeSpanEnd())
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' Attivo la modalità AUTO prima per preparar il cyclo start
|
||||
' Se modalità invio a step per debug di Siemens
|
||||
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||
MessageBox.Show( "ActivateProgram Done, Press Ok to Continue", "Send Program Step by Step")
|
||||
End If
|
||||
' Attivo la modalità AUTO prima per preparare il cyclo start
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' Se modalità invio a step per debug di Siemens
|
||||
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||
MessageBox.Show( "AUTO Mode Setting Done, Press Ok to Continue", "Send Program Step by Step")
|
||||
End If
|
||||
' Modalità automatica
|
||||
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
|
||||
TimeSpanInit()
|
||||
@@ -1604,6 +1739,89 @@ Public Class CNCommunication
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function SpecialSendProgram(sz_PC_filename As String, sz_NC_filename As String) As Boolean
|
||||
' Solo per Fanuc
|
||||
If m_nNCType <> 4 Then Return False
|
||||
|
||||
' Nuova modalità con nome di programma come progetto
|
||||
If Not String.IsNullOrEmpty( m_sSpecialDest) Then
|
||||
Dim sDestProg As String = m_CurrProjPage.GetCurrentProjectTitle().ToUpperInvariant()
|
||||
' Eseguo trasmissione
|
||||
Dim bOk As Boolean = ( m_CN.Download2_NC_prog(sz_PC_filename, m_sSpecialDest, sDestProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "Send2Result=" & bOk.ToString())
|
||||
' Se non riuscita riprovo
|
||||
If Not bOk Then
|
||||
bOk = ( m_CN.Download2_NC_prog(sz_PC_filename, m_sSpecialDest, sDestProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "SecondSend2Result=" & bOk.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
|
||||
' Vecchia modalità con numero di programma
|
||||
Else
|
||||
' Indice base
|
||||
Dim nBase As Integer = 900
|
||||
' Ho possibilità di trasmettere in più aree consecutive (901, 902, ...)
|
||||
For I As Integer = 1 To m_nSpecialAreas
|
||||
' Leggo la variabile semaforo dell'area I-esima
|
||||
Dim nVal As Integer = -1
|
||||
Dim sVar As String = "#" & (nBase + I).ToString()
|
||||
EgtOutLog( "IndVar=" & sVar)
|
||||
For J As Integer = 1 To 20
|
||||
' Devo rileggere la variabile ad ogni ciclo
|
||||
m_CN.ReadEls_Add_Parameter(sVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If m_CN.n_DReadELS_handle = 3 Then
|
||||
nVal = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
EgtOutLog( "Value=" & nVal.ToString())
|
||||
If nVal <> -1 Then
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Se posso trasmettere
|
||||
If nVal = 0 Then
|
||||
' Assegno numero di programma
|
||||
Dim sNumProg As String = "O0" & ( nBase + I).ToString()
|
||||
EgtOutLog( "NumProg=" & sNumProg)
|
||||
' Eseguo trasmissione
|
||||
Dim bOk As Boolean = ( m_CN.Download_NC_prog(sz_PC_filename, sNumProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "SendResult=" & bOk.ToString())
|
||||
' Se non riuscita riprovo
|
||||
If Not bOk Then
|
||||
bOk = ( m_CN.Download_NC_prog(sz_PC_filename, sNumProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "SecondSendResult=" & bOk.ToString())
|
||||
End If
|
||||
' Se andata a buon fine
|
||||
If bOk Then
|
||||
' Dichiaro programma trasmesso
|
||||
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(sVar, "1")
|
||||
System.Threading.Thread.Sleep(100)
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function SpecialSendCopyProgram(sz_PC_filename As String) As Boolean
|
||||
' Solo per Fanuc
|
||||
If m_nNCType <> 4 Then Return False
|
||||
' Creo path destinazione
|
||||
Try
|
||||
Dim sDestProg As String = m_CurrProjPage.GetCurrentProjectTitle() & ".cnc"
|
||||
Dim sDestPath As String = My.Computer.FileSystem.CombinePath(m_sSpecialDest, sDestProg)
|
||||
My.Computer.FileSystem.CopyFile(sz_PC_filename, sDestPath, True)
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub GetSpecialCAxes()
|
||||
If m_CN.bCPos Then
|
||||
m_CN.d_axis_position(m_nA4) = m_CN.dCPos
|
||||
@@ -1808,4 +2026,16 @@ Public Class IndexArrayToBit
|
||||
m_sNameVar = NameVar
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
' Utlizzata per definire la lista degli assi impostati in macchina
|
||||
Public Class AxisData
|
||||
Public bIsLinear As Boolean
|
||||
Public sName As String
|
||||
Public nIndex As Integer
|
||||
Sub New(_bIsLinear As Boolean, _sName As String, _nINdex As Integer)
|
||||
bIsLinear = _bIsLinear
|
||||
sName = _sName
|
||||
nIndex = _nINdex
|
||||
End Sub
|
||||
End Class
|
||||
@@ -131,6 +131,8 @@ Public MustInherit Class CN_generico
|
||||
Public d_axis_position(MAX_AXES) As Double
|
||||
Public d_axis_delta(MAX_AXES) As Double
|
||||
Public b_axis_valid(MAX_AXES) As Boolean
|
||||
' ver. 2.7h2: gestione del tipo di asse per eseguire una corretta conversione dei dati inch/mm
|
||||
Public b_axis_is_linear(MAX_AXES) As Boolean
|
||||
|
||||
Public d_DReadELS_value As Double
|
||||
Public n_DReadELS_handle As Short
|
||||
@@ -325,6 +327,10 @@ Public MustInherit Class CN_generico
|
||||
Public MustOverride Function Write_var_1(sz_par As String, lvalue As Long) As Int16
|
||||
|
||||
Public MustOverride Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
|
||||
Public Overridable Function Download2_NC_prog(sz_PC_filename As String, sz_NC_Dir As String, sz_NC_filename As String) As Int16
|
||||
Return -1
|
||||
End Function
|
||||
|
||||
Public MustOverride Function Upload_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||
|
||||
|
||||
@@ -1018,7 +1018,7 @@ Module M_Fanuc
|
||||
Function Send_file_to_nc(ByVal szFileToSend As String, ByVal szDirCn As String, ByVal szNameOnNc As String) As Boolean
|
||||
|
||||
Dim szNamePrgCopy As String
|
||||
Dim szProgramDel As String = szDirCn & "\" & szNameOnNc
|
||||
Dim szProgramDel As String
|
||||
Dim b_ret As Boolean = False
|
||||
|
||||
If File.Exists(szFileToSend) Then
|
||||
@@ -1026,7 +1026,11 @@ Module M_Fanuc
|
||||
szNamePrgCopy = InserisciNome(szFileToSend, szNameOnNc) ' correct name inserting for Fanuc 30 series Dim szProgramDel As String = szDirCn & "\" & szNameOnNc
|
||||
|
||||
If szDirCn <> "" Then
|
||||
szProgramDel = szDirCn & "\" & szNameOnNc
|
||||
If szDirCn.EndsWith( "/") Then
|
||||
szProgramDel = szDirCn & szNameOnNc
|
||||
Else
|
||||
szProgramDel = szDirCn & "/" & szNameOnNc
|
||||
End If
|
||||
Else
|
||||
szProgramDel = szNameOnNc
|
||||
End If
|
||||
@@ -1357,8 +1361,6 @@ Module M_Fanuc
|
||||
|
||||
nLen = InStrRev(szFileName, "\")
|
||||
|
||||
'NomeOk = Mid(szFileName, nLen + 1) ' filename ( senza "\"
|
||||
|
||||
szFileProgramma = Mid(szFileName, 1, nLen) ' path ( fino a "\" inclusa )
|
||||
|
||||
szFileProgramma = szFileProgramma & "Temp.txt"
|
||||
@@ -1371,28 +1373,28 @@ Module M_Fanuc
|
||||
nFilew = FreeFile()
|
||||
FileOpen(nFilew, szFileProgramma, OpenMode.Output)
|
||||
|
||||
' PrintLine(nFilew, "%" & vbLf & "<" & NomeSend & ">") ' !!!!!!!! da spostare
|
||||
PrintLine(nFilew, vbLf & "<" & NomeSend & ">") ' !!
|
||||
' scrittura nome programma preceduta da linea vuota
|
||||
If NomeSend.StartsWith( "O") Then
|
||||
PrintLine(nFilew, vbLf & NomeSend)
|
||||
Else
|
||||
PrintLine(nFilew, vbLf & "<" & NomeSend & ">")
|
||||
End If
|
||||
|
||||
'trascrivo file tranne prima linea
|
||||
While (Not EOF(nFiler))
|
||||
' Trascrivo file tranne prima linea
|
||||
While Not EOF(nFiler)
|
||||
|
||||
' leggo linea
|
||||
szLine = LineInput(nFiler)
|
||||
|
||||
' leva linee con % e <e cambia M30 in M99
|
||||
|
||||
' dopo il % serve il nome del programma
|
||||
|
||||
If ((InStr(szLine, "%") > 0)) Then 'leva %
|
||||
' PrintLine(nFilew, szLine)
|
||||
ElseIf ((InStr(szLine, "<") > 0)) Then 'leva <....
|
||||
'PrintLine(nFilew, "<" & NomeSend & ">")
|
||||
' qq
|
||||
ElseIf (Mid(szLine, 1, 1) = "O") Then ' leva le righe Oxxxxx
|
||||
'qq
|
||||
'ElseIf ((InStr(szLine, "M30") > 0)) Then ' cambia M30 in M99
|
||||
' PrintLine(nFilew, "M99")
|
||||
' leva linee con %
|
||||
If InStr(szLine, "%") > 0 Then
|
||||
' Nothing
|
||||
' leva linee con < (se non preceduto da M98)
|
||||
ElseIf InStr(szLine, "<") > 0 AndAlso InStr(szLine, "M98") = 0 Then
|
||||
' Nothing
|
||||
' leva le righe Oxxxxx
|
||||
ElseIf Mid(szLine, 1, 1) = "O" Then
|
||||
' Nothing
|
||||
Else
|
||||
PrintLine(nFilew, szLine)
|
||||
End If
|
||||
@@ -1405,9 +1407,7 @@ Module M_Fanuc
|
||||
FileClose(nFiler)
|
||||
FileClose(nFilew)
|
||||
|
||||
|
||||
Return szFileProgramma
|
||||
|
||||
End Function
|
||||
|
||||
Private Function Get_null_terminated_string(cha As Char()) As String
|
||||
|
||||
@@ -376,7 +376,7 @@ Module M_MMFiles
|
||||
|
||||
execute_command()
|
||||
' Rimango in attesa
|
||||
EgtOutLog(" → CycleStart")
|
||||
EgtOutLog(" -> CycleStart")
|
||||
Return SiemensRet.n_result
|
||||
|
||||
End Function
|
||||
@@ -603,7 +603,7 @@ Module M_MMFiles
|
||||
'EgtOutLog("Write_Nc_var start dell'm_mmFiles")
|
||||
SiemensSend.n_Command = CMD.CMD_Read_NC_subscription
|
||||
SiemensSend.sz_string_2 = VarAddr ' indirizzo su CN dell' oggetto da scrivere
|
||||
EgtOutLog(" → Sottoscrivo lettura di '" & VarAddr & "'")
|
||||
EgtOutLog(" -> Sottoscrivo lettura di '" & VarAddr & "'")
|
||||
SiemensSend.n_param1 = Index ' tipo di dato da scrivere
|
||||
EgtOutLog(" Indice del vettore associato '" & Index & "'")
|
||||
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
|
||||
@@ -734,15 +734,26 @@ Module M_MMFiles
|
||||
' Copia delle quote degli assi
|
||||
For nI As Integer = 0 To (m_Axes_Id.Count() - 1)
|
||||
Dim nId As Short = m_Axes_Id(nI)
|
||||
' agli assi lineari devo applicare il coefficiente
|
||||
If (nId Mod 10) < 3 Then
|
||||
CurrCN.d_axis_position(nI) = SiemensRet.d_interf_axis_position(nId) * LinCoeff
|
||||
CurrCN.d_axis_delta(nI) = SiemensRet.d_interf_axis_delta(nId) * LinCoeff
|
||||
' gli assi rotanti sono sempre in gradi
|
||||
Else
|
||||
CurrCN.d_axis_position(nI) = SiemensRet.d_interf_axis_position(nId)
|
||||
CurrCN.d_axis_delta(nI) = SiemensRet.d_interf_axis_delta(nId)
|
||||
|
||||
'' agli assi lineari devo applicare il coefficiente
|
||||
'If (nId Mod 10) < 3 Then
|
||||
' CurrCN.d_axis_position(nI) = SiemensRet.d_interf_axis_position(nId) * LinCoeff
|
||||
' CurrCN.d_axis_delta(nI) = SiemensRet.d_interf_axis_delta(nId) * LinCoeff
|
||||
' ' gli assi rotanti sono sempre in gradi
|
||||
'Else
|
||||
' CurrCN.d_axis_position(nI) = SiemensRet.d_interf_axis_position(nId)
|
||||
' CurrCN.d_axis_delta(nI) = SiemensRet.d_interf_axis_delta(nId)
|
||||
'End If
|
||||
|
||||
' ver 2.7h2
|
||||
CurrCN.d_axis_position(nI) = SiemensRet.d_interf_axis_position(nId)
|
||||
CurrCN.d_axis_delta(nI) = SiemensRet.d_interf_axis_delta(nId)
|
||||
' verifico se l'indice 'i' è associato ad un asse rotativo oppure lineare
|
||||
If CurrCN.b_axis_is_linear(nI) Then
|
||||
CurrCN.d_axis_position(nI) *= LinCoeff
|
||||
CurrCN.d_axis_delta(nI) *= LinCoeff
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
' Copia variabili R
|
||||
|
||||
@@ -289,7 +289,7 @@ Namespace Num
|
||||
|
||||
' Stringhe valide : "COM" o "XIP01, 0, 10, 0, 0, 0"
|
||||
Dim nret As Integer = NC_connect(m_szCnDataVar(CnData.Comm))
|
||||
EgtOutLog(" → Risultatao apertura connessiione: " & nret)
|
||||
EgtOutLog(" -> Risultato apertura connessione: " & nret)
|
||||
If nret <> 0 Then Return False
|
||||
|
||||
n_state = 2
|
||||
@@ -538,7 +538,7 @@ Namespace Num
|
||||
If nret <> 0 Then
|
||||
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
||||
Else
|
||||
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " → ok")
|
||||
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " -> ok")
|
||||
End If
|
||||
|
||||
global_state = eStateType.READY
|
||||
@@ -928,7 +928,7 @@ Namespace Num
|
||||
' Ultimo numero di segmento invaito
|
||||
Dim i As UInt16
|
||||
' Invia il primo segmento (dati comunicazione)
|
||||
EgtOutLog(" -> Invia il primo segmento " & " → PPport: " & n_PPport & " → NC file name: " & sz_PC_filename & " → Dnc Mode: " & DNC_MODE_FIRST)
|
||||
EgtOutLog(" -> Invia il primo segmento " & " -> PPport: " & n_PPport & " -> NC file name: " & sz_PC_filename & " -> Dnc Mode: " & DNC_MODE_FIRST)
|
||||
Dim nRet As Int16 = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_FIRST, i)
|
||||
' Inserisco un tempo di attesa di sicurezza
|
||||
Thread.Sleep(100)
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
<Compile Include="DirectCuts\SquaringUC.xaml.vb">
|
||||
<DependentUpon>SquaringUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DirectCuts\VarMdiCommand.vb" />
|
||||
<Compile Include="DrawImport\AlzFrontUC.xaml.vb">
|
||||
<DependentUpon>AlzFrontUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -1157,7 +1158,7 @@
|
||||
<Resource Include="Resources\NewIcons\MHT.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\logo-OmCut.png" />
|
||||
<Resource Include="Resources\NewIcons\Logo-OmagCut.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\PartRotOff.png" />
|
||||
@@ -1364,7 +1365,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Spiral.png" />
|
||||
<Resource Include="Resources\NewIcons\Drag_Rettangle.png" />
|
||||
<Resource Include="Resources\NewIcons\Drag_Rectangle.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\GenerateCN.png" />
|
||||
@@ -1419,12 +1420,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %282%29.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %283%29.png" />
|
||||
<Resource Include="Resources\NewIcons\RawHeight.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -1447,6 +1442,12 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\icoBottom-3D.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\DatiMacchina1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\DatiMacchina2.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<BitmapImage x:Key="ZoomInImg" UriSource="Resources/NewIcons/Zoom+.png"></BitmapImage>
|
||||
<BitmapImage x:Key="ZoomOutImg" UriSource="Resources/NewIcons/Zoom-.png"></BitmapImage>
|
||||
<BitmapImage x:Key="ZoomWinImg" UriSource="Resources/NewIcons/ZoomWIn.png"></BitmapImage>
|
||||
<BitmapImage x:Key="LogoOmagImg" UriSource="Resources/NewIcons/logo-OmCut.png"></BitmapImage>
|
||||
<BitmapImage x:Key="LogoOmagImg" UriSource="Resources/NewIcons/Logo-OmagCut.png"></BitmapImage>
|
||||
|
||||
<!--Nuove icone da sistemare-->
|
||||
<BitmapImage x:Key="AvantiVeloceImg" UriSource="Resources/NewIcons/AvantiVeloce.png"></BitmapImage>
|
||||
@@ -113,7 +113,7 @@
|
||||
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Drag_RectangleImg" UriSource="Resources/NewIcons/Drag_Rectangle.png"></BitmapImage>
|
||||
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_CurrProjSummeryTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Setter Property="Margin" Value="6,0,0,0"/>
|
||||
</Style>
|
||||
@@ -639,10 +639,10 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_LowerCaseCharacterTextBlock" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="GroupBoxHeaderTemplate">
|
||||
@@ -748,8 +748,80 @@
|
||||
|
||||
<!--TextBlock per elementi delle ListBox-->
|
||||
|
||||
<Style x:Key="OmagCut_ListBoxTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Style x:Key="OmagCut_ListBoxTextBlock" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!--DataTemplate testo ed immagine-->
|
||||
<DataTemplate x:Key="DataTemplateItem">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />-->
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Style="{DynamicResource OmagCut_ListBoxIcon}" />
|
||||
<!--<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" VerticalAlignment="Center" />-->
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" Style="{DynamicResource OmagCut_ListBoxTextBlock}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- ListBoxItem -->
|
||||
|
||||
<Style x:Key="ItemList" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Setter Property="Margin" Value="1,0,1,0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="Padding" Value="2"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Border x:Name="Bd"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="White"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="false"/>
|
||||
<Condition Property="IsMouseOver" Value="true"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="LightGray"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="true"/>
|
||||
<Condition Property="Selector.IsSelectionActive" Value="false"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="LightGray"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="White"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -189,12 +189,13 @@
|
||||
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Drag_RectangleImg" UriSource="Resources/NewIcons/Drag_Rectangle.png"></BitmapImage>
|
||||
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
|
||||
|
||||
<!--Machine-->
|
||||
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
|
||||
<BitmapImage x:Key="DatiMacchinaImg1" UriSource="Resources/NewIcons/DatiMacchina1.png"></BitmapImage>
|
||||
<BitmapImage x:Key="DatiMacchinaImg2" UriSource="Resources/NewIcons/DatiMacchina2.png"></BitmapImage>
|
||||
<BitmapImage x:Key="DB-lavorazioniImg" UriSource="Resources/NewIcons/DB-lavorazioni.png"></BitmapImage>
|
||||
<BitmapImage x:Key="DB-utensiliImg" UriSource="Resources/NewIcons/DB-utensili.png"></BitmapImage>
|
||||
<BitmapImage x:Key="MacchinaImg" UriSource="Resources/NewIcons/Macchina.png"></BitmapImage>
|
||||
@@ -1039,6 +1040,7 @@
|
||||
|
||||
<!--TextBlock per elementi delle ListBox-->
|
||||
<Style x:Key="OmagCut_LowerCaseCharacterTextBlock" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_Black}"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
@@ -1046,6 +1048,8 @@
|
||||
|
||||
<Style x:Key="OmagCut_ListBoxTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_CurrProjSummeryTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
|
||||
@@ -1115,9 +1119,10 @@
|
||||
|
||||
<!-- ListBoxItem -->
|
||||
|
||||
<Style TargetType="{x:Type ListBoxItem}">
|
||||
<Style x:Key="ItemList" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Setter Property="Margin" Value="1,0,1,0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
|
||||
@@ -38,7 +38,7 @@ Public Class OptionsPageUC
|
||||
FractionPatternCmBx.SelectedIndex = nCurrFractionPattern
|
||||
EgtWPFLib.FractionStringConverter.SetCurrFractionPattern(nCurrFractionPattern)
|
||||
|
||||
' Imposto la preciosne della rappresentazione frazionaria
|
||||
' Imposto la precisione della rappresentazione frazionaria
|
||||
dPrecision = CDbl(GetPrivateProfileInt(S_GENERAL, K_PRECISION, 64, m_MainWindow.GetIniFile()))
|
||||
Dim Index As Integer = PrecisionCmBx.Items.IndexOf(dPrecision)
|
||||
PrecisionCmBx.SelectedIndex = Index
|
||||
@@ -49,7 +49,7 @@ Public Class OptionsPageUC
|
||||
|
||||
' Carico la lista con il tipo di avvio
|
||||
StartLauncherCmBx.ItemsSource = StartLauncherList
|
||||
' 0-New, 1-Last, 2-Open, 3-Window
|
||||
' 0-Ultimo progetto, 1-Nuovo progetto, 2-Apri cartella, 3-Mostra finestra
|
||||
StartLauncherCmBx.SelectedIndex = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
|
||||
' Rendo invisibile il GroupBox dei Temi la versione corrente
|
||||
|
||||
@@ -89,7 +89,7 @@ Public Class AddToDataBaseUC
|
||||
If Not EgtPHOTOLib.MainData.bEnableTextId Then
|
||||
WritePrivateProfileString(S_SCRAPS, K_LASTBLOCK, EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock, m_OmagPhotoWD.m_MainWindow.GetIniFile())
|
||||
End If
|
||||
' aggiorno il testo del messaggio "Add" → "Save"
|
||||
' aggiorno il testo del messaggio "Add" -> "Save"
|
||||
AddBtn.Content = EgtMsg(91252) ' Save
|
||||
|
||||
' notifico che da ora la lastra inserita è in modalità di modifica (non salvo la lastra come nuova, ma la sovrascrivo come in modifica)
|
||||
|
||||
@@ -330,13 +330,18 @@ Public Class CurrentProjectPageUC
|
||||
EgtSetCurrentContext(CurrentProjectScene.GetCtx())
|
||||
' Cancello eventuali messaggi
|
||||
ClearMessage()
|
||||
' Se è stata modificata l'uso della lama inclinata allora aggiorno anche questa lavorazione
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
' assegno la lavorazione corrente per i tagli di lama inclinati (solo se specificato nella ComboBox della ChooseMachinig)
|
||||
RestoreDef_Machinig(True)
|
||||
End If
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
If nWarn = 1 Then SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseDownScene
|
||||
@@ -434,7 +439,7 @@ Public Class CurrentProjectPageUC
|
||||
m_dRawHeight = 0
|
||||
UpdateHeightTxBx()
|
||||
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGroupInPark()
|
||||
' Parcheggio correttamente i pezzi precedentemente salvati
|
||||
Dim nIdList As New List(Of Integer)
|
||||
Dim nStatList As New List(Of Integer)
|
||||
@@ -550,9 +555,7 @@ Public Class CurrentProjectPageUC
|
||||
' carica ultimo progetto
|
||||
Friend Function LoadProject(ByVal sPath As String, Optional ByVal bUpdateIndex As Boolean = True) As Boolean
|
||||
' Se richiesto, imposto nuovo indice di progetto
|
||||
If bUpdateIndex Then
|
||||
SetNextProjectIndex()
|
||||
End If
|
||||
If bUpdateIndex Then SetNextProjectIndex()
|
||||
' Carico il file del progetto
|
||||
EgtOutLog("LoadProject : " & sPath & " (" & m_nCurrProj.ToString() & ")")
|
||||
If Not LoadFile(sPath) Then
|
||||
@@ -569,39 +572,42 @@ Public Class CurrentProjectPageUC
|
||||
UpdateHeightTxBx()
|
||||
' aggiorno materiale
|
||||
m_MainWindow.m_CurrentMachine.SetCurrMatByName(GetProjectMaterial())
|
||||
' recupero Id del gruppo "OmagCUT"
|
||||
Dim nProjMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
' aggiorno altezza sovaratavola
|
||||
If GetPrivateProfileInt(S_GENERAL, "AdditionalTableByProj", 0, m_sIniFile) = 1 Then
|
||||
' leggo il valore OrigiAdditionalTable
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ADD_TAB_BY_PROJ, 0, m_sIniFile) = 1 Then
|
||||
' leggo il valore OrigAdditionalTable
|
||||
Dim dValue As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable
|
||||
Dim sKey As String = K_ADDITIONALTABLE
|
||||
Select Case GetCurrentTable()
|
||||
Case 4
|
||||
sKey = K_TAB4_ADDITIONALTABLE
|
||||
Case 3
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
|
||||
sKey = K_TAB3_ADDITIONALTABLE
|
||||
Case 2
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
|
||||
Case Else
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
|
||||
sKey = K_TAB2_ADDITIONALTABLE
|
||||
End Select
|
||||
EgtGetInfo(nProjMarkId, sKey, dValue)
|
||||
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
||||
End If
|
||||
' forzo visualizzazione eventuali dati su aree
|
||||
' Forzo visualizzazione eventuali dati su aree
|
||||
SetAreasStatus(True)
|
||||
' Recupero info C Home
|
||||
' Recupero info C_Home corrente
|
||||
Dim dCHomeCurrMach As Double
|
||||
Dim dCHomeCurrproj As Double
|
||||
EgtGetAxisHomePos("C", dCHomeCurrMach)
|
||||
' Verifico che esista l'info del progetto
|
||||
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
|
||||
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
|
||||
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||
' Verifico C_Home del progetto
|
||||
Dim dCHomeCurrproj As Double
|
||||
If EgtGetInfo(nProjMarkId, INFO_CAXESHOME, dCHomeCurrproj) Then
|
||||
' Recupero tipo di ventose usate
|
||||
Dim nVacType As Integer = 0
|
||||
EgtGetInfo(EgtGetHeadId("H4"), KEY_VAC_TYPE, nVacType)
|
||||
' Se ventose di lato alla testa e C_Home diverso, registro un problema
|
||||
If nVacType = 2 And Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
|
||||
End If
|
||||
Else
|
||||
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
EgtSetInfo(nProjMarkId, INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Dichiaro progetto non modificato
|
||||
EgtResetModified()
|
||||
Return True
|
||||
@@ -627,7 +633,7 @@ Public Class CurrentProjectPageUC
|
||||
' Se la macchina del file è quella impostata
|
||||
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
|
||||
AdjustAdditionalTable(True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
Else
|
||||
' Emetto messaggio
|
||||
Dim sOut As String = EgtMsg(90320) & " (" & sFileMachine & ")" ' Macchina diversa
|
||||
@@ -703,7 +709,7 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Notifico a foto il cambio di path
|
||||
EgtChangePhotoPath(nPhotoId, sNewPhoto)
|
||||
' Altrimenti cancello eventuali file di foto associabili al progetto
|
||||
' Altrimenti cancello eventuali file di foto associabili al progetto
|
||||
Else
|
||||
Dim sPhoto1 As String = Path.ChangeExtension(sPath, "jpg")
|
||||
Dim sPhoto2 As String = Path.ChangeExtension(sPath, "png")
|
||||
@@ -722,10 +728,11 @@ Public Class CurrentProjectPageUC
|
||||
End Try
|
||||
End If
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido
|
||||
AddProjectMark()
|
||||
' Assegno indice di progetto e materiale
|
||||
SetProjectIndexFlag()
|
||||
SetProjectMaterial()
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
' Assegno nome, indice di progetto e materiale
|
||||
SetProjectName( nMarkId)
|
||||
SetProjectIndex( nMarkId)
|
||||
SetProjectMaterial( nMarkId)
|
||||
' Eseguo
|
||||
If Not SaveFile(sPath) Then Return False
|
||||
' aggiungo il file all'elenco dei file recenti
|
||||
@@ -754,9 +761,7 @@ Public Class CurrentProjectPageUC
|
||||
Dim CurrProjName As String = String.Empty
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
||||
' Se nome vuoto, non salvo
|
||||
If String.IsNullOrEmpty(CurrProjName) Then
|
||||
Return False
|
||||
End If
|
||||
If String.IsNullOrEmpty(CurrProjName) Then Return False
|
||||
Dim sPath As String = m_MainWindow.GetNamedSaveDir() & "\" & CurrProjName & ".nge"
|
||||
' Rinomino eventuale fotografia
|
||||
Dim nPhotoId As Integer = GetPhoto()
|
||||
@@ -779,8 +784,8 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
|
||||
'--------------------------------------------------------------------------------
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
' Gestione visulizzazione lista pezzi in parcheggio
|
||||
If m_MainWindow.EnabledDxfPark() Then
|
||||
' Gestione visualizzazione lista pezzi in parcheggio
|
||||
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
|
||||
SelParkIndWD.CopyImgSvg(sPath)
|
||||
SelParkIndWD.sActualProj = String.Empty
|
||||
@@ -789,11 +794,13 @@ Public Class CurrentProjectPageUC
|
||||
'--------------------------------------------------------------------------------
|
||||
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido
|
||||
AddProjectMark()
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
' Assegno nome, indice di progetto e materiale
|
||||
SetProjectName( nMarkId)
|
||||
SetProjectIndex( nMarkId)
|
||||
SetProjectMaterial( nMarkId)
|
||||
' Eseguo
|
||||
If Not SaveFile(sPath) Then
|
||||
Return False
|
||||
End If
|
||||
If Not SaveFile(sPath) Then Return False
|
||||
' aggiungo il file all'elenco dei file recenti
|
||||
m_MruFiles.Add(sPath)
|
||||
' Dichiaro progetto non modificato
|
||||
@@ -830,6 +837,15 @@ Public Class CurrentProjectPageUC
|
||||
Friend Function GetCurrentProject() As Integer
|
||||
Return m_nCurrProj
|
||||
End Function
|
||||
|
||||
Friend Function GetCurrentProjectTitle() As String
|
||||
Dim CurrProjName As String = ""
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
||||
If String.IsNullOrWhiteSpace(CurrProjName) Then
|
||||
CurrProjName = Math.Abs(m_nCurrProj).ToString("D4")
|
||||
End If
|
||||
Return CurrProjName
|
||||
End Function
|
||||
|
||||
Friend Function GetCurrentProjectName() As String
|
||||
Dim CurrProjName As String = String.Empty
|
||||
@@ -902,22 +918,16 @@ Public Class CurrentProjectPageUC
|
||||
End Function
|
||||
|
||||
Friend Function AddProjectMark() As Integer
|
||||
' Recupero flag di tagli ridotti
|
||||
Dim nReducedCut As Integer = GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 1, m_MainWindow.GetMachIniFile())
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido e imposto flag dei tagli ridotti
|
||||
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
If nMarkId = GDB_ID.NULL Then
|
||||
nMarkId = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetName(nMarkId, NAME_PROJMARK)
|
||||
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||
' altrimenti, aggiorno il flag dei tagli ridotti
|
||||
Else
|
||||
Dim nMarkReducedCut As Integer = 0
|
||||
If Not EgtGetInfo(nMarkId, INFO_REDUCEDCUT, nMarkReducedCut) OrElse nMarkReducedCut <> nReducedCut Then
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||
End If
|
||||
End If
|
||||
' Recupero flag di tagli ridotti e lo imposo o aggiorno nel progetto
|
||||
Dim nReducedCut As Integer = GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 1, m_MainWindow.GetMachIniFile())
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut, True)
|
||||
Return nMarkId
|
||||
End Function
|
||||
|
||||
@@ -982,9 +992,16 @@ Public Class CurrentProjectPageUC
|
||||
Return (nFlag <> 0)
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectIndexFlag() As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJINDEX, Math.Abs(m_nCurrProj))
|
||||
Friend Function SetProjectName( Optional nMarkId As Integer = GDB_ID.NULL) As Boolean
|
||||
If nMarkId = GDB_ID.NULL Then nMarkId = AddProjectMark()
|
||||
Dim sCurrProjName As String = String.Empty
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrProjName, m_MainWindow.GetIniFile())
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJNAME, sCurrProjName, True)
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectIndex( Optional nMarkId As Integer = GDB_ID.NULL) As Boolean
|
||||
If nMarkId = GDB_ID.NULL Then nMarkId = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJINDEX, Math.Abs(m_nCurrProj), True)
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectOrder(sOrder As String) As Boolean
|
||||
@@ -1012,13 +1029,10 @@ Public Class CurrentProjectPageUC
|
||||
Return EgtRemoveInfo(nMarkId, INFO_LASTSLAB)
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectMaterial() As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
If Not IsNothing(m_MainWindow.m_CurrentMachine.CurrMat) Then
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJMAT, m_MainWindow.m_CurrentMachine.CurrMat.sName)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Friend Function SetProjectMaterial( Optional nMarkId As Integer = GDB_ID.NULL) As Boolean
|
||||
If nMarkId = GDB_ID.NULL Then nMarkId = AddProjectMark()
|
||||
If IsNothing(m_MainWindow.m_CurrentMachine.CurrMat) Then Return False
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJMAT, m_MainWindow.m_CurrentMachine.CurrMat.sName, True)
|
||||
End Function
|
||||
|
||||
Friend Function GetProjectMaterial() As String
|
||||
@@ -1068,7 +1082,7 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
Friend Sub UpdateMachiningTxBx()
|
||||
' se macchina waterjet e senza uscita lama allora visualizzo info WJ
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And Not m_MainWindow.m_CurrentMachine.ExistsSawHead() Then
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
|
||||
'& "-" & m_MainWindow.m_CurrentMachine.sCurrWaterJettingQuality
|
||||
Else
|
||||
|
||||
@@ -68,7 +68,7 @@ Public Class OmagPhotoWD
|
||||
End If
|
||||
|
||||
'--------------- DEFINSCO nuova lastra esistente ---------------
|
||||
' imposto come prima pagina sempre la lista (per inizializzare gli elementi della libreria) → ACCELERARE il processo di creazione di questo oggetto!
|
||||
' imposto come prima pagina sempre la lista (per inizializzare gli elementi della libreria) -> ACCELERARE il processo di creazione di questo oggetto!
|
||||
EgtPHOTOLib.PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.NEWSLAB
|
||||
' imposto il percoso della foto appena generato
|
||||
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ImagePath = sImage
|
||||
@@ -142,7 +142,7 @@ Public Class OmagPhotoWD
|
||||
m_AddToDataBaseUC.MatTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Material
|
||||
m_AddToDataBaseUC.ThicknessTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness
|
||||
m_AddToDataBaseUC.ProjectTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo
|
||||
' aggiorno il testo del messaggio "Add" → "Save"
|
||||
' aggiorno il testo del messaggio "Add" -> "Save"
|
||||
m_AddToDataBaseUC.AddBtn.Content = EgtMsg(91252) ' Save
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White"
|
||||
<TextBlock Name="FilePathTxBl" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<Grid Grid.Row="1" Grid.RowSpan="2">
|
||||
@@ -46,7 +46,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox Name="FileListBox"
|
||||
ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
ItemsSource="{Binding ItemList}"/>
|
||||
ItemsSource="{Binding ItemList}"
|
||||
ItemContainerStyle="{DynamicResource ItemList}"/>
|
||||
|
||||
<Grid Grid.Row="1" Margin="0,0,8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -317,7 +317,7 @@ Public Class OpenPageUC
|
||||
SelParkIndWD.sActualProj = sPath
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd, OpenScene.GetCtx)
|
||||
If ListParkInd.Count > 2 And GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
If m_MainWindow.EnabledDxfPark() And ListParkInd.Count > 2 Then
|
||||
m_SelParkInd = New SelParkIndWD(m_MainWindow, OpenScene.GetCtx)
|
||||
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
|
||||
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
PlacementTarget="{Binding ElementName=ResetCutBtn}">
|
||||
<WrapPanel Orientation="Vertical"
|
||||
Background="{DynamicResource OmagCut_Gray}">
|
||||
<Button x:Name="ResetCut1Btn"
|
||||
<Button x:Name="ResetCut2Btn"
|
||||
Width ="78" Height="78"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button x:Name="ResetCut2Btn"
|
||||
<Button x:Name="ResetCut1Btn"
|
||||
Width ="78" Height="78"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
</WrapPanel>
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
Imports EgtWPFLib
|
||||
|
||||
Public Class ProjectMgrUC
|
||||
' Creo una varibile statica per verificare di non stampare due volte lo stesso messaggio
|
||||
Public Shared bFirstRun As Boolean = True
|
||||
|
||||
' Riferimenti a pagine (condivisi tra tutte le istanze della classe)
|
||||
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private Shared m_CurrProjPage As CurrentProjectPageUC
|
||||
@@ -11,6 +14,7 @@ Public Class ProjectMgrUC
|
||||
' usato per scrivere i comadi di movimento test lavorazione
|
||||
Friend m_CN As CN_generico
|
||||
|
||||
' L'inizializzazine avviene 2 volte: una per i tagli CAD ed una per le cornici
|
||||
Private Sub ProjectMgrUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
NewBtn.ToolTip = EgtMsg(90303) ' Nuovo
|
||||
@@ -21,9 +25,12 @@ Public Class ProjectMgrUC
|
||||
VeinMatchingBtn.ToolTip = EgtMsg(90309) ' Vein Match
|
||||
|
||||
RegisterBtn.Content = "REG" ' Shape Registration
|
||||
ResetCutBtn.Content = EgtMsg(90336) ' Reset
|
||||
ResetCut2Btn.Content = EgtMsg(91024) ' Reset lavorazioni
|
||||
ResetCut1Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
|
||||
|
||||
'ResetCutBtn.Content = EgtMsg(90336) ' Reset
|
||||
'ResetCut2Btn.Content = EgtMsg(91024) ' Reset lavorazioni
|
||||
'ResetCut1Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
|
||||
PopulateListCmdReset()
|
||||
|
||||
SimulateBtn.ToolTip = EgtMsg(90301) ' Simulate - Simula
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||
WorkBtn.ToolTip = EgtMsg(90310) ' Export - Esporta
|
||||
@@ -255,6 +262,8 @@ Public Class ProjectMgrUC
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
#Region "RESET"
|
||||
|
||||
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
|
||||
If ResetCutPopUp.IsOpen Then
|
||||
@@ -263,18 +272,28 @@ Public Class ProjectMgrUC
|
||||
ResetCutPopUp.IsOpen = True
|
||||
End If
|
||||
Else
|
||||
ResetCut3Btn_Click()
|
||||
CallFunction(0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Reimposto le feed di tutte le lavorazioni
|
||||
Private Sub ResetCut1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut1Btn.Click
|
||||
CallFunction(1)
|
||||
End Sub
|
||||
|
||||
' Reimposto le lavorazioni di default e ripristino i parametri
|
||||
Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click
|
||||
CallFunction(2)
|
||||
End Sub
|
||||
|
||||
' Reimposto le feed di tutte le lavorazioni
|
||||
Private Sub FeedReset()
|
||||
' 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
|
||||
Private Sub HardReset()
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Cancello eventuali messaggi
|
||||
m_CurrProjPage.ClearMessage()
|
||||
@@ -283,7 +302,7 @@ Public Class ProjectMgrUC
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' cancello tutti i ponticelli disegnati
|
||||
ResetAllBRidges()
|
||||
ResetAllBridges()
|
||||
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||
ResetAllSplitCut()
|
||||
|
||||
@@ -296,7 +315,7 @@ Public Class ProjectMgrUC
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
' Se esistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
ResetAllRawPart()
|
||||
' Aggiorno Info C Home
|
||||
Dim dCHome As Double
|
||||
@@ -307,7 +326,7 @@ Public Class ProjectMgrUC
|
||||
End Sub
|
||||
|
||||
' Resetta i valori dei parametri (ma non le lavorazioni)
|
||||
Private Sub ResetCut3Btn_Click()
|
||||
Private Sub StandardReset()
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Cancello eventuali messaggi
|
||||
m_CurrProjPage.ClearMessage()
|
||||
@@ -316,14 +335,14 @@ Public Class ProjectMgrUC
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' cancello tutti i ponticelli disegnati
|
||||
ResetAllBRidges()
|
||||
ResetAllBridges()
|
||||
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||
ResetAllSplitCut()
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(90351)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
' Se esistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||
ResetAllRawPart()
|
||||
' Aggiorno Info C Home
|
||||
Dim dCHome As Double
|
||||
@@ -333,6 +352,96 @@ Public Class ProjectMgrUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Const HARD_RESET As String = "HARD"
|
||||
Private Const STANDARD_RESET As String = "STANDARD"
|
||||
Private Const FEED_RESET As String = "FEED"
|
||||
|
||||
Private Enum RESET_TYPE
|
||||
HARD
|
||||
STANDARD
|
||||
FEED
|
||||
End Enum
|
||||
|
||||
Private m_ListCmdReset As New List(Of RESET_TYPE) From {RESET_TYPE.HARD, RESET_TYPE.STANDARD, RESET_TYPE.FEED}
|
||||
|
||||
Private Sub CallFunction(IndexListCmdReset As Integer)
|
||||
Select Case m_ListCmdReset(IndexListCmdReset)
|
||||
Case RESET_TYPE.STANDARD
|
||||
EgtOutLog("STNADRD Reset")
|
||||
StandardReset()
|
||||
Case RESET_TYPE.HARD
|
||||
EgtOutLog("HARD Reset")
|
||||
HardReset()
|
||||
Case RESET_TYPE.FEED
|
||||
EgtOutLog("FEED Reset")
|
||||
FeedReset()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub SetBtnResetContent(IndexListCmdReset As Integer, Btn As Button)
|
||||
Select Case m_ListCmdReset(IndexListCmdReset)
|
||||
Case RESET_TYPE.STANDARD
|
||||
Btn.Content = EgtMsg(90336) ' Reset
|
||||
Case RESET_TYPE.HARD
|
||||
Btn.Content = EgtMsg(91024) ' Reset lavorazioni
|
||||
Case RESET_TYPE.FEED
|
||||
Btn.Content = EgtMsg(91025) ' Aggiorna feed/speed
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub PopulateListCmdReset()
|
||||
Dim sConfig As String = "HARD,STANDARD,FEED"
|
||||
GetPrivateProfileString(S_GENERAL, "ResetCmd", sConfig, sConfig, m_MainWindow.GetIniFile())
|
||||
Dim sItems As String() = sConfig.Split(",")
|
||||
' VERIFICA della lettura configurazione
|
||||
If sItems.Count <> 3 Then
|
||||
If bFirstRun Then
|
||||
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
|
||||
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED'")
|
||||
End If
|
||||
Else
|
||||
Dim bOk As Boolean = True
|
||||
Dim sErrMsg As String = String.Empty
|
||||
' popolo una lista di appoggio
|
||||
Dim TempList As New List(Of RESET_TYPE) From {RESET_TYPE.STANDARD, RESET_TYPE.STANDARD, RESET_TYPE.STANDARD}
|
||||
For Index As Integer = 0 To sItems.Count - 1
|
||||
If sItems(Index).Trim = STANDARD_RESET Then
|
||||
TempList(Index) = RESET_TYPE.STANDARD
|
||||
ElseIf sItems(Index).Trim = HARD_RESET Then
|
||||
TempList(Index) = RESET_TYPE.HARD
|
||||
ElseIf sItems(Index).Trim = FEED_RESET Then
|
||||
TempList(Index) = RESET_TYPE.FEED
|
||||
Else
|
||||
bOk = False
|
||||
sErrMsg = sErrMsg & If(String.IsNullOrEmpty(sErrMsg), "", ",") & sItems(Index).Trim
|
||||
End If
|
||||
Next
|
||||
' verifico che non ci siano elementi ripetuti nella lista
|
||||
If Not bOk Then
|
||||
If bFirstRun Then
|
||||
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
|
||||
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED' (i seguenti parametri non sono decodificati: " &
|
||||
sErrMsg & " )")
|
||||
End If
|
||||
ElseIf TempList(0) = TempList(1) Or TempList(0) = TempList(2) Or TempList(1) = TempList(2) Then
|
||||
If bFirstRun Then
|
||||
EgtOutLog("WARNING configurazione: in Config.ini del programma nella sezione 'General/ResetCmd' " &
|
||||
"non trovato una sequenza del tipo 'HARD,STANDARD,FEED' (due o più dati sono ripetuti)")
|
||||
End If
|
||||
Else
|
||||
m_ListCmdReset = TempList
|
||||
End If
|
||||
End If
|
||||
|
||||
SetBtnResetContent(0, ResetCutBtn)
|
||||
SetBtnResetContent(1, ResetCut1Btn)
|
||||
SetBtnResetContent(2, ResetCut2Btn)
|
||||
|
||||
bFirstRun = False
|
||||
End Sub
|
||||
|
||||
#End Region ' Reset
|
||||
|
||||
Private Sub SimulateBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulateBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
@@ -352,7 +461,7 @@ Public Class ProjectMgrUC
|
||||
#If TRIAL Then
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
#Else
|
||||
' se sono in modalità Test allora eseguo solo il posizionamento della lama
|
||||
' Se sono in modalità Test Posizione lavorazione
|
||||
If m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv Then
|
||||
' Verifico non sia versione Ufficio
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||
@@ -372,9 +481,6 @@ Public Class ProjectMgrUC
|
||||
If Not TestToolWD.DialogResult Then Return
|
||||
Dim CurrTestTool As TestTool = TestToolWD.GetSelectedTool
|
||||
|
||||
'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'EgtTdbSetCurrTool(sSaw)
|
||||
|
||||
Dim dThick As Double = 0
|
||||
Dim dHeight As Double = 0
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
@@ -395,8 +501,7 @@ Public Class ProjectMgrUC
|
||||
dThick = dThick / 2
|
||||
End If
|
||||
|
||||
|
||||
'recupero il lato selezionato
|
||||
' recupero il lato selezionato
|
||||
Dim nIdSelected As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv
|
||||
If nIdSelected = -1 Then Return
|
||||
' recupero il vettore nel punto medio dell'entità
|
||||
@@ -408,16 +513,14 @@ Public Class ProjectMgrUC
|
||||
vtDirT.Normalize()
|
||||
' calcolo la direzione di offset da applicare all'utensile
|
||||
Dim vtOffset As New Vector3d(vtDirT.x, vtDirT.y, vtDirT.z)
|
||||
vtOffset.Rotate(Vector3d.Z_AX, 90)
|
||||
vtOffset.Rotate(Vector3d.Z_AX(), 90)
|
||||
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
||||
vtDirT.Rotate(Vector3d.Z_AX, 90)
|
||||
vtDirT.Rotate(Vector3d.Z_AX(), 90)
|
||||
Else
|
||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
||||
vtDirT.Rotate(Vector3d.Z_AX, 90)
|
||||
' calcolo il versore perpendicolare al piano di taglio (diretto verso l'interno dell'utensile)
|
||||
vtDirT.Rotate(vtDirLine, 90)
|
||||
' direzione utensile sempre Z+
|
||||
vtDirT = Vector3d.Z_AX()
|
||||
End If
|
||||
|
||||
' Calcolo punto di posizionamemto (punto medio)
|
||||
@@ -435,50 +538,66 @@ Public Class ProjectMgrUC
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
|
||||
' Imposto la lama corrente, preso dalla scelta precedente
|
||||
'If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Imposto l'utensile corrente, preso dalla scelta precedente
|
||||
If Not EgtSetCalcTool(CurrTestTool.ToolName, CurrTestTool.ToolHead, CurrTestTool.ToolExit) Then Return
|
||||
Dim vsAxNames As String() = Nothing
|
||||
EgtGetAllCurrAxesNames( vsAxNames)
|
||||
Dim nRotAxCnt As Integer = vsAxNames.Count() - 3
|
||||
|
||||
' calcolo la posizione degli assi rotanti C, B
|
||||
Dim nStat As Integer
|
||||
Dim dC1, dB1, dC2, dB2 As Double
|
||||
' Se utensile LAMA
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
' Se LAMA
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
' Se LASER
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Se LASER
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Forzo B90
|
||||
' Se asse C non calcolato, imposto il valore di Home
|
||||
If nRotAxCnt = 0 Or nStat < 0 Then
|
||||
dC1 = dHomeC
|
||||
dC2 = dHomeC
|
||||
End If
|
||||
' Forzo asse B a 90 (per le lame)
|
||||
dB1 = 90
|
||||
' Forzo la pozione in Z alla quota di Home (per evitare l'errore di fine corsa asse Z)
|
||||
Dim dHomeZ As Double = 0
|
||||
EgtGetAxisHomePos("Z", dHomeZ)
|
||||
ptMid.z = dHomeZ
|
||||
Else
|
||||
' Se utensile speciale
|
||||
If CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
' Se FRESA/FORETTO
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
' Se WJ
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se FRESA o FORETTO
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se asse C non calcolato, imposto il valore preferenziale
|
||||
If nStat < 0 Then
|
||||
dC1 = nStepRotC
|
||||
dC2 = nStepRotC
|
||||
End If
|
||||
' Se WATERJET
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se asse C non calcolato, imposto il valore di Home
|
||||
If nStat < 0 Then
|
||||
dC1 = dHomeC
|
||||
dC2 = dHomeC
|
||||
End If
|
||||
End If
|
||||
|
||||
' calcolo la posizione degli assi lineari X, Y, Z
|
||||
Dim dX, dY, dZ As Double
|
||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||
' Se laser, forzo la Z alla quota di Home
|
||||
If CurrTestTool.ToolIsLaser Then
|
||||
Dim dHomeZ As Double = 0
|
||||
EgtGetAxisHomePos("Z", dHomeZ)
|
||||
dZ = dHomeZ
|
||||
End If
|
||||
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
@@ -486,35 +605,56 @@ Public Class ProjectMgrUC
|
||||
EgtOutLog("Out of stroke: " & nStat)
|
||||
vtDirT = -vtDirT
|
||||
ptMid -= vtDirT * dThick
|
||||
' Se LAMA
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
' Se LASER
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Se LASER
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se asse C non calcolato, imposto il valore di Home
|
||||
If nRotAxCnt = 0 Or nStat < 0 Then
|
||||
dC1 = dHomeC
|
||||
dC2 = dHomeC
|
||||
End If
|
||||
' Forzo B90
|
||||
dB1 = 90
|
||||
Else
|
||||
If CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
' Se FRESA/FORETTO
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
' Se WJ
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se FRESA/FORETTO
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se asse C non calcolato, imposto il valore preferenziale
|
||||
If nStat < 0 Then
|
||||
dC1 = nStepRotC
|
||||
dC2 = nStepRotC
|
||||
End If
|
||||
' Se WATERJET
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
' Se WJ
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Se asse C non calcolato, imposto il valore di Home
|
||||
If nStat < 0 Then
|
||||
dC1 = dHomeC
|
||||
dC2 = dHomeC
|
||||
End If
|
||||
End If
|
||||
' calcolo la posizione degli assi lineari X, Y, Z ( correggere il punto ptMid.z sommando il raggio utensile)
|
||||
' calcolo la posizione degli assi lineari X, Y, Z
|
||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||
' Se laser, forzo la Z alla quota di Home
|
||||
If CurrTestTool.ToolIsLaser Then
|
||||
Dim dHomeZ As Double = 0
|
||||
EgtGetAxisHomePos("Z", dHomeZ)
|
||||
dZ = dHomeZ
|
||||
End If
|
||||
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
@@ -524,19 +664,13 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
|
||||
'--------------------------- Comunico i movimenti in origine macchina al CN ----------------------------------------
|
||||
Dim ptMachine As Point3d = New Point3d(dX, dY, If(CurrTestTool.ToolIsLaser, 0, dZ))
|
||||
ExecuteCommandCNC(ptMachine, dC1, dB1, CurrTestTool)
|
||||
ExecuteTestMoveCNC(New Point3d(dX, dY, dZ), dC1, dB1, CurrTestTool)
|
||||
Return
|
||||
End If
|
||||
' ---------------------------- Fine modalità test --------------------------------------------
|
||||
' se esiste salvo il nome del progetto
|
||||
Dim sCurrProjName As String = String.Empty
|
||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrProjName, m_MainWindow.GetIniFile())
|
||||
If Not String.IsNullOrEmpty(sCurrProjName) Then
|
||||
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME, sCurrProjName)
|
||||
Else
|
||||
EgtRemoveInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME)
|
||||
End If
|
||||
' ---------------------------- Fine modalità test posizione lavorazione --------------------------------------------
|
||||
|
||||
' Salvo eventuale nome del progetto
|
||||
m_CurrProjPage.SetProjectName()
|
||||
|
||||
Dim bOk As Boolean = True
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
@@ -556,7 +690,7 @@ Public Class ProjectMgrUC
|
||||
m_CurrProjPage.UpdateSideAngCutProbeFlag()
|
||||
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
||||
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
|
||||
Dim bDirectCut As Boolean = IsDirectCutOn()
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
Not bDirectCut And
|
||||
Not m_CurrProjPage.GetOrderMachiningFlag() Then
|
||||
@@ -584,7 +718,7 @@ Public Class ProjectMgrUC
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Inserisco indice di progetto
|
||||
m_CurrProjPage.SetProjectIndexFlag()
|
||||
m_CurrProjPage.SetProjectIndex()
|
||||
' Inserisco il materiale
|
||||
m_CurrProjPage.SetProjectMaterial()
|
||||
' Salvo il progetto con le lavorazioni
|
||||
@@ -657,7 +791,8 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
|
||||
'------------------- INIZIO Avvio il Ciclo-Start-------------------------
|
||||
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 AndAlso
|
||||
( m_MainWindow.m_CNCommunication.m_nNCType <> 4 Or m_MainWindow.m_CNCommunication.SpecialSend <> 1) Then
|
||||
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
|
||||
MyCicloStartWD.ShowDialog()
|
||||
End If
|
||||
@@ -923,35 +1058,32 @@ Public Class ProjectMgrUC
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateFeedAllMachining()
|
||||
' recupero il valore di Feed della lavorazione corrente
|
||||
Dim SettedMachinig As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, SettedMachinig)
|
||||
|
||||
' Parametri della lavorazione letta da DB
|
||||
Dim sMachiningName As String = String.Empty
|
||||
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
|
||||
' errore: lavorazione non trovata
|
||||
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
|
||||
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
|
||||
Return
|
||||
End If
|
||||
Dim dFeed As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
|
||||
Dim dFeedStarted As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
|
||||
Dim dFeedEnded As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
|
||||
Dim dFeedTipped As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
|
||||
Dim dFeedBack As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
|
||||
Dim dFeedSideAng As Double = 0
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
|
||||
' Elenco delle lavorazioni
|
||||
Dim MachiningList As New List(Of SplitMach)
|
||||
|
||||
' Recupero l'indice della fase corrente
|
||||
Dim nCurrPhase As Integer = 1
|
||||
' recupero in numero di fasi presenti nel progetto
|
||||
Dim nCountPhase As Integer = EgtGetPhaseCount()
|
||||
' ciclo su tutte le fasi di lavorazione
|
||||
' Numero di lavorazioni del progetto (conteggiate nel ciclo for)
|
||||
Dim nMach As Integer = 0
|
||||
' Numero di lavorazioni aggiornate (conteggate nel ciclo for)
|
||||
Dim nMachUpdated As Integer = 0
|
||||
' Elenco dei nomi lavorazioni aggiorniate
|
||||
Dim UpdateMachinigNameList As New List(Of String)
|
||||
|
||||
' ciclo su tutte le fasi di lavorazione
|
||||
For IndexPhase As Integer = 1 To nCountPhase
|
||||
' imposto la fase corrente
|
||||
nCurrPhase = IndexPhase
|
||||
@@ -963,6 +1095,31 @@ Public Class ProjectMgrUC
|
||||
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
|
||||
' setto la lavorazione come corrente
|
||||
If EgtSetCurrMachining(nOperId) Then
|
||||
Dim sCurrMachiningName As String = String.Empty
|
||||
EgtGetMachiningParam(MCH_MP.NAME, sCurrMachiningName)
|
||||
' Se la lavorazione corrente da DB è diversa da quella della lavorazione allora aggiorno i dati
|
||||
If sCurrMachiningName <> sMachiningName Then
|
||||
sMachiningName = sCurrMachiningName
|
||||
' Recupero la lavorazione dell'operazione indicata
|
||||
If Not EgtMdbSetCurrMachining(sMachiningName) Then
|
||||
EgtOutLog("ERRORE: Machining '" & sMachiningName & "' does not exist in DB of machining.")
|
||||
sMachiningName = String.Empty
|
||||
Continue For
|
||||
End If
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
|
||||
Else
|
||||
' verifico se è stata applicata una variazione delle Feed
|
||||
If UpdateMachinigNameList.FindIndex(Function(x) x = sCurrMachiningName) = -1 Then
|
||||
' La lavorazione corrente non ha nessun parametro nuovo
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim bUpdate As Boolean = False
|
||||
' STANDARD
|
||||
Dim dOrigFeed As Double
|
||||
@@ -1021,15 +1178,29 @@ Public Class ProjectMgrUC
|
||||
' conto il numero di lavorazioni aggiornate
|
||||
If bUpdate Then
|
||||
nMachUpdated += 1
|
||||
If UpdateMachinigNameList.FindIndex(Function(x) x = sCurrMachiningName) = -1 Then
|
||||
UpdateMachinigNameList.Add(sCurrMachiningName)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
If UpdateMachinigNameList.Count > 0 Then
|
||||
Dim sMsg As String = String.Empty
|
||||
For Each Item As String In UpdateMachinigNameList
|
||||
sMsg = sMsg & If(String.IsNullOrEmpty(sMsg), "", ",") & Item
|
||||
Next
|
||||
EgtOutLog("Le lavorazioni aggiornate sono: " & sMsg)
|
||||
Else
|
||||
EgtOutLog("Nessuna lavorazione è stata aggiornata: Feed da DB uguali a quelle impostate nelle lavorazioni")
|
||||
End If
|
||||
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91243) & nMachUpdated & "/ " & nMach) ' Lavorazione aggiornate:
|
||||
End Sub
|
||||
|
||||
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
||||
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double, SelTestTool As TestTool)
|
||||
Private Sub ExecuteTestMoveCNC(ptMid As Point3d, dAngC As Double, dAngB As Double, SelTestTool As TestTool)
|
||||
|
||||
Dim CmdString As String = String.Empty
|
||||
If Not EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||
@@ -1040,7 +1211,7 @@ Public Class ProjectMgrUC
|
||||
' imposto avanzamneto in rapido (non deve essere impostata feed e speed)
|
||||
EgtLuaSetGlobBoolVar("CMD.G0", True)
|
||||
|
||||
'----------- POSIZINE MACCHINA -----------
|
||||
'----------- POSIZIONE MACCHINA -----------
|
||||
' Leggo gli assi rispetto allo 0 macchina
|
||||
m_CurrNcComm.m_CN.set_OP_OM(0)
|
||||
|
||||
@@ -1055,13 +1226,6 @@ Public Class ProjectMgrUC
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
|
||||
'' Recupero spessore lama corrente
|
||||
'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'EgtTdbSetCurrTool(sSaw)
|
||||
'Dim dThick As Double = 0
|
||||
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
'EgtLuaSetGlobNumVar("CMD.SAWTH", dThick)
|
||||
|
||||
EgtTdbSetCurrTool(SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLNAME", SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLALIAS", SelTestTool.ToolAlias)
|
||||
@@ -1072,7 +1236,6 @@ Public Class ProjectMgrUC
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||
EgtLuaSetGlobStringVar("CMD.TCPOS", sTCPos)
|
||||
|
||||
|
||||
'----------- ASSEGNO POSIZIONE DI ARRIVO MACCHINA -----------
|
||||
' Assegno valore ad ogni asse da muovere (in zero macchina)
|
||||
EgtLuaSetGlobNumVar("CMD.X_AXISMOVE", ptMid.x)
|
||||
@@ -1092,9 +1255,7 @@ Public Class ProjectMgrUC
|
||||
' Log del comando
|
||||
EgtOutLog("CmdString=" & CmdString)
|
||||
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
' Modifico stringa per inserire i newline ( in questo caso non c'è bisogno perchè tutto sulla stessa linea)
|
||||
' Modifico stringa per inserire i newline
|
||||
CmdString = CmdString.Replace("<br/>", Environment.NewLine)
|
||||
' Creo file...
|
||||
Dim FilePath As String = m_MainWindow.GetCncDir() & "\TestWork" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||
@@ -1119,8 +1280,7 @@ Public Class ProjectMgrUC
|
||||
|
||||
End Sub
|
||||
|
||||
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
||||
|
||||
' ------------------------------------------------------------------------------------------------
|
||||
Private Sub TestBtn_Click(sender As Object, e As RoutedEventArgs) Handles TestBtn.Click
|
||||
If TestBtn.IsChecked Then
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv = True
|
||||
@@ -1197,7 +1357,7 @@ Public Class ProjectMgrUC
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||
' nuovi bottoni pagina di Nesting
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Hidden
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible Then
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
@@ -1287,11 +1447,11 @@ Public Class ProjectMgrUC
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
|
||||
' nuovi bottoni pagina di Nesting
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Visible
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRectangleBtn.Visibility = Windows.Visibility.Visible
|
||||
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden Then
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible
|
||||
End If
|
||||
' disabilito i comandi per gestioen SpotReg
|
||||
' disabilito i comandi per gestione SpotReg
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.PointRegCheckedOff()
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Hidden
|
||||
@@ -1299,9 +1459,6 @@ Public Class ProjectMgrUC
|
||||
' Nascondo bottoni rawpage
|
||||
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Visible
|
||||
|
||||
' Nascondo i bottoni per la definizione degli Spotreg
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||
|
||||
' Se c'è la foto devo sistemare
|
||||
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
|
||||
' Recupero il riferimento originale del primo grezzo
|
||||
|
||||
@@ -102,7 +102,7 @@ Public Class StartLauncherWD
|
||||
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
||||
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
||||
Else
|
||||
MruFileListRemove.Add(ItemFile)
|
||||
MruFileListRemove.Add(sFileName)
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -111,7 +111,7 @@ Public Class StartLauncherWD
|
||||
EgtOutLog(" WARNING: File " & ItemFileRemove & " does not exist or is not accessible, it's been removed from MruFiles list")
|
||||
Next
|
||||
|
||||
' posiziono la fistra in centro alla pagina
|
||||
' posiziono la finestra in centro alla pagina
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
|
||||
|
||||
@@ -26,28 +26,19 @@ Public Class Camera
|
||||
Private m_bCalcContour As Boolean = False
|
||||
Private m_nCameraCount As Integer = 0
|
||||
Private m_sCameraPath As String = String.Empty
|
||||
'Private m_sCameraPath2 As String = String.Empty
|
||||
Private m_sCameraProcName As String = String.Empty
|
||||
'Private m_sCameraProcName2 As String = String.Empty
|
||||
Private m_sImage As String = String.Empty
|
||||
'Private m_sImage2 As String = String.Empty
|
||||
Private m_sInfo As String = String.Empty
|
||||
'Private m_sInfo2 As String = String.Empty
|
||||
Private m_sResult As String = String.Empty
|
||||
'Private m_sResult2 As String = String.Empty
|
||||
Private m_sContour As String = String.Empty
|
||||
'Private m_sContour2 As String = String.Empty
|
||||
Private m_nThreshold As Integer = 60
|
||||
Private m_dTolerance As Double = 5
|
||||
Private m_nTimeout As Integer = 30
|
||||
Private m_sImageDir As String = String.Empty
|
||||
|
||||
Private Const CAMERAMNG As String = "CameraMng"
|
||||
Private Const N_LOOP As Integer = 20
|
||||
|
||||
'Public m_ProcessCmg As New Process()
|
||||
|
||||
' Lista dei processi Cmg associati ad igni tavola
|
||||
' Lista dei processi Cmg associati ad ogni tavola
|
||||
Public m_ProcessCmgList As New List(Of Process)
|
||||
' restituisce lo stato che il processo associato alla tavola corrente (PrepareCamera)
|
||||
Private m_bIsRunnigProc As Boolean = False
|
||||
@@ -96,6 +87,8 @@ Public Class Camera
|
||||
(GetPrivateProfileInt(S_GENERAL, K_CONTOURFROMCAMERA, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
' Ricavo il nome del processo associato
|
||||
m_sCameraProcName = Path.GetFileNameWithoutExtension(m_sCameraPath)
|
||||
' Terminazione di eventuali processi omonimi in esecuzione
|
||||
KillPreviousProcesses()
|
||||
' Avvio processi del camera manager per ogni tavola
|
||||
CamerasHide()
|
||||
Return True
|
||||
@@ -104,7 +97,7 @@ Public Class Camera
|
||||
Public Function Close() As Boolean
|
||||
If m_bBusy Then Return False
|
||||
If m_bCameraLink Then
|
||||
KillProcess()
|
||||
KillProcesses()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
@@ -179,7 +172,7 @@ Public Class Camera
|
||||
' Indice di processo uguale all'indice della tavola
|
||||
nIndProc = nIndTab
|
||||
Case 1
|
||||
' Alla tavola 1 possono essre associati 2 processi (solo se camera Hq abilitata e attiva)
|
||||
' Alla tavola 1 possono essere associati 2 processi (solo se camera Hq abilitata e attiva)
|
||||
If nIndTab = 1 And
|
||||
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
|
||||
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
|
||||
@@ -197,6 +190,8 @@ Public Class Camera
|
||||
|
||||
' OK: Avvio un processo per ogni tavola presente in macchina
|
||||
Public Function CamerasHide() As Boolean
|
||||
If Not m_bCameraLink Then Return False
|
||||
|
||||
' Lancio il programma in cieco, se già attivo lo nascondo
|
||||
m_nCameraCount = GetTableCount()
|
||||
|
||||
@@ -215,12 +210,13 @@ Public Class Camera
|
||||
' Gestisco correttamente solo il caso: 2 tavole e 1 camera
|
||||
m_nCameraCount = m_nCameraCount - 1
|
||||
Case Else
|
||||
EgtOutLog(" 🚨 CAUTION : Differenza tra numero di camere e numero di tavole: " & DeltaCameraTab.ToString &
|
||||
EgtOutLog(" --> CAUTION : Differenza tra numero di camere e numero di tavole: " & DeltaCameraTab.ToString &
|
||||
", sarà attivata solo la prima camera.")
|
||||
DeltaCameraTab = 0
|
||||
End Select
|
||||
Else
|
||||
EgtOutLog(" 🚨 CAUTION : In file *.ini machine '[Photo]' there is not param 'CameraCounter'.")
|
||||
' 🚨 CAUTION:
|
||||
EgtOutLog(" --> CAUTION : In file *.ini machine '[Photo]' there is not param 'CameraCounter'.")
|
||||
' Aggiungo un altro processo se camera Hq abilitata (non esite una vera tavola associata)
|
||||
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||
m_nCameraCount = m_nCameraCount + 1
|
||||
@@ -359,7 +355,7 @@ Public Class Camera
|
||||
End Sub
|
||||
|
||||
Private Function GoHomeForPhoto() As Boolean
|
||||
Dim bGoHome As Boolean = GetPrivateProfileInt(S_PHOTO, K_ENABELE_GOHOME_FOR_PHOTO, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
Dim bGoHome As Boolean = GetPrivateProfileInt(S_PHOTO, K_ENABLE_GOHOME_FOR_PHOTO, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
' Se non configurato esco senza generare errore
|
||||
If Not bGoHome Then Return True
|
||||
' Costruisco il bottone per potere eseguire il comando MDI
|
||||
@@ -371,9 +367,8 @@ Public Class Camera
|
||||
Else
|
||||
EgtOutLog("Direct command for positionig head: " & sDirectCmdFile)
|
||||
End If
|
||||
GoHome = New TwoStateButton("", sDirectCmdFile, "", "", "")
|
||||
' eseguo lo script lua associato
|
||||
GoHome.ExecuteMDICommand(GoHome.TLuaScriptName)
|
||||
VarMdiCommand.ExecuteMDICommand(sDirectCmdFile)
|
||||
' Leggo nome variabile posizione home raggiunta
|
||||
Dim CameraStateNameVar As String = String.Empty
|
||||
GetPrivateProfileString(S_PHOTO, K_CAMERA_STATE_VAR, "", CameraStateNameVar, m_MainWindow.GetMachIniFile())
|
||||
@@ -384,8 +379,7 @@ Public Class Camera
|
||||
Else
|
||||
EgtOutLog("Variable for read status of positioning head: " & CameraStateNameVar)
|
||||
End If
|
||||
' 91144=Going home
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91144))
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91144)) ' Going home
|
||||
UpdateUI()
|
||||
' Eseguo reset variabile posizione home raggiunta
|
||||
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(CameraStateNameVar, "0")
|
||||
@@ -418,21 +412,19 @@ Public Class Camera
|
||||
Return bPositionOk
|
||||
End Function
|
||||
|
||||
' OK: Ottengo l'indice del processo associato alla tavola e la configurazione del processo
|
||||
' Ottengo l'indice del processo associato alla tavola e la configurazione del processo
|
||||
Private Function PrepareCamera() As Integer
|
||||
' Stati del processo
|
||||
m_bIsRunnigProc = False
|
||||
m_bClickOk = False
|
||||
m_bCorrectedImgOk = False
|
||||
m_bSavedBackImage = False
|
||||
' Argomento utilizzato per verificare lo stato della comunicazione
|
||||
Dim sArgs As String = "7"
|
||||
Dim nIndTab As Integer = GetCurrentTable()
|
||||
Dim nIndProc As Integer = GetProcessFromCurrentTable(nIndTab)
|
||||
' Invio richiesta al processo per vedere se la comunicazione è aperta
|
||||
' Invio richiesta al processo per vedere se la comunicazione è aperta (comando 7)
|
||||
Try
|
||||
If Not m_ProcessCmgList(nIndProc - 1).HasExited Then
|
||||
m_ProcessCmgList(nIndProc - 1).StandardInput.WriteLine(sArgs)
|
||||
m_ProcessCmgList(nIndProc - 1).StandardInput.WriteLine("7")
|
||||
Else
|
||||
Return -2
|
||||
End If
|
||||
@@ -450,8 +442,8 @@ Public Class Camera
|
||||
ReloadCameraHide(nIndProc - 1)
|
||||
For i As Integer = 0 To N_LOOP
|
||||
Thread.Sleep(1000)
|
||||
' Invio richiesta al processo per vedere se la comunicazione è aperta
|
||||
m_ProcessCmgList(nIndProc - 1).StandardInput.WriteLine(sArgs)
|
||||
' Invio richiesta al processo per vedere se la comunicazione è aperta (comando 7)
|
||||
m_ProcessCmgList(nIndProc - 1).StandardInput.WriteLine("7")
|
||||
If m_bIsRunnigProc Then Exit For
|
||||
Next
|
||||
End If
|
||||
@@ -464,10 +456,12 @@ Public Class Camera
|
||||
GetPrivateProfileString(S_CAMERA, K_CAM_RESULT, "", m_sResult, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_CAMERA, K_CAM_CONTOUR, "", m_sContour, m_MainWindow.GetIniFile())
|
||||
|
||||
m_sImage = m_sImage.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sInfo = m_sInfo.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sResult = m_sResult.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sContour = m_sContour.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
If nIndProc <> 1 Then
|
||||
m_sImage = m_sImage.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sInfo = m_sInfo.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sResult = m_sResult.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sContour = m_sContour.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
End If
|
||||
|
||||
Return If(m_bIsRunnigProc, nIndProc, -1)
|
||||
End Function
|
||||
@@ -796,20 +790,33 @@ Public Class Camera
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function ProcessIsRunning() As Boolean
|
||||
' OK: chiudo tutti i processi di CameraMng in esecuzione prima dell'avvio
|
||||
Private Sub KillPreviousProcesses()
|
||||
If Not m_bCameraLink Then Return
|
||||
Dim Procs() As Process
|
||||
Procs = Process.GetProcessesByName(m_sCameraProcName)
|
||||
Return (Procs.Length() > 0)
|
||||
End Function
|
||||
For i As Integer = 0 To Procs.Count() - 1
|
||||
Try
|
||||
Procs(i).Kill()
|
||||
Procs(i).WaitForExit( 50)
|
||||
Catch Ex As Exception
|
||||
EgtOutLog(ex.Message())
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' OK: chiudo tutti i processi che hanno il nome CameraMng.exe
|
||||
Private Sub KillProcess()
|
||||
Dim Procs() As Process
|
||||
Procs = Process.GetProcessesByName(m_sCameraProcName)
|
||||
For i As Integer = 0 To Procs.Length() - 1
|
||||
Procs(i).Kill()
|
||||
Procs(i).WaitForExit(2000)
|
||||
Next i
|
||||
' OK: chiudo tutti i processi di CameraMng lanciati
|
||||
Private Sub KillProcesses()
|
||||
For i As Integer = 0 To m_ProcessCmgList.Count() - 1
|
||||
Try
|
||||
' Invio comando "8" di annuncio chiusura
|
||||
m_ProcessCmgList(i).StandardInput.WriteLine("8")
|
||||
' Eseguo chiusura
|
||||
m_ProcessCmgList(i).Kill()
|
||||
Catch Ex As Exception
|
||||
EgtOutLog(ex.Message())
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -64,7 +64,7 @@ Public Class ChooseMachining
|
||||
Private Sub InitializeMachiningLists()
|
||||
|
||||
' in assenza dell'uscita H1 nascondo i parametri lama
|
||||
If EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
If Not m_CurrentMachine.ExistsSawHead() Then
|
||||
CurrSawingTxBl.Visibility = Visibility.Hidden
|
||||
CurrSawingCmBx.Visibility = Visibility.Hidden
|
||||
End If
|
||||
@@ -87,7 +87,8 @@ Public Class ChooseMachining
|
||||
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl)
|
||||
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx)
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER,
|
||||
CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
|
||||
' Creo lista lavorazioni foretto e fresa
|
||||
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
|
||||
CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
|
||||
@@ -121,14 +122,15 @@ Public Class ChooseMachining
|
||||
m_WJettingList.Add("")
|
||||
End If
|
||||
|
||||
' ---- MACCHINA CON CAMBIO UTENSILE ----
|
||||
' ---- MACCHINA CON CAMBIO UTENSILE ----
|
||||
ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
|
||||
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 --
|
||||
CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
|
||||
' -- FORATURA --
|
||||
m_DrillingList.Clear()
|
||||
If CanChangeTool() Then CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_DrillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrDrilling = String.Empty
|
||||
@@ -136,8 +138,9 @@ Public Class ChooseMachining
|
||||
' aggiungo il campo vuoto
|
||||
m_DrillingList.Add("")
|
||||
End If
|
||||
' -- FRESATURA --
|
||||
CreateMachiningList(MCH_MY.MILLING, m_MillingList)
|
||||
' -- FRESATURA --
|
||||
m_MillingList.Clear()
|
||||
If CanChangeTool() Then CreateMachiningList(MCH_MY.MILLING, m_MillingList)
|
||||
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
|
||||
If m_MillingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrMilling = String.Empty
|
||||
@@ -146,7 +149,8 @@ Public Class ChooseMachining
|
||||
m_MillingList.Add("")
|
||||
End If
|
||||
' -- SVUOTATURA --
|
||||
CreateMachiningList(MCH_MY.POCKETING, m_PocketingList)
|
||||
m_PocketingList.Clear()
|
||||
If CanChangeTool() Then CreateMachiningList(MCH_MY.POCKETING, m_PocketingList)
|
||||
If m_PocketingList.Count = 0 Then
|
||||
m_CurrentMachine.sCurrPocketing = String.Empty
|
||||
Else
|
||||
@@ -187,22 +191,19 @@ Public Class ChooseMachining
|
||||
|
||||
End Select
|
||||
|
||||
If m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
If m_CurrentMachine.bWaterJet And Not m_CurrentMachine.ExistsSawHead() Then
|
||||
|
||||
Else
|
||||
' verifico che lista delle lavorazioni di lama non sia vuoto
|
||||
If m_SawingList.Count > 0 Then
|
||||
' provo ad assegnare la lama corrente (se l'associazione fallisce corrispoende ad impostare un campo vuoto)
|
||||
' provo ad assegnare la lama corrente (se l'associazione fallisce corrisponde ad impostare un campo vuoto)
|
||||
CurrSawingCmBx.SelectedItem = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
Else
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
' se non riesco a fare l'assegnazione della lama allora elimino il nome della lama salvata
|
||||
' se lavorazione di lama non definita, dichiaro da scegliere
|
||||
If String.IsNullOrEmpty(CurrSawingCmBx.SelectedItem) Then
|
||||
' verifico che il nome della lama esista
|
||||
If CurrSawingCmBx.SelectedItem <> m_MainWindow.m_CurrentMachine.sCurrSawing Then
|
||||
m_MachIsModified = True
|
||||
End If
|
||||
m_MachIsModified = True
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Runtime.Remoting.Metadata.W3cXsd2001
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
|
||||
@@ -45,6 +46,9 @@ Public Class RawPartPageUC
|
||||
Private m_RawOffsY As Double = 0
|
||||
Private m_RawKerf As Double = 0
|
||||
Private m_PrecKerf As Double = 0
|
||||
' Delta di visualizzazione su offset grezzo
|
||||
Private m_dDeltaRoX As Double = 0
|
||||
Private m_dDeltaRoY As Double = 0
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
' Definizione lista modalità di definizione grezzo per ComboBox
|
||||
@@ -142,6 +146,26 @@ Public Class RawPartPageUC
|
||||
XY = 3
|
||||
End Enum
|
||||
|
||||
Private Sub SetRawOffsetX( dRawOffsX As Double)
|
||||
OffsetXTxBx.Text = LenToString(dRawOffsX + m_dDeltaRoX, 2)
|
||||
End Sub
|
||||
|
||||
Private Function GetRawOffsetX( ByRef dRawOffsX As Double) As Boolean
|
||||
If Not StringToLen(OffsetXTxBx.Text, dRawOffsX) Then Return False
|
||||
dRawOffsX -= m_dDeltaRoX
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub SetRawOffsetY( dRawOffsY As Double)
|
||||
OffsetYTxBx.Text = LenToString(dRawOffsY + m_dDeltaRoY, 2)
|
||||
End Sub
|
||||
|
||||
Private Function GetRawOffsetY( ByRef dRawOffsY As Double) As Boolean
|
||||
If Not StringToLen(OffsetYTxBx.Text, dRawOffsY) Then Return False
|
||||
dRawOffsY -= m_dDeltaRoY
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||
|
||||
'Creazione della Page UserControl e relative impostazioni
|
||||
@@ -269,6 +293,17 @@ Public Class RawPartPageUC
|
||||
EgtOutLog("Error : TableMin e TableRef1 are different")
|
||||
End If
|
||||
End If
|
||||
' Imposto eventuali delta di visualizzazione per Offset Grezzo
|
||||
m_dDeltaRoX = 0
|
||||
m_dDeltaRoY = 0
|
||||
If GetPrivateProfileInt(S_TABLE, K_ALLTABORIGTAB1, 0, m_MainWindow.GetMachIniFile()) <> 0 AndAlso GetCurrentTable() <> 1 Then
|
||||
Dim TabX As Double = GetPrivateProfileDouble( S_TABLE, K_TABX, Double.NaN, m_MainWindow.GetMachIniFile())
|
||||
Dim TabY As Double = GetPrivateProfileDouble( S_TABLE, K_TABY, Double.NaN, m_MainWindow.GetMachIniFile())
|
||||
If Not Double.IsNaN( TabX) AndAlso Not Double.IsNaN( TabY) Then
|
||||
m_dDeltaRoX = ptRef1.x - TabX
|
||||
m_dDeltaRoY = ptRef1.y - TabY
|
||||
End If
|
||||
End If
|
||||
' Nascondo eventuali pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Deseleziono pezzi
|
||||
@@ -327,15 +362,15 @@ Public Class RawPartPageUC
|
||||
|
||||
' Carico le info del riferimento alternativo della tavola
|
||||
m_nOtherRefTabLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||
EgtSetLevel(m_nOtherRefTabLay, GDB_LV.TEMP)
|
||||
LoadOtherRefTab()
|
||||
|
||||
' Assegno dati grezzo rettangolare ai textbox
|
||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
KerfTxBx.Text = LenToString(dInvertKerf * m_RawKerf, 2)
|
||||
|
||||
' Recupero gli ID delle pareti che delimitano l'area Protetta (movimenti in OverZ)
|
||||
@@ -352,7 +387,7 @@ Public Class RawPartPageUC
|
||||
m_SafetyZone_Y = ptMinY.y
|
||||
End If
|
||||
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
|
||||
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
DrawSafetyZone(m_CurrentMachine.dAdditionalTable + m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
|
||||
' Creo layer temporaneo per crocette
|
||||
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||
@@ -657,7 +692,7 @@ Public Class RawPartPageUC
|
||||
|
||||
' Creo una copia del punto corrente
|
||||
Dim ptTemp As New Point3d(ptCurr.x, ptCurr.y, ptCurr.z)
|
||||
Select Case DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, ptCurr - m_ptPrev)
|
||||
Select Case DrawSafetyZone(m_CurrentMachine.dAdditionalTable + m_RawHeight, m_CurrentMachine.dHighPieceZ, ptCurr - m_ptPrev)
|
||||
Case STATDRAG.X_
|
||||
ptCurr.x = m_ptPrev.x
|
||||
Case STATDRAG._Y
|
||||
@@ -678,8 +713,6 @@ Public Class RawPartPageUC
|
||||
End Select
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptTemp
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
End Sub
|
||||
|
||||
Private Sub ModifyRectangle(ptCurr As Point3d)
|
||||
@@ -697,15 +730,15 @@ Public Class RawPartPageUC
|
||||
m_RawOffsX += vtMove.x
|
||||
m_RawOffsY += vtMove.y
|
||||
If dKerf < 0 Then
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX - m_RawKerf, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY - m_RawKerf, 2)
|
||||
SetRawOffsetX(m_RawOffsX - m_RawKerf)
|
||||
SetRawOffsetY(m_RawOffsY - m_RawKerf)
|
||||
Else
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
End If
|
||||
|
||||
End If
|
||||
' se sposto lato sotto
|
||||
' se sposto lato sotto
|
||||
ElseIf m_nDragEnt = 1 Then
|
||||
Dim dDelta = ptCurr.y - m_ptPrev.y
|
||||
If m_RawWidth - dDelta > MIN_RAW_DIM And m_RawOffsY + dDelta > m_RawKerf Then
|
||||
@@ -719,14 +752,14 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
If dKerf < 0 Then
|
||||
WidthTxBx.Text = LenToString(m_RawWidth + 2 * m_RawKerf, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY - m_RawKerf, 2)
|
||||
SetRawOffsetY(m_RawOffsY - m_RawKerf)
|
||||
Else
|
||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
End If
|
||||
|
||||
End If
|
||||
' se sposto lato a destra
|
||||
' se sposto lato a destra
|
||||
ElseIf m_nDragEnt = 2 Then
|
||||
Dim dDelta = ptCurr.x - m_ptPrev.x
|
||||
If m_RawLength + dDelta > MIN_RAW_DIM And
|
||||
@@ -743,7 +776,7 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
|
||||
End If
|
||||
' se sposto lato sopra
|
||||
' se sposto lato sopra
|
||||
ElseIf m_nDragEnt = 3 Then
|
||||
Dim dDelta = ptCurr.y - m_ptPrev.y
|
||||
If m_RawWidth + dDelta > MIN_RAW_DIM And
|
||||
@@ -760,7 +793,7 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
|
||||
End If
|
||||
' se sposto lato a sinistra
|
||||
' se sposto lato a sinistra
|
||||
ElseIf m_nDragEnt = 4 Then
|
||||
Dim dDelta = ptCurr.x - m_ptPrev.x
|
||||
If m_RawLength - dDelta > MIN_RAW_DIM And m_RawOffsX + dDelta > m_RawKerf Then
|
||||
@@ -774,12 +807,10 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
If dKerf < 0 Then
|
||||
LengthTxBx.Text = LenToString(m_RawLength + 2 * m_RawKerf, 2)
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX - m_RawKerf, 2)
|
||||
|
||||
SetRawOffsetX(m_RawOffsX - m_RawKerf)
|
||||
Else
|
||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -860,11 +891,11 @@ Public Class RawPartPageUC
|
||||
If m_bProbingOn Then Return
|
||||
' reimposto il comando OutLine
|
||||
OutlineBtn_Click(Nothing, Nothing)
|
||||
' Nasocndo eventuali pareti
|
||||
' Nascondo eventuali pareti
|
||||
If m_bExistsSafetyZone Then
|
||||
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
|
||||
EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
|
||||
EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
|
||||
EgtSetMode(m_nIdMinRedX, GDB_MD.HIDDEN)
|
||||
EgtSetMode(m_nIdMinRedY, GDB_MD.HIDDEN)
|
||||
End If
|
||||
|
||||
' Se confermata uscita
|
||||
@@ -1963,13 +1994,13 @@ Public Class RawPartPageUC
|
||||
If dKerf < 0 Then
|
||||
LengthTxBx.Text = LenToString(m_RawLength + 2 * m_RawKerf, 2)
|
||||
WidthTxBx.Text = LenToString(m_RawWidth + 2 * m_RawKerf, 2)
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX - m_RawKerf, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY - m_RawKerf, 2)
|
||||
SetRawOffsetX(m_RawOffsX - m_RawKerf)
|
||||
SetRawOffsetY(m_RawOffsY - m_RawKerf)
|
||||
Else
|
||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -2081,7 +2112,7 @@ Public Class RawPartPageUC
|
||||
If EgtMoveRawPart(m_CurrProjPage.m_nRawId, vtMove) Then
|
||||
' Aggiorno gli offset
|
||||
m_RawOffsX += vtMove.x
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
' Se c'è la foto, devo aggiornarne la posizione
|
||||
Dim nPhotoId = m_CurrProjPage.GetPhoto()
|
||||
If nPhotoId <> GDB_ID.NULL Then
|
||||
@@ -2169,7 +2200,7 @@ Public Class RawPartPageUC
|
||||
Return
|
||||
End If
|
||||
' verifico se l'altezza del pezzo è maggiore di quella consentita in macchina
|
||||
DrawSafetyZone(dHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
DrawSafetyZone(m_CurrentMachine.dAdditionalTable + dHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
If dHeight > -EPS_ZERO Then
|
||||
m_CurrProjPage.ClearMessage()
|
||||
If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then
|
||||
@@ -2199,21 +2230,17 @@ Public Class RawPartPageUC
|
||||
Dim dKerf As Double = 0
|
||||
StringToLen(KerfTxBx.Text, dKerf)
|
||||
Dim dOffsetX As Double
|
||||
If Not StringToLen(OffsetXTxBx.Text, dOffsetX) Then
|
||||
Return
|
||||
End If
|
||||
If Not GetRawOffsetX( dOffsetX) Then Return
|
||||
Dim dMinOffsetX = m_RawKerf
|
||||
If dKerf < 0 And dOffsetX >= 0 Then
|
||||
'm_RawOffsX = dOffsetX + m_RawKerf
|
||||
'UpdateRawPart()
|
||||
m_RawOffsX = dOffsetX
|
||||
AdjustRawPartPositionNegativeKerf()
|
||||
ElseIf dKerf >= 0 And dOffsetX >= dMinOffsetX Then
|
||||
m_RawOffsX = dOffsetX
|
||||
UpdateRawPart()
|
||||
Else
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90519) & " " & LenToString(dMinOffsetX, 2)) ' Minimo offset X =
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90519) & " " & LenToString(dMinOffsetX + m_dDeltaRoX, 2)) ' Minimo offset X =
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -2221,9 +2248,7 @@ Public Class RawPartPageUC
|
||||
Dim dKerf As Double = 0
|
||||
StringToLen(KerfTxBx.Text, dKerf)
|
||||
Dim dOffsetY As Double
|
||||
If Not StringToLen(OffsetYTxBx.Text, dOffsetY) Then
|
||||
Return
|
||||
End If
|
||||
If Not GetRawOffsetY( dOffsetY) Then Return
|
||||
Dim dMinOffsetY = m_RawKerf
|
||||
If dKerf < 0 And dOffsetY >= 0 Then
|
||||
'm_RawOffsY = dOffsetY + m_RawKerf
|
||||
@@ -2234,25 +2259,24 @@ Public Class RawPartPageUC
|
||||
m_RawOffsY = dOffsetY
|
||||
UpdateRawPart()
|
||||
Else
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90520) & " " & LenToString(dMinOffsetY, 2)) ' Minimo offset Y =
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90520) & " " & LenToString(dMinOffsetY + m_dDeltaRoY, 2)) ' Minimo offset Y =
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Funzione che si occupa di disegnare le pareti dell'area sicura e di gestire il grezzo (
|
||||
' Funzione che si occupa di disegnare le pareti dell'area sicura e di gestire il grezzo
|
||||
Private Function DrawSafetyZone(dHeight As Double, dHighPieceZ As Double, vtMove As Vector3d) As STATDRAG
|
||||
' Se non esiste allora esci senza eseguire controlli
|
||||
If Not m_bExistsSafetyZone Then Return STATDRAG.OK
|
||||
' Verifico se attivare la visualizzazione
|
||||
Dim nStatus As GDB_ST = GDB_ST.OFF
|
||||
If dHeight > dHighPieceZ Then
|
||||
nStatus = GDB_ST.ON_
|
||||
End If
|
||||
Dim bShow As Boolean = ( dHeight > dHighPieceZ)
|
||||
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
|
||||
EgtSetStatus(m_nIdMinRedX, nStatus)
|
||||
EgtSetStatus(m_nIdMinRedY, nStatus)
|
||||
EgtSetMode(m_nIdMinRedX, If( bShow, GDB_MD.STD, GDB_MD.HIDDEN))
|
||||
EgtSetMode(m_nIdMinRedY, If( bShow, GDB_MD.STD, GDB_MD.HIDDEN))
|
||||
EgtSetStatus(m_nIdMinRedX, GDB_ST.ON_)
|
||||
EgtSetStatus(m_nIdMinRedY, GDB_ST.ON_)
|
||||
EgtDraw()
|
||||
If nStatus = GDB_ST.ON_ Then
|
||||
If bShow Then
|
||||
Return VerifyDimensionRawSafetyZone(vtMove)
|
||||
End If
|
||||
Return STATDRAG.OK
|
||||
@@ -2300,8 +2324,8 @@ Public Class RawPartPageUC
|
||||
' aggiorno il valore di Offset
|
||||
m_RawOffsX = m_SafetyZone_X + m_RawKerf - m_ptTableMin.x
|
||||
m_RawOffsY = ptMinRaw.y + m_RawKerf - m_ptTableMin.y
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
bCalcBBoxRaw = True
|
||||
nStat = STATDRAG.X_
|
||||
End If
|
||||
@@ -2313,8 +2337,8 @@ Public Class RawPartPageUC
|
||||
EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
|
||||
m_RawOffsX = ptMinRaw.x + m_RawKerf - m_ptTableMin.x
|
||||
m_RawOffsY = m_SafetyZone_Y - dRawWidth + m_RawKerf - m_ptTableMin.y
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
bCalcBBoxRaw = True
|
||||
nStat = nStat + STATDRAG._Y
|
||||
End If
|
||||
@@ -2372,8 +2396,8 @@ Public Class RawPartPageUC
|
||||
m_RawOffsX = ptRawMin.x - m_ptTableMin.x + m_RawKerf * dInvertKerf
|
||||
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf * dInvertKerf
|
||||
End If
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||
SetRawOffsetX(m_RawOffsX)
|
||||
SetRawOffsetY(m_RawOffsY)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -2464,8 +2488,8 @@ Public Class RawPartPageUC
|
||||
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
StringToLen(OffsetXTxBx.Text, m_RawOffsX)
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
GetRawOffsetX(m_RawOffsX)
|
||||
GetRawOffsetY(m_RawOffsY)
|
||||
' UpdateRawPart()
|
||||
UpdateRawPartKerf()
|
||||
' Recupero id contorno kerf
|
||||
@@ -2488,8 +2512,8 @@ Public Class RawPartPageUC
|
||||
' recupero dati grezzo
|
||||
StringToLen(LengthTxBx.Text, m_RawLength)
|
||||
StringToLen(WidthTxBx.Text, m_RawWidth)
|
||||
StringToLen(OffsetXTxBx.Text, m_RawOffsX)
|
||||
StringToLen(OffsetYTxBx.Text, m_RawOffsY)
|
||||
GetRawOffsetX(m_RawOffsX)
|
||||
GetRawOffsetY(m_RawOffsY)
|
||||
|
||||
If m_PrecKerf >= 0 Then
|
||||
m_RawLength = m_RawLength + 2 * m_RawKerf
|
||||
@@ -2553,7 +2577,7 @@ Public Class RawPartPageUC
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90522) & " " & LenToString(dMaxKerf, 2)) ' Massimo kerf =
|
||||
End If
|
||||
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
|
||||
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
DrawSafetyZone(m_CurrentMachine.dAdditionalTable + m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
|
||||
End Sub
|
||||
|
||||
Private Sub RawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawProbingBtn.Click
|
||||
@@ -2790,7 +2814,9 @@ Public Class RawPartPageUC
|
||||
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
EgtErase(m_nTempLay)
|
||||
m_nTempLay = GDB_ID.NULL
|
||||
EgtErase(m_nOtherRefTabLay)
|
||||
m_nOtherRefTabLay = GDB_ID.NULL
|
||||
' Dichiaro pagina non attiva
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 917 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
@@ -89,12 +89,14 @@ Public Class SimulationPageUC
|
||||
EgtOutLog(" -- PREPARE SIMUL --")
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
Dim bOk As Boolean = True
|
||||
' nascondo i pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Visualizzo opportunamente la macchina
|
||||
m_nMachLook = MCH_LOOK.ALL
|
||||
EgtSetMachineLook(m_nMachLook)
|
||||
' Imposto vista 3d isometrica di tutto
|
||||
EgtSetView(VT.ISO_SE, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
EgtZoom(ZM.ALL, False)
|
||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
||||
EgtEraseCurrSetup()
|
||||
' Verifico l'attrezzaggio degli utensili utilizzati
|
||||
@@ -108,7 +110,7 @@ Public Class SimulationPageUC
|
||||
m_CurrProjPage.UpdateSideAngCutProbeFlag()
|
||||
' Se pezzi piani e non taglio diretto e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
||||
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
|
||||
Dim bDirectCut As Boolean = IsDirectCutOn()
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
Not bDirectCut And
|
||||
Not m_CurrProjPage.GetOrderMachiningFlag() Then
|
||||
@@ -178,6 +180,12 @@ Public Class SimulationPageUC
|
||||
m_CurrProjPage.ShowContour(False)
|
||||
' Nascondo eventuali testi con dati su aree
|
||||
m_CurrProjPage.SetAreasStatus(False)
|
||||
' Nascondo eventuali pareti
|
||||
Dim nIdBase As Integer = EgtGetBaseId("Base")
|
||||
Dim m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
|
||||
If m_nIdMinRedX <> GDB_ID.NULL Then EgtSetMode(m_nIdMinRedX, GDB_MD.HIDDEN)
|
||||
Dim m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
|
||||
If m_nIdMinRedY <> GDB_ID.NULL Then EgtSetMode(m_nIdMinRedY, GDB_MD.HIDDEN)
|
||||
' Recupero eventuale fase di ripartenza
|
||||
m_nRestart = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart()
|
||||
' Imposto prima fase
|
||||
@@ -207,12 +215,6 @@ Public Class SimulationPageUC
|
||||
Else
|
||||
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative))
|
||||
End If
|
||||
|
||||
Dim nIdBase As Integer = EgtGetBaseId("Base")
|
||||
Dim m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
|
||||
If m_nIdMinRedX <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
|
||||
Dim m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
|
||||
If m_nIdMinRedY <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
|
||||
EgtOutLog(" -- END PREPARE SIMUL --")
|
||||
End Sub
|
||||
|
||||
@@ -309,7 +311,7 @@ Public Class SimulationPageUC
|
||||
' Se non c'è restart esco
|
||||
If m_nRestart = 0 Then Return
|
||||
' Se tagli diretti restart non valido ed esco
|
||||
If GetDirectCutPart() <> GDB_ID.NULL Then Return
|
||||
If IsDirectCutOn() Then Return
|
||||
' Info
|
||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90359) & " (" & m_nRestart.ToString() & ")") ' Restart (n)
|
||||
' Salto
|
||||
@@ -576,9 +578,9 @@ Public Class SimulationPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub GenerateCN_Click(sender As Object, e As RoutedEventArgs)
|
||||
' Se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
||||
' Se il bottone Shift è premuto apriro' il file CadCut1 nel programma NotePad
|
||||
Dim IsPressedShiftKey As Boolean = False
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift Then IsPressedShiftKey = True
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then IsPressedShiftKey = True
|
||||
|
||||
' Eventualmente fermo la simulazione
|
||||
m_nStatus = MCH_SIM_ST.UI_STOP
|
||||
@@ -593,7 +595,7 @@ Public Class SimulationPageUC
|
||||
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Inserisco indice di progetto
|
||||
m_CurrProjPage.SetProjectIndexFlag()
|
||||
m_CurrProjPage.SetProjectIndex()
|
||||
' Inserisco il materiale
|
||||
m_CurrProjPage.SetProjectMaterial()
|
||||
' Salvo il progetto con le lavorazioni
|
||||
@@ -637,7 +639,7 @@ Public Class SimulationPageUC
|
||||
' ricarico la pagina di simulazione
|
||||
EgtSetCurrPhase(1)
|
||||
' nascondo i pezzi in parcheggio
|
||||
HideParkedParts(True)
|
||||
HideParkedParts()
|
||||
' Avvio ambiente di simulazione
|
||||
EgtSimInit()
|
||||
EgtSimStart()
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
Imports System.Globalization
|
||||
Imports System.Diagnostics
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports EgtWPFLib
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
|
||||
Module Utility
|
||||
Friend Function CompoColor(sIniFile As String) As Color3d
|
||||
@@ -45,140 +42,9 @@ Module Utility
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
#Region "INCHES FRACTIONS"
|
||||
'Enum FractionPattern
|
||||
' None
|
||||
' Feet_Inches
|
||||
' Inches
|
||||
'End Enum
|
||||
|
||||
'' seleziona il tipo di Pattern con cui stamoare i dati
|
||||
' seleziona il tipo di Pattern di stampa dei dati
|
||||
Friend nCurrFractionPattern As FractionStringConverter.FractionPattern = FractionPattern.Feet_Inches
|
||||
Friend dPrecision As Double = 64
|
||||
|
||||
'Friend Function StringFractionToStringDecimal(dVal As Double, dBase As Double) As String
|
||||
' Dim sSign As String = String.Empty
|
||||
' If dVal < 0 Then
|
||||
' sSign = "-"
|
||||
' dVal = Math.Abs(dVal)
|
||||
' End If
|
||||
' Dim sFraction As String = String.Empty
|
||||
' ' integer and decima part of the value
|
||||
' Dim dInteger As Double = Math.Floor(dVal)
|
||||
' Dim dFraction As Double = dVal - dInteger
|
||||
' ' the nearest decimal numerator
|
||||
' Dim dNumeretor As Double = dFraction * dBase
|
||||
' Dim dRound As Double = Math.Round(dNumeretor)
|
||||
' ' estimates the irreducible fraction
|
||||
' If dRound = 0 Then
|
||||
' ' no decimal part
|
||||
' ElseIf dRound = dBase Then
|
||||
' ' no decimal part
|
||||
' dInteger = dInteger + 1
|
||||
' Else
|
||||
' ' simplify fraction
|
||||
' While dRound Mod 2 = 0
|
||||
' dRound = dRound / 2
|
||||
' dBase = dBase / 2
|
||||
' End While
|
||||
' sFraction = DoubleToString(dRound, 0) & "/" & DoubleToString(dBase, 0)
|
||||
' End If
|
||||
' ' sVal: dFeet'dInteger"sFraction --- dInteger sFraction
|
||||
' Return WriteFraction(dInteger, sFraction)
|
||||
'End Function
|
||||
|
||||
'' trasforma il valore da pollici a piedi
|
||||
'Private Sub ConvertInchesToFeet(ByRef dFeet As Double, ByRef dInches As Double)
|
||||
' If dInches = 0 Then Return
|
||||
' While dInches - 12 >= 0
|
||||
' dFeet = dFeet + 1
|
||||
' dInches = dInches - 12
|
||||
' End While
|
||||
'End Sub
|
||||
|
||||
'' stampa dati in funzione del pattern dichiarato
|
||||
'Private Function WriteFraction(ByVal dInches As Double, sFraction As String) As String
|
||||
' Dim sVal As String = String.Empty
|
||||
' Select Case nCurrFractionPattern
|
||||
' Case FractionPattern.Feet_Inches
|
||||
' Dim dFeet As Double = 0
|
||||
' ConvertInchesToFeet(dFeet, dInches)
|
||||
' If dFeet > 0 Then
|
||||
' sVal = String.Format("{0}'{1}""{2}", DoubleToString(dFeet, 0), DoubleToString(dInches, 0), sFraction).Trim
|
||||
' Else
|
||||
' sVal = String.Format("{0}""{1}", DoubleToString(dInches, 0), sFraction).Trim
|
||||
' End If
|
||||
' Case FractionPattern.Inches
|
||||
' sVal = DoubleToString(dInches, 0) & " " & sFraction
|
||||
' sVal = String.Format("{0}""{1}", DoubleToString(dInches, 0), sFraction).Trim
|
||||
' End Select
|
||||
' Return sVal
|
||||
'End Function
|
||||
|
||||
'' riceve la stringa sorgente e restituisce la nuova strunga in formato decimale (senza eseguire conversioni di unità)
|
||||
'Friend Function StringFractionToDouble(sVal As String, ByRef sValConverted As String) As Boolean
|
||||
' Dim dVal As Double = 0
|
||||
' ' dato in ingresso: sVal = 2'3"23/32
|
||||
' Dim sFeet As String = String.Empty
|
||||
' Dim sFeetPattern As String = "^.*?(?=')"
|
||||
' Dim dFeet As Double = 0
|
||||
' Dim bOkFeet As Boolean = True
|
||||
' Dim bFeetExists As Boolean = False
|
||||
' Dim sInch As String = String.Empty
|
||||
' Dim sInchPattern As String = "(?<=')(.*?)(?="")" ' se la stringa contiene l'apice singolo
|
||||
' Dim sInchPattern1 As String = "(.*?)(?="")" ' se la stringa NON contiene l'apice singolo
|
||||
' Dim dInch As Double = 0
|
||||
' Dim bOkInch As Boolean = True
|
||||
' Dim bInchExists As Boolean = False
|
||||
' Dim sFraction As String = String.Empty
|
||||
' Dim sFractionPattern As String = "(?<="")(.*)" ' se la stringa contiene l'apice doppio
|
||||
' Dim sFractionPattern1 As String = "(?<=')(.*)" ' se la stringa NON contiene l'apice doppio ma solo quello singolo
|
||||
' Dim dFraction As Double = 0
|
||||
' Dim bOkFraction As Boolean = True
|
||||
' Dim bFractionExists As Boolean = False
|
||||
|
||||
' ' recupero il valore di Feet (2')
|
||||
' Dim sMyMatch As String = Regex.Match(sVal, sFeetPattern).Groups(1).Value
|
||||
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||
' sFeet = sMyMatch.Trim
|
||||
' bOkFeet = StringToDouble(sFeet, dFeet)
|
||||
' bFeetExists = True
|
||||
' End If
|
||||
|
||||
' ' recupero il valore di Inch (3") dopo i Feet - oppure direttamente i pollici
|
||||
' If bFeetExists Then
|
||||
' sMyMatch = Regex.Match(sVal, sInchPattern).Groups(1).Value
|
||||
' Else
|
||||
' sMyMatch = Regex.Match(sVal, sInchPattern1).Groups(1).Value
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||
' sInch = sMyMatch.Trim
|
||||
' bOkInch = StringToDouble(sInch, dInch)
|
||||
' bInchExists = True
|
||||
' End If
|
||||
|
||||
' ' recupero il valore frazionario (23/32) dopo i pollici - oppure dopo i feet - oppure direttamente i valore inteso come pollici
|
||||
' If bInchExists Then
|
||||
' sMyMatch = Regex.Match(sVal, sFractionPattern).Groups(1).Value
|
||||
' ElseIf bFeetExists And Not bInchExists Then
|
||||
' sMyMatch = Regex.Match(sVal, sFractionPattern1).Groups(1).Value
|
||||
' ElseIf Not bFeetExists And Not bInchExists Then
|
||||
' sMyMatch = sVal
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||
' sFraction = sMyMatch
|
||||
' bOkFraction = StringToDouble(sFraction, dFraction)
|
||||
' End If
|
||||
|
||||
' ' calcolo il valore decimale dell'espressione
|
||||
' If bOkFeet And bOkInch And bOkFraction Then
|
||||
' dVal = dFeet / 12 + dInch + dFraction
|
||||
' sValConverted = DoubleToString(dVal, 4)
|
||||
' Return True
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
#End Region ' Inches Fraction
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -204,14 +70,13 @@ Module Utility
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' conerte il dato (in mm) in stringa nell'unità corrente
|
||||
' converte il dato (in mm) in stringa nell'unità corrente
|
||||
Friend Function LenToString(dVal As Double, nNumDec As Integer, Optional ByVal bForceToDecimal As Boolean = False) As String
|
||||
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
|
||||
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
|
||||
' conevrto il dato corrente in decimale
|
||||
Dim dCurrVal As Double = dVal
|
||||
StringToDouble(sVal, dCurrVal)
|
||||
' converto il dato corrente in decimale
|
||||
Dim dCurrVal As Double = dVal / ONEINCH
|
||||
Return DoubleToStringFraction(dCurrVal, dPrecision)
|
||||
End If
|
||||
Return sVal
|
||||
@@ -453,24 +318,21 @@ Module Utility
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Restituisce il colore dell'utensile correntemente settato, se non trova l'utesile o il colore ritorna il default (0,255,0)
|
||||
' Restituisce il colore dell'utensile correntemente settato, se non trova l'utensile o il colore ritorna il default (0,255,0)
|
||||
Friend Function GetColorPV() As Color3d
|
||||
Dim ToolString As String = String.Empty
|
||||
' Recupero il campo COLOR dalle note di sistema
|
||||
Dim ToolColor As String = String.Empty
|
||||
'EgtTdbGetCurrToolParam(MCH_MP.SYSNOTES, ToolString)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SYSNOTES, ToolString)
|
||||
EgtTdbGetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ToolColor)
|
||||
' Recupero i tre valori interi RGB
|
||||
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)
|
||||
Dim nRed, nGreen, nBlue As Integer
|
||||
If sItems.Count>= 3 AndAlso
|
||||
Integer.TryParse( sItems(0), nRed) AndAlso
|
||||
Integer.TryParse( sItems(1), nGreen) AndAlso
|
||||
Integer.TryParse( sItems(2), nBlue) Then
|
||||
Return New Color3d(nRed, nGreen, nBlue, 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
|
||||
Return New Color3d(0, 255, 0, 100)
|
||||
End If
|
||||
End Function
|
||||
|
||||
@@ -536,76 +398,70 @@ Module Utility
|
||||
Return BackBottomColor
|
||||
End Function
|
||||
|
||||
Public Sub GetDrillFromDrilling(ByRef sCurrDrill As String, ByVal sCurrDrilling As String)
|
||||
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
|
||||
' creo l'elenco degli utensili di foratura
|
||||
Dim sToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
Dim DrillToolList As New ObservableCollection(Of String)
|
||||
DrillToolList.Clear()
|
||||
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
|
||||
DrillToolList.Add(sToolName)
|
||||
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
|
||||
DrillToolList.Add(sToolName)
|
||||
End While
|
||||
Public Function GetDrillFromDrilling(sCurrDrilling As String) As String
|
||||
' Se foratura non definita, esco subito
|
||||
If String.IsNullOrWhiteSpace(sCurrDrilling) Then Return ""
|
||||
' Salvo lavorazione e utensile correnti
|
||||
Dim sPrevMach As String = ""
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sPrevMach)
|
||||
Dim sPrevTool As String = ""
|
||||
EgtTdbGetCurrToolParam(MCH_TP.NAME, sPrevTool)
|
||||
' Inizializzo nome utensile a nessuno
|
||||
Dim sCurrDrill As String = ""
|
||||
' Se esiste la lavorazione
|
||||
If EgtMdbSetCurrMachining(sCurrDrilling) Then
|
||||
' recupero il nome dell'utensile della lavorazione
|
||||
Dim sTuuid As String = ""
|
||||
Dim sToolName As String = ""
|
||||
If Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid) OrElse
|
||||
Not EgtTdbGetToolFromUUID(sTuuid, sToolName) Then
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sToolName)
|
||||
End If
|
||||
' recupero l'utensile associato alla lavorazione
|
||||
'Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||
Dim ToolString As String = String.Empty
|
||||
EgtMdbSetCurrMachining(sCurrDrilling)
|
||||
' Recupero nome utensile tramite TUUID
|
||||
Dim sTuuid As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool As IEnumerable In DrillToolList
|
||||
If CurrTool.ToString() = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bToolExist Then
|
||||
sCurrDrill = ToolString
|
||||
Else
|
||||
sCurrDrill = String.Empty
|
||||
' ne verifico il tipo
|
||||
Dim nToolType As Integer = MCH_TY.NONE
|
||||
If EgtTdbSetCurrTool( sToolName) AndAlso
|
||||
EgtTdbGetCurrToolParam( MCH_TP.TYPE, nToolType) AndAlso ( nToolType And MCH_TF.DRILLBIT) <> 0 Then
|
||||
sCurrDrill = sToolName
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
' Ripristino lavorazione e utensile correnti
|
||||
EgtMdbSetCurrMachining(sPrevMach)
|
||||
EgtTdbSetCurrTool(sPrevTool)
|
||||
' Restituisco il nome dell'utensile
|
||||
Return sCurrDrill
|
||||
End Function
|
||||
|
||||
Public Sub GetMillFromMilling(ByRef sCurrMill As String, ByVal sCurrMilling As String)
|
||||
If String.IsNullOrEmpty(sCurrMill) Or String.IsNullOrWhiteSpace(sCurrMill) Then
|
||||
' creo l'elenco degli utensili di foratura
|
||||
Dim sToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
Dim MillToolList As New ObservableCollection(Of String)
|
||||
MillToolList.Clear()
|
||||
If EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType) Then
|
||||
MillToolList.Add(sToolName)
|
||||
While EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
|
||||
MillToolList.Add(sToolName)
|
||||
End While
|
||||
Public Function GetMillFromMilling(sCurrMilling As String) As String
|
||||
' Se fresatura non definita, esco subito
|
||||
If String.IsNullOrWhiteSpace(sCurrMilling) Then Return ""
|
||||
' Salvo lavorazione e utensile correnti
|
||||
Dim sPrevMach As String = ""
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sPrevMach)
|
||||
Dim sPrevTool As String = ""
|
||||
EgtTdbGetCurrToolParam(MCH_TP.NAME, sPrevTool)
|
||||
' Inizializzo nome utensile a nessuno
|
||||
Dim sCurrMill As String = ""
|
||||
' Se esiste la lavorazione
|
||||
If EgtMdbSetCurrMachining(sCurrMilling) Then
|
||||
' recupero il nome dell'utensile della lavorazione
|
||||
Dim sTuuid As String = ""
|
||||
Dim sToolName As String = ""
|
||||
If Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid) OrElse
|
||||
Not EgtTdbGetToolFromUUID(sTuuid, sToolName) Then
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sToolName)
|
||||
End If
|
||||
' recupero l'utensile associato alla lavorazione
|
||||
'Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||
Dim ToolString As String = String.Empty
|
||||
EgtMdbSetCurrMachining(sCurrMilling)
|
||||
' Recupero nome utensile tramite TUUID
|
||||
Dim sTuuid As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, ToolString)
|
||||
Dim bToolExist As Boolean = False
|
||||
For Each CurrTool As IEnumerable In MillToolList
|
||||
If CurrTool.ToString() = ToolString Then
|
||||
bToolExist = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bToolExist Then
|
||||
sCurrMill = ToolString
|
||||
Else
|
||||
sCurrMill = String.Empty
|
||||
' ne verifico il tipo
|
||||
Dim nToolType As Integer = MCH_TY.NONE
|
||||
If EgtTdbSetCurrTool( sToolName) AndAlso
|
||||
EgtTdbGetCurrToolParam( MCH_TP.TYPE, nToolType) AndAlso ( nToolType And MCH_TF.MILL) <> 0 Then
|
||||
sCurrMill = sToolName
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
' Ripristino lavorazione e utensile correnti
|
||||
EgtMdbSetCurrMachining(sPrevMach)
|
||||
EgtTdbSetCurrTool(sPrevTool)
|
||||
' Restituisco il nome dell'utensile
|
||||
Return sCurrMill
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -387,7 +387,7 @@ Friend Module VeinMatching
|
||||
End Function
|
||||
|
||||
' ------------------- CARICO I PEZZI PRESENTI NEL PROGETTO CORRENTE -------------------
|
||||
' carico tutti i pezzi del progetto corrente che sonon di tipo PCucina, PBagno, AlzFront
|
||||
' carico tutti i pezzi del progetto corrente che sono di tipo PCucina, PBagno, AlzFront
|
||||
Friend Function LoadCurrPartFromProj() As Boolean
|
||||
' Recupero il contesto corrente
|
||||
Dim nCurrCtx = EgtGetCurrentContext()
|
||||
|
||||