diff --git a/AlarmsPageUC.xaml b/AlarmsPageUC.xaml index 60b80dd..cc7e5b1 100644 --- a/AlarmsPageUC.xaml +++ b/AlarmsPageUC.xaml @@ -76,7 +76,7 @@ - diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb index 9593b79..bd8ce46 100644 --- a/AlarmsPageUC.xaml.vb +++ b/AlarmsPageUC.xaml.vb @@ -10,6 +10,8 @@ Public Class AlarmsPageUC Private m_CurrentMachine As CurrentMachine Friend m_CN As CN_generico + ' Definizione pagina attrezzaggio + Friend m_SetUpPage As SetUpPage ' Properties Private m_bFirst As Boolean = True @@ -17,7 +19,7 @@ Public Class AlarmsPageUC Private m_SawList As New List(Of String) Private m_DrillList As New List(Of String) Private m_MillList As New List(Of String) - Private m_AuxToolTypeList As New List(Of String) + Private m_AuxToolTypeList As New List(Of StringIdCmBx) Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs) @@ -60,17 +62,18 @@ Public Class AlarmsPageUC Case CurrentMachine.MountedToolConfigs.SAW 'Non eseguo alcuna azione Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL - m_AuxToolTypeList.Add("Nessuno") If m_CurrentMachine.bDrilling Then - m_AuxToolTypeList.Add("Fresatura") + m_AuxToolTypeList.Add(New StringIdCmBx(2, EgtMsg(MSG_ALARMSPAGEUC + 22))) If m_CurrentMachine.bMilling Then - m_AuxToolTypeList.Add("Foratura") + m_AuxToolTypeList.Add(New StringIdCmBx(1, EgtMsg(MSG_ALARMSPAGEUC + 21))) End If Else If m_CurrentMachine.bMilling Then - m_AuxToolTypeList.Add("Foratura") + m_AuxToolTypeList.Add(New StringIdCmBx(1, EgtMsg(MSG_ALARMSPAGEUC + 21))) End If End If + ' Aggiungo elemento nessuno in fondo alla lista + m_AuxToolTypeList.Add(New StringIdCmBx(0, EgtMsg(MSG_ALARMSPAGEUC + 20))) AuxiliaryToolTxBl.Visibility = Windows.Visibility.Visible AuxiliaryToolCmBx.Visibility = Windows.Visibility.Visible @@ -80,41 +83,22 @@ Public Class AlarmsPageUC CurrMillCmBx.Visibility = Windows.Visibility.Hidden If m_CurrentMachine.sCurrDrill <> String.Empty Then - AuxiliaryToolCmBx.SelectedItem = "Foratura" + AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(1, m_AuxToolTypeList) CurrDrillTxBl.SetValue(Grid.RowProperty, 4) CurrDrillCmBx.SetValue(Grid.RowProperty, 5) CurrDrillTxBl.Visibility = Windows.Visibility.Visible CurrDrillCmBx.Visibility = Windows.Visibility.Visible ElseIf m_CurrentMachine.sCurrMill <> String.Empty Then - AuxiliaryToolCmBx.SelectedItem = "Fresatura" + AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(2, m_AuxToolTypeList) CurrMillTxBl.Visibility = Windows.Visibility.Visible CurrMillCmBx.Visibility = Windows.Visibility.Visible Else - AuxiliaryToolCmBx.SelectedItem = "Nessuno" + AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(0, m_AuxToolTypeList) End If Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER SetUpBtn.Visibility = Windows.Visibility.Visible - 'CreateToolList(MCH_TF.DRILLBIT, m_DrillList) - 'm_DrillList.Add("Nessuno") - 'CreateToolList(MCH_TF.MILL, m_MillList) - 'm_MillList.Add("Nessuna") - 'AuxiliaryToolTxBl.Visibility = Windows.Visibility.Hidden - 'AuxiliaryToolCmBx.Visibility = Windows.Visibility.Hidden - 'CurrDrillTxBl.Visibility = Windows.Visibility.Visible - 'CurrDrillCmBx.Visibility = Windows.Visibility.Visible - 'CurrMillTxBl.Visibility = Windows.Visibility.Visible - 'CurrMillCmBx.Visibility = Windows.Visibility.Visible - 'If m_CurrentMachine.sCurrDrill <> String.Empty Then - ' CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill - 'Else - ' CurrDrillCmBx.SelectedItem = "Nessuno" - 'End If - 'If m_CurrentMachine.sCurrMill <> String.Empty Then - ' CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill - 'Else - ' CurrMillCmBx.SelectedItem = "Nessuna" - 'End If + End Select ' Leggo offset fori @@ -144,15 +128,16 @@ Public Class AlarmsPageUC End Sub Private Sub AuxiliaryToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryToolCmBx.SelectionChanged - Select Case AuxiliaryToolCmBx.SelectedItem - Case "Nessuno" + Dim SelectedItem As StringIdCmBx = AuxiliaryToolCmBx.SelectedItem + Select Case SelectedItem.nId + Case 0 CurrDrillTxBl.Visibility = Windows.Visibility.Hidden CurrDrillCmBx.Visibility = Windows.Visibility.Hidden CurrMillTxBl.Visibility = Windows.Visibility.Hidden CurrMillCmBx.Visibility = Windows.Visibility.Hidden m_CurrentMachine.sCurrDrill = String.Empty m_CurrentMachine.sCurrMill = String.Empty - Case "Foratura" + Case 1 CreateToolList(MCH_TF.DRILLBIT, m_DrillList) m_DrillList.Add("Nessuno") CurrDrillTxBl.SetValue(Grid.RowProperty, 4) @@ -167,7 +152,7 @@ Public Class AlarmsPageUC CurrDrillCmBx.Visibility = Windows.Visibility.Visible CurrMillTxBl.Visibility = Windows.Visibility.Hidden CurrMillCmBx.Visibility = Windows.Visibility.Hidden - Case "Fresatura" + Case 2 CreateToolList(MCH_TF.MILL, m_MillList) m_MillList.Add("Nessuna") If m_CurrentMachine.sCurrMill = String.Empty Then @@ -227,7 +212,8 @@ Public Class AlarmsPageUC Private Sub SetUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles SetUpBtn.Click m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me) - m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(New SetUpPage) + m_SetUpPage = New SetUpPage + m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_SetUpPage) End Sub Private Sub HolesOffsetTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HolesOffsetTxBx.EgtClosed diff --git a/CadCutPageUC.xaml.vb b/CadCutPageUC.xaml.vb index 7f7c691..1378b75 100644 --- a/CadCutPageUC.xaml.vb +++ b/CadCutPageUC.xaml.vb @@ -12,22 +12,32 @@ Public Class CadCutPageUC ' Dichiarazione delle Page UserControl Friend WithEvents m_NestPage As NestPageUC Friend m_SplitPage As SplitPageUC + Friend m_MoveRawPartPage As MoveRawPartPage ' Variabile che indica la modalità - Friend m_bNesting As Boolean = False + Friend m_MovePartPage As MovePartsPages ' Oggetto di gestione della macchina fotografica Friend m_Camera As New Camera + ' Elenco pagine interne a cadcutpage + Friend Enum MovePartsPages As Integer + Nest + Split + MoveRawPart + End Enum + Private Sub CadCutPage_Initialized(sender As Object, e As EventArgs) ' Creazione delle Page UserControl m_NestPage = New NestPageUC m_SplitPage = New SplitPageUC + m_MoveRawPartPage = New MoveRawPartPage ' Posizionamento nella griglia delle Page UserControl m_NestPage.SetValue(Grid.RowSpanProperty, 3) m_SplitPage.SetValue(Grid.RowSpanProperty, 3) + m_MoveRawPartPage.SetValue(Grid.RowSpanProperty, 3) ' Nascondo progress e label per messaggi PhotoProgress.Visibility = Windows.Visibility.Hidden @@ -44,7 +54,8 @@ Public Class CadCutPageUC m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC ' Seleziono UserControl di apertura CadCutPageGrid.Children.Add(m_NestPage) - m_bNesting = True + m_MovePartPage = MovePartsPages.Nest + 'm_bNesting = True SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative)) EgtZoom(ZM.ALL) ' Inizializzo gestore macchina fotografica @@ -92,26 +103,29 @@ Public Class CadCutPageUC Private Sub CadCutPage_Unloaded(sender As Object, e As RoutedEventArgs) ' Chiudo tutti gli UserControl attivi - If m_bNesting Then - CadCutPageGrid.Children.Remove(m_NestPage) - Else - CadCutPageGrid.Children.Remove(m_SplitPage) - End If + Select Case m_MovePartPage + Case MovePartsPages.Nest + CadCutPageGrid.Children.Remove(m_NestPage) + Case MovePartsPages.Split + CadCutPageGrid.Children.Remove(m_SplitPage) + Case MovePartsPages.MoveRawPart + CadCutPageGrid.Children.Remove(m_MoveRawPartPage) + End Select End Sub Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click - If m_bNesting Then - SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Nest.png", UriKind.Relative)) - CadCutPageGrid.Children.Remove(m_NestPage) - CadCutPageGrid.Children.Add(m_SplitPage) - m_bNesting = False - Else - SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative)) - CadCutPageGrid.Children.Remove(m_SplitPage) - CadCutPageGrid.Children.Add(m_NestPage) - m_bNesting = True - End If - + Select Case m_MovePartPage + Case MovePartsPages.Nest + SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Nest.png", UriKind.Relative)) + CadCutPageGrid.Children.Remove(m_NestPage) + CadCutPageGrid.Children.Add(m_SplitPage) + m_MovePartPage = MovePartsPages.Split + Case MovePartsPages.Split + SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative)) + CadCutPageGrid.Children.Remove(m_SplitPage) + CadCutPageGrid.Children.Add(m_NestPage) + m_MovePartPage = MovePartsPages.Nest + End Select End Sub Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click diff --git a/ChooseMachining.xaml b/ChooseMachining.xaml index f324a44..ae72d80 100644 --- a/ChooseMachining.xaml +++ b/ChooseMachining.xaml @@ -37,7 +37,7 @@ - diff --git a/ChooseMachining.xaml.vb b/ChooseMachining.xaml.vb index 72a89d9..2f7f174 100644 --- a/ChooseMachining.xaml.vb +++ b/ChooseMachining.xaml.vb @@ -7,7 +7,7 @@ Public Class ChooseMachining Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine ' Liste che contengono gli elementi appartenenti alle ComboBox Private m_SawingList As New List(Of String) - Private m_AuxiliaryMachiningTypeList As New List(Of String) + Private m_AuxMachTypeList As New List(Of StringIdCmBx) Private m_DrillingList As New List(Of String) Private m_MillingList As New List(Of String) ' Numero righe della finestra, necessario per non ridimensionarla quando si cambia il tipo di utensile ausiliario @@ -23,7 +23,7 @@ Public Class ChooseMachining Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2 Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2 CurrSawingCmBx.ItemsSource = m_SawingList - AuxiliaryMachiningCmBx.ItemsSource = m_AuxiliaryMachiningTypeList + AuxiliaryMachiningCmBx.ItemsSource = m_AuxMachTypeList CurrDrillingCmBx.ItemsSource = m_DrillingList CurrMillingCmBx.ItemsSource = m_MillingList @@ -74,31 +74,33 @@ Public Class ChooseMachining CurrSawingCmBx.SelectedItem = If(Not IsNothing(m_SawingList(0)), m_SawingList(0), Nothing) If Not m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAW Then - m_AuxiliaryMachiningTypeList.Add("Nessuna") If m_CurrentMachine.bDrilling Then - m_AuxiliaryMachiningTypeList.Add("Fresatura") + m_AuxMachTypeList.Add(New StringIdCmBx(2, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 12))) If m_CurrentMachine.bMilling Then - m_AuxiliaryMachiningTypeList.Add("Foratura") + m_AuxMachTypeList.Add(New StringIdCmBx(1, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 11))) If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then - m_AuxiliaryMachiningTypeList.Add("Entrambe") + m_AuxMachTypeList.Add(New StringIdCmBx(3, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 13))) End If End If Else If m_CurrentMachine.bMilling Then - m_AuxiliaryMachiningTypeList.Add("Foratura") + m_AuxMachTypeList.Add(New StringIdCmBx(1, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 11))) End If End If + ' Aggiungo nessuna come ultimo elemento della lista + m_AuxMachTypeList.Add(New StringIdCmBx(0, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 10))) + If m_CurrentMachine.sCurrDrilling <> String.Empty Then If m_CurrentMachine.sCurrMilling <> String.Empty Then - AuxiliaryMachiningCmBx.SelectedItem = "Entrambe" + AuxiliaryMachiningCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(3, m_AuxMachTypeList) Else - AuxiliaryMachiningCmBx.SelectedItem = "Foratura" + AuxiliaryMachiningCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(1, m_AuxMachTypeList) End If Else If m_CurrentMachine.sCurrMilling <> String.Empty Then - AuxiliaryMachiningCmBx.SelectedItem = "Fresatura" + AuxiliaryMachiningCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(2, m_AuxMachTypeList) Else - AuxiliaryMachiningCmBx.SelectedItem = "Nessuna" + AuxiliaryMachiningCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(0, m_AuxMachTypeList) End If End If End If @@ -174,8 +176,9 @@ Public Class ChooseMachining End Sub Private Sub AuxiliaryMachiningCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryMachiningCmBx.SelectionChanged - Select Case AuxiliaryMachiningCmBx.SelectedItem - Case "Nessuna" + Dim SelectedItem As StringIdCmBx = AuxiliaryMachiningCmBx.SelectedItem + Select Case SelectedItem.nId + Case 0 If m_RowNumber > 8 Then For Index = m_RowNumber - 1 To 8 Step -1 ChooseMachiningGrid.RowDefinitions.RemoveAt(Index) @@ -190,7 +193,7 @@ Public Class ChooseMachining CurrMillingTxBl.Visibility = Windows.Visibility.Hidden CurrMillingCmBx.Visibility = Windows.Visibility.Hidden Me.Height = 341.2 - Case "Foratura" + Case 1 ' Definizione di due righe della tabella con la giusta altezza If m_RowNumber < 10 Then For Index = 1 To 10 - m_RowNumber @@ -212,7 +215,7 @@ Public Class ChooseMachining CurrMillingTxBl.Visibility = Windows.Visibility.Hidden CurrMillingCmBx.Visibility = Windows.Visibility.Hidden Me.Height = 426.5 - Case "Fresatura" + Case 2 ' Definizione di due righe della tabella con la giusta altezza If m_RowNumber < 10 Then For Index = 1 To 10 - m_RowNumber @@ -234,7 +237,7 @@ Public Class ChooseMachining CurrMillingTxBl.Visibility = Windows.Visibility.Visible CurrMillingCmBx.Visibility = Windows.Visibility.Visible Me.Height = 426.5 - Case "Entrambe" + Case 3 ' Definizione di quattro righe della tabella con la giusta altezza If m_RowNumber < 12 Then For Index = 1 To 12 - m_RowNumber @@ -284,3 +287,36 @@ Public Class ChooseMachining End Sub End Class + +Class StringIdCmBx + + Private m_nId As Integer + Private m_sName As String + + Friend Shared Function FromIdToStringIdCmBx(nId As Integer, List As List(Of StringIdCmBx)) As StringIdCmBx + For Each Item In List + If Item.nId = nId Then + Return Item + End If + Next + Return Nothing + End Function + + Friend ReadOnly Property nId As Integer + Get + Return m_nId + End Get + End Property + + Public ReadOnly Property sName As String + Get + Return m_sName + End Get + End Property + + Sub New(Id As Integer, sName As String) + m_nId = Id + m_sName = sName + End Sub + +End Class \ No newline at end of file diff --git a/ConstMsg.vb b/ConstMsg.vb index 10cdd5a..d9a953a 100644 --- a/ConstMsg.vb +++ b/ConstMsg.vb @@ -22,8 +22,9 @@ Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700 Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720 Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760 - Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 800 - Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 900 + Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800 + Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900 + Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 950 Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100 End Module diff --git a/MachinePageUC.xaml.vb b/MachinePageUC.xaml.vb index e1a2b41..f682c14 100644 --- a/MachinePageUC.xaml.vb +++ b/MachinePageUC.xaml.vb @@ -141,6 +141,10 @@ Public Class MachinePageUC Private Sub MachinePage_Unloaded(sender As Object, e As RoutedEventArgs) Select Case m_ActiveMachinePage Case MachinePages.Alarms + If Not IsNothing(m_AlarmsPageUC.m_SetUpPage) And MachinePageGrid.Children.Contains(m_AlarmsPageUC.m_SetUpPage) Then + MachinePageGrid.Children.Remove(m_AlarmsPageUC.m_SetUpPage) + MachinePageGrid.Children.Add(m_AlarmsPageUC) + End If Case MachinePages.ToolsDb AlarmsBtn.IsChecked = True ToolsDBBtn.IsChecked = False diff --git a/MachiningDbPageUC.xaml.vb b/MachiningDbPageUC.xaml.vb index 906da2a..c1622a9 100644 --- a/MachiningDbPageUC.xaml.vb +++ b/MachiningDbPageUC.xaml.vb @@ -17,13 +17,13 @@ Public Class MachiningDbPageUC Private m_sMachiningName As String = String.Empty 'Array che contengono le variabili per Combobox - Dim WorkSide() As String = {"Centro", "Sinistra", "Destra"} - Dim HeadSide() As String = {"Sinistra", "Destra"} - Dim LeadInType() As String = {"Centrato", "Interno", "Esterno", "Esteso centrato", "Esteso esterno"} - Dim ExtLinkType() As String = {"Centrato", "Esteso precedente", "Esteso successivo", "Estesi entrambi"} - Dim LeadOutType() As String = {"Centrata", "Interna", "Esterna"} - Dim CurveUse() As String = {"Salta", "Approssima", "Convesso"} - Dim StepType() As String = {"Zig zag", "Una via", "Va e Vieni"} + Dim WorkSide() As String + Dim HeadSide() As String + Dim LeadInType() As String + Dim ExtLinkType() As String + Dim LeadOutType() As String + Dim CurveUse() As String + Dim StepType() As String Dim SawTool As New List(Of String) Dim DrillTool As New List(Of String) @@ -35,6 +35,15 @@ Public Class MachiningDbPageUC ' Assegno la lista degli utensili come sorgente del treeview MachiningTreeView.ItemsSource = MachiningsList + ' Imposto testo delle combobox da file dei messaggi + WorkSide = {EgtMsg(MSG_COMBOBOXPARAM + 21), EgtMsg(MSG_COMBOBOXPARAM + 22), EgtMsg(MSG_COMBOBOXPARAM + 23)} + HeadSide = {EgtMsg(MSG_COMBOBOXPARAM + 22), EgtMsg(MSG_COMBOBOXPARAM + 23)} + LeadInType = {EgtMsg(MSG_COMBOBOXPARAM + 24), EgtMsg(MSG_COMBOBOXPARAM + 25), EgtMsg(MSG_COMBOBOXPARAM + 26), EgtMsg(MSG_COMBOBOXPARAM + 27), EgtMsg(MSG_COMBOBOXPARAM + 28)} + ExtLinkType = {EgtMsg(MSG_COMBOBOXPARAM + 24), EgtMsg(MSG_COMBOBOXPARAM + 29), EgtMsg(MSG_COMBOBOXPARAM + 30), EgtMsg(MSG_COMBOBOXPARAM + 31)} + LeadOutType = {EgtMsg(MSG_COMBOBOXPARAM + 32), EgtMsg(MSG_COMBOBOXPARAM + 33), EgtMsg(MSG_COMBOBOXPARAM + 34)} + CurveUse = {EgtMsg(MSG_COMBOBOXPARAM + 35), EgtMsg(MSG_COMBOBOXPARAM + 36), EgtMsg(MSG_COMBOBOXPARAM + 37)} + StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)} + 'Assegno array a combobox WorkSideCmBx.ItemsSource = WorkSide HeadSideCmBx.ItemsSource = HeadSide diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index d627154..2ce29d5 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -675,7 +675,7 @@ Class MainWindow Private Function ExitFromSplit() As Boolean ' Se non sono in split tutto ok - If m_ActivePage <> Pages.CadCut OrElse m_CadCutPageUC.m_bNesting Then + If m_ActivePage <> Pages.CadCut OrElse m_CadCutPageUC.m_MovePartPage = CadCutPageUC.MovePartsPages.Nest Then Return True End If ' Mi assicuro di terminare correttamente lo split diff --git a/MoveRawPartPage.xaml b/MoveRawPartPage.xaml new file mode 100644 index 0000000..754eace --- /dev/null +++ b/MoveRawPartPage.xaml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MoveRawPartPage.xaml.vb b/MoveRawPartPage.xaml.vb new file mode 100644 index 0000000..fd94fe9 --- /dev/null +++ b/MoveRawPartPage.xaml.vb @@ -0,0 +1,13 @@ +Public Class MoveRawPartPage + + ' Riferimento alla MainWindow + Private m_MainWindow As MainWindow = Application.Current.MainWindow + + Private Sub LaterBtn_Click(sender As Object, e As RoutedEventArgs) Handles LaterBtn.Click + m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) + m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_SplitPage) + m_MainWindow.m_CadCutPageUC.m_MovePartPage = CadCutPageUC.MovePartsPages.Split + + End Sub + +End Class diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj index 42273c9..cf5740f 100644 --- a/OmagCUT.vbproj +++ b/OmagCUT.vbproj @@ -165,6 +165,9 @@ ManualAxesMoveUC.xaml + + MoveRawPartPage.xaml + MultipleCut.xaml @@ -282,6 +285,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/SetUpPage.xaml b/SetUpPage.xaml index da4b37a..98f56e8 100644 --- a/SetUpPage.xaml +++ b/SetUpPage.xaml @@ -31,7 +31,7 @@ - + diff --git a/SetUpPage.xaml.vb b/SetUpPage.xaml.vb index d06ac91..9a89238 100644 --- a/SetUpPage.xaml.vb +++ b/SetUpPage.xaml.vb @@ -2,6 +2,7 @@ Imports System.ComponentModel Imports OmagCUT.TreeViewItem Imports EgtUILib +Imports EgtWPFLib Public Class SetUpPage @@ -20,18 +21,35 @@ Public Class SetUpPage ' Assegno la lista utensili come sorgente dell'albero ToolTree.ItemsSource = m_ToolTreeList - ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina per cambio utensile macchina - Dim ColNum As Integer = Math.Ceiling(m_MainWindow.m_CurrentMachine.dToolChangerNum / 5) - For Index = 5 To ColNum + 1 Step -1 - For Index2 = Index * 5 To (Index - 1) * 5 + 1 Step -1 - TlChGrid.Children.Remove(GetTlChPosFromIndex(Index2)) - TlChGrid.Children.Remove(GetTxBxFromIndex(Index2)) + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + '' Cambio utensile macchina + ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina + Dim ColNum As Integer = Math.Ceiling(m_MainWindow.m_CurrentMachine.dToolChangerNum / 5) + For Index = 5 To ColNum + 1 Step -1 + For Index2 = Index * 5 To (Index - 1) * 5 + 1 Step -1 + TlChGrid.Children.Remove(GetTlChPosFromIndex(Index2)) + TlChGrid.Children.Remove(GetTxBxFromIndex(Index2)) + Next + TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 1) + TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2) Next - TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 1) - TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2) - Next + ' Modifico il numero di elementi presenti sull'ultima colonna + For Index = ColNum * 5 To m_MainWindow.m_CurrentMachine.dToolChangerNum + 1 Step -1 + TlChGrid.Children.Remove(GetTlChPosFromIndex(Index)) + TlChGrid.Children.Remove(GetTxBxFromIndex(Index)) + Next + ' Assegno lunghezza alla scrollviewer + TlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ColNum * 2 + ' Carico i nomi dei portautensili + For Index = 1 To m_MainWindow.m_CurrentMachine.dToolChangerNum + GetTlChPosFromIndex(Index).PositionNameTxBl.Text = m_MainWindow.m_CurrentMachine.ToolChangerName(Index - 1) + Next + Else + SetUpPageGrid.Children.Remove(TlChScVw) + End If - ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina per cambio utensile manuale + '' Cambio utensile manuale + ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina Dim ManColNum As Integer = Math.Ceiling(m_MainWindow.m_CurrentMachine.dManualToolChangerNum / 5) For Index = 12 To ManColNum + 1 Step -1 For Index2 = Index * 5 To (Index - 1) * 5 + 1 Step -1 @@ -41,32 +59,30 @@ Public Class SetUpPage ManTlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 1) ManTlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2) Next - - ' Modifico il numero di elementi presenti sull'ultima colonna sia macchina che manuale - For Index = ColNum * 5 To m_MainWindow.m_CurrentMachine.dToolChangerNum + 1 Step -1 - TlChGrid.Children.Remove(GetTlChPosFromIndex(Index)) - TlChGrid.Children.Remove(GetTxBxFromIndex(Index)) - Next + ' Modifico il numero di elementi presenti sull'ultima colonna For Index = ManColNum * 5 To m_MainWindow.m_CurrentMachine.dManualToolChangerNum + 1 Step -1 ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index)) ManTlChGrid.Children.Remove(GetManTxBxFromIndex(Index)) Next - - ' Assegno lunghezza alle scrollviewer - TlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ColNum * 2 + ' Assegno lunghezza alla scrollviewer ManTlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ManColNum * 2 - - ' Visualizzo il portautensile della macchina - TlChScVw.Visibility = Windows.Visibility.Visible - ToolChangerBtn.IsChecked = True - - ' Carico tutti i nomi dei portautensili - For Index = 1 To m_MainWindow.m_CurrentMachine.dToolChangerNum - GetTlChPosFromIndex(Index).PositionNameTxBl.Text = m_MainWindow.m_CurrentMachine.ToolChangerName(Index - 1) - Next + ' Carico i nomi dei portautensili For Index = 1 To m_MainWindow.m_CurrentMachine.dManualToolChangerNum GetManTlChPosFromIndex(Index).PositionNameTxBl.Text = m_MainWindow.m_CurrentMachine.ManualToolChangerName(Index - 1) Next + + '' Se portautensili della macchina presente + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + ' Apro quello + TlChScVw.Visibility = Windows.Visibility.Visible + ToolChangerBtn.IsChecked = True + Else + ' Altimenti apro portautensili manuale ed elimino bottoni di scelta + ManTlChScVw.Visibility = Windows.Visibility.Visible + ToolChangerBtn.Visibility = Windows.Visibility.Hidden + ManualToolChangerBtn.Visibility = Windows.Visibility.Hidden + End If + End Sub Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded @@ -771,6 +787,14 @@ Public Class SetUpPage Next End Sub + ' Evento che permette di aprire le cartelle degli utensili con un click singolo + Private Sub ToolTree_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseUp + If TypeOf ToolTree.SelectedItem Is CathegoryItem Then + Dim SelectedCathegory As CathegoryItem = ToolTree.SelectedItem + SelectedCathegory.IsExpanded = Not SelectedCathegory.IsExpanded + End If + End Sub + Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click SaveToolChangerStatus() m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC) @@ -782,4 +806,25 @@ Public Class SetUpPage m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me) End Sub + ' Evento che posiziona l'utensile nel suo portautensile predefinito dopo un doppio click + Private Sub ToolTree_PreviewMouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseDoubleClick + If TypeOf ToolTree.SelectedItem Is CustomItem Then + Dim SelectedTool As CustomItem = ToolTree.SelectedItem + EgtTdbSetCurrTool(SelectedTool.Name) + Dim ToolPositionName As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, ToolPositionName) + For Each TlChPos In m_MainWindow.m_CurrentMachine.ToolChanger + If TlChPos.sName = ToolPositionName Then + If TlChPos.sTool = String.Empty Then + Else + Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", "Portautensile predefinito già occupato", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION) + End If + 'Dim eSource As New RoutedEventArgs(New RoutedEvent, GetManTlChPosFromIndex(TlChPos.sPosition)) + 'ToolHolder_ToolClick(sender, eSource) + Exit For + End If + Next + End If + End Sub + End Class diff --git a/SplitPageUC.xaml.vb b/SplitPageUC.xaml.vb index a602588..f5a24b2 100644 --- a/SplitPageUC.xaml.vb +++ b/SplitPageUC.xaml.vb @@ -225,6 +225,12 @@ Public Class SplitPageUC End If End Sub + Private Sub LaterBtn_Click(sender As Object, e As RoutedEventArgs) Handles LaterBtn.Click + m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage) + m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) + m_MainWindow.m_CadCutPageUC.m_MovePartPage = CadCutPageUC.MovePartsPages.MoveRawPart + End Sub + End Class Public Class NameIdLsBxItem diff --git a/ToolsDbPageUC.xaml.vb b/ToolsDbPageUC.xaml.vb index 085c069..e227557 100644 --- a/ToolsDbPageUC.xaml.vb +++ b/ToolsDbPageUC.xaml.vb @@ -30,8 +30,8 @@ Public Class ToolsDbPageUC Private m_dToolMaxMat As Double = 0 'Array che contengono i tipi di Coolant - Dim ToolCoolant() As String = {"No", "Interna", "Esterna", "Entrambe"} - Dim SawCoolant() As String = {"No", "Esterna"} + Dim ToolCoolant() As String + Dim SawCoolant() As String 'Variabile che conserva l'utensile precedentemente selezionato usata nel caso si selezioni annulla quando si cambia utensile selezionato Private m_OldItem As Object @@ -51,12 +51,15 @@ Public Class ToolsDbPageUC ' Assegno la lista degli utensili come sorgente del treeview ToolTreeView.ItemsSource = ToolsList + ' Imposto testo delle combobox da file dei messaggi + ToolCoolant = {EgtMsg(MSG_COMBOBOXPARAM + 1), EgtMsg(MSG_COMBOBOXPARAM + 2), EgtMsg(MSG_COMBOBOXPARAM + 3), EgtMsg(MSG_COMBOBOXPARAM + 4)} + SawCoolant = {EgtMsg(MSG_COMBOBOXPARAM + 1), EgtMsg(MSG_COMBOBOXPARAM + 3)} + 'Imposto i messaggi letti dal file dei messaggi NewBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 15) SaveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 17) RemoveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18) - NameTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 1) TCPosTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 2) HeadTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 3) @@ -404,13 +407,13 @@ Public Class ToolsDbPageUC StringToLen(MaxMatTxBx.Text, dTemp) EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, dTemp) End If - StringToLen(LonOffsetTxBx.Text, dTemp) - EgtTdbSetCurrToolParam(MCH_TP.LONOFFSET, dTemp) - StringToLen(RadOffsetTxBx.Text, dTemp) - EgtTdbSetCurrToolParam(MCH_TP.RADOFFSET, dTemp) - Dim ToolType As Integer - EgtTdbGetCurrToolParam(MCH_TP.TYPE, ToolType) - If (ToolType And MCH_TF.SAWBLADE) <> 0 Then + If m_nToolType <> MCH_TY.DRILL_STD Then + StringToLen(LonOffsetTxBx.Text, dTemp) + EgtTdbSetCurrToolParam(MCH_TP.LONOFFSET, dTemp) + StringToLen(RadOffsetTxBx.Text, dTemp) + EgtTdbSetCurrToolParam(MCH_TP.RADOFFSET, dTemp) + End If + If m_nToolType = MCH_TY.SAW_STD Then If CoolantCmBx.SelectedIndex = 0 Then nTemp = 0 ElseIf CoolantCmBx.SelectedIndex = 1 Then @@ -456,7 +459,12 @@ Public Class ToolsDbPageUC CorrTxBx.Visibility = Windows.Visibility.Visible MaxMatTxBl.Visibility = If(m_nToolType = MCH_TY.SAW_STD, Windows.Visibility.Visible, Windows.Visibility.Hidden) MaxMatTxBx.Visibility = If(m_nToolType = MCH_TY.SAW_STD, Windows.Visibility.Visible, Windows.Visibility.Hidden) - OffsetGpBx.Visibility = Windows.Visibility.Visible + OffsetGpBx.Visibility = If(m_nToolType <> MCH_TY.DRILL_STD, Windows.Visibility.Visible, Windows.Visibility.Hidden) + If m_nToolType = MCH_TY.DRILL_STD Then + AbsorptionBrd.SetValue(Grid.RowProperty, 19) + Else + AbsorptionBrd.SetValue(Grid.RowProperty, 23) + End If AbsorptionBrd.Visibility = Windows.Visibility.Visible End Sub