OmagCUT 1.6v4 :
- aggiunta gestione utensili con attrezzaggio manuale e automatico da toolchanger - corretta gestione interni di componenti - migliorata gestione grezzo principale sempre di fase 1.
This commit is contained in:
+35
-4
@@ -136,14 +136,16 @@ Friend Module CamAuto
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.DRILLING Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDrill) <> 0 Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDrill) <> 0 And
|
||||
Not FindToolOnChanger(sTool) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
End If
|
||||
End If
|
||||
ElseIf nType = MCH_OY.MILLING Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrMill) <> 0 Then
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrMill) <> 0 And
|
||||
Not FindToolOnChanger(sTool) Then
|
||||
bOk = False
|
||||
If sMissingTools.IndexOf(sTool) = -1 Then
|
||||
sMissingTools = sMissingTools & sTool & ", "
|
||||
@@ -156,6 +158,23 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function FindToolOnChanger(sTool As String) As Boolean
|
||||
' Ricerca nel cambia utensili automatico
|
||||
For i As Integer = 0 To m_MainWindow.m_CurrentMachine.ToolChangerNbr() - 1
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.ToolChanger(i).sTool) = 0 Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
' Ricerca nel cambia utensili manuale
|
||||
For i As Integer = 0 To m_MainWindow.m_CurrentMachine.ManualToolChangerNbr() - 1
|
||||
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.ManualToolChanger(i).sTool) = 0 Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
' Non trovato
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function TestAllMachiningsForStrict() As Boolean
|
||||
Dim bModified As Boolean = False
|
||||
' Affondamento ridotto
|
||||
@@ -428,11 +447,23 @@ Friend Module CamAuto
|
||||
End Function
|
||||
|
||||
Friend Function GetRawBox(ByRef ptRawMin As Point3d, ByRef ptRawMax As Point3d) As Boolean
|
||||
Return GetRawBox(EgtGetFirstRawPart(), ptRawMin, ptRawMax)
|
||||
' Recupero il grezzo (primo con fase 1)
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL And Not EgtVerifyRawPartPhase(nRawId, 1)
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
' eseguo
|
||||
Return GetRawBox(nRawId, ptRawMin, ptRawMax)
|
||||
End Function
|
||||
|
||||
Friend Function GetRawBox(ByRef b3RawBox As BBox3d) As Boolean
|
||||
Return GetRawBox(EgtGetFirstRawPart(), b3RawBox)
|
||||
' Recupero il grezzo (primo con fase 1)
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL And Not EgtVerifyRawPartPhase(nRawId, 1)
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
' eseguo
|
||||
Return GetRawBox(nRawId, b3RawBox)
|
||||
End Function
|
||||
|
||||
Friend Function GetRawBox(nRawId As Integer, ByRef ptRawMin As Point3d, ByRef ptRawMax As Point3d) As Boolean
|
||||
|
||||
@@ -38,8 +38,8 @@ Public Class CompoDimensionUC
|
||||
m_DrawPage.OkBtn.IsEnabled = False
|
||||
End If
|
||||
' se componenti con buchi interni visualizzo bottoni appositi
|
||||
Dim sCompo As String = m_DrawPage.sCompoName.Substring(0, m_DrawPage.sCompoName.Length - 6)
|
||||
If sCompo = "PCucina" Or sCompo = "PBagno" Then
|
||||
If m_DrawPage.sCompoName.StartsWith("PCucina") Or
|
||||
m_DrawPage.sCompoName.StartsWith("PBagno") Then
|
||||
ShowInternalBtn(True)
|
||||
Else
|
||||
ShowInternalBtn(False)
|
||||
|
||||
+5
-4
@@ -637,6 +637,7 @@ Public Class CurrentMachine
|
||||
GetPrivateProfileString(S_TOOLCHANGER, K_POS & Index, Nothing, sTool, sMachIniFile)
|
||||
m_ToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
||||
Next
|
||||
|
||||
' Leggo numero portautensili manuali
|
||||
m_ManualToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_MANUALNUMBER, 0, sMachIniFile)
|
||||
|
||||
@@ -735,13 +736,13 @@ End Class
|
||||
|
||||
Class ToolChangerPos
|
||||
|
||||
Private m_sPosition As Integer
|
||||
Private m_nPosition As Integer
|
||||
Private m_sName As String = String.Empty
|
||||
Private m_sTool As String = String.Empty
|
||||
|
||||
Public ReadOnly Property sPosition As Integer
|
||||
Public ReadOnly Property nPosition As Integer
|
||||
Get
|
||||
Return m_sPosition
|
||||
Return m_nPosition
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -761,7 +762,7 @@ Class ToolChangerPos
|
||||
End Property
|
||||
|
||||
Sub New(sPosition As Integer, sName As String, sTool As String)
|
||||
m_sPosition = sPosition
|
||||
m_nPosition = sPosition
|
||||
m_sName = sName
|
||||
m_sTool = sTool
|
||||
End Sub
|
||||
|
||||
@@ -273,8 +273,11 @@ Public Class CurrentProjectPageUC
|
||||
If Not LoadFile(sPath) Then
|
||||
Return False
|
||||
End If
|
||||
' aggiorno grezzo
|
||||
' aggiorno grezzo (è il primo con fase 1)
|
||||
m_nRawId = EgtGetFirstRawPart()
|
||||
While m_nRawId <> GDB_ID.NULL And Not EgtVerifyRawPartPhase(m_nRawId, 1)
|
||||
m_nRawId = EgtGetNextRawPart(m_nRawId)
|
||||
End While
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||
' aggiorno spessore grezzo
|
||||
m_dRawHeight = GetRawHeight()
|
||||
|
||||
@@ -201,6 +201,8 @@ Public Class DrawPageUC
|
||||
If Not bOk Then
|
||||
EgtOutLog("Error in Component " & sCompo)
|
||||
End If
|
||||
MessageTxBl.Text = ""
|
||||
MessageGrid.Background = Brushes.Transparent
|
||||
' Leggo le variabili da Lua (per sapere numero, nome e tipo)
|
||||
ReadAndShowVariables()
|
||||
' Imposto le variabili del componente
|
||||
|
||||
@@ -186,7 +186,7 @@ Public Class InternalComponentPageUC
|
||||
m_MainWindow.m_DrawPageUC.m_MainComponentPage.GetPrivateProfileCompo("InternalCompo" & index, "InternalCompo" & index, nCompoName, sCompo, sCompoImage, m_MainWindow.GetIniFile())
|
||||
Dim sCompoImageSource As ImageSource
|
||||
|
||||
'verifico presenza immagine e la aggiungo
|
||||
' Verifico presenza immagine e la aggiungo
|
||||
If sCompoImage.Length <> 0 Then
|
||||
Try
|
||||
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
|
||||
@@ -213,7 +213,7 @@ Public Class InternalComponentPageUC
|
||||
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 2)
|
||||
End If
|
||||
|
||||
'verifico presenza testo
|
||||
' Verifico presenza testo
|
||||
If nCompoName > 0 Then
|
||||
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
|
||||
' verifico presenza immagine
|
||||
|
||||
@@ -60,5 +60,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.6.22.1")>
|
||||
<Assembly: AssemblyFileVersion("1.6.22.1")>
|
||||
<Assembly: AssemblyVersion("1.6.22.4")>
|
||||
<Assembly: AssemblyFileVersion("1.6.22.4")>
|
||||
|
||||
+5
-1
@@ -78,8 +78,12 @@ Public Class NestPageUC
|
||||
End Sub
|
||||
|
||||
Public Sub CalcRawPart()
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
' determino il grezzo (è il primo con fase 1)
|
||||
m_nRawId = EgtGetFirstRawPart()
|
||||
While m_nRawId <> GDB_ID.NULL And Not EgtVerifyRawPartPhase(m_nRawId, 1)
|
||||
m_nRawId = EgtGetNextRawPart(m_nRawId)
|
||||
End While
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
GetRawBox(m_ptRawMin, m_ptRawMax)
|
||||
EgtGetInfo(m_nRawId, KEY_KERF, m_dKerf)
|
||||
End Sub
|
||||
|
||||
@@ -156,6 +156,8 @@ Public Class RawPartPageUC
|
||||
HideParkedParts()
|
||||
' Deseleziono pezzi
|
||||
EgtDeselectAll()
|
||||
' Cancello tutte le lavorazioni
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
' Visualizzo eventuale foto
|
||||
m_MainWindow.m_CurrentProjectPageUC.ShowPhoto(True)
|
||||
Dim bHeightModified As Boolean = False
|
||||
@@ -817,8 +819,11 @@ Public Class RawPartPageUC
|
||||
Dim Col = m_RawCol
|
||||
' in presenza di foto rendo molto più trasparente
|
||||
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then Col.A = 20
|
||||
' Se non esiste già il grezzo e richiesto, lo inserisco
|
||||
' Se non esiste già il grezzo (primo con fase 1) e richiesto, lo inserisco
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL And Not EgtVerifyRawPartPhase(nRawId, 1)
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
If nRawId = GDB_ID.NULL And m_RawHeight > EPS_SMALL Then
|
||||
m_CurrProjPage.m_nRawId = EgtAddRawPart(Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
|
||||
m_RawWidth + 2 * m_RawKerf, m_RawHeight, Col)
|
||||
|
||||
@@ -70,18 +70,18 @@ Public Class SecondaryComponentPageUC
|
||||
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
|
||||
'verifico presenza immagine
|
||||
If sCompoImage.Length > 0 Then
|
||||
'se la lunghezza del testo è maggiore di 15 lo taglio
|
||||
If sCompoName.Length > 15 Then
|
||||
sCompoName = sCompoName.Substring(0, 15)
|
||||
'se la lunghezza del testo è maggiore di 20 lo taglio
|
||||
If sCompoName.Length > 20 Then
|
||||
sCompoName = sCompoName.Substring(0, 20)
|
||||
End If
|
||||
GetLabel(index).Text = sCompoName
|
||||
'Se ci sono sia testo che immagine imposto un margine di 10
|
||||
CustomThickness.Right = 10
|
||||
GetImage(index).Margin = CustomThickness
|
||||
Else
|
||||
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
|
||||
If sCompoName.Length > 22 Then
|
||||
sCompoName = sCompoName.Substring(0, 22)
|
||||
'se l'immagine non c'è e il testo è maggiore di 30 lo taglio
|
||||
If sCompoName.Length > 30 Then
|
||||
sCompoName = sCompoName.Substring(0, 30)
|
||||
End If
|
||||
GetLabel(index).Text = sCompoName
|
||||
End If
|
||||
|
||||
+46
-10
@@ -112,8 +112,8 @@ Public Class SetUpPage
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
GetTlChPosFromIndex(ToolPosition.sPosition).Tool.IsChecked = True
|
||||
GetTxBxFromIndex(ToolPosition.sPosition).Text = ToolPosition.sTool
|
||||
GetTlChPosFromIndex(ToolPosition.nPosition).Tool.IsChecked = True
|
||||
GetTxBxFromIndex(ToolPosition.nPosition).Text = ToolPosition.sTool
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -138,8 +138,8 @@ Public Class SetUpPage
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
GetManTlChPosFromIndex(ToolPosition.sPosition).Tool.IsChecked = True
|
||||
GetManTxBxFromIndex(ToolPosition.sPosition).Text = ToolPosition.sTool
|
||||
GetManTlChPosFromIndex(ToolPosition.nPosition).Tool.IsChecked = True
|
||||
GetManTxBxFromIndex(ToolPosition.nPosition).Text = ToolPosition.sTool
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -513,7 +513,6 @@ Public Class SetUpPage
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
' Funzione che carica gli utensili del Db nell'albero
|
||||
Friend Sub InitializeToolFamily(sFIniConst As String, nFType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
|
||||
If GetPrivateProfileInt(S_TOOLS, sFIniConst, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||
@@ -545,16 +544,25 @@ Public Class SetUpPage
|
||||
ManTlChPos50.ToolClick, ManTlChPos51.ToolClick, ManTlChPos52.ToolClick, ManTlChPos53.ToolClick, ManTlChPos54.ToolClick, ManTlChPos55.ToolClick, ManTlChPos56.ToolClick,
|
||||
ManTlChPos57.ToolClick, ManTlChPos58.ToolClick, ManTlChPos59.ToolClick, ManTlChPos60.ToolClick
|
||||
Dim ToolHolderClicked As ToolChangerPosUC = e.Source
|
||||
' Se da posizionare
|
||||
If ToolHolderClicked.Tool.IsChecked() Then
|
||||
' Se utensile valido
|
||||
If Not IsNothing(ToolTree.SelectedItem) And TypeOf ToolTree.SelectedItem Is CustomItem Then
|
||||
Dim Tool As CustomItem = DirectCast(ToolTree.SelectedItem, CustomItem)
|
||||
m_SetUpToolsList.Items.Add(Tool)
|
||||
' inserisco in posizione del TC
|
||||
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = Tool.Name
|
||||
' tolgo dalla lista dei disponibili
|
||||
RemoveToolFromList()
|
||||
' aggiorno posizione in DB utensili
|
||||
EgtTdbSetCurrTool(Tool.Name)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TCPOS, ToolHolderClicked.PositionNameTxBl.Text)
|
||||
EgtTdbSaveCurrTool()
|
||||
Else
|
||||
ToolHolderClicked.Tool.IsChecked = False
|
||||
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
||||
End If
|
||||
' altrimenti da levare
|
||||
Else
|
||||
RestoreToolInList(GetTxBxFromTlChPos(ToolHolderClicked.Name).Text)
|
||||
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
|
||||
@@ -787,12 +795,16 @@ Public Class SetUpPage
|
||||
|
||||
' Funzione che salva lo stato dei portautensili
|
||||
Private Sub SaveToolChangerStatus()
|
||||
' Salvo attrezzaggio automatico
|
||||
For Index As Integer = 1 To m_MainWindow.m_CurrentMachine.ToolChangerNbr
|
||||
m_MainWindow.m_CurrentMachine.ToolPos(Index - 1) = GetTxBxFromIndex(Index).Text
|
||||
Next
|
||||
' Salvo attrezzaggio manuale
|
||||
For Index As Integer = 1 To m_MainWindow.m_CurrentMachine.ManualToolChangerNbr
|
||||
m_MainWindow.m_CurrentMachine.ManualToolPos(Index - 1) = GetManTxBxFromIndex(Index).Text
|
||||
Next
|
||||
' Salvo DB utensili
|
||||
EgtTdbSave()
|
||||
End Sub
|
||||
|
||||
' Evento che permette di aprire le cartelle degli utensili con un click singolo
|
||||
@@ -804,12 +816,17 @@ Public Class SetUpPage
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' Eseguo salvataggio (DB utensili + attrezzaggio)
|
||||
SaveToolChangerStatus()
|
||||
' Esco
|
||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC)
|
||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me)
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
' Ricarico DB utensili (attrezzaggio non viene salvato)
|
||||
EgtTdbReload()
|
||||
' Esco
|
||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC)
|
||||
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me)
|
||||
End Sub
|
||||
@@ -823,22 +840,41 @@ Public Class SetUpPage
|
||||
EgtTdbSetCurrTool(SelectedTool.Name)
|
||||
Dim ToolPositionName As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, ToolPositionName)
|
||||
' Cerco il portautensile nella lista per vederne lo stato
|
||||
If String.IsNullOrEmpty(ToolPositionName) Then Return
|
||||
' Cerco il portautensile nella lista degli automatici per vederne lo stato
|
||||
For Each TlChPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If TlChPos.sName = ToolPositionName Then
|
||||
' Se la posizione è libera
|
||||
If GetTxBxFromIndex(TlChPos.sPosition).Text = String.Empty Then
|
||||
If GetTxBxFromIndex(TlChPos.nPosition).Text = String.Empty Then
|
||||
' Aggiungo l'utensile
|
||||
Dim Tool As CustomItem = ToolTree.SelectedItem
|
||||
m_SetUpToolsList.Items.Add(Tool)
|
||||
GetTxBxFromIndex(TlChPos.sPosition).Text = Tool.Name
|
||||
GetTlChPosFromIndex(TlChPos.sPosition).Tool.IsChecked = True
|
||||
GetTxBxFromIndex(TlChPos.nPosition).Text = Tool.Name
|
||||
GetTlChPosFromIndex(TlChPos.nPosition).Tool.IsChecked = True
|
||||
RemoveToolFromList()
|
||||
Else
|
||||
' Altrimenti segnalo che la posizione è già occupata
|
||||
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "IMPOSSIBILE ESEGUIRE IL COMANDO", "Portautensile predefinito già occupato", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
||||
End If
|
||||
Exit For
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
' Cerco il portautensile nella lista dei manuali per vederne lo stato
|
||||
For Each TlChPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||
If TlChPos.sName = ToolPositionName Then
|
||||
' Se la posizione è libera
|
||||
If GetTxBxFromIndex(TlChPos.nPosition).Text = String.Empty Then
|
||||
' Aggiungo l'utensile
|
||||
Dim Tool As CustomItem = ToolTree.SelectedItem
|
||||
m_SetUpToolsList.Items.Add(Tool)
|
||||
GetTxBxFromIndex(TlChPos.nPosition).Text = Tool.Name
|
||||
GetTlChPosFromIndex(TlChPos.nPosition).Tool.IsChecked = True
|
||||
RemoveToolFromList()
|
||||
Else
|
||||
' Altrimenti segnalo che la posizione è già occupata
|
||||
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "IMPOSSIBILE ESEGUIRE IL COMANDO", "Portautensile predefinito già occupato", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -46,6 +46,8 @@ Public Class SplitPageUC
|
||||
End If
|
||||
' Nascondo eventuali pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Deseleziono pezzi
|
||||
EgtDeselectAll()
|
||||
EgtZoom(ZM.ALL)
|
||||
' Faccio ordine automatico delle lavorazioni
|
||||
Dim bOk As Boolean = SortAllMachinings()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<!-- Definizione del ToolHolderUc -->
|
||||
<Grid>
|
||||
<Image Source="/Resources/ToolChangerPos.png"/>
|
||||
<ToggleButton Name="Tool" Width="80" Height="80" Margin="22,40,26,8" Background="#7FB4B4B4">
|
||||
<ToggleButton Name="Tool" Width="50" Height="50" Margin="22,40,26,8" Background="#7FB4B4B4">
|
||||
<ToggleButton.Template>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
</ToggleButton.Template>
|
||||
</ToggleButton>
|
||||
<TextBlock Name="PositionNameTxBl" Height="30" Width="69" FontSize="20" Margin="8,7,51,91"/>
|
||||
<TextBlock Name="PositionNameTxBl" Height="22" Width="68" FontSize="16" Margin="12,16,41,61"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user