Compare commits

...

19 Commits

Author SHA1 Message Date
Nicola Pievani 5190a41470 Lettura degli interi Bit a Bit 2024-07-30 14:30:53 +02:00
Nicola Pievani 3afe6bb35b Migliorata stampa dei messaggi OutLog comunicazione 2024-07-29 13:54:57 +02:00
Nicola Pievani 554ae16e48 Merge branch 'develop' into Features/Manage_SimensOne 2024-07-26 18:35:54 +02:00
Nicola Pievani 1b4d239202 OnOff lavorazioni elezione lavorazioni con DoppioClick 2024-07-26 14:30:35 +02:00
Nicola Pievani 3b2d15703a Lettura bit a bit Siemens 2024-07-25 15:20:47 +02:00
Nicola Pievani 8e5a4d4ac5 Merge branch 'develop' into Features/Manage_SimensOne 2024-07-24 08:51:27 +02:00
Nicola Pievani f2ce55ff27 Nuova versione programma ver 2.6g1 2024-07-17 13:01:48 +02:00
Nicola Pievani ae3b16b715 Merge branch 'Features/Imports_Engrave_Btn' into develop 2024-07-17 12:32:39 +02:00
Nicola Pievani 8ff4b74725 Nuovo parametro MachDb Waterjet (Full Slow) 2024-07-17 12:32:25 +02:00
Nicola Pievani 18fb37b497 Inserito comando per gestione Engrave nella pagina IMPORT 2024-06-26 12:30:04 +02:00
Nicola Pievani 246e55f733 Gestione comandi di taglio in SplitPage per tagli piccoli 2024-06-24 16:10:33 +02:00
Nicola Pievani 9b29b16a33 Merge branch 'Features/ZigZan_In_XY_Plane' into develop 2024-06-18 18:05:01 +02:00
Nicola Pievani 1debeab653 Gestione spianatura con fresa e lama 2024-06-18 18:04:44 +02:00
Nicola Pievani 63c3a4e085 Inizio spianatura a ZigZag in XY 2024-06-13 18:32:09 +02:00
Nicola Pievani 7830105bc4 Merge branch 'Features/Raw_From_Diagonal' into develop 2024-06-13 16:20:09 +02:00
Nicola Pievani 8a11051575 Gestione grezzo definito con due punti 2024-06-13 16:18:10 +02:00
Nicola Pievani 0b50832b4e Correzione gestione StepType in spianatura 2024-06-13 10:09:29 +02:00
Nicola Pievani 40bdcec46e Miglioramenti genarali programma 2024-06-11 17:34:13 +02:00
Nicola Pievani 26ef6b2d3b Migliorata gestione SiemensCommand 2024-03-13 11:26:33 +01:00
22 changed files with 1226 additions and 464 deletions
+36 -10
View File
@@ -38,6 +38,8 @@ Public Module SplitAuto
Public m_dStartFreeLen As Double
Public m_dEndFreeLen As Double
Public m_vtDir As Vector3d
' ver 2.6f4: tagli corti gestiti con LeadIn.OUT/LeadOut.OUT
Public m_bMngLeadInOnIntCorner As Boolean
End Class
'-----------------------------------------------------------------------------------------------
@@ -111,15 +113,19 @@ Public Module SplitAuto
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
Mach.m_nEntId = nEntId
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
End If
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL) And
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL And (nRes And CAR_RES.LI_OK) <> 0) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
@@ -171,6 +177,26 @@ Public Module SplitAuto
Return True
End Function
Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean
If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then
' Posso estendere SOLO l'uscita
bOut = True
bIn = False
ElseIf CurrMach.m_dPrevAng > EPS_ANG_SMALL And CurrMach.m_dNextAng < -EPS_ANG_SMALL Then
' Posso estendere SOLO l'ingresso
bIn = True
bOut = False
ElseIf CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng < -EPS_ANG_SMALL Then
' NON Posso estendere
bIn = False
bOut = False
Else
bIn = True
bOut = True
End If
Return True
End Function
'-----------------------------------------------------------------------------------------------
' calcolo il numero di tipi di lavorazioni
Friend Sub CountMachiningType(MachSplit As SplitMach, ByRef nCountSawing As Integer, ByRef nCountWaterjetting As Integer, ByRef nCountOtherMachining As Integer)
@@ -799,13 +825,13 @@ Public Module SplitAuto
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
vtMove As Vector3d, dMinMove As Double) As Boolean
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
Dim rmData As New RawMoveData
Dim vtMove2 As Vector3d = -vtMove
VacuumCups.ResetHeadName()
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum= PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
rmData.m_vtRawMove = vtMove
SaveOneMoveInfoInDisposition(nDispId, rmData)
@@ -826,9 +852,9 @@ Public Module SplitAuto
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
' Spostamento originale
Dim vtOriMove As New Vector3d( vtMove)
Dim vtOriMove As New Vector3d(vtMove)
' Livello di movimento
Dim nMoveLevel As Integer = GetPrivateProfileInt( S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
Dim nMoveLevel As Integer = GetPrivateProfileInt(S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
Dim nMove As Integer = 1
' Se esce dalla tavola, movimento già annullato ed esco con errore
If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
@@ -863,7 +889,7 @@ Public Module SplitAuto
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += 0.5 * vtOriMove
nMove += 1
If nMoveLevel = nMove Then return True
If nMoveLevel = nMove Then Return True
Else
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
End If
+207 -99
View File
@@ -61,6 +61,9 @@ Public Class SplitPageUC
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
Private m_StartEndModifyOnIntCorner As Boolean = False
Private m_IsCtrlKeyDown As Boolean = False
Private m_IsShiftKeyDown As Boolean = False
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
PrevBtn.IsEnabled = False
' Collego lista di oggetti a ListBox
@@ -453,6 +456,24 @@ Public Class SplitPageUC
#End Region ' Bridge
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene_DoubleClick
If MachiningLsBx.SelectedItems.Count = 1 Then
OnMyMouseDownScene(sender, e)
Dim x As NameIdLsBxItem = DirectCast(MachiningLsBx.SelectedItems(0), NameIdLsBxItem)
Dim nI As Integer = x.Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
x.bIsActive = False
Else
m_MachiningList(nI).m_bEnabled = True
x.bIsActive = True
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
EgtDraw()
End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
@@ -595,6 +616,7 @@ Public Class SplitPageUC
Dim dUsal As Double
' ----------------------- REPEAT -----------------------
Do
If Not m_MachiningList(m_nDragInd).m_bCanStartAll Then Exit Do
dDelta = -dDelta
' Leggo il valore salvato nella geometria
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
@@ -628,6 +650,7 @@ Public Class SplitPageUC
Dim dUeal As Double
dDelta = -dDelta
Do
If Not m_MachiningList(m_nDragInd).m_bCanEndAll Then Exit Do
dDelta = -dDelta
' Leggo il valore salvato nella geometria
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
@@ -731,6 +754,24 @@ Public Class SplitPageUC
EgtDraw()
End Sub
Private Sub MachiningLsBx_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.MouseDoubleClick
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
If MachiningLsBx.SelectedItems.Count = 1 Then
Dim x As NameIdLsBxItem = DirectCast(MachiningLsBx.SelectedItems(0), NameIdLsBxItem)
Dim nI As Integer = x.Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
x.bIsActive = False
Else
m_MachiningList(nI).m_bEnabled = True
x.bIsActive = True
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
EgtDraw()
End If
End Sub
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
MoveItem(-1)
End Sub
@@ -914,11 +955,31 @@ Public Class SplitPageUC
EnableButtons()
End Sub
' ERRORE: questo evento non è eseguito!
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
'' DA FARE: quando seleziono Esc devo togliere deselezionare tutte le enità!
'Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
' If e.Key = Key.Escape Then
' ' se sono in fase di creazione di un ponticello interrompo
' DeselectWJBridgesPart()
' EgtDeselectAll()
' RemoveMarkAndNumbers()
' End If
'End Sub
Private Sub MachiningLsBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyDown
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
m_IsCtrlKeyDown = True
End If
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
m_IsShiftKeyDown = True
End If
End Sub
Private Sub MachiningLsBx_KeyUp(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyUp
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
m_IsCtrlKeyDown = False
End If
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
m_IsShiftKeyDown = False
End If
End Sub
@@ -1125,37 +1186,46 @@ Public Class SplitPageUC
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
End If
Next
' Se modificato qualcosa
@@ -1193,24 +1263,33 @@ Public Class SplitPageUC
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLiPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
If nLiPrev = MCH_SAW_LI.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
Next
EgtDraw()
' Imposto flag di modifica
@@ -1226,37 +1305,46 @@ Public Class SplitPageUC
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
' allungo
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
End If
Next
' Se modificato qualcosa
@@ -1294,24 +1382,33 @@ Public Class SplitPageUC
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
For nI As Integer = 0 To m_MachiningList.Count() - 1
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
Else
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
Dim nLoPrev As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
If nLoPrev = MCH_SAW_LO.OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
' ri-verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
' accorcio
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
Next
EgtDraw()
' Imposto flag di modifica
@@ -1389,6 +1486,12 @@ Public Class SplitPageUC
' Se taglio con lama
If nMachiningType = MCH_MY.SAWING And
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
If Not m_MachiningList(nI).m_bCanStartAll Then
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
Return
End If
' leggo il valore salvato nella geometria
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
@@ -1564,6 +1667,11 @@ Public Class SplitPageUC
If nMachiningType = MCH_MY.SAWING And
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
If Not m_MachiningList(nI).m_bCanEndAll Then
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
Return
End If
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
+2
View File
@@ -223,6 +223,8 @@ Module ConstGen
Public Const INFO_DEPTH2 As String = "Depth2"
Public Const INFO_AGG2 As String = "Agg2"
Public Const INFO_ROUNDOFF As String = "RoundOff"
Public Const INFO_DIRECTCUT As String = "DirectCut"
Public Const INFO_STEP_TYPE As String = "StepType"
' 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
+1
View File
@@ -335,6 +335,7 @@ Module ConstIni
Public Const K_DC_FLATT_HEADSIDE As String = "FlattHeadSide"
Public Const K_DC_FLATT_MACHTYPE As String = "FlattMachType"
Public Const K_DC_FLATT_ROTLOCK As String = "FlattRotLock"
Public Const K_DC_FLAT_CHAINEDPATH As String = "ChainedPath"
Public Const K_DC_FLATT_POSX As String = "FlattPosX"
Public Const K_DC_FLATT_POSY As String = "FlattPosY"
Public Const K_DC_POLISH_NAME As String = "PolishName"
+1
View File
@@ -230,6 +230,7 @@
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_ENGRAVING_DEPTH As String = "EngravingDepth"
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
@@ -23,6 +23,9 @@ Public Class ControlsMachineButtonUC
Friend m_CN As CN_generico
Private m_bFirst As Boolean = True
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
Friend Shared m_OutLogTypeButton As Boolean = True
' Creazione converter da String a ImageSource
Dim ImageConverter As New ImageSourceConverter
@@ -76,6 +79,7 @@ Public Class ControlsMachineButtonUC
For Each MachineButton As MachineButton In m_ButtonList
GetTypeButton(MachineButton)
Next
m_OutLogTypeButton = False
NotifyPropertyChanged("ButtonList")
End If
@@ -87,6 +91,7 @@ Public Class ControlsMachineButtonUC
'-------------------------------------------------------------------------------
Friend Sub GetTypeButton(CurrMachineButton As MachineButton)
If Not m_OutLogTypeButton Then Return
Dim BtnType As Type = CurrMachineButton.GetType
If BtnType Is GetType(NoStateButton) Then
EgtOutLog("" & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
+144 -101
View File
@@ -7,142 +7,185 @@
mc:Ignorable="d"
d:DesignHeight="597.3" d:DesignWidth="256">
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{DynamicResource OmagCut_LightGray}">-->
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{DynamicResource OmagCut_LightGray}">-->
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
<!-- Definizione della Grid FlatteningCut -->
<Grid Name="FlatteningCutGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid FlatteningCut -->
<Grid Name="FlatteningCutGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="Point1Btn" Grid.Column="0"
<ToggleButton Name="Point1Btn" Grid.Column="0"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Acquisisci-P1Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
<Image Source="{DynamicResource Acquisisci-P1Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="Point2Btn" Grid.Column="1"
<ToggleButton Name="Point2Btn" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Acquisisci-P2Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
<Image Source="{DynamicResource Acquisisci-P2Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</Grid>
</Grid>
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
<ScrollViewer VerticalScrollBarVisibility="Visible" Visibility="Visible"
Grid.Row="1" Grid.RowSpan="11" Grid.ColumnSpan="2">
<Grid Name="DatiTaglioGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.1"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="0.1"/>
</Grid.RowDefinitions>
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="LenghtTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
<EgtWPFLib:EgtTextBox Name="LenghtTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="WidthTxBl" Grid.Column="0" Grid.Row="5"
<TextBlock Name="WidthTxBl" Grid.Column="0" Grid.Row="5"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OverlapTxBl" Grid.Column="0" Grid.Row="6"
<TextBlock Name="OverlapTxBl" Grid.Column="0" Grid.Row="6"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OverlapTxBx" Grid.Column="1" Grid.Row="6" Margin="0,0,6,0"
<EgtWPFLib:EgtTextBox Name="OverlapTxBx" Grid.Column="1" Grid.Row="6" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="ZReleasedTxBl" Grid.Column="0" Grid.Row="7"
<TextBlock Name="ZReleasedTxBl" Grid.Column="0" Grid.Row="7"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ZReleasedTxBx" Grid.Column="1" Grid.Row="7" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<EgtWPFLib:EgtTextBox Name="ZReleasedTxBx" Grid.Column="1" Grid.Row="7" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="SideTxBl" Grid.Row="8" Grid.ColumnSpan="2"
<TextBlock Name="SideTxBl" Grid.Row="8" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<CheckBox Name="SideChBx" Grid.Row="8" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
<CheckBox Name="SideChBx" Grid.Row="8" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="0,0,6,0"/>
<ComboBox Name="TypeCmBx" Grid.Row="9" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox Name="TypeCmBx" Grid.Row="9" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RotLockTxBl" Grid.Row="10" Grid.ColumnSpan="2"
<TextBlock Name="RotLockTxBl" Grid.Row="10" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<CheckBox Name="RotLockChBx" Grid.Row="10" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
<CheckBox Name="RotLockChBx" Grid.Row="10" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="0,0,6,0"/>
<Grid Grid.Row="11" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
<TextBlock Name="ChainedPathTxBl" Grid.Row="11" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
<CheckBox Name="ChainedPathChBx" Grid.Row="11" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="0,0,6,0"/>
<Grid Grid.Row="12" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ComboBox Name="SelToolCmBx" Grid.Row="12" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Grid Grid.Row="13" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
</Grid>
</ScrollViewer>
<Grid Grid.Row="12" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource EseguiImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource EseguiImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Border>
</UserControl>
+167 -40
View File
@@ -1,4 +1,6 @@
Imports EgtUILib
Imports System.Reflection
Imports EgtUILib
Imports EgtUILib.EgtInterface
Public Class FlatteningCut
@@ -35,14 +37,18 @@ Public Class FlatteningCut
Private m_bHeadSide As Boolean = False
Private m_nMachType As Integer = 1
Private m_bRotLock As Boolean = False
Private m_bChainedPath As Boolean = True
Private m_nTool As Integer = 0
' Array delle modalità di acquisizione dei punti
Private m_PointsModeArray(2) As String
' Array delle tipologia di lavorazione della spianatura
Private m_TypeArray(1) As String
Private m_TypeArray(2) As String
' Punto selezionato nel disegno
Private m_ptPrev As Point3d
' Layer per crocette temporanee
Private m_nTempLay As Integer = GDB_ID.NULL
' Array degliutensili disponibili (lama e fresa)
Private m_ToolsArray(1) As String
' Costanti
Private Const MAX_TAB_DEPTH As Double = 10.0
@@ -57,8 +63,9 @@ Public Class FlatteningCut
End Enum
' Costanti che indicano la tipologia di lavorazione della spianatura
Private Enum MACH_TYPE As Integer
ONEWAY = 0
ZIGZAG = 1
ZIGZAG = 0
ONEWAY = 1
SPIRAL = 2
End Enum
'Costante che indica il lato in cui posizionare i tagli
Private Enum CutSide As Integer
@@ -66,6 +73,11 @@ Public Class FlatteningCut
Right
End Enum
Private Enum TOOL As Integer
SAW = 0
MILL = 1
End Enum
' Per abilitare la spianatura con la FRESA deve essere imposatato a TRUE il flag "Usa Fresa" nella pagina MACCHINA (campo INCISIONI)
Private Sub FlatteningCut_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creo lista modalità di acquisizione punto
@@ -75,8 +87,9 @@ Public Class FlatteningCut
' la associo alla combobox
PointModeCmBx.ItemsSource = m_PointsModeArray
' Creo lista tipo lavorazione
m_TypeArray(MACH_TYPE.ONEWAY) = EgtMsg(MSG_COMBOBOXPARAM + 39)
m_TypeArray(MACH_TYPE.ZIGZAG) = EgtMsg(MSG_COMBOBOXPARAM + 38)
m_TypeArray(MACH_TYPE.ONEWAY) = EgtMsg(MSG_COMBOBOXPARAM + 39)
m_TypeArray(MACH_TYPE.SPIRAL) = EgtMsg(MSG_COMBOBOXPARAM + 51)
' la associo alla combobox
TypeCmBx.ItemsSource = m_TypeArray
' assegno messaggi
@@ -90,19 +103,26 @@ Public Class FlatteningCut
ZReleasedTxBl.Text = "Z Svincolo"
SideTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
RotLockTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 29)
ChainedPathTxBl.Text = "Chained path"
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
' tipo di utensile in uso per la lavorazione
m_ToolsArray(TOOL.SAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24)
m_ToolsArray(TOOL.MILL) = "Mill"
SelToolCmBx.ItemsSource = m_ToolsArray
' Carico i dati dell'ultimo taglio
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dWid = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_WIDTH, m_dWid, m_MainWindow.GetIniFile())
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dLen = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_LENGTH, m_dLen, m_MainWindow.GetIniFile())
m_dWid = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_WIDTH, m_dWid, m_MainWindow.GetIniFile())
m_dOverlap = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_OVERLAP, m_dOverlap, m_MainWindow.GetIniFile())
m_dZReleased = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, m_dZReleased, m_MainWindow.GetIniFile())
m_bHeadSide = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
m_nMachType = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType, m_MainWindow.GetIniFile())
m_bRotLock = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, 0, m_MainWindow.GetIniFile()) <> 0)
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_nMachType = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType, m_MainWindow.GetIniFile())
m_bRotLock = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, 0, m_MainWindow.GetIniFile()) <> 0)
m_bChainedPath = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLAT_CHAINEDPATH, 0, m_MainWindow.GetIniFile()) <> 0)
m_nTool = GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile())
m_ptTipP1.x = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
End Sub
@@ -125,16 +145,16 @@ Public Class FlatteningCut
' Disabilito registrazione progetto modificato
EgtDisableModified()
' Creo layer temporaneo per crocette
m_nTempLay = EgtCreateGroup( GDB_ID.ROOT)
EgtSetLevel( m_nTempLay, GDB_LV.TEMP)
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
' Origine tavola
m_bRawOk = True
If Not EgtGetTableRef( 1, m_ptTabOri) Then
If Not EgtGetTableRef(1, m_ptTabOri) Then
m_bRawOk = False
EgtOutLog("Error on TableRef1")
End If
' Dati del grezzo
If Not GetRawBox( m_ptRawMin, m_ptRawMax) Then
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then
m_bRawOk = False
EgtOutLog("Error on RawBox")
End If
@@ -142,7 +162,7 @@ Public Class FlatteningCut
m_bPointP1Ok = False
m_bPointP2Ok = False
' Inizializzo primo punto acquisito dal disegno
m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG())
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
m_ptPrev.z = m_ptRawMax.z
' Disegno crocetta che indica il punto acquisito
CreateCross(m_nTempLay, m_ptPrev)
@@ -151,10 +171,10 @@ Public Class FlatteningCut
SetCoordVisibility(True)
ShowCoord()
' Assegno parametri di lavorazione già definiti
DepthTxBx.Text = LenToString( m_dDepth, 1)
DirectionTxBx.Text = DoubleToString( m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
LenghtTxBx.Text = LenToString( m_dLen, 1)
WidthTxBx.Text = LenToString( m_dWid, 2)
DepthTxBx.Text = LenToString(m_dDepth, 1)
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
LenghtTxBx.Text = LenToString(m_dLen, 1)
WidthTxBx.Text = LenToString(m_dWid, 2)
OverlapTxBx.Text = LenToString(m_dOverlap, 2)
ZReleasedTxBx.Text = LenToString(m_dZReleased, 2)
' carico la quota di svincolo per la spianatura
@@ -163,6 +183,9 @@ Public Class FlatteningCut
SideChBx.IsChecked = m_bHeadSide
TypeCmBx.SelectedIndex = m_nMachType
RotLockChBx.IsChecked = m_bRotLock
ChainedPathChBx.IsChecked = m_bChainedPath
' Assegno l'utensile in definito in macchina per la fresatura
SelToolCmBx.SelectedIndex = m_nTool
' Reset taglio e disabilito bottone esecuzione
m_bCutOk = False
UpdateSimulOkBtn()
@@ -176,16 +199,16 @@ Public Class FlatteningCut
Friend Sub FlatteningCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Salvo i dati correnti
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_WIDTH, DoubleToString( m_dWid, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_OVERLAP, DoubleToString(m_dOverlap, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, DoubleToString(m_dZReleased, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, If( m_bHeadSide, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_DEPTH, DoubleToString(m_dDepth, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_ANGH, DoubleToString(m_dAngO, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_LENGTH, DoubleToString(m_dLen, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_WIDTH, DoubleToString(m_dWid, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_OVERLAP, DoubleToString(m_dOverlap, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, DoubleToString(m_dZReleased, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, If(m_bHeadSide, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If(m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' Se non vado in simulazione
If Not m_bSimul Then
@@ -296,7 +319,7 @@ Public Class FlatteningCut
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
' Ora imposto la lama corrente
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
' Altrimenti da lama
' Altrimenti da lama
Else
' Imposto la lama corrente
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
@@ -314,7 +337,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
@@ -378,7 +401,7 @@ Public Class FlatteningCut
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
' Ora imposto la lama corrente
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
' Altrimenti da lama
' Altrimenti da lama
Else
' Imposto la lama corrente
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
@@ -391,7 +414,7 @@ Public Class FlatteningCut
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
m_bPointP2Ok = True
' Altrimenti da disegno
' Altrimenti da disegno
Else
' Assegno punto selezionato nel disegno a m_ptTipP2
m_ptTipP2 = m_ptPrev
@@ -546,6 +569,16 @@ Public Class FlatteningCut
EgtDraw()
End Sub
Private Sub SelToolCmBx_SelectionChanged(sender As Object, e As EventArgs) Handles SelToolCmBx.SelectionChanged
m_nTool = SelToolCmBx.SelectedIndex
' Disabilito il concatenamento
ChainedPathChBx.IsEnabled = (m_nTool = TOOL.MILL)
' Disegno il taglio
CreateFlatteningCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
Private Sub RotLockChBx_Click(sender As Object, e As EventArgs) Handles RotLockChBx.Click
m_bRotLock = RotLockChBx.IsChecked
' Disegno il taglio
@@ -554,6 +587,14 @@ Public Class FlatteningCut
EgtDraw()
End Sub
Private Sub ChainedPathChBx_Click(sender As Object, e As EventArgs) Handles ChainedPathChBx.Click
m_bChainedPath = ChainedPathChBx.IsChecked
' Disegno il taglio
CreateFlatteningCut()
SetMachineInCurrPos()
EgtDraw()
End Sub
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
' Recupero il valore della coordinata (in 0 Tab)
Dim dXcoord As Double = 0
@@ -605,9 +646,9 @@ Public Class FlatteningCut
m_CurrProjPage.SetWarningMessage("Trial Version")
#Else
' Verifico non sia versione Ufficio
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage( "Office Version")
Return
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage("Office Version")
Return
End If
' Verifico ci sia un taglio valido
If Not m_bCutOk Then Return
@@ -644,10 +685,12 @@ Public Class FlatteningCut
' 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 = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0)
Dim bForceUseMill As Boolean = (m_nTool = TOOL.MILL)
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
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
@@ -682,18 +725,24 @@ Public Class FlatteningCut
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
EgtSetInfo(nCutId, INFO_DIRECTCUT, 1)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
If (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0) Then
If (m_nTool = TOOL.MILL) Then
EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool)
End If
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 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
MultiplyCut(nLayerId, nCutId)
' Creo layer per crocetta di riferimento
@@ -726,10 +775,17 @@ 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()
If dThick = 0 Then Return False
' Salvo la prima curva 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
@@ -747,7 +803,10 @@ Public Class FlatteningCut
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
@@ -757,6 +816,7 @@ Public Class FlatteningCut
' 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
@@ -770,10 +830,77 @@ Public Class FlatteningCut
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 -----------------------
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
Next
Dim ptNear As Point3d
EgtStartPoint(CutsList(0), ptNear)
Dim IdJointCurv As Integer = EgtCreateCurveCompoByChain(nLayerId, CutsList.ToArray, ptNear, True)
EgtSetInfo(IdJointCurv, INFO_DIRECTCUT, 1)
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)
End Sub
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
' Aggiungo crocette
Dim vtCrossX As New Vector3d(20, 0, 0)
+6 -3
View File
@@ -72,7 +72,10 @@ 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)
' 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)
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
@@ -263,7 +266,7 @@ Public Class SingleDrillUC
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
m_bPointP1Ok = True
' Imposto la lama corrente
If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
End If
' Disegno il taglio
@@ -443,9 +446,9 @@ Public Class SingleDrillUC
ptIns.z = dRawHeight
' Inserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
EgtSetCurrPhase(1)
' Inserisco la lavorazione
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
EgtSetCurrPhase(1)
' Eventuale eliminazione Home finale
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
RemoveFinalHome()
+7 -2
View File
@@ -22,6 +22,9 @@ Public Class VacuumMachineButtonUC
Friend m_CN As CN_generico
Private m_bFirst As Boolean = True
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
Friend m_OutLogTypeButton As Boolean = True
' Creazione converter da String a ImageSource
Dim ImageConverter As New ImageSourceConverter
@@ -73,8 +76,9 @@ Public Class VacuumMachineButtonUC
End While
For Each MachineButton As MachineButton In m_ButtonList
GetTypeButton(MachineButton)
OutLogTypeButton(MachineButton)
Next
m_OutLogTypeButton = False
NotifyPropertyChanged("ButtonList")
End If
@@ -85,7 +89,8 @@ Public Class VacuumMachineButtonUC
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
'-------------------------------------------------------------------------------
Friend Sub GetTypeButton(CurrMachineButton As MachineButton)
Friend Sub OutLogTypeButton(CurrMachineButton As MachineButton)
If Not m_OutLogTypeButton Then Return
Dim BtnType As Type = CurrMachineButton.GetType
If BtnType Is GetType(NoStateButton) Then
EgtOutLog("" & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
+105 -103
View File
@@ -7,55 +7,57 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="ImportPage_Initialized" Loaded="ImportPage_Loaded" Unloaded="ImportPage_Unloaded">
<!-- Definizione della ImportPage -->
<Border>
<Grid Name="ImportPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid superiore per Button -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<!-- Definizione della ImportPage -->
<Border>
<Grid Name="ImportPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="SideAngleBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<Button Name="Cad2dBtn" Grid.Column="4" Padding="0"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
<!-- Definizione della Grid laterale -->
<Grid Name="LeftGrid" Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="7.25*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
<!-- Definizione della Grid superiore per Button -->
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="SideAngleBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="EngraveBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
<Button Name="Cad2dBtn" Grid.Column="4" Padding="0"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
<!-- Definizione della Grid laterale -->
<Grid Name="LeftGrid" Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="7.25*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<Grid Name="FinderGrd" Grid.Row="3" Margin="0,0,8,0">
@@ -68,68 +70,68 @@
<Button Name="ClearFindBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Margin="0,6,2,6">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}" Width="30" />
</Button>
</Grid>
<Border Name="MessageBrd" Grid.Row="5" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
</Grid>
<Border Name="MessageBrd" Grid.Row="5" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</Border>
</Border>
</Grid>
<!-- Definizione della Grid inferiore per Button -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="UseLayerBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="UseClosedCurveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="UseRegionBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<RadioButton Name="mmBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<RadioButton Name="inchBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Button Name="OrderListBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<ToggleButton Name="TopBtn" Grid.Column="7" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Grid Name="PartNumberGrd" Grid.Column="8" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
TextAlignment="Right"/>
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</Grid>
<Button Name="OkBtn" Grid.Column="10" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!-- Definizione della Grid inferiore per Button -->
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="UseLayerBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="UseClosedCurveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="UseRegionBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<RadioButton Name="mmBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<RadioButton Name="inchBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Button Name="OrderListBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<ToggleButton Name="TopBtn" Grid.Column="7" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Grid Name="PartNumberGrd" Grid.Column="8" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
TextAlignment="Right"/>
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</Grid>
<Button Name="OkBtn" Grid.Column="10" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="11" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
<Button Name="ExitBtn" Grid.Column="11" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</UserControl>
+141 -21
View File
@@ -88,6 +88,7 @@ Public Class ImportPageUC
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati
FiloTopBtn.Content = EgtMsg( 90400) 'Filo Top
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto
EngraveBtn.Content = "Engrave"
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
Cad2dBtn.Content = "Cad 2d"
@@ -163,6 +164,10 @@ Public Class ImportPageUC
' Pulisco tutto
ClearView()
' Definizione di quale comando deve essere visualizzato
DripCutBtn.Visibility = If(String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw), Visibility.Hidden, Visibility.Visible)
EngraveBtn.Visibility = If(DripCutBtn.Visibility <> Visibility.Visible, Visibility.Visible, Visibility.Hidden)
FileListBox.UnselectAll()
' inibisco selezione diretta da Scene
ImportScene.SetStatusNull()
@@ -343,7 +348,12 @@ Public Class ImportPageUC
ResetBtn.IsEnabled = False
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
' Evito di settare le proprietà di oggeti che sono con visibilità Hidden
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
Return True
End Function
@@ -404,7 +414,11 @@ Public Class ImportPageUC
OkBtn.IsEnabled = False
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
ElseIf m_nFileType = FT_TRF Or m_nFileType = FT_CUT Then
' abilito bottone Insert, disabilito bottoni UseLayer, UseClosedCurve, UseRegion e Reset
@@ -420,7 +434,11 @@ Public Class ImportPageUC
OkBtn.IsEnabled = True
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
End If
' altrimenti import per cornici
@@ -433,10 +451,10 @@ Public Class ImportPageUC
End Function
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
OnMouseDownSceneSideAngle( e)
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked Then
OnMouseDownSceneSideAngle(e)
ElseIf DripDrillBtn.IsChecked() Then
OnMouseDownSceneUnderDrill( e)
OnMouseDownSceneUnderDrill(e)
ElseIf FiloTopBtn.IsChecked() Then
OnMouseDownSceneFiloTop( e)
End If
@@ -619,7 +637,7 @@ Public Class ImportPageUC
Private Sub SelectedPartChanged()
' Se sono in modalità inclinazioni o gocciolatoio calcolo lati inclinabili e creo testi
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked() Then
m_SideAngleUC.ReLoadSideAnglePage()
End If
End Sub
@@ -680,8 +698,12 @@ Public Class ImportPageUC
' abilito bottone angoli su lati esterni
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
End Sub
@@ -712,8 +734,12 @@ Public Class ImportPageUC
' abilito bottone angoli su lati esterni
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
End Sub
@@ -744,8 +770,12 @@ Public Class ImportPageUC
' abilito bottone angoli su lati esterni
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
End Sub
@@ -1029,22 +1059,24 @@ Public Class ImportPageUC
' Salvo direttorio corrente
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
' Tolgo pagina inclinazioni/gocciolatoi se attiva
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked() Then
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
If SideAngleBtn.IsChecked() Then
SideAngleBtn.IsChecked = False
ElseIf EngraveBtn.IsChecked() Then
EngraveBtn.IsChecked = False
Else
DripCutBtn.IsChecked() = False
End If
' Tolgo pagina fori da sotto se attiva
' Tolgo pagina fori da sotto se attiva
ElseIf DripDrillBtn.IsChecked() Then
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_UnderDrillUC)
DripDrillBtn.IsChecked() = False
' Tolgo pagina Filo Top se attiva
' Tolgo pagina Filo Top se attiva
ElseIf FiloTopBtn.IsChecked() Then
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
@@ -1071,7 +1103,11 @@ Public Class ImportPageUC
FileListBox.Visibility = Windows.Visibility.Hidden
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
FiloTopBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
@@ -1093,8 +1129,72 @@ Public Class ImportPageUC
EgtDeselectAll()
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
mmBtn.IsEnabled = True
inchBtn.IsEnabled = True
' Elimino scritte angoli per input e inserisco quelle definitive
SideAngle.WriteSideAngleForNest(ImportScene.GetCtx())
' Riabilito bottone reset
ResetBtn.IsEnabled = True
' Pulisco area messaggi
MessageTxBx.Text = ""
MessageBrd.Background = Brushes.Transparent
End If
EgtZoom(ZM.ALL)
End Sub
Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click
If EngraveBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni per percorsi interni
AdjustSelectRegions()
' Dichiaro nessuna selezione
m_nSelectedPart = GDB_ID.NULL
m_nSelectedLayer = GDB_ID.NULL
' Imposto modalità sideangle
m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE
LeftGrid.Children.Add(m_SideAngleUC)
FilePathTxBl.Visibility = Windows.Visibility.Hidden
FileListBox.Visibility = Windows.Visibility.Hidden
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
' Disabilito bottone reset
ResetBtn.IsEnabled = False
' Messaggio di selezione da effettuare
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
' Deseleziono eventuali pezzi rimasti selezionati
m_nSelectedPart = GDB_ID.NULL
m_nSelectedLayer = GDB_ID.NULL
EgtDeselectAll()
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
mmBtn.IsEnabled = True
@@ -1124,6 +1224,9 @@ Public Class ImportPageUC
' Disabilito SideAngleBtn,FiloTop, DripDrillBtn e unità di misura
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
If DripCutBtn.Visibility <> Visibility.Visible Then
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
@@ -1144,8 +1247,9 @@ Public Class ImportPageUC
' Riabilito SideAngleBtn, FiloTop, DripDrillBtn e unità di misura
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
If DripCutBtn.Visibility <> Visibility.Visible Then
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
mmBtn.IsEnabled = True
inchBtn.IsEnabled = True
' Elimino scritte angoli per input e inserisco quelle definitive
@@ -1174,7 +1278,11 @@ Public Class ImportPageUC
' Disabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
SideAngleBtn.IsEnabled = False
FiloTopBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
' Disabilito bottone reset
@@ -1196,8 +1304,12 @@ Public Class ImportPageUC
' Riabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
mmBtn.IsEnabled = True
inchBtn.IsEnabled = True
' Riabilito bottone reset
@@ -1223,7 +1335,11 @@ Public Class ImportPageUC
FileListBox.Visibility = Windows.Visibility.Hidden
' Disabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
SideAngleBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = False
Else
EngraveBtn.IsEnabled = False
End If
DripDrillBtn.IsEnabled = False
mmBtn.IsEnabled = False
inchBtn.IsEnabled = False
@@ -1245,8 +1361,12 @@ Public Class ImportPageUC
EgtDeselectAll()
' Riabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
If DripCutBtn.Visibility = Visibility.Visible Then
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
Else
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
End If
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
mmBtn.IsEnabled = True
+1 -1
View File
@@ -61,7 +61,7 @@ Public Class MachiningDbPageUC
StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)}
RouFinStepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39)}
ExtCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(MSG_COMBOBOXPARAM + 45)}
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44)}
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(90852)}
' Assegno array a combobox
WorkSideCmBx.ItemsSource = WorkSide
+2 -2
View File
@@ -343,8 +343,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2605, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2605, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2607, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2607, 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
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.6.5.2")>
<Assembly: AssemblyFileVersion("2.6.5.2")>
<Assembly: AssemblyVersion("2.6.7.6")>
<Assembly: AssemblyFileVersion("2.6.7.6")>
+177 -70
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports EgtUILib
Imports System.IO
Imports System.Text
Imports EgtWPFLib.EgtMsgBox
Imports OmagCUT.CN_generico
Public Class CNCommunication
@@ -240,6 +241,16 @@ Public Class CNCommunication
m_bInInches = (GetPrivateProfileInt(S_AXES, K_ININCHES, 0, m_MainWindow.GetMachIniFile()) <> 0)
End Sub
Private Sub KillSimensCom(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
If proc.ProcessName.ToString = sAppName Then
proc.Kill()
End If
Next
End Sub
Private Sub InitCn()
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Yellow")
@@ -275,6 +286,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)
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)
@@ -406,8 +418,9 @@ Public Class CNCommunication
EgtOutLog("Error starting NC communication : " & ex.Message)
End Try
'' Per forzare la lettura delle variabili siemens di configurazione
'm_nNCType = 3
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
' m_nNCType = 3
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
Select Case m_nNCType
Case 0 'Debug
@@ -433,33 +446,27 @@ Public Class CNCommunication
Try
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
Dim sArg As String = "-start """ & m_sCNSiemensPath & """"
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
KillSimensCom(m_sCNSiemensHMIPath)
Process.Start(m_sCNSiemensHMIPath, sArg)
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
If m_CN.m_IsSiemensOne Then
' ' Creo l'abbonamento delle seguenti varibili che saranno sempre lette in ciclo dal Siemenscomm
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
' ' stati bottoni ventose
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac), VarType.TInteger, 1)
' ' stati porte
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed), VarType.TInteger, 2)
' ' ventose
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
' ' stati bottoni parte 2
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.CBAxes), VarType.TInteger, 4)
' ' ampere e ampere override
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Spindle), VarType.TDouble, 0)
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
' Leggo tutte le varaibili che sono state caricate nel percorso [NcData] del file *.ini
Dim nIndexArrayBool As Integer = 0
Dim nIndexArrayInt As Integer = 0
Dim nIndexArrayLong As Integer = 0
Dim nIndexArrayDoub As Integer = 0
Dim nIndexArrayStr As Integer = 0
' Creo un vettore che mi permetta di risalire a cose contiene ogni vettore FLAG (di tipo Enum)
' lista che associa Indice del vettore al nome (per associazioni Bit a Bit)
Dim ListIndexToVar As New List(Of IndexArrayToBit)
' Creo un vettore che mi permetta di risalire a cosa contiene ogni vettore FLAG (di tipo Enum)
For ItemIndex As Integer = 0 To m_CN.m_szCnDataVar.Count - 1
' escludo i Flag 'Comm' e 'Refresh'
If ItemIndex = CnData.Comm Or ItemIndex = CnData.Refresh Then
@@ -511,6 +518,35 @@ Public Class CNCommunication
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayStr)
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayStr, ItemIndex, nVarType))
nIndexArrayStr += 1
Case 5
If nIndexArrayInt > 14 Then
Continue For
End If
' verifico se devo riempire un vettore con bit
Dim sSubItem As String() = sItem(1).Split("."c)
' //My. name. Is Bond._James Bond!
Dim sVarName = String.Join(".", sSubItem.Take(sSubItem.Length - 1)) ' //My. name. Is Bond
Dim sIndexBit = sSubItem.Last() ' //_James Bond!
If sSubItem.Count > 1 And IsNumeric(sIndexBit) Then
Dim bFound As Boolean = False
Dim nIndexArrayInt_1 As Integer = nIndexArrayInt
For Each VarSiemens As IndexArrayToBit In ListIndexToVar
If VarSiemens.sNameVar.Trim = sVarName.Trim Then
nIndexArrayInt_1 = VarSiemens.nIndex
bFound = True
Exit For
End If
Next
nVarType = VarType.TInteger
m_CN.DVariables_Read_Subscription(sVarName, nVarType, nIndexArrayInt_1)
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayInt_1, ItemIndex, nVarType, sIndexBit))
If Not bFound Then
nIndexArrayInt += 1
ListIndexToVar.Add(New IndexArrayToBit(nIndexArrayInt_1, sVarName.Trim))
End If
Else
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è inidicato il bit associato")
End If
Case Else
If nIndexArrayInt > 14 Then
Continue For
@@ -521,6 +557,8 @@ Public Class CNCommunication
nIndexArrayInt += 1
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)")
End If
End If
Next
@@ -528,6 +566,7 @@ Public Class CNCommunication
' Recupero il perocorso delle variabili PLC
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
ElseIf m_CN.m_IsActiveModeSubscription Then
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
End If
@@ -1055,6 +1094,68 @@ Public Class CNCommunication
'Laser = 16384
End Enum
#Region "MASCHERA per conttrollo Bit a Bit"
<Flags()>
Public Enum Mask As Integer
bit_Err = -1
bit_0 = &H1 ' 1
bit_1 = &H2 ' 2
bit_2 = &H4 ' 4
bit_3 = &H8 ' 8
bit_4 = &H10 ' 16
bit_5 = &H20 ' 32
bit_6 = &H40 ' 64
bit_7 = &H80 ' 128
bit_8 = &H100 ' 256
bit_9 = &H200 ' 512
bit_10 = &H400 ' 1024
bit_11 = &H800 ' 2048
bit_12 = &H1000 ' 4096
bit_13 = &H2000 ' 8192
bit_14 = &H4000 ' 16384
bit_15 = &H8000 ' 32768
End Enum
Public Function GetMaskByBit(IndexBit As Integer) As Mask
Dim Bit_ As Mask = Mask.bit_Err
Select Case IndexBit
Case 0
Bit_ = Mask.bit_0
Case 1
Bit_ = Mask.bit_1
Case 2
Bit_ = Mask.bit_2
Case 3
Bit_ = Mask.bit_3
Case 4
Bit_ = Mask.bit_4
Case 5
Bit_ = Mask.bit_5
Case 6
Bit_ = Mask.bit_6
Case 7
Bit_ = Mask.bit_7
Case 8
Bit_ = Mask.bit_8
Case 9
Bit_ = Mask.bit_9
Case 10
Bit_ = Mask.bit_10
Case 11
Bit_ = Mask.bit_11
Case 12
Bit_ = Mask.bit_12
Case 13
Bit_ = Mask.bit_13
Case 14
Bit_ = Mask.bit_14
Case 15
Bit_ = Mask.bit_15
End Select
Return Bit_
End Function
#End Region ' Maschera per controllo Bit a Bit
Public Function IsSetAll(value As Integer, flag As Integer) As Boolean
' somma Bit a Bit
Return ((value And flag) = flag)
@@ -1070,7 +1171,7 @@ Public Class CNCommunication
m_MachineStatus.DisplaySpeed()
m_MachineStatus.DisplayPower()
'm_MachineStatus.DisplayPower()
m_MachineStatus.DisplayVar()
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
@@ -1103,66 +1204,17 @@ Public Class CNCommunication
End If
End If
' lettura delle variabili abbonate
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
' ' lettura variabili stati mancanti su Siemens
' Dim nVarValue As Integer = m_CN.n_data(0)
' EgtOutLog("Variabile PLC control addr: " & 1 & " value: " & nVarValue)
' m_CN.bSpindleState = IsSetAll(nVarValue, ControlStates.Spindle)
' m_CN.bLaserTracState = IsSetAll(nVarValue, ControlStates.LaserTrac)
' m_CN.bCoolantState = IsSetAll(nVarValue, ControlStates.Coolant)
' m_CN.bInternalCoolantState = IsSetAll(nVarValue, ControlStates.InternalCoolant)
' m_CN.bExternCoolantState = IsSetAll(nVarValue, ControlStates.ExternCoolant)
' m_CN.bCBAxesState = IsSetAll(nVarValue, ControlStates.CAxis)
' m_CN.bAirBlowState = IsSetAll(nVarValue, ControlStates.AirBlow)
' m_CN.bHomeState = IsSetAll(nVarValue, ControlStates.Home)
' m_CN.bTableUpState = IsSetAll(nVarValue, ControlStates.TableUp)
' m_CN.bTableDownState = IsSetAll(nVarValue, ControlStates.TableDown)
' m_CN.bLimitZState = IsSetAll(nVarValue, ControlStates.LimitZ)
' m_CN.b5AxesState = IsSetAll(nVarValue, ControlStates.Axis5)
'nVarValue = m_CN.n_data(1)
''EgtOutLog("Variabile PLC vacuum addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac) & " value: " & nVarValue)
'm_CN.bVacuumUp = IsSetAll(nVarValue, VacuumStates.VacuumUp)
'm_CN.bVacuumDown = IsSetAll(nVarValue, VacuumStates.VacuumDown)
'm_CN.bVacuum2Up = IsSetAll(nVarValue, VacuumStates.Vacuum2Up)
'm_CN.bVacuum2Down = IsSetAll(nVarValue, VacuumStates.Vacuum2Down)
'm_CN.bVacuum1State = IsSetAll(nVarValue, VacuumStates.Vacuum1State)
'm_CN.bVacuum2State = IsSetAll(nVarValue, VacuumStates.Vacuum2State)
'm_CN.bVacuum3State = IsSetAll(nVarValue, VacuumStates.Vacuum3State)
'm_CN.bVacuum4State = IsSetAll(nVarValue, VacuumStates.Vacuum4State)
'm_CN.bVacuum5State = IsSetAll(nVarValue, VacuumStates.Vacuum5State)
'm_CN.bVacuum6State = IsSetAll(nVarValue, VacuumStates.Vacuum6State)
'm_CN.bOpenAllState = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State And m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
'm_CN.bCloseAllState = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State And Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
'm_CN.bOpen123State = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State)
'm_CN.bOpen456State = (m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
'm_CN.bClose123State = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State)
'm_CN.bClose456State = (Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
'm_CN.bBlowState = IsSetAll(nVarValue, VacuumStates.AirBlow)
'm_CN.bVacuumOn = IsSetAll(nVarValue, VacuumStates.VacuumOn)
'm_CN.bVacuumOff = IsSetAll(nVarValue, VacuumStates.VacuumOff)
'm_CN.bBypassState = IsSetAll(nVarValue, VacuumStates.BypassState)
'
'nVarValue = m_CN.n_data(2)
''EgtOutLog("Variabile PLC door addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed) & " value: " & nVarValue)
'm_CN.nDoorClosedState = nVarValue
'
'nVarValue = m_CN.n_data(4)
''EgtOutLog("Variabile PLC control 2 addr: " & 3 & " value: " & nVarValue)
'm_CN.bLaserState = IsSetAll(nVarValue, ControlStates2.Laser)
'm_CN.bHsm = IsSetAll(nVarValue, ControlStates2.Hsm)
'm_CN.bResetState = IsSetAll(nVarValue, ControlStates2.ResetState)
'm_CN.bFeedHold = IsSetAll(nVarValue, ControlStates2.FeedHold)
'm_CN.bSpeedHold = IsSetAll(nVarValue, ControlStates2.SpindleHold)
'------------ SINUMERIK ONE ----------------------------------------------
For IndxLst As Integer = 0 To ListReferenceIndex.Count - 1
Dim nType As Integer = ListReferenceIndex(IndxLst).TypeArray
Dim nFlag As Integer = ListReferenceIndex(IndxLst).FlagIndex
Dim nIndex As Integer = ListReferenceIndex(IndxLst).SiemnesArrayIndex
Dim nIndexBit As Integer = ListReferenceIndex(IndxLst).IndexBit
Dim b_temp As Boolean = False
Dim n_temp As Boolean = 0
Dim n_temp As Integer = 0
Dim l_temp As Long = 0.0
Dim d_temp As Double = 0.0
' leggo il valore caricato
@@ -1171,6 +1223,8 @@ Public Class CNCommunication
b_temp = m_CN.b_data(nIndex)
Case VarType.TInteger
n_temp = m_CN.n_data(nIndex)
' VENTOSE: lettura dato da intero Bit a Bit (ver_2.6h1), ritorno un Boolean
b_temp = ReadBit(nIndexBit, n_temp)
Case VarType.TLong
l_temp = m_CN.l_data(nIndex)
Case VarType.TDouble
@@ -1195,6 +1249,8 @@ Public Class CNCommunication
Else
m_nCountRefresh = m_nCountRefresh + 1
End If
Case CN_generico.CnData.Power
m_CN.d_spindle_power = d_temp
Case CN_generico.CnData.Spindle ' (7) Stato rotazione mandrino
m_CN.bSpindleState = b_temp
Case CN_generico.CnData.Coolant ' (8) Stato acqua
@@ -1293,6 +1349,8 @@ Public Class CNCommunication
End If
m_MachineStatus.DisplayPower()
' 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
@@ -1382,6 +1440,14 @@ Public Class CNCommunication
End Sub
Private Function ReadBit(IndexBit As Integer, Val As Integer) As Boolean
If IndexBit < 0 Then Return False
Dim _mask = GetMaskByBit(IndexBit)
If _mask = Mask.bit_Err Then Return False
If (Val And _mask) = 0 Then Return False
Return True
End Function
Friend Function SetProgramMainOrSub(bMain As Boolean) As Boolean
Return m_CN.SetProgramMainOrSub(bMain)
End Function
@@ -1599,6 +1665,8 @@ Public Class RefereceFlagSimens
Private m_SiemnesArrayIndex As Integer
Private m_FlagIndex As Integer
Private m_TypeArray As Integer
' Opzionale
Private m_IndexBit As Integer = -1
Public Property SiemnesArrayIndex As Integer
Get
@@ -1627,10 +1695,49 @@ Public Class RefereceFlagSimens
End Set
End Property
Public Property IndexBit As String
Get
Return m_IndexBit
End Get
Set(value As String)
m_IndexBit = value
End Set
End Property
Sub New(IndArray As Integer, Flag As Integer, nType As Integer)
m_SiemnesArrayIndex = IndArray
m_FlagIndex = Flag
m_TypeArray = nType
End Sub
Sub New(IndArray As Integer, Flag As Integer, nType As Integer, nIndBit As Integer)
m_SiemnesArrayIndex = IndArray
m_FlagIndex = Flag
m_TypeArray = nType
m_IndexBit = nIndBit
End Sub
End Class
Public Class IndexArrayToBit
Private m_nIndex As Integer = 0
Public ReadOnly Property nIndex As Integer
Get
Return m_nIndex
End Get
End Property
Private m_sNameVar As String = ""
Public ReadOnly Property sNameVar As String
Get
Return m_sNameVar
End Get
End Property
Sub New(Index As Integer, NameVar As String)
m_nIndex = Index
m_sNameVar = NameVar
End Sub
End Class
+1 -1
View File
@@ -228,7 +228,7 @@ Public Class CN_Siemens
Public Overrides Sub DVariables_Read_Subscription(VarAddr As String, ParType As Short, Index As Integer)
' Ricevo il percorso della varibile, il tipo
Dim n_ret As Short = Read_subscription(VarAddr, ParType, Index)
'EgtOutLog("CN SIEMENS Dopo lettura abbonamento")
EgtOutLog(" ABBONAMENTO (Esito: " & n_ret.ToString & ") -> Address: " & VarAddr & ", Type: " & ParType.ToString & ", Index: " & Index.ToString)
End Sub
'
+8 -6
View File
@@ -345,6 +345,9 @@ Module M_MMFiles
Function ActivateProgram(ByVal sz_part_program As String) As Short
'EgtOutLog("ActivateProgram start dell'm_mmFiles")
EgtOutLog("Flag di comando: " & CMD.CMD_ActivateProgram.ToString)
EgtOutLog("Stringa di comando: " & sz_part_program.ToString)
SiemensSend.n_Command = CMD.CMD_ActivateProgram
SiemensSend.sz_string = sz_part_program
@@ -600,16 +603,15 @@ 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 & "'")
EgtOutLog(" Indice del vettore associato '" & Index & "'")
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
execute_command()
m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message = SiemensRet.sz_interf_error_message
EgtOutLog("sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
EgtOutLog("n_result: " & SiemensRet.n_result)
EgtOutLog(" sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
EgtOutLog(" n_result: " & SiemensRet.n_result)
Return SiemensRet.n_result
End Function
+1 -1
View File
@@ -289,6 +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)
If nret <> 0 Then Return False
n_state = 2
@@ -583,7 +584,6 @@ Namespace Num
End Function
Function Read_machine_pos() As Int16
Dim nret As Int16
Dim i, n As Integer
+8 -1
View File
@@ -7,6 +7,7 @@ Imports EgtWPFLib5
Public Class CurrentProjectPageUC
' Dichiarazione eventi
Friend Event OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
Friend Event OnMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)
Friend Event OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
Friend Event OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Riferimento alla MainWindow
@@ -336,6 +337,10 @@ Public Class CurrentProjectPageUC
RaiseEvent OnMouseDownScene(sender, e)
End Sub
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.MouseDoubleClick
RaiseEvent OnMouseDownScene_DoubleClick(sender, e)
End Sub
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseMoveScene
RaiseEvent OnMouseMoveScene(sender, e)
End Sub
@@ -495,7 +500,9 @@ Public Class CurrentProjectPageUC
' Nuova geometria
Dim nAddTabId As Integer = GDB_ID.NULL
' Se esiste geometria di riferimento
Dim nRefAddTabId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetTableId( MAIN_TAB), "SOLID"), MACH_ADD_TABLE)
Dim sNameTable As String = MAIN_TAB
EgtGetTableName(sNameTable)
Dim nRefAddTabId = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(EgtGetTableId(sNameTable), "SOLID"), MACH_ADD_TABLE)
If nRefAddTabId <> GDB_ID.NULL Then
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId)
EgtSetStatus( nAddTabId, GDB_ST.ON_)
+3 -1
View File
@@ -136,7 +136,9 @@
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<ToggleButton Name="RemoveBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
<Button Name="CloseBtn" Grid.Row="1"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RectangleBtn" Grid.Row="1" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
+201
View File
@@ -210,6 +210,7 @@ Public Class RawPartPageUC
AddBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 14) 'Add - Aggiungi
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
RectangleBtn.Content = "Rectangle"
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
OtherRefTabTxBl.Text = "New Ref On Tab"
@@ -328,6 +329,7 @@ Public Class RawPartPageUC
RawModeCmBx.SelectedIndex = RAWMODE.BY_POINTS
PointsGpBx.Visibility = Windows.Visibility.Visible
CloseBtn.Visibility = Windows.Visibility.Hidden
RectangleBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo crocette
UpdateCircles()
EgtZoom(ZM.ALL)
@@ -756,6 +758,8 @@ Public Class RawPartPageUC
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
' Non è possibile uscire con tastatura in corso
If m_bProbingOn Then Return
' reimposto il comando OutLine
@@ -921,6 +925,7 @@ Public Class RawPartPageUC
RawModeView()
' Disattivo il bottone
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
OkBtn.IsEnabled = False
Case 3 ' Da Lama
If Not m_MainWindow.m_CurrentMachine.bSaw Then ' Da fotografia
@@ -953,6 +958,7 @@ Public Class RawPartPageUC
RawModeView()
' Disattivo il bottone
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
OkBtn.IsEnabled = False
Case 4 ' Da fotografia
' Se ero in modalità da laser
@@ -1017,6 +1023,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 2)
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
CloseBtn.Visibility = Windows.Visibility.Hidden
RectangleBtn.Visibility = Windows.Visibility.Hidden
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
@@ -1039,6 +1046,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
RectangleBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
@@ -1061,6 +1069,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 2)
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
CloseBtn.Visibility = Windows.Visibility.Hidden
RectangleBtn.Visibility = Windows.Visibility.Hidden
' Attivo bottoni zone rovinate
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
' Disattivo bottoni foto
@@ -1100,6 +1109,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
RectangleBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
@@ -1121,6 +1131,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
RectangleBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
@@ -1142,6 +1153,7 @@ Public Class RawPartPageUC
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
RectangleBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
@@ -1198,6 +1210,9 @@ Public Class RawPartPageUC
End Sub
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
' disabilito i comandi di chiusura contorno
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
Select Case m_ActiveRawMode
Case RAWMODE.RECTANGLE
AddBtn.IsChecked = False
@@ -1246,9 +1261,15 @@ Public Class RawPartPageUC
m_bptLast = True
End If
m_ptLast = ptAcquired
' Se ho almeno un segmento allora deve essere la diagonale
If m_CurveXKerfList.Count = 1 Then
OkBtn.IsEnabled = True
RectangleBtn.IsEnabled = True
End If
If m_CurveXKerfList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
AddBtn.IsChecked = False
EgtDraw()
@@ -1294,9 +1315,14 @@ Public Class RawPartPageUC
m_bptLast = True
End If
m_ptLast = ptAcquired
If m_CurveXKerfList.Count = 1 Then
OkBtn.IsEnabled = True
RectangleBtn.IsEnabled = True
End If
If m_CurveXKerfList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
AddBtn.IsChecked = False
EgtDraw()
@@ -1352,9 +1378,14 @@ Public Class RawPartPageUC
m_bptLast = True
End If
m_ptLast = ptAcquired
If m_CurveXDamagedAreaList.Count = 1 Then
OkBtn.IsEnabled = True
RectangleBtn.IsEnabled = True
End If
If m_CurveXDamagedAreaList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
AddBtn.IsChecked = False
EgtDraw()
@@ -1400,9 +1431,14 @@ Public Class RawPartPageUC
m_bptLast = True
End If
m_ptLast = ptAcquired
If m_CurveXDamagedAreaList.Count = 1 Then
OkBtn.IsEnabled = True
RectangleBtn.IsEnabled = True
End If
If m_CurveXDamagedAreaList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
AddBtn.IsChecked = False
EgtDraw()
@@ -1487,6 +1523,17 @@ Public Class RawPartPageUC
' Aggiorno ptLast
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
End If
' reset dei comandi di chiusura
If m_CurveXKerfList.Count = 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = True
End If
If m_CurveXKerfList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
Else
m_bptLast = False
End If
@@ -1507,6 +1554,17 @@ Public Class RawPartPageUC
' Aggiorno ptLast
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
End If
' reset dei comandi di chiusura
If m_CurveXKerfList.Count = 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = True
End If
If m_CurveXKerfList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
Else
m_bptLast = False
End If
@@ -1537,6 +1595,17 @@ Public Class RawPartPageUC
' Aggiorno ptLast
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
End If
' reset dei comandi di chiusura
If m_CurveXDamagedAreaList.Count = 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = True
End If
If m_CurveXDamagedAreaList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
Else
m_bptLast = False
End If
@@ -1557,6 +1626,17 @@ Public Class RawPartPageUC
' Aggiorno ptLast
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
End If
' reset dei comandi di chiusura
If m_CurveXDamagedAreaList.Count = 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = True
End If
If m_CurveXDamagedAreaList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
RectangleBtn.IsEnabled = False
End If
Else
m_bptLast = False
End If
@@ -2581,6 +2661,21 @@ Public Class RawPartPageUC
EgtEmptyGroup(m_nTempLay)
End Sub
Private Sub RectangleBtn_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
Select Case m_ActiveRawMode
Case RAWMODE.DAMAGED_BY_LASER
CloseDamagedAreaByLaser_Rectangle()
Case RAWMODE.DAMAGED_BY_SAW
CloseDamagedAreaBySaw_Rectangle()
Case RAWMODE.FROM_SAW
CloseRawBySaw_Rectangle()
Case Else
CloseRawByLaser_Rectangle()
End Select
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nTempLay)
End Sub
Private Sub CloseRawByLaser()
' Verifico ci siano punti
If m_CurveXKerfList.Count() = 0 Then Return
@@ -2615,6 +2710,33 @@ Public Class RawPartPageUC
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
End Sub
Private Sub CloseRawByLaser_Rectangle()
' Verifico ci siano punti
If m_CurveXKerfList.Count() <> 1 Then Return
' Recupero punto iniziale prima e unica linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXKerfList(0), ptStart)
' Recupero punto finale prima e unica linea del grezzo
Dim ptEnd As Point3d
EgtEndPoint(m_CurveXKerfList(0), ptEnd)
' Elimo il segmemnto usato come diagonale
EgtErase(m_CurveXKerfList(0))
' Pulisco lista entità del grezzo (che contiene la diagonale)
m_CurveXKerfList.Clear()
' Procedo a costruire il rettangolo
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
' salvo come ultimo punto, l'ultimo calcolato
m_ptLast = pt_Temp
'CurveXKerfArray(3) = EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptStart)
'm_CurveXKerfList.Add(CurveXKerfArray(3))
CloseRawByLaser()
End Sub
Private Sub CloseRawBySaw()
@@ -2651,6 +2773,33 @@ Public Class RawPartPageUC
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
End Sub
Private Sub CloseRawBySaw_Rectangle()
' Verifico ci siano punti
If m_CurveXKerfList.Count() <> 1 Then Return
' Recupero punto iniziale prima e unica linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXKerfList(0), ptStart)
' Recupero punto finale prima e unica linea del grezzo
Dim ptEnd As Point3d
EgtEndPoint(m_CurveXKerfList(0), ptEnd)
' Elimo il segmemnto usato come diagonale
EgtErase(m_CurveXKerfList(0))
' Pulisco lista entità del grezzo (che contiene la diagonale)
m_CurveXKerfList.Clear()
' Procedo a costruire il rettangolo
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
' salvo come ultimo punto, l'ultimo calcolato
m_ptLast = pt_Temp
'CurveXKerfArray(3) = EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptStart)
'm_CurveXKerfList.Add(CurveXKerfArray(3))
CloseRawBySaw()
End Sub
#Region "Damaged Area"
@@ -2707,6 +2856,32 @@ Public Class RawPartPageUC
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
End Sub
Private Sub CloseDamagedAreaByLaser_Rectangle()
' Verifico che esista una sola linea
If m_CurveXDamagedAreaList.Count() <> 1 Then Return
' Recupero punto iniziale prima linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXDamagedAreaList(0), ptStart)
' Recupero punto finale prima e unica linea del grezzo
Dim ptEnd As Point3d
EgtEndPoint(m_CurveXDamagedAreaList(0), ptEnd)
' Elimo il segmemnto usato come diagonale
EgtErase(m_CurveXDamagedAreaList(0))
' Pulisco lista entità del grezzo (che contiene la diagonale)
m_CurveXDamagedAreaList.Clear()
' Procedo a costruire il rettangolo
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
' salvo come ultimo punto, l'ultimo calcolato
m_ptLast = pt_Temp
' procedo a costruire il rettangolo
CloseDamagedAreaByLaser()
End Sub
Private Sub CloseDamagedAreaBySaw()
@@ -2733,6 +2908,32 @@ Public Class RawPartPageUC
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
RectangleBtn.IsEnabled = False
End Sub
Private Sub CloseDamagedAreaBySaw_Rectangle()
' Verifico che esista una sola linea
If m_CurveXDamagedAreaList.Count() <> 1 Then Return
' Recupero punto iniziale prima linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXDamagedAreaList(0), ptStart)
' Recupero punto finale prima e unica linea del grezzo
Dim ptEnd As Point3d
EgtEndPoint(m_CurveXDamagedAreaList(0), ptEnd)
' Elimo il segmemnto usato come diagonale
EgtErase(m_CurveXDamagedAreaList(0))
' Pulisco lista entità del grezzo (che contiene la diagonale)
m_CurveXDamagedAreaList.Clear()
' Procedo a costruire il rettangolo
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
' salvo come ultimo punto, l'ultimo calcolato
m_ptLast = pt_Temp
' procedo a costruire il rettangolo
CloseDamagedAreaBySaw()
End Sub
Private Sub RemoveDamagedArea()