OmagCut :
- aggiunta possibilità ripartenza - aggiunta possibilità pausa al termine di una lavorazione.
This commit is contained in:
+15
@@ -36,6 +36,7 @@ Friend Module CamAuto
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart()
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -465,6 +466,20 @@ Friend Module CamAuto
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function SetPause(nMchId As Integer) As Boolean
|
||||
Return EgtSetInfo(nMchId, INFO_MCH_PAUSE, True)
|
||||
End Function
|
||||
|
||||
Friend Function GetPause(nMchId As Integer) As Boolean
|
||||
Dim bPause As Boolean = False
|
||||
EgtGetInfo(nMchId, INFO_MCH_PAUSE, bPause)
|
||||
Return bPause
|
||||
End Function
|
||||
|
||||
Friend Function ResetPause(nMchId As Integer) As Boolean
|
||||
Return EgtRemoveInfo(nMchId, INFO_MCH_PAUSE)
|
||||
End Function
|
||||
|
||||
Friend Function UpdateMachiningPreview(nMchId As Integer, bMoveOnPart As Boolean) As Boolean
|
||||
' Imposto la lavorazione corrente
|
||||
If Not EgtSetCurrMachining(nMchId) Then Return False
|
||||
|
||||
@@ -125,6 +125,8 @@ Module ConstGen
|
||||
Public Const INFO_PROJMAT As String = "ProjMat"
|
||||
' Info per programma di linea inviato
|
||||
Public Const INFO_NCPROGSENT As String = "NcProgSent"
|
||||
' Info per riavvio programma da fase successiva alla prima
|
||||
Public Const INFO_NCRESTART As String = "NcRestart"
|
||||
' Info per ingombro pezzi con gocciolatoio
|
||||
Public Const INFO_DRIPBBOX As String = "DripBBox"
|
||||
' Info per rotazione in registrazione grezzo
|
||||
@@ -173,6 +175,8 @@ Module ConstGen
|
||||
Public Const INFO_MCH_USER_OFF As String = "UserOff"
|
||||
' Info lavorazione disabilitata perchè lavorata in doppio con altra
|
||||
Public Const INFO_MCH_DUPLED As String = "Dupled"
|
||||
' Info lavorazione per pausa alla fine
|
||||
Public Const INFO_MCH_PAUSE As String = "Pause"
|
||||
' Nome contorno taglio
|
||||
Public Const NAME_PV_CUT As String = "CUT"
|
||||
' Nome contorno pre-taglio
|
||||
|
||||
@@ -114,6 +114,10 @@
|
||||
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
||||
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
||||
Public Const K_MACH_WASHING As String = "Washing"
|
||||
Public Const K_MACH_ENABLERESTART As String = "EnableRestart"
|
||||
Public Const K_MACH_ENABLEPAUSE As String = "EnablePause"
|
||||
' DrillMillC90
|
||||
' CutLongDxSx
|
||||
|
||||
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
||||
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
||||
|
||||
@@ -95,6 +95,11 @@ Public Class CurrentMachine
|
||||
Private m_dTab2PhotoOffsetX As Double = 0
|
||||
Private m_dTab2PhotoOffsetY As Double = 0
|
||||
|
||||
' Abilitazione scelta restart
|
||||
Private m_bEnableRestart As Boolean = False
|
||||
' Abilitazione scelta pausa a fine lavorazione
|
||||
Private m_bEnablePause As Boolean = False
|
||||
|
||||
' Flag home finale per tagli diretti
|
||||
Private m_bDirectCutsFinalHome As Boolean = True
|
||||
|
||||
@@ -529,6 +534,18 @@ Public Class CurrentMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bEnableRestart As Boolean
|
||||
Get
|
||||
Return m_bEnableRestart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bEnablePause As Boolean
|
||||
Get
|
||||
Return m_bEnablePause
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Property bDirectCutsFinalHome As Boolean
|
||||
Get
|
||||
Return m_bDirectCutsFinalHome
|
||||
@@ -846,6 +863,11 @@ Public Class CurrentMachine
|
||||
m_dTab2PhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETX, 0, sMachIniFile)
|
||||
m_dTab2PhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETY, 0, sMachIniFile)
|
||||
|
||||
' Leggo abilitazione per restart
|
||||
m_bEnableRestart = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENABLERESTART, 0, sMachIniFile) <> 0)
|
||||
' Leggo abilitazione scelta pausa a fine lavorazione
|
||||
m_bEnablePause = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENABLEPAUSE, 0, sMachIniFile) <> 0)
|
||||
|
||||
' Leggo flag per posizione home alla fine dei tagli diretti
|
||||
m_bDirectCutsFinalHome = (GetPrivateProfileInt(S_MACH_DIRECTCUTS, K_FINALHOME, 1, sMachIniFile) <> 0)
|
||||
|
||||
|
||||
@@ -662,6 +662,23 @@ Public Class CurrentProjectPageUC
|
||||
Return nNcSent
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectNcRestart(nRestartPhase As Integer) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_NCRESTART, nRestartPhase)
|
||||
End Function
|
||||
|
||||
Friend Function GetProjectNcRestart() As Integer
|
||||
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
Dim nRestartPhase As Integer = 0
|
||||
EgtGetInfo(nMarkId, INFO_NCRESTART, nRestartPhase)
|
||||
Return nRestartPhase
|
||||
End Function
|
||||
|
||||
Friend Function ResetProjectNcRestart() As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtRemoveInfo(nMarkId, INFO_NCRESTART)
|
||||
End Function
|
||||
|
||||
Friend Function SetLoadPath(sPath As String) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_LOADPATH, sPath)
|
||||
|
||||
@@ -264,6 +264,7 @@ Public Class ProjectMgrUC
|
||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
||||
If bModif Then
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -286,6 +287,20 @@ Public Class ProjectMgrUC
|
||||
m_CurrProjPage.SaveFile(sMchPath)
|
||||
' Costringo ad aggiornare UI
|
||||
UpdateUI()
|
||||
' Se presente ripartenza, ne chiedo conferma
|
||||
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
|
||||
If nPhaseRestart <> 0 Then
|
||||
' Confermi ripartenza dalla fase NNN ?
|
||||
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
|
||||
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
|
||||
Select Case AskNcRestart.m_nPressedBtn
|
||||
Case 1 ' YES
|
||||
Case 2 ' NO
|
||||
m_CurrProjPage.ResetProjectNcRestart()
|
||||
Case Else ' CANCEL
|
||||
Return
|
||||
End Select
|
||||
End If
|
||||
' Genero file CNC (lancio anche se errore in precedenza)
|
||||
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\CadCut" & m_CurrMachine.sIsoFileExt
|
||||
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
|
||||
|
||||
@@ -20,6 +20,7 @@ Public Module SplitAuto
|
||||
Public m_bStartAll As Boolean
|
||||
Public m_bEndAll As Boolean
|
||||
Public m_bEnabled As Boolean
|
||||
Public m_bPause As Boolean
|
||||
End Class
|
||||
|
||||
'-----------------------------------------------------------------------------------------------
|
||||
@@ -108,6 +109,8 @@ Public Module SplitAuto
|
||||
End If
|
||||
' abilitazione
|
||||
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
|
||||
' pausa
|
||||
Mach.m_bPause = GetPause(nOperId)
|
||||
' inserisco in lista
|
||||
MachSplitList.Add(Mach)
|
||||
' altrimenti la disattivo
|
||||
|
||||
+4
-2
@@ -48,7 +48,7 @@
|
||||
</Button>
|
||||
<Button Name="ModifyBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="AutoBtn" Grid.Column="3" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<Button Name="RestartBtn" Grid.Column="3" Style="{StaticResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -132,7 +132,8 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
@@ -144,6 +145,7 @@
|
||||
<Button Name="AllCenEndBtn" Grid.Column="5" Style="{StaticResource OmagCut_YellowTextButton}" FontSize="{DynamicResource SplitPageBtn_FontSize}"/>
|
||||
<Button Name="AllExtendBtn" Grid.Column="6" Style="{StaticResource OmagCut_YellowTextButton}" FontSize="{DynamicResource SplitPageBtn_FontSize}"/>
|
||||
<Button Name="AllReduceBtn" Grid.Column="7" Style="{StaticResource OmagCut_YellowTextButton}" FontSize="{DynamicResource SplitPageBtn_FontSize}"/>
|
||||
<Button Name="PauseBtn" Grid.Column="8" Style="{StaticResource OmagCut_YellowTextButton}" FontSize="{DynamicResource SplitPageBtn_FontSize}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+56
-3
@@ -39,6 +39,8 @@ Public Class SplitPageUC
|
||||
AllReduceBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 16) ' Accorc. Tutti
|
||||
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) ' Modifica
|
||||
AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto
|
||||
RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart
|
||||
PauseBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 31) ' Pausa On/Off
|
||||
End Sub
|
||||
|
||||
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
@@ -103,6 +105,15 @@ Public Class SplitPageUC
|
||||
End If
|
||||
' Abilitazione bottoni
|
||||
EnableButtons()
|
||||
' Se sola visualizzazione, segnalazione di eventuale fase di restart
|
||||
If m_bShow Then
|
||||
Dim nPhaseRestart As Integer = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart()
|
||||
If nPhaseRestart = m_nCurrPhase Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(MSG_SPLITPAGEUC + 19) & " (" & m_nCurrPhase.ToString() & ")")
|
||||
Else
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ShowMachiningList()
|
||||
@@ -116,17 +127,29 @@ Public Class SplitPageUC
|
||||
Else
|
||||
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 1) & "°"
|
||||
End If
|
||||
If Mach.m_bPause Then AddPauseText(sText)
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
|
||||
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
|
||||
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
|
||||
If Mach.m_bPause Then AddPauseText(sText)
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
|
||||
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
|
||||
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
|
||||
If Mach.m_bPause Then AddPauseText(sText)
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub AddPauseText(ByRef sName As String)
|
||||
sName &= " " & EgtMsg(MSG_SPLITPAGEUC + 32) ' Pausa
|
||||
End Sub
|
||||
|
||||
Private Sub RemovePauseText(ByRef sName As String)
|
||||
sName = sName.Replace(EgtMsg(MSG_SPLITPAGEUC + 32), "")
|
||||
sName = sName.TrimEnd()
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
@@ -176,9 +199,7 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub OnOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles OnOffBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then
|
||||
Return
|
||||
End If
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
@@ -614,6 +635,22 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
If GetPause(nOperId) Then
|
||||
ResetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = False
|
||||
RemovePauseText(SelItem.Name)
|
||||
Else
|
||||
SetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = True
|
||||
AddPauseText(SelItem.Name)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||
' Dichiaro solo visualizzazione
|
||||
m_bShow = True
|
||||
@@ -648,6 +685,17 @@ Public Class SplitPageUC
|
||||
SplitPageUC_Loaded(Nothing, Nothing)
|
||||
End Sub
|
||||
|
||||
Private Sub RestartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RestartBtn.Click
|
||||
' Se fase corrente è la prima, imposto partenza normale
|
||||
If m_nCurrPhase = 1 Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart()
|
||||
' Altrimenti, imposto la ripartenza dalla fase corrente
|
||||
Else
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetProjectNcRestart(m_nCurrPhase)
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(MSG_SPLITPAGEUC + 19) & " (" & m_nCurrPhase.ToString() & ")")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ModifyBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifyBtn.Click
|
||||
' Dichiaro non più solo visualizzazione
|
||||
m_bShow = False
|
||||
@@ -685,6 +733,7 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
ExitSplit(Not m_bToNext)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
@@ -813,7 +862,10 @@ Public Class SplitPageUC
|
||||
' Per bottone MODIFY
|
||||
ModifyBtn.IsEnabled = m_bShow
|
||||
' Per bottone AUTO
|
||||
AutoBtn.Visibility = If(m_bShow, Windows.Visibility.Hidden, Windows.Visibility.Visible)
|
||||
AutoBtn.IsEnabled = Not m_bShow And ((GetDisabledCutsCount() > 0 Or m_nCurrPhase = 1) And Not m_bByHand)
|
||||
' Per bottone RESTART
|
||||
RestartBtn.Visibility = If(m_bShow, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||
' Altri bottoni
|
||||
MoveUpBtn.IsEnabled = Not m_bShow
|
||||
MoveDownBtn.IsEnabled = Not m_bShow
|
||||
@@ -831,6 +883,7 @@ Public Class SplitPageUC
|
||||
AllCenEndBtn.IsEnabled = Not m_bShow
|
||||
AllExtendBtn.IsEnabled = Not m_bShow
|
||||
AllReduceBtn.IsEnabled = Not m_bShow
|
||||
PauseBtn.IsEnabled = Not m_bShow
|
||||
End Sub
|
||||
|
||||
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
|
||||
|
||||
Reference in New Issue
Block a user