From d40fa7cf786a3bcb724d3a95d2f5fd320055320f Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Wed, 2 Mar 2016 19:29:52 +0000 Subject: [PATCH] OmagCut : - Miglioramento selezione utensili attivi in combobox. --- AlarmsPageUC.xaml.vb | 39 +++++++++++++++++--- ChooseMachining.xaml.vb | 14 ++++++-- ConstGen.vb | 2 ++ MachineCNPageUC.xaml.vb | 6 ++++ RawPartPageUC.xaml | 4 +-- RawPartPageUC.xaml.vb | 80 +++++++++++++++++++++++++++++++---------- 6 files changed, 117 insertions(+), 28 deletions(-) diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb index e5dc0c5..0cb56e3 100644 --- a/AlarmsPageUC.xaml.vb +++ b/AlarmsPageUC.xaml.vb @@ -1,4 +1,5 @@ Imports System.Windows.Threading +Imports System.Collections.ObjectModel Imports System.IO Imports EgtUILib Imports EgtWPFLib @@ -17,8 +18,8 @@ Public Class AlarmsPageUC 'Lista che contiene le lame disponibili (per Combobox pagina Alarms) 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_DrillList As New ObservableCollection(Of String) + Private m_MillList As New ObservableCollection(Of String) Private m_AuxToolTypeList As New List(Of StringIdCmBx) Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs) @@ -114,12 +115,22 @@ Public Class AlarmsPageUC CurrMillCmBx.Visibility = Windows.Visibility.Hidden If m_CurrentMachine.sCurrDrill <> String.Empty Then + Dim sTempCurrDrill = m_CurrentMachine.sCurrDrill + CreateToolList(MCH_TF.DRILLBIT, m_DrillList) + m_DrillList.Add("Nessuno") + m_CurrentMachine.sCurrDrill = sTempCurrDrill + CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill 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 + Dim sTempCurrMill = m_CurrentMachine.sCurrMill + CreateToolList(MCH_TF.MILL, m_MillList) + m_MillList.Add("Nessuno") + m_CurrentMachine.sCurrMill = sTempCurrMill + CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(2, m_AuxToolTypeList) CurrMillTxBl.Visibility = Windows.Visibility.Visible CurrMillCmBx.Visibility = Windows.Visibility.Visible @@ -177,8 +188,11 @@ Public Class AlarmsPageUC m_CurrentMachine.sCurrDrill = String.Empty m_CurrentMachine.sCurrMill = String.Empty Case 1 + Dim sTempCurrDrill = m_CurrentMachine.sCurrDrill CreateToolList(MCH_TF.DRILLBIT, m_DrillList) m_DrillList.Add("Nessuno") + m_CurrentMachine.sCurrDrill = sTempCurrDrill + CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill CurrDrillTxBl.SetValue(Grid.RowProperty, 4) CurrDrillCmBx.SetValue(Grid.RowProperty, 5) If m_CurrentMachine.sCurrDrill = String.Empty Then @@ -192,8 +206,11 @@ Public Class AlarmsPageUC CurrMillTxBl.Visibility = Windows.Visibility.Hidden CurrMillCmBx.Visibility = Windows.Visibility.Hidden Case 2 + Dim sTempCurrMill = m_CurrentMachine.sCurrMill CreateToolList(MCH_TF.MILL, m_MillList) - m_MillList.Add("Nessuna") + m_MillList.Add("Nessuno") + m_CurrentMachine.sCurrMill = sTempCurrMill + CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill If m_CurrentMachine.sCurrMill = String.Empty Then CurrMillCmBx.SelectedItem = "Nessuna" Else @@ -237,8 +254,20 @@ Public Class AlarmsPageUC End If End Sub - Private Sub CreateToolList(ToolType As Integer, ToolList As List(Of String)) - 'SawList.Clear() + Private Overloads Sub CreateToolList(ToolType As Integer, ToolList As ObservableCollection(Of String)) + ToolList.Clear() + Dim ToolName As String = String.Empty + Dim nType As Integer = MCH_TY.NONE + If EgtTdbGetFirstTool(ToolType, ToolName, nType) Then + ToolList.Add(ToolName) + While EgtTdbGetNextTool(ToolType, ToolName, nType) + ToolList.Add(ToolName) + End While + End If + End Sub + + Private Overloads Sub CreateToolList(ToolType As Integer, ToolList As List(Of String)) + ToolList.Clear() Dim ToolName As String = String.Empty Dim nType As Integer = MCH_TY.NONE If EgtTdbGetFirstTool(ToolType, ToolName, nType) Then diff --git a/ChooseMachining.xaml.vb b/ChooseMachining.xaml.vb index a74732a..b6221b4 100644 --- a/ChooseMachining.xaml.vb +++ b/ChooseMachining.xaml.vb @@ -1,4 +1,5 @@ -Imports EgtUILib +Imports System.Collections.ObjectModel +Imports EgtUILib Public Class ChooseMachining @@ -349,7 +350,16 @@ 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 + Friend Overloads 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 Overloads Shared Function FromIdToStringIdCmBx(nId As Integer, List As ObservableCollection(Of StringIdCmBx)) As StringIdCmBx For Each Item In List If Item.nId = nId Then Return Item diff --git a/ConstGen.vb b/ConstGen.vb index b060fb7..993ee79 100644 --- a/ConstGen.vb +++ b/ConstGen.vb @@ -67,6 +67,8 @@ Module ConstGen Public Const NAME_OUTKERF As String = "SheetOut" ' Chiave per definizione del grezzo per punti Public Const KEY_RAWBYPOINTS As String = "Rbp" + ' Nome del contorno di dell'area rovinata + Public Const NAME_DAMAGED As String = "Damaged" ' Contrassegno di progetto OmagCut Public Const NAME_PROJMARK As String = "OmagCut" diff --git a/MachineCNPageUC.xaml.vb b/MachineCNPageUC.xaml.vb index 8cb190c..d6795d3 100644 --- a/MachineCNPageUC.xaml.vb +++ b/MachineCNPageUC.xaml.vb @@ -26,6 +26,12 @@ Public Class MachineCNPageUC MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16) PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17) ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12) + ' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini + If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, "0", m_MainWindow.GetIniFile()) = 1 Then + PartProgTransferGpBx.Visibility = Windows.Visibility.Visible + Else + PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden + End If End Sub Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) diff --git a/RawPartPageUC.xaml b/RawPartPageUC.xaml index 0e39af8..633e053 100644 --- a/RawPartPageUC.xaml +++ b/RawPartPageUC.xaml @@ -113,8 +113,8 @@ -