EgtCAM5 :

- Aggiunta ricerca su MTable lavorazioni ordinate.
- Aggiunta possibilità in MTable di spostare anche le righe della tabella associazioni.
- Migliorie varie.
This commit is contained in:
Emmanuele Sassi
2017-07-21 17:52:04 +00:00
parent a621285cd5
commit db6662ec48
4 changed files with 253 additions and 79 deletions
+19 -29
View File
@@ -171,6 +171,7 @@
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
</Style.Resources>
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<EventSetter Event="PreviewMouseDown" Handler="LeftTableMouseDown"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsValidForSearch}" Value="True">
<Setter Property="Background" Value="{StaticResource EgaltechGreen}"></Setter>
@@ -376,7 +377,7 @@
</DataGrid.InputBindings>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<EventSetter Event="PreviewMouseDown" Handler="CellLeftClick"/>
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="CellLeftClick"/>
<EventSetter Event="PreviewMouseRightButtonDown" Handler="CellRightClick"/>
<EventSetter Event="PreviewMouseRightButtonUp" Handler="CellRightUp"/>
<EventSetter Event="PreviewMouseUp" Handler="CellMouseUp"/>
@@ -390,12 +391,16 @@
</Style.Resources>
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<EventSetter Event="MouseRightButtonDown" Handler="RowRightClick"/>
<EventSetter Event="MouseLeftButtonDown" Handler="RowLeftClick"/>
<!--<EventSetter Event="MouseLeftButtonDown" Handler="RowLeftClick"/>-->
<EventSetter Event="PreviewMouseDown" Handler="RowMouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="RowMouseUp"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsGroupEven}" Value="True">
<Setter Property="Background" Value="{StaticResource EgaltechUltralightGray}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsValidForSearch}" Value="True">
<Setter Property="Background" Value="{StaticResource EgaltechGreen}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
@@ -428,13 +433,13 @@
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox SelectedItem="{Binding PropertyPar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
<ComboBox SelectedItem="{Binding grh_PropertyPar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding PropertyList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock ToolTip="{Binding Path=PropertyPar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<TextBlock ToolTip="{Binding Path=grh_PropertyPar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource PropertyConverter}">
<Binding Path="PropertyPar" />
@@ -459,15 +464,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna GeometryName-->
<!--
<DataGridTextColumn Width="1*"
Binding="{Binding Geometry}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GeometryHdr, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>-->
<!--Colonna MachiningName-->
<DataGridTemplateColumn Width="1*"
@@ -482,18 +479,9 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningName-->
<!--
<DataGridTextColumn Width="1*"
Binding="{Binding Machining}"
IsReadOnly="True">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachiningHdr, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>-->
<!--Colonna Join-->
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding Join}">
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding grh_Join}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.JoinHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
@@ -545,18 +533,20 @@
IsEnabled="{Binding IsEnabledResetSearch}"/>
</Grid>
<Button Content="{Binding AddMachiningBtn}" Command="{Binding AddRowCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="1"/>
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding AddRemoveRow_IsEnabled}"
Grid.Column="1"/>
<Button Content="{Binding RemoveMachiningBtn}" Command="{Binding RemoveRowCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="2"/>
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding AddRemoveRow_IsEnabled}"
Grid.Column="2"/>
<Button Content="/\" Command="{Binding MoveRowUpCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding MoveRowUp_IsEnabled}"
IsEnabled="{Binding MoveRow_IsEnabled}"
Grid.Column="3"/>
<Button Content="\/" Command="{Binding MoveRowDownCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding MoveRowDown_IsEnabled}"
IsEnabled="{Binding MoveRow_IsEnabled}"
Grid.Column="4"/>
<Button Content="Group" Command="{Binding GroupCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
+13 -5
View File
@@ -17,11 +17,19 @@ Public Class MTableDbV
m_MTableDbVM = MTableDbVM
End Sub
Private Sub RowLeftClick(sender As Object, e As MouseButtonEventArgs)
e.Handled = True
Private Sub LeftTableMouseDown(sender As Object, e As MouseButtonEventArgs)
m_MTableDbVM.FocusedTable = MTableDbVM.Tables.LEFTTABLE
m_MTableDbVM.ResetRightTableSelection()
End Sub
Private Sub RowMouseDown(sender As Object, e As MouseButtonEventArgs)
m_MTableDbVM.FocusedTable = MTableDbVM.Tables.RIGHTTABLE
m_MTableDbVM.ResetLeftTableSelection()
End Sub
Private Sub RowRightClick(sender As Object, e As MouseButtonEventArgs)
m_MTableDbVM.FocusedTable = MTableDbVM.Tables.RIGHTTABLE
m_MTableDbVM.ResetLeftTableSelection()
e.Handled = True
End Sub
@@ -62,7 +70,7 @@ Public Class MTableDbV
End If
End If
If Not bSelCell And Not CurrCell.IsEditing Or CurrCell.Column Is MachiningDataGrid.Columns(4) Then
m_EditCell.IsEditing = False
If Not IsNothing(m_EditCell) Then m_EditCell.IsEditing = False
Keyboard.ClearFocus()
MachiningDataGrid.Focus()
e.Handled = True
@@ -78,8 +86,8 @@ Public Class MTableDbV
Dim SelectedRow As MTableMachiningGridBoxItem = DirectCast(CurrCell.DataContext, MTableMachiningGridBoxItem)
m_MTableDbVM.RightSelect(SelectedRow)
End If
m_EditCell.IsEditing = False
CurrCell.IsSelected = False
If Not IsNothing(m_EditCell) Then m_EditCell.IsEditing = False
CurrCell.IsEditing = False
Keyboard.ClearFocus()
MachiningDataGrid.Focus()
e.Handled = True
+124 -31
View File
@@ -7,6 +7,21 @@ Imports System.Text.RegularExpressions
Public Class MTableDbVM
Inherits VMBase
Friend Enum Tables As Integer
LEFTTABLE = 1
RIGHTTABLE = 2
End Enum
Private m_FocusedTable As Tables = Tables.LEFTTABLE
Friend Property FocusedTable As Tables
Get
Return m_FocusedTable
End Get
Set(value As Tables)
m_FocusedTable = value
End Set
End Property
Private Shared m_refMTableDbVM As MTableDbVM
Public Shared ReadOnly Property refMTableDbVM As MTableDbVM
Get
@@ -38,19 +53,22 @@ Public Class MTableDbVM
Set(value As String)
If value <> m_TextToSearch Then
If Not String.IsNullOrWhiteSpace(value) Then
' deseleziono tutto nella tabella delle lavorazioni ordinate
ResetRightTableSelection()
' recupero tabella selezionata
Dim SelectedMTable As MTableListBoxItem = Nothing
For TableIndex = 0 To m_TablesList.Count - 1
If m_TablesList(TableIndex).IsSelected Then
SelectedMTable = m_TablesList(TableIndex)
End If
Next
' se esiste, cerco il testo ed abilito il bottone reset
If Not IsNothing(SelectedMTable) Then
SearchText(value, SelectedMTable)
IsEnabledResetSearch = True
End If
SearchText(value, SelectedMTable)
IsEnabledResetSearch = True
Else
' altrimenti resetto la ricerca e disabilito il bottone reset
ResetSearchedRow()
IsEnabledResetSearch = False
End If
@@ -84,28 +102,28 @@ Public Class MTableDbVM
End Set
End Property
Private m_MoveRowUp_IsEnabled As Boolean
Public Property MoveRowUp_IsEnabled As Boolean
Private m_AddRemoveRow_IsEnabled As Boolean
Public Property AddRemoveRow_IsEnabled As Boolean
Get
Return m_MoveRowUp_IsEnabled
Return m_AddRemoveRow_IsEnabled
End Get
Set(value As Boolean)
If value <> m_MoveRowUp_IsEnabled Then
m_MoveRowUp_IsEnabled = value
NotifyPropertyChanged("MoveRowUp_IsEnabled")
If value <> m_AddRemoveRow_IsEnabled Then
m_AddRemoveRow_IsEnabled = value
NotifyPropertyChanged("AddRemoveRow_IsEnabled")
End If
End Set
End Property
Private m_MoveRowDown_IsEnabled As Boolean
Public Property MoveRowDown_IsEnabled As Boolean
Private m_MoveRow_IsEnabled As Boolean
Public Property MoveRow_IsEnabled As Boolean
Get
Return m_MoveRowDown_IsEnabled
Return m_MoveRow_IsEnabled
End Get
Set(value As Boolean)
If value <> m_MoveRowDown_IsEnabled Then
m_MoveRowDown_IsEnabled = value
NotifyPropertyChanged("MoveRowDown_IsEnabled")
If value <> m_MoveRow_IsEnabled Then
m_MoveRow_IsEnabled = value
NotifyPropertyChanged("MoveRow_IsEnabled")
End If
End Set
End Property
@@ -430,6 +448,7 @@ Public Class MTableDbVM
Private Sub SearchText(sText As String, SelectedMTable As MTableListBoxItem)
Dim bFirst As Boolean = True
' cerco nella tabella associazioni
For AssociationIndex = 0 To SelectedMTable.AssociationList.Count - 1
Dim CurrAssociation As MTableAssociationGridBoxItem = SelectedMTable.AssociationList(AssociationIndex)
If CurrAssociation.Name.ToLower.Contains(sText) Then
@@ -442,6 +461,17 @@ Public Class MTableDbVM
CurrAssociation.IsValidForSearch = False
End If
Next
' cerco nella tabella lavorazioni ordinate
For MachineIndex = 0 To SelectedMTable.ActiveMachinesList.Count - 1
For MachiningIndex = 0 To SelectedMTable.ActiveMachinesList(MachineIndex).MachiningList.Count - 1
Dim CurrMachining As MTableMachiningGridBoxItem = SelectedMTable.ActiveMachinesList(MachineIndex).MachiningList(MachiningIndex)
If CurrMachining.Geometry.ToLower.Contains(sText) Then
CurrMachining.IsValidForSearch = True
Else
CurrMachining.IsValidForSearch = False
End If
Next
Next
End Sub
Private Sub SearchInNewlySelectedMTable(SelectedMTable As MTableListBoxItem)
@@ -562,15 +592,15 @@ Public Class MTableDbVM
' gestisco bottoni
' se ho selezionato un gruppo 0 e c'è un gruppo già selezionato
If SelectedRow.GroupId = 0 And nSelFirstGroupId = nSelLastGroupId And bItemFound Then
ManageMachiningButtons(True, False, False)
ManageMachiningButtons(False, True, False, False)
ElseIf SelectedRow.GroupId <> 0 And nSelFirstGroupId = nSelLastGroupId And bZeroItemFound Then
ManageMachiningButtons(True, False, False)
ManageMachiningButtons(False, True, False, False)
ElseIf SelectedRow.GroupId <> 0 And bItemFound Then
ManageMachiningButtons(False, True, False)
ManageMachiningButtons(False, False, True, False)
ElseIf SelectedRow.GroupId <> 0 And Not bItemFound Then
ManageMachiningButtons(False, False, True)
ManageMachiningButtons(False, False, False, True)
Else
ManageMachiningButtons(False, False, False)
ManageMachiningButtons(False, False, False, False)
End If
End Sub
@@ -616,7 +646,7 @@ Public Class MTableDbVM
If m_TablesList(TableIndex).SelMachine.MachiningList.Count - 1 = MachiningIndex OrElse m_TablesList(TableIndex).SelMachine.MachiningList(MachiningIndex + 1).GroupId <> CurrMachining.GroupId Then
bLastIsGroup = True
End If
End If
End If
End If
End If
Next
@@ -626,9 +656,9 @@ Public Class MTableDbVM
' gestisco bottoni
' se ho selezionato un gruppo 0 e c'è un gruppo già selezionato
If bItemFound And nSelFirstGroupId = nSelLastGroupId Then
ManageMachiningButtons(False, False, True)
ManageMachiningButtons(False, False, False, True)
Else
ManageMachiningButtons(False, False, False)
ManageMachiningButtons(False, False, False, False)
End If
End Sub
@@ -669,19 +699,19 @@ Public Class MTableDbVM
Friend Sub RightSelect(SelectedRow As MTableMachiningGridBoxItem)
Dim bIsRowSelected As Boolean = SelectedRow.IsSelected
' deseleziono tutto
ResetSelection()
ResetRightTableSelection()
If Not bIsRowSelected Then
' seleziono la lavorazione clickata
SelectedRow.IsSelected = True
' attivo solo tasti di movimento
ManageMachiningButtons(False, False, True)
ManageMachiningButtons(False, False, False, True)
Else
' disattivo tutti i tasti
ManageMachiningButtons(False, False, False)
ManageMachiningButtons(False, False, False, False)
End If
End Sub
Private Sub ResetSelection()
Friend Sub ResetRightTableSelection()
For TableIndex = 0 To m_TablesList.Count - 1
If m_TablesList(TableIndex).IsSelected Then
For MachiningIndex = 0 To m_TablesList(TableIndex).SelMachine.MachiningList.Count - 1
@@ -693,13 +723,25 @@ Public Class MTableDbVM
Next
End Sub
Friend Sub ResetLeftTableSelection()
For TableIndex = 0 To m_TablesList.Count - 1
If m_TablesList(TableIndex).IsSelected Then
For AssociationIndex = 0 To m_TablesList(TableIndex).AssociationList.Count - 1
Dim CurrAssociation As MTableAssociationGridBoxItem = m_TablesList(TableIndex).AssociationList(AssociationIndex)
CurrAssociation.IsSelected = False
Next
Exit For
End If
Next
End Sub
#End Region ' SelectGroupCommand
Private Sub ManageMachiningButtons(bPosition As Boolean, bGroup As Boolean, bMove As Boolean)
Friend Sub ManageMachiningButtons(bAddRemoveRow As Boolean, bPosition As Boolean, bGroup As Boolean, bMove As Boolean)
AddRemoveRow_IsEnabled = bAddRemoveRow
Position_IsEnabled = bPosition
Group_IsEnabled = bGroup
MoveRowDown_IsEnabled = bMove
MoveRowUp_IsEnabled = bMove
MoveRow_IsEnabled = bMove
End Sub
#End Region
@@ -948,6 +990,7 @@ Public Class MTableDbVM
End Sub
Public Sub ResetSearchedRow()
' analizzo tabella associazioni
For TableIndex = 0 To m_TablesList.Count - 1
If m_TablesList(TableIndex).IsSelected Then
For AssociationIndex = 0 To m_TablesList(TableIndex).AssociationList.Count - 1
@@ -957,6 +1000,18 @@ Public Class MTableDbVM
Exit For
End If
Next
' analizzo tabella lavorazioni ordinate
For TableIndex = 0 To m_TablesList.Count - 1
If m_TablesList(TableIndex).IsSelected Then
For MachineIndex = 0 To m_TablesList(TableIndex).ActiveMachinesList.Count - 1
For MachiningIndex = 0 To m_TablesList(TableIndex).ActiveMachinesList(MachineIndex).MachiningList.Count - 1
Dim CurrMachining As MTableMachiningGridBoxItem = m_TablesList(TableIndex).ActiveMachinesList(MachineIndex).MachiningList(MachiningIndex)
CurrMachining.IsValidForSearch = False
Next
Next
Exit For
End If
Next
End Sub
@@ -1179,6 +1234,7 @@ Public Class MTableDbVM
Public Sub RemoveRow(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If Not IsNothing(SelectedMTable) AndAlso SelectedMTable.AssociationList.Count > 1 Then
If IsNothing(SelectedMTable.SelectedAssociation) Then Return
' Chiedo conferma cancellazione riga di associazione
If MessageBox.Show(EgtMsg(MSG_DOORSERRORS + 10), EgtMsg(MSG_DOORSERRORS + 11), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then
Return
@@ -1233,11 +1289,28 @@ Public Class MTableDbVM
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' Right table Movement
''' </summary>
Public Sub MoveRowUp(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
If m_FocusedTable = Tables.LEFTTABLE Then
LeftTableMoveRowUp(SelectedMTable)
Else
RightTableMoveRowUp(SelectedMTable)
End If
End Sub
' Left table Movement
Public Sub LeftTableMoveRowUp(SelectedMTable As MTableListBoxItem)
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex >= 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex - 1)
End If
End Sub
Public Sub RightTableMoveRowUp(SelectedMTable As MTableListBoxItem)
SelectedMTable.m_IsMachiningOrdModified = True
MoveRow(SelectedMTable, True)
End Sub
@@ -1474,6 +1547,24 @@ Public Class MTableDbVM
Public Sub MoveRowDown(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
If m_FocusedTable = Tables.LEFTTABLE Then
LeftTableMoveRowDown(SelectedMTable)
Else
RigthTableMoveRowDown(SelectedMTable)
End If
End Sub
' Spostamento sulla tabella delle associazioni
Public Sub LeftTableMoveRowDown(SelectedMTable As MTableListBoxItem)
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex < SelectedMTable.AssociationList.Count - 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex + 1)
End If
End Sub
' Spostamento sulla tabella ordine lavorazioni
Public Sub RigthTableMoveRowDown(SelectedMTable As MTableListBoxItem)
SelectedMTable.m_IsMachiningOrdModified = True
MoveRow(SelectedMTable, False)
End Sub
@@ -1499,6 +1590,7 @@ Public Class MTableDbVM
Public Sub Group(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
SelectedMTable.m_IsMachiningOrdModified = True
Dim bGroupStarted As Boolean = False
Dim bGroupEnded As Boolean = False
Dim nGroupIndex As Integer = 0
@@ -1578,6 +1670,7 @@ Public Class MTableDbVM
Public Sub Position(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) Then Return
SelectedMTable.m_IsMachiningOrdModified = True
Dim MachToMove As MTableMachiningGridBoxItem = Nothing
Dim MachRef As MTableMachiningGridBoxItem = Nothing
Dim OldIndex As Integer = -1
@@ -1619,7 +1712,7 @@ Public Class MTableDbVM
End If
Next
' Rivaluto bottoni che dipendono da selezione
ManageMachiningButtons(False, False, True)
ManageMachiningButtons(False, False, False, True)
End Sub
#End Region ' PositionCommand
+97 -14
View File
@@ -13,6 +13,9 @@ Public Class MTableListBoxItem
Friend Shared m_delCloseMTableWnd As Action
Friend Shared m_delSearchInMTable As Action(Of MTableListBoxItem)
' Parametro che indica se sono state apportate modifiche alla tabella lavorazioni ordinata tramite i comandi sposta, posiziona o ordina
Friend m_IsMachiningOrdModified As Boolean = False
Private m_Visibility As Visibility
Public Property Visibility As Visibility
Get
@@ -38,6 +41,11 @@ Public Class MTableListBoxItem
m_delCloseMTableWnd()
Return
End If
' resetto liste lavorazioni
MTableAssociationGridBoxItem.ResetMachiningList()
' resetto stato bottoni di modifica della tabella delle lavorazioni ordinate (posiziona, raggruppa, sposta su e giù)
m_IsMachiningOrdModified = False
' leggo la tabella
If Not ReadMTableFile() Then Return
SelectedAssociation = If(m_AssociationList.Count > 0, m_AssociationList(0), Nothing)
SelMachine = m_ActiveMachinesList(0)
@@ -197,16 +205,28 @@ Public Class MTableListBoxItem
Public Function IsModified() As Boolean
Dim CurrIsModified As Boolean = False
' verifico se ci sono stati cambiamenti nell'ordine delle lavorazioni
If m_IsMachiningOrdModified Then Return True
' verifico se ci sono state modifiche nella lista macchine
For Index As Integer = 0 To m_ActiveMachinesList.Count - 1
If m_ActiveMachinesList(Index).m_IsModified = True Then
Return True
End If
Next
' verifico se ci sono state modifiche nella lista associazioni
For Index = 0 To m_AssociationList.Count - 1
If m_AssociationList(Index).m_IsModified = True Then
Return True
End If
Next
' verifico se ci sono state modifiche nella lista lavorazioni ordinate
For MachineIndex As Integer = 0 To m_ActiveMachinesList.Count - 1
For MachiningIndex = 0 To m_ActiveMachinesList(MachineIndex).MachiningList.Count - 1
If m_ActiveMachinesList(MachineIndex).MachiningList(MachiningIndex).m_IsModified = True Then
Return True
End If
Next
Next
Return False
End Function
@@ -355,6 +375,9 @@ Public Class MTableMachiningGridBoxItem
Private m_refMTableMachine As MTableMachineListBoxItem
' Variabile che indica se questo oggetto è stato modificato
Friend m_IsModified As Boolean = False
Private m_RWGroupId As Integer
Public Property RWGroupId As Integer
Get
@@ -405,6 +428,24 @@ Public Class MTableMachiningGridBoxItem
End Property
Private m_Property As String
Public Property grh_PropertyPar As String
Get
Return m_Property
End Get
Set(value As String)
m_IsModified = True
m_Property = value
' lo modifico anche a tutti gli altri elementi del gruppo
Dim PositionIndex As Integer = m_refMTableMachine.MachiningList.IndexOf(Me)
For MachiningIndex = PositionIndex To m_refMTableMachine.MachiningList.Count - 1
If m_refMTableMachine.MachiningList(MachiningIndex).GroupId = GroupId Then
m_refMTableMachine.MachiningList(MachiningIndex).SetProperty(m_Property)
Else
Exit For
End If
Next
End Set
End Property
Public Property PropertyPar As String
Get
Return m_Property
@@ -450,6 +491,18 @@ Public Class MTableMachiningGridBoxItem
End Property
Private m_Join As Boolean
Public Property grh_Join As Boolean
Get
Return m_Join
End Get
Set(value As Boolean)
If value <> m_Join Then
m_IsModified = True
m_Join = value
NotifyPropertyChanged("Join")
End If
End Set
End Property
Public Property Join As Boolean
Get
Return m_Join
@@ -462,6 +515,18 @@ Public Class MTableMachiningGridBoxItem
End Set
End Property
' Variabile che indica se il nome dell'associazione corrisponde ai criteri di ricerca
Private m_IsValidForSearch As Boolean
Public Property IsValidForSearch As Boolean
Get
Return m_IsValidForSearch
End Get
Set(value As Boolean)
m_IsValidForSearch = value
NotifyPropertyChanged("IsValidForSearch")
End Set
End Property
Sub New(dGroup As Integer, sGeometry As String, sMachining As String, bJoin As Boolean, ByRef refMTableMachine As MTableMachineListBoxItem)
m_RWGroupId = dGroup
m_GroupId = dGroup \ 100
@@ -490,6 +555,7 @@ Public Class MTableMachiningGridBoxItem
Public Shared Sub Remove(Item As MTableMachiningGridBoxItem, MachiningList As ObservableCollection(Of MTableMachiningGridBoxItem))
' recupero indice dell'Item all'interno della lista
Dim ItemIndex As Integer = MachiningList.IndexOf(Item)
If ItemIndex < 0 Then Return
Dim bIncrementFollowingGroup As Boolean = False
If MachiningList.Count = 1 OrElse MachiningList(ItemIndex).GroupId = 0 Then
bIncrementFollowingGroup = False
@@ -549,6 +615,7 @@ Public Class MTableAssociationGridBoxItem
Set(value As Boolean)
If value <> m_IsSelected Then
m_IsSelected = value
MTableDbVM.refMTableDbVM.ManageMachiningButtons(True, False, False, True)
NotifyPropertyChanged("IsSelected")
End If
End Set
@@ -667,7 +734,7 @@ Public Class MTableAssociationGridBoxItem
End If
Next
If Not bFound Then
m_SelectedMachType = m_MachTypeList(0)
m_SelectedMachType = Nothing
NotifyPropertyChanged("SelectedMachType")
End If
End If
@@ -683,14 +750,20 @@ Public Class MTableAssociationGridBoxItem
Return
End If
EgtSetCurrMachine(m_ActiveMachinesList(value - 1).SelectedMachine)
m_RefMachItem = ManageOrderedMachining(Mach, nOldMachId, RefMachItem, "Mach")
m_RefMachUpItem = ManageOrderedMachining(MachUp, nOldMachId, RefMachUpItem, "MachUp")
m_RefMachDwItem = ManageOrderedMachining(MachDw, nOldMachId, RefMachDwItem, "MachDw")
If Not IsNothing(m_SelectedMachType) Then
m_RefMachItem = ManageOrderedMachining(Mach, nOldMachId, RefMachItem)
m_RefMachUpItem = ManageOrderedMachining(MachUp, nOldMachId, RefMachUpItem)
m_RefMachDwItem = ManageOrderedMachining(MachDw, nOldMachId, RefMachDwItem)
' aggiorno grafica
If String.IsNullOrWhiteSpace(m_Mach) Then NotifyPropertyChanged("Mach")
If String.IsNullOrWhiteSpace(m_MachUp) Then NotifyPropertyChanged("MachUp")
If String.IsNullOrWhiteSpace(m_MachDw) Then NotifyPropertyChanged("MachDw")
End If
End If
End Set
End Property
Private Function ManageOrderedMachining(ByRef Mach As String, nOldMachId As Integer, ByRef CurrRefMachItem As MTableMachiningGridBoxItem, sProperty As String) As MTableMachiningGridBoxItem
Private Function ManageOrderedMachining(ByRef Mach As String, nOldMachId As Integer, ByRef CurrRefMachItem As MTableMachiningGridBoxItem) As MTableMachiningGridBoxItem
If Not String.IsNullOrEmpty(Mach) Then
' se non usata da altre lavorazioni sulla stessa macchina
Dim bFound As Boolean = False
@@ -711,7 +784,6 @@ Public Class MTableAssociationGridBoxItem
If Not EgtMdbSetCurrMachining(Mach) Then
CurrRefMachItem = Nothing
Mach = String.Empty
NotifyPropertyChanged(sProperty)
Else
' se lavorazione mantenuta nella tabella della macchina precedente,
If bFound Then
@@ -1011,16 +1083,27 @@ Public Class MTableAssociationGridBoxItem
End Property
' Liste per le lavorazioni
Private m_DrillingList As New List(Of List(Of String))
Private m_SawingList As New List(Of List(Of String))
Private m_MillingList As New List(Of List(Of String))
Private m_PocketingList As New List(Of List(Of String))
Private m_MortisingList As New List(Of List(Of String))
Private m_SawRoughingList As New List(Of List(Of String))
Private m_SawFinishingList As New List(Of List(Of String))
Private m_ChiselingList As New List(Of List(Of String))
Private Shared m_DrillingList As New List(Of List(Of String))
Private Shared m_SawingList As New List(Of List(Of String))
Private Shared m_MillingList As New List(Of List(Of String))
Private Shared m_PocketingList As New List(Of List(Of String))
Private Shared m_MortisingList As New List(Of List(Of String))
Private Shared m_SawRoughingList As New List(Of List(Of String))
Private Shared m_SawFinishingList As New List(Of List(Of String))
Private Shared m_ChiselingList As New List(Of List(Of String))
Private Shared m_MachinesMachTypeList As New List(Of List(Of MachineModel.MachiningsType))
Friend Shared Sub ResetMachiningList()
m_DrillingList = New List(Of List(Of String))
m_SawingList = New List(Of List(Of String))
m_MillingList = New List(Of List(Of String))
m_PocketingList = New List(Of List(Of String))
m_MortisingList = New List(Of List(Of String))
m_SawRoughingList = New List(Of List(Of String))
m_SawFinishingList = New List(Of List(Of String))
m_ChiselingList = New List(Of List(Of String))
End Sub
Sub New(bOn As Boolean, sName As String, nMachId As Integer, nShift As Integer, sOper As String,
RefMachItem As MTableMachiningGridBoxItem, sMach As String, RefMachUpItem As MTableMachiningGridBoxItem, sMachUp As String, RefMachDwItem As MTableMachiningGridBoxItem, sMachDw As String,
ByRef ActiveMachinesList As ObservableCollection(Of MTableMachineListBoxItem), ByRef AssociationList As ObservableCollection(Of MTableAssociationGridBoxItem))