OmagCUT :
- aggiunta gestione lavorazione di taglio anche con lama manuale (ovviamente non si cambia lama).
This commit is contained in:
+94
-110
@@ -4,7 +4,7 @@ Imports EgtUILib
|
||||
Public Class ChangeToolWD
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Private m_SetUpMachiningList As New ObservableCollection(Of ItemMachining)
|
||||
Private m_MachiningList As New ObservableCollection(Of ItemMachining)
|
||||
|
||||
Sub New(Owner As Window)
|
||||
Me.Owner = Owner
|
||||
@@ -73,8 +73,8 @@ Public Class ChangeToolWD
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
' Definizione del collegamento tra ItemList e ListBox1
|
||||
SetUpToolListBox.ItemsSource = m_SetUpMachiningList
|
||||
' 90378=Seleziona lavorazione
|
||||
SetUpToolListBox.ItemsSource = m_MachiningList
|
||||
' Seleziona lavorazione
|
||||
FilePathTxBl.Text = EgtMsg(90378)
|
||||
End Sub
|
||||
|
||||
@@ -85,8 +85,8 @@ Public Class ChangeToolWD
|
||||
' carico elenco degli utensili impostati attualmente in macchina (anche il laser!)
|
||||
LoadSetUpMachining()
|
||||
' ricerco la lavorazione corrente
|
||||
Dim Item As ItemMachining = m_SetUpMachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing)
|
||||
Dim Index As Integer = m_SetUpMachiningList.IndexOf(Item)
|
||||
Dim Item As ItemMachining = m_MachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing)
|
||||
Dim Index As Integer = m_MachiningList.IndexOf(Item)
|
||||
If Index < 0 Then
|
||||
' Imposto lavorazione di default
|
||||
EgtMdbSetCurrMachining(m_CurrSawing)
|
||||
@@ -97,8 +97,8 @@ Public Class ChangeToolWD
|
||||
Index = 0
|
||||
End If
|
||||
' se presente seleziono il primo elemento
|
||||
If m_SetUpMachiningList.Count > 0 Then
|
||||
SetUpToolListBox.SelectedItem = m_SetUpMachiningList(Index)
|
||||
If m_MachiningList.Count > 0 Then
|
||||
SetUpToolListBox.SelectedItem = m_MachiningList(Index)
|
||||
OkBtn.IsEnabled = True
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
@@ -109,61 +109,55 @@ Public Class ChangeToolWD
|
||||
|
||||
' Creo le liste da mostrare nella lista
|
||||
Private Function LoadSetUpMachining() As Boolean
|
||||
Dim sNameTool As String = String.Empty
|
||||
Dim nType As Integer = 0
|
||||
Dim sHeadTool As String = String.Empty
|
||||
Dim nExitTool As Integer = 0
|
||||
' Pulisco la lista delle lavorazioni di lama
|
||||
m_MachiningList.Clear()
|
||||
' Imposto il contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
' Recupero la lista di tutte le lavorazioni di lama
|
||||
Dim local_Sawing As TreeViewItem.CathegoryItem = GetAllSawing()
|
||||
Dim SawingList As List(Of String) = GetAllSawing()
|
||||
' Se non ci sono lavorazioni di lama allora esco
|
||||
If IsNothing(local_Sawing) Then Return False
|
||||
|
||||
' Ripulisco la lista degli utensili
|
||||
m_SetUpMachiningList.Clear()
|
||||
CreateSawingList(local_Sawing)
|
||||
|
||||
If SawingList.Count() = 0 Then Return False
|
||||
' Carico le lavorazioni di lama compatibili
|
||||
CreateSawingList(SawingList)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Creo la lista delle delle lavorazioni di lama da proporre
|
||||
Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem)
|
||||
Private Sub CreateSawingList(SawingList As List(Of String))
|
||||
' Recupero le info della lama montata di default
|
||||
GetDiamAndThickDefaultSaw()
|
||||
' Verifico se lama fissa
|
||||
Dim bFixedSaw As Boolean = Not CamAuto.CanChangeSaw()
|
||||
' recupero la prima lavorazione
|
||||
For Each Item As TreeViewItem.CustomItem In SawingFam.Items
|
||||
Dim sNameTool As String = String.Empty
|
||||
For Each sSawingName As String In SawingList
|
||||
Dim sToolName As String = ""
|
||||
' Imposto la lavorazione corrente
|
||||
EgtMdbSetCurrMachining(Item.Name)
|
||||
EgtMdbSetCurrMachining(sSawingName)
|
||||
' Recupero il nome dell'utensile della lavorazione
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool)
|
||||
If Not String.IsNullOrEmpty(sNameTool) And VerifyCurrSawTolerance(sNameTool) Then
|
||||
' Recupero la posizione
|
||||
EgtTdbSetCurrTool(sNameTool)
|
||||
Dim sTCPos As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||
' Se lama fissa sono ammesse solo altre lavorazioni con la stessa
|
||||
If bFixedSaw Then
|
||||
If sNameTool = m_DefaultSaw_Name AndAlso VerifyCurrMachiningMaterial() Then
|
||||
m_SetUpMachiningList.Add(New ItemMachining(Item.Name, sNameTool, sTCPos, Utility.GetColorPV()))
|
||||
End If
|
||||
' altrimenti cerco le lame compatibili nel TC automatico
|
||||
ElseIf Not String.IsNullOrEmpty(sTCPos) Then
|
||||
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If ToolPosition.sTool <> String.Empty Then
|
||||
If sNameTool = ToolPosition.sTool Then
|
||||
' Verifico il materiale e lo spessore
|
||||
If VerifyCurrMachiningMaterial() Then
|
||||
m_SetUpMachiningList.Add(New ItemMachining(Item.Name, sNameTool, sTCPos, Utility.GetColorPV()))
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sToolName)
|
||||
If String.IsNullOrWhiteSpace( sToolName) Then Continue For
|
||||
' Se lama fissa
|
||||
If bFixedSaw Then
|
||||
' Sono ammesse solo altre lavorazioni con la stessa lama
|
||||
If sToolName = m_DefaultSaw_Name AndAlso VerifyCurrMachiningMaterial() Then
|
||||
' recupero eventuale posizione
|
||||
EgtTdbSetCurrTool(sToolName)
|
||||
Dim sTCPos As String = ""
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||
' inserisco in lista
|
||||
m_MachiningList.Add(New ItemMachining(sSawingName, sToolName, sTCPos, New Color3d(0, 0, 0, 100)))
|
||||
End If
|
||||
' altrimenti (ammessa solo se da TC)
|
||||
Else
|
||||
' Verifico compatibilità nelle dimensioni lama e nei materiali ammessi dalla lavorazione
|
||||
If Not( VerifyCurrSawTolerance(sToolName) AndAlso VerifyCurrMachiningMaterial()) Then Continue For
|
||||
' Cerco la lama nel TC
|
||||
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If sToolName = ToolPosition.sTool Then
|
||||
m_MachiningList.Add(New ItemMachining(sSawingName, sToolName, ToolPosition.sName, Utility.GetColorPV()))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
' reimposto la lavorazione di lama e la lama impostate in macchina
|
||||
@@ -171,49 +165,39 @@ Public Class ChangeToolWD
|
||||
EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing)
|
||||
End Sub
|
||||
|
||||
' verifico l'utensile corrente (impostato nella funzione chiamante) se può lavorare il grezzo corrente
|
||||
' Verifico se la lavorazione impostata nella chiamante e quindi corrente può lavorare il grezzo corrente
|
||||
Private Function VerifyCurrMachiningMaterial() As Boolean
|
||||
Dim m_MaterialsList As New ObservableCollection(Of MachiningMaterial)
|
||||
For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName, Material.SubId))
|
||||
Else
|
||||
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName))
|
||||
' Stringa identificativa del materiale corrente
|
||||
Dim sCurrMatId As String = m_MainWindow.m_CurrentMachine.CurrMat.nId.ToString()
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||
sCurrMatId &= "." & m_MainWindow.m_CurrentMachine.CurrMat.SubId.ToString()
|
||||
End If
|
||||
' Recupero elenco materiali della lavorazione
|
||||
Dim sSysNotes As String = ""
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, sSysNotes)
|
||||
If String.IsNullOrWhiteSpace( sSysNotes) Then Return False
|
||||
' Cerco un materiale compatibile con il corrente
|
||||
Dim sItems() As String = sSysNotes.Split(";".ToCharArray)
|
||||
For Ind As Integer = 0 To sItems.Count() - 1
|
||||
' Divido il materiale nei suoi parametri
|
||||
Dim sParams() = sItems(Ind).Split(",".ToCharArray)
|
||||
' Se è il materiale del grezzo corrente
|
||||
If sParams.Count() >= 3 AndAlso Trim(sParams(0)) = sCurrMatId Then
|
||||
' Verifico rientri nello spessore ammesso
|
||||
Dim dMinTh As Double = 0
|
||||
Dim dMaxTh As Double = 0
|
||||
StringToDouble(sParams(1), dMinTh)
|
||||
StringToDouble(sParams(2), dMaxTh)
|
||||
If dMinTh < dMaxTh - 10 * EPS_SMALL And
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight >= dMinTh And
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight <= dMaxTh Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim ToolString As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString)
|
||||
If ToolString <> String.Empty Then
|
||||
Dim sItems() = ToolString.Split(";".ToCharArray)
|
||||
Dim Index As Integer = 0
|
||||
For Each Material As MachiningMaterial In m_MaterialsList
|
||||
Dim Param() As String = sItems(Index).Split(",".ToCharArray)
|
||||
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
|
||||
Dim nParId As Integer = 0
|
||||
Dim nSubParId As Integer = 0
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||
If StringToInt(SubParam(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId AndAlso SubParam.Count > 1 AndAlso
|
||||
StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then
|
||||
StringToDouble(Param(1), Material.dMinThickness)
|
||||
StringToDouble(Param(2), Material.dMaxThickness)
|
||||
Material.VerifyIfActive()
|
||||
Else
|
||||
Material.VerifyIfActive()
|
||||
End If
|
||||
Else
|
||||
If StringToInt(Param(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId Then
|
||||
StringToDouble(Param(1), Material.dMinThickness)
|
||||
StringToDouble(Param(2), Material.dMaxThickness)
|
||||
Material.VerifyIfActive()
|
||||
If m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight > Material.dMinThickness And m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight < Material.dMaxThickness Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
End If
|
||||
' Non ho trovato niente
|
||||
Return False
|
||||
End Function
|
||||
|
||||
@@ -233,35 +217,35 @@ Public Class ChangeToolWD
|
||||
If Delta_Diam < 0.25 * m_DefaultSaw_Diam And Delta_Thick < EPS_SMALL Then
|
||||
Return True
|
||||
Else
|
||||
EgtOutLog(String.Format("New saw {0} can not repalce the current {1}; Delta_Diam={2}, |Delta_Thick|={3} ", sNameTool, m_DefaultSaw_Name, Delta_Diam, Delta_Thick))
|
||||
EgtOutLog(String.Format("New saw {0} can not replace the current {1}; Delta_Diam={2}, |Delta_Thick|={3} ", sNameTool, m_DefaultSaw_Name, Delta_Diam, Delta_Thick))
|
||||
End If
|
||||
Else
|
||||
EgtOutLog("Impossible to find in tooldb SAW: " & sNameTool)
|
||||
EgtOutLog("Impossible to find in toolDB saw: " & sNameTool)
|
||||
End If
|
||||
Else
|
||||
If String.IsNullOrEmpty(m_DefaultSaw_Name) Then
|
||||
EgtOutLog("There is no currsaw setted in machine!")
|
||||
EgtOutLog("There is no machine CurrSaw!")
|
||||
Else
|
||||
EgtOutLog("Impossible to find in tooldb currsaw setted in machine: " & m_DefaultSaw_Name)
|
||||
EgtOutLog("Impossible to find in toolDB machine CurrSaw: " & m_DefaultSaw_Name)
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' Restituisce tutto l'elenco delle lavorazioni disponibili in macchina
|
||||
Private Function GetAllSawing() As TreeViewItem.CathegoryItem
|
||||
' Restituisce tutto l'elenco delle lavorazioni di taglio di lama disponibili in macchina
|
||||
Private Function GetAllSawing() As List(Of String)
|
||||
Dim sFName As String = EgtMsg(90771) ' Uscita
|
||||
Dim nFType As Integer = MCH_MY.SAWING
|
||||
If Not m_MainWindow.m_CurrentMachine.bSawing Then Return Nothing
|
||||
' Inserisco categoria ed eventuali elementi
|
||||
Dim MachiningCathegory As New TreeViewItem.CathegoryItem(sFName, nFType)
|
||||
Dim SawingList As New List(Of String)
|
||||
Dim nFType As Integer = MCH_MY.SAWING
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(nFType, MachiningName)
|
||||
While bFound
|
||||
MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType))
|
||||
SawingList.Add( MachiningName)
|
||||
bFound = EgtMdbGetNextMachining(nFType, MachiningName)
|
||||
End While
|
||||
Return MachiningCathegory
|
||||
Return SawingList
|
||||
End Function
|
||||
|
||||
#End Region ' Set up machinining
|
||||
@@ -272,12 +256,12 @@ Public Class ChangeToolWD
|
||||
' Recupero item selezionato
|
||||
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
Else
|
||||
m_NewSawing = m_MachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_MachiningList(SetUpToolListBox.SelectedIndex).FootprintToolColor
|
||||
m_TCPos = m_MachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
OkBtn.IsEnabled = True
|
||||
End If
|
||||
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
|
||||
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
' A seconda del tipo
|
||||
OkBtn.IsEnabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub SetUpToolListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SetUpToolListBox.SelectionChanged
|
||||
@@ -287,9 +271,9 @@ Public Class ChangeToolWD
|
||||
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
Else
|
||||
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
|
||||
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
m_NewSawing = m_MachiningList(SetUpToolListBox.SelectedIndex).Machining
|
||||
m_EgtColor = m_MachiningList(SetUpToolListBox.SelectedIndex).FootprintToolColor
|
||||
m_TCPos = m_MachiningList(SetUpToolListBox.SelectedIndex).ToolPos
|
||||
OkBtn.IsEnabled = True
|
||||
End If
|
||||
End Sub
|
||||
@@ -307,7 +291,7 @@ Public Class ItemMachining
|
||||
Private m_Machining As String = String.Empty
|
||||
Private m_ToolExit As Integer = 1
|
||||
Private m_ToolType As Integer = -1
|
||||
Private m_PrintFootToolColor As New Color3d(0, 255, 0, 100)
|
||||
Private m_FootprintToolColor As New Color3d(0, 255, 0, 100)
|
||||
Private m_cSawColor As SolidColorBrush
|
||||
|
||||
' Posizione porta utensile
|
||||
@@ -358,12 +342,12 @@ Public Class ItemMachining
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PrintFootToolColor As Color3d
|
||||
Public Property FootprintToolColor As Color3d
|
||||
Get
|
||||
Return m_PrintFootToolColor
|
||||
Return m_FootprintToolColor
|
||||
End Get
|
||||
Set(value As Color3d)
|
||||
m_PrintFootToolColor = value
|
||||
m_FootprintToolColor = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -380,8 +364,8 @@ Public Class ItemMachining
|
||||
m_Machining = sMachining
|
||||
m_ToolPos = sToolPos
|
||||
m_ToolName = sToolName
|
||||
m_PrintFootToolColor = cColor
|
||||
m_cSawColor = New SolidColorBrush(Color.FromRgb(m_PrintFootToolColor.R, m_PrintFootToolColor.G, m_PrintFootToolColor.B))
|
||||
m_FootprintToolColor = cColor
|
||||
m_cSawColor = New SolidColorBrush(Color.FromRgb(m_FootprintToolColor.R, m_FootprintToolColor.G, m_FootprintToolColor.B))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+56
-17
@@ -232,10 +232,10 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub AddItemToList(i As Integer, Mach As SplitMach, sText As String, nMach As Integer)
|
||||
Dim sTCPos As String = String.Empty
|
||||
Dim sTCPos As String = ""
|
||||
' Visualizzo la posizione utensile solo se configurata
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
Dim sMachining As String = String.Empty, sTool As String = String.Empty
|
||||
Dim sMachining As String = "", sTool As String = ""
|
||||
GetMachiningAndTool(Mach.m_nId, sMachining, sTool)
|
||||
' Verifico che sia montata su un portautensile
|
||||
EgtTdbSetCurrTool(sTool)
|
||||
@@ -243,9 +243,16 @@ Public Class SplitPageUC
|
||||
End If
|
||||
' Se TCPos non trovato
|
||||
If String.IsNullOrEmpty(sTCPos) Then
|
||||
' Inserisco solo nome lavorazione
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach))
|
||||
' altrimenti esiste utensile
|
||||
' Imposto come lavorazione corrente
|
||||
EgtSetCurrMachining(Mach.m_nId)
|
||||
' Se c'è lavorazione forzata, assegno colore nero
|
||||
If VerifyForcedCurrMachine() Then
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach, "", New SolidColorBrush(Color.FromRgb(0, 0, 0))))
|
||||
' altrimenti solo nome
|
||||
Else
|
||||
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach))
|
||||
End If
|
||||
' altrimenti assegno TcPos e colore
|
||||
Else
|
||||
Dim sawColor As Color3d = Utility.GetColorPV()
|
||||
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B)
|
||||
@@ -253,6 +260,22 @@ Public Class SplitPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function VerifyForcedCurrMachine() As Boolean
|
||||
' Se non c'è geometria, non può essere forzata
|
||||
Dim EntId As Integer = GDB_ID.NULL
|
||||
Dim SubEntId As Integer = GDB_ID.NULL
|
||||
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return False
|
||||
' Se c'è Info standard è forzata
|
||||
If EgtExistsInfo(EntId, DEF_MACHINING) Then Return True
|
||||
' Se c'è Info per inclinato verifico se nome lavorazione non è standard
|
||||
Dim sMchTilted As String = ""
|
||||
If EgtGetInfo(EntId, DEF_MACHINING_TILTED, sMchTilted) AndAlso
|
||||
(Not m_MainWindow.m_CurrentMachine.bApplySawingTilted OrElse
|
||||
sMchTilted <> m_MainWindow.m_CurrentMachine.sCurrSawingTilted) Then Return True
|
||||
' In tutti gli altri casi non è forzata
|
||||
Return False
|
||||
End Function
|
||||
|
||||
#Region "BRIDGE"
|
||||
|
||||
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
|
||||
@@ -501,7 +524,7 @@ Public Class SplitPageUC
|
||||
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
|
||||
If Not m_bActive OrElse m_bShow Then Return
|
||||
|
||||
If e.Button = Windows.Forms.MouseButtons.Right And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
If e.Button = Windows.Forms.MouseButtons.Right Then
|
||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||
Dim nSel1 As Integer = GDB_ID.NULL
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
@@ -656,16 +679,17 @@ Public Class SplitPageUC
|
||||
' Cambiamenti possibili solo se taglio di lama
|
||||
If EgtGetOperationType( nMchId) <> MCH_OY.SAWING Then Return
|
||||
' Imposto la lavorazione corrente
|
||||
Dim sSawing As String = String.Empty
|
||||
EgtSetCurrMachining(nMchId)
|
||||
Dim EntId As Integer = GDB_ID.NULL
|
||||
Dim SubEntId As Integer = GDB_ID.NULL
|
||||
EgtSetCurrMachining(nMchId)
|
||||
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return
|
||||
' verifico se la lavorazione selezionata ha un angolo di inclinazione
|
||||
Dim dSideAng As Double = 0.0
|
||||
EgtGetMachiningParam(MCH_MP.SIDEANGLE, dSideAng)
|
||||
Dim sDefMach As String = If(Math.Abs(dSideAng) < EPS_ANG_SMALL, DEF_MACHINING, DEF_MACHINING_TILTED)
|
||||
Dim bVertical As Boolean = ( Math.Abs(dSideAng) < EPS_ANG_SMALL)
|
||||
Dim sDefMach As String = If(bVertical, DEF_MACHINING, DEF_MACHINING_TILTED)
|
||||
' Recupero il nome della lavorazione
|
||||
Dim sSawing As String = ""
|
||||
EgtGetInfo(EntId, sDefMach, sSawing)
|
||||
|
||||
' Apro pagina di selezione della lavorazione
|
||||
@@ -677,7 +701,19 @@ Public Class SplitPageUC
|
||||
|
||||
' se seleziono "Ok" allora cambio la lavorazione
|
||||
If m_ChangeToolPage.DialogResult Then
|
||||
EgtSetInfo(EntId, sDefMach, m_ChangeToolPage.NewSawing)
|
||||
' se taglio verticale o non c'è lavorazione dedicata per inclinato
|
||||
If bVertical Or Not m_MainWindow.m_CurrentMachine.bApplySawingTilted Then
|
||||
' se ripristino default, tolgo info
|
||||
If m_ChangeToolPage.NewSawing = m_MainWindow.m_CurrentMachine.sCurrSawing Then
|
||||
EgtRemoveInfo(EntId, sDefMach)
|
||||
' altrimenti la aggiorno
|
||||
Else
|
||||
EgtSetInfo(EntId, sDefMach, m_ChangeToolPage.NewSawing)
|
||||
End If
|
||||
' altrimenti inclinato con lavorazione dedicata
|
||||
Else
|
||||
EgtSetInfo(EntId, sDefMach, m_ChangeToolPage.NewSawing)
|
||||
End If
|
||||
Dim Index As Integer = 0
|
||||
For Index = 0 To m_MachiningList.Count() - 1
|
||||
If m_MachiningList(Index).m_nId = nMchId Then Exit For
|
||||
@@ -716,7 +752,12 @@ Public Class SplitPageUC
|
||||
Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor
|
||||
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B)
|
||||
m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor)
|
||||
m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso
|
||||
Not VerifyForcedCurrMachine() Then
|
||||
m_ItemList(Index).MachiningTCPosVisibility = Visibility.Hidden
|
||||
else
|
||||
m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
m_bModified = True
|
||||
@@ -948,9 +989,7 @@ Public Class SplitPageUC
|
||||
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
|
||||
Dim Index As Integer = MachiningLsBx.SelectedIndex
|
||||
If Index = -1 Then Return
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
|
||||
ChangeMachining(m_MachiningList(Index).m_nId)
|
||||
End If
|
||||
ChangeMachining(m_MachiningList(Index).m_nId)
|
||||
End Sub
|
||||
|
||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||
@@ -2606,10 +2645,10 @@ Public Class SplitPageUC
|
||||
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)
|
||||
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)
|
||||
RestartBtn.IsEnabled = m_bShow And m_MainWindow.m_CurrentMachine.bEnableRestart
|
||||
RestartBtn.IsEnabled = (m_bShow And m_MainWindow.m_CurrentMachine.bEnableRestart)
|
||||
' Altri bottoni
|
||||
MoveUpBtn.IsEnabled = Not m_bShow
|
||||
MoveDownBtn.IsEnabled = Not m_bShow
|
||||
@@ -2630,7 +2669,7 @@ Public Class SplitPageUC
|
||||
ModifStartBtn.IsEnabled = Not m_bShow
|
||||
ModifEndBtn.IsEnabled = Not m_bShow
|
||||
InvertBtn.IsEnabled = Not m_bShow
|
||||
PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause
|
||||
PauseBtn.IsEnabled = (Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause)
|
||||
BridgesWJBtn.IsEnabled = Not m_bShow
|
||||
BridgesDeleteWJBtn.IsEnabled = Not m_bShow
|
||||
QualityWJBtn.IsEnabled = Not m_bShow
|
||||
|
||||
@@ -227,7 +227,7 @@ Module SideAngle
|
||||
EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng)
|
||||
EgtSetInfo(EntId, INFO_HEEL, dHeel)
|
||||
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
|
||||
If Not String.IsNullOrEmpty(sSawingTilted) Then
|
||||
If Not String.IsNullOrWhiteSpace(sSawingTilted) Then
|
||||
EgtSetInfo(EntId, DEF_MACHINING_TILTED, sSawingTilted)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -555,9 +555,7 @@ Public Class CurrentProjectPageUC
|
||||
' carica ultimo progetto
|
||||
Friend Function LoadProject(ByVal sPath As String, Optional ByVal bUpdateIndex As Boolean = True) As Boolean
|
||||
' Se richiesto, imposto nuovo indice di progetto
|
||||
If bUpdateIndex Then
|
||||
SetNextProjectIndex()
|
||||
End If
|
||||
If bUpdateIndex Then SetNextProjectIndex()
|
||||
' Carico il file del progetto
|
||||
EgtOutLog("LoadProject : " & sPath & " (" & m_nCurrProj.ToString() & ")")
|
||||
If Not LoadFile(sPath) Then
|
||||
@@ -574,39 +572,42 @@ Public Class CurrentProjectPageUC
|
||||
UpdateHeightTxBx()
|
||||
' aggiorno materiale
|
||||
m_MainWindow.m_CurrentMachine.SetCurrMatByName(GetProjectMaterial())
|
||||
' recupero Id del gruppo "OmagCUT"
|
||||
Dim nProjMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
' aggiorno altezza sovaratavola
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ADD_TAB_BY_PROJ, 0, m_sIniFile) = 1 Then
|
||||
' leggo il valore OrigiAdditionalTable
|
||||
' leggo il valore OrigAdditionalTable
|
||||
Dim dValue As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable
|
||||
Dim sKey As String = K_ADDITIONALTABLE
|
||||
Select Case GetCurrentTable()
|
||||
Case 4
|
||||
sKey = K_TAB4_ADDITIONALTABLE
|
||||
Case 3
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
|
||||
sKey = K_TAB3_ADDITIONALTABLE
|
||||
Case 2
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
|
||||
Case Else
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
|
||||
sKey = K_TAB2_ADDITIONALTABLE
|
||||
End Select
|
||||
EgtGetInfo(nProjMarkId, sKey, dValue)
|
||||
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
||||
End If
|
||||
' forzo visualizzazione eventuali dati su aree
|
||||
' Forzo visualizzazione eventuali dati su aree
|
||||
SetAreasStatus(True)
|
||||
' Recupero info C Home
|
||||
' Recupero info C_Home corrente
|
||||
Dim dCHomeCurrMach As Double
|
||||
Dim dCHomeCurrproj As Double
|
||||
EgtGetAxisHomePos("C", dCHomeCurrMach)
|
||||
' Verifico che esista l'info del progetto
|
||||
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
|
||||
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
|
||||
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||
' Verifico C_Home del progetto
|
||||
Dim dCHomeCurrproj As Double
|
||||
If EgtGetInfo(nProjMarkId, INFO_CAXESHOME, dCHomeCurrproj) Then
|
||||
' Recupero tipo di ventose usate
|
||||
Dim nVacType As Integer = 0
|
||||
EgtGetInfo(EgtGetHeadId("H4"), KEY_VAC_TYPE, nVacType)
|
||||
' Se ventose di lato alla testa e C_Home diverso, registro un problema
|
||||
If nVacType = 2 And Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
|
||||
End If
|
||||
Else
|
||||
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
EgtSetInfo(nProjMarkId, INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Dichiaro progetto non modificato
|
||||
EgtResetModified()
|
||||
Return True
|
||||
|
||||
Reference in New Issue
Block a user