Compare commits

..

5 Commits

Author SHA1 Message Date
Dario Sassi 14bf36ed68 EgtBEAMWALL :
- aggiornamento EgtUILib e EgtWPFLib5
- piccola miglioria per SpecialPanel
- correzione calcolo numero pezzi inseriti in barre grazie a nuova funzione EgtDuploInRawCount.
2023-12-14 20:31:52 +01:00
Dario Sassi 06bac914ef Merge commit '625f12a1e8df19e094d02b068f3bb988602a7c04' 2023-12-14 12:52:12 +01:00
Dario Sassi 1b956580c9 EgtBEAMWALL 2.5l2 :
- ricompilazione con aggiornamento versione.
2023-12-14 12:51:47 +01:00
Demetrio Cassarino 625f12a1e8 - creato nuovo pulsante dump per la visualizzazione file lua 2023-12-14 11:11:50 +01:00
Emmanuele Sassi 84dffd8966 - aggiunta gestione modi controllo in caso di nuovo controllo
- aggiunto refresh sort su lista supervisore
2023-11-08 09:27:21 +01:00
42 changed files with 560 additions and 966 deletions
+1 -1
View File
@@ -587,7 +587,7 @@ Public Class BTLPartM
Public ReadOnly Property nINPROD As Integer
Get
Dim INPROD As Integer = 0
EgtDuploCount(m_nPartId, INPROD)
EgtDuploInRawCount(m_nPartId, INPROD)
Return INPROD
End Get
End Property
@@ -23,8 +23,5 @@
Public Const COL_USAGE As String = "colUSAGE"
Public Const COL_WASTE As String = "colWASTE"
Public Const COL_ARCHIVED As String = "colARCHIVED"
Public Const COL_PROJID As String = "colPROJID"
Public Const COL_PRODID As String = "colPRODID"
Public Const COL_CREATEDATE As String = "colCRTDATE"
End Module
+3
View File
@@ -168,4 +168,7 @@ Public Module ConstIni
Public Const K_EXTERNALFILEPATH As String = "ExternalFilePath"
Public Const K_REMINDERFREQUENCY As String = "ReminderFrequency"
Public Const S_SPECIAL As String = "Special"
Public Const K_SPECIALENABLE As String = "SpecialEnable"
End Module
-1
View File
@@ -116,7 +116,6 @@
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
<Compile Include="ProjectFileVM\ProdItem.vb" />
<Compile Include="Utility\DimensionsIniFile.vb" />
<Compile Include="Utility\Enum.vb" />
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
+2 -2
View File
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -68,7 +68,6 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding FilterTypeList}"
SelectedItem="{Binding SelFilterType}"
@@ -81,17 +80,6 @@
Visibility="{Binding SearchText_Visibility}"/>
<StackPanel Grid.Column="2"
Orientation="Horizontal">
<TextBlock Text="Page index"
Style="{StaticResource OptionTextBlock}"/>
<Button Content="&lt;"
Command="{Binding PrevPage_Command}" />
<TextBlock Text="{Binding nPageIndex}"
Style="{StaticResource OptionTextBlock}"/>
<Button Content="&gt;"
Command="{Binding NextPage_Command}" />
</StackPanel>
<StackPanel Grid.Column="3"
Orientation="Horizontal">
<TextBlock Text="{Binding Rows_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding RowQuantityList}"
@@ -104,7 +92,7 @@
<EgtBEAMWALL:EgtDataGrid x:Name="MainDataGrid"
Grid.Row="1"
ItemsSource="{Binding PageList}"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
@@ -116,12 +104,10 @@
Margin="5"
RowDetailsVisibilityMode="Visible"
CellEditEnding="MainDataGrid_CellEditEnding"
BindingColumns="{Binding ProdColumns}"
Sorting="MainDataGrid_Sorting">
BindingColumns="{Binding ProdColumns}">
<DataGrid.Resources>
<!-- ProdId -->
<DataGridTextColumn x:Key="colPRODID"
Binding="{Binding sProdId}">
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
@@ -129,8 +115,7 @@
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Name-->
<DataGridTextColumn x:Key="colNAME"
Binding="{Binding sName}">
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.Header>
<Grid>
<Grid.ColumnDefinitions>
@@ -149,23 +134,19 @@
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Creation date -->
<DataGridTextColumn x:Key="colCRTDATE"
Binding="{Binding dtCreateDate}">
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Machine -->
<DataGridTextColumn x:Key="colMACHINE"
Binding="{Binding sMachine}"
CanUserSort="False">
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Machine_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Archived -->
<DataGridTemplateColumn x:Key="colARCHIVED"
CanUserSort="False">
<DataGridTemplateColumn x:Key="colARCHIVED">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="\Resources\OpenProjectFileDialog\Archived.png"
@@ -83,182 +83,4 @@ Public Class NewOpenProjectFileDialogV
'm_OpenProjFileDialogVM.SetIsEditNameActive(False)
End Sub
Private Sub MainDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs)
' aggiorno direziona colonna
Dim column As DataGridColumn = e.Column
column.SortDirection = If((column.SortDirection <> ListSortDirection.Ascending), ListSortDirection.Ascending, ListSortDirection.Descending)
'' ricalcolo colonne sort
'Dim datagrid As DataGrid = sender
'ProdItemComparer.RefreshColumns()
'' lancio sort custom
'm_OpenProjFileDialogVM.RefreshProdItemSort()
m_OpenProjFileDialogVM.SortPageList()
m_OpenProjFileDialogVM.UpdatePageList()
e.Handled = True
End Sub
End Class
Friend Class ProdItemComparer
Implements IComparer
Private Shared DataGrid As DataGrid
Friend Shared Sub SetDataGrid(value As DataGrid)
DataGrid = value
End Sub
Private Shared m_OpenProjFileDialogVM As NewOpenProjectFileDialogVM
Friend Shared Sub SetOpenProjFileDialogVM(value As NewOpenProjectFileDialogVM)
m_OpenProjFileDialogVM = value
End Sub
Private Shared m_ColumnList As New List(Of DataGridColumn)
Private Shared m_EgtColumnList As New List(Of EgtDataGridColumn)
Friend Shared Sub RefreshColumns()
m_ColumnList.Clear()
m_EgtColumnList.Clear()
For Each col In DataGrid.Columns
If Not IsNothing(col.SortDirection) Then
m_ColumnList.Add(col)
m_EgtColumnList.Add(m_OpenProjFileDialogVM.ProdColumns(col.DisplayIndex))
End If
Next
' Map.refRawPartListVM.SetRawPartListSorted(m_ColumnList.Count > 0)
End Sub
Public Function Compare(x As Object, y As Object) As Integer Implements IComparer.Compare
' Dim First As MyMachGroupVM = DirectCast(x, MyMachGroupVM)
' Dim Second As MyMachGroupVM = DirectCast(y, MyMachGroupVM)
' Dim bFirstProduced As Boolean = First.nProduction_State = Core.ItemState.WIP OrElse First.nProduction_State = Core.ItemState.Produced
' Dim bSecondProduced As Boolean = Second.nProduction_State = Core.ItemState.WIP OrElse Second.nProduction_State = Core.ItemState.Produced
' Dim bFirstInQueue As Boolean = First.bToBeProduced
' Dim bSecondInQueue As Boolean = Second.bToBeProduced
' ' verifico se gia' prodotti
' If bFirstProduced AndAlso bSecondProduced Then
' If First.nProductionIndex > Second.nProductionIndex Then
' Return 1
' ElseIf First.nProductionIndex < Second.nProductionIndex Then
' Return -1
' Else
' Return 0
' End If
' ElseIf bFirstProduced Then
' Return -1
' ElseIf bSecondProduced Then
' Return 1
' ElseIf bFirstInQueue AndAlso bSecondInQueue Then
' If First.nProductionIndex > Second.nProductionIndex Then
' Return 1
' ElseIf First.nProductionIndex < Second.nProductionIndex Then
' Return -1
' Else
' Return 0
' End If
' ElseIf bFirstInQueue Then
' Return -1
' ElseIf bSecondInQueue Then
' Return 1
' Else
' ' verifico ordine per colonne
' Dim ColumnIndex = 0
' While ColumnIndex <= m_EgtColumnList.Count - 1
' Dim nDir As ListSortDirection = If(m_ColumnList(ColumnIndex).SortDirection, 1, -1)
' Dim nCheck As Integer = Check(First, Second, nDir, m_EgtColumnList(ColumnIndex))
' If nCheck <> 0 Then
' Return nCheck
' End If
' ColumnIndex += 1
' End While
' ' se non trovo colonne, metto in ordine indice di produzione
' If First.nProductionIndex > Second.nProductionIndex Then
' Return 1
' ElseIf First.nProductionIndex < Second.nProductionIndex Then
' Return -1
' Else
' Return 0
' End If
' End If
End Function
Private Function Check(First As MyMachGroupVM, Second As MyMachGroupVM, nDirection As Integer, Column As EgtDataGridColumn) As Integer
Select Case Column.Name
Case COL_NAME
If First.nName > Second.nName Then
Return 1 * nDirection
ElseIf First.nName < Second.nName Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_STARTCUT
If First.Id > Second.Id Then
Return 1 * nDirection
ElseIf First.Id < Second.Id Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_W
If First.dW > Second.dW Then
Return 1 * nDirection
ElseIf First.dW < Second.dW Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_H
If First.dH > Second.dH Then
Return 1 * nDirection
ElseIf First.dH < Second.dH Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_L
If First.dL > Second.dL Then
Return 1 * nDirection
ElseIf First.dL < Second.dL Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_POSZ
'If First.posz > Second.dL Then
' Return 1 * nDirection
'ElseIf First.dL < Second.dL Then
' Return -1 * nDirection
'Else
' Return 0
'End If
Case COL_MATERIAL
If First.sMATERIAL > Second.sMATERIAL Then
Return 1 * nDirection
ElseIf First.sMATERIAL < Second.sMATERIAL Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_USAGE
If First.dUsage > Second.dUsage Then
Return 1 * nDirection
ElseIf First.dUsage < Second.dUsage Then
Return -1 * nDirection
Else
Return 0
End If
Case COL_WASTE
If First.dWaste > Second.dWaste Then
Return 1 * nDirection
ElseIf First.dWaste < Second.dWaste Then
Return -1 * nDirection
Else
Return 0
End If
End Select
End Function
End Class
End Class
@@ -19,7 +19,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
EXPORTDATE = 1
End Enum
Protected Enum FilterTypes As Integer
Private Enum FilterTypes As Integer
NULL = 0
ID = 1
BTLFILENAME = 2
@@ -36,9 +36,9 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Enum
Public Enum RowQuantities As Integer
TEN = 0
TWENTY = 1
THIRTY = 2
FIFTY = 0
HUNDRED = 1
HUNDREDANDFIFTY = 2
End Enum
Friend Event m_CloseWindow(bDialogResult As Boolean)
@@ -67,27 +67,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Get
End Property
Private m_colProjId_Name As EgtDataGridColumn
Public ReadOnly Property colProjId_Name As EgtDataGridColumn
Get
Return m_colProjId_Name
End Get
End Property
Private m_colProdId_Name As EgtDataGridColumn
Public ReadOnly Property colProdId_Name As EgtDataGridColumn
Get
Return m_colProdId_Name
End Get
End Property
Private m_colCreateDate_Name As EgtDataGridColumn
Public ReadOnly Property colCreateDate_Name As EgtDataGridColumn
Get
Return m_colCreateDate_Name
End Get
End Property
Protected m_ProjColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property ProjColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -127,13 +106,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Get
End Property
Private m_ProjectList_View As CollectionView = Nothing
Public ReadOnly Property ProjectList_View As CollectionView
Get
Return m_ProjectList_View
End Get
End Property
Public m_ProjectList_View As CollectionView = Nothing
Protected m_ProjectList As New ObservableCollection(Of ProdItem)
Public ReadOnly Property ProjectList As ObservableCollection(Of ProdItem)
Get
@@ -212,8 +185,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Set(value As Integer)
' aggiorno lista da Db
RefreshProjectList()
'm_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -255,8 +227,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
NotifyPropertyChanged(NameOf(Date_Visibility))
' aggiorno lista da Db
RefreshProjectList()
' m_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -271,8 +242,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_STARTDATE, lStartDate.ToString())
' aggiorno lista da Db
RefreshProjectList()
' m_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -287,8 +257,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_ENDDATE, lEndDate.ToString())
' aggiorno lista da Db
RefreshProjectList()
' m_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -306,7 +275,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Get
End Property
Protected m_SelRowQuantity As RowQuantities
Private m_SelRowQuantity As RowQuantities
Public Property SelRowQuantity As Integer
Get
Return m_SelRowQuantity
@@ -314,8 +283,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Set(value As Integer)
m_SelRowQuantity = value
RefreshProjectList()
' m_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -340,8 +308,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
If Not IsNothing(SearchDate) Then SearchDate.Clear()
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
m_SelFilterType = m_FilterTypeList(0)
'm_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
' ora setto il valore scelto come Tipo Filtro
m_SelFilterType = value
Select Case m_SelFilterType.Id
@@ -365,8 +332,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
End Get
Set(value As String)
m_SearchText = value
'm_ProjectList_View.Refresh()
UpdatePageList()
m_ProjectList_View.Refresh()
End Set
End Property
@@ -424,9 +390,9 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Set(value As Boolean)
m_bViewArchived = value
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_VIEWARCHIVED, If(bViewArchived, 1, 0))
If Not IsNothing(m_colArchived_Name) Then
m_colArchived_Name.Visible = value
RefreshProjectList()
If Not IsNothing( m_colArchived_Name) Then
m_colArchived_Name.Visible = value
RefreshProjectList()
End If
End Set
End Property
@@ -453,30 +419,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
NotifyPropertyChanged(NameOf(bDelete_IsEnabled))
End Sub
Private m_PageList_View As ListCollectionView = Nothing
Public ReadOnly Property PageList_View As ListCollectionView
Get
Return m_PageList_View
End Get
End Property
Protected m_PageList As New ObservableCollection(Of ProdItem)
Public Property PageList As ObservableCollection(Of ProdItem)
Get
Return m_PageList
End Get
Set(value As ObservableCollection(Of ProdItem))
m_PageList = value
End Set
End Property
Private m_nPageIndex As Integer = 1
Public ReadOnly Property nPageIndex As Integer
Get
Return m_nPageIndex
End Get
End Property
Protected m_ChangeOpenedProjectOnCancel As Boolean = False
#Region "Messages"
@@ -603,8 +545,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Private m_cmdDelete As ICommand
Private m_cmdArchive As ICommand
Private m_cmdCancel As ICommand
Private m_cmdPrevPage As ICommand
Private m_cmdNextPage As ICommand
#End Region ' FIELDS & PROPERTIES
@@ -615,9 +555,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
LoadColumns()
m_colProdFile_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_NAME)
m_colArchived_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_ARCHIVED)
m_colProjId_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_PROJID)
m_colProdId_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_PRODID)
m_colCreateDate_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_CREATEDATE)
' leggo valori per filtri
m_SelDayType = GetMainPrivateProfileInt(S_OPENFILEDIALOG, K_DAYTYPE, 0)
Select Case m_SelDayType
@@ -652,29 +589,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
End Sub
Private m_ProdItemComparer As ProdItemComparer
Friend ReadOnly Property ProdItemComparer As ProdItemComparer
Get
Return m_ProdItemComparer
End Get
End Property
Friend Sub SetPageListView()
m_PageList_View = CollectionViewSource.GetDefaultView(m_PageList)
m_ProdItemComparer = New ProdItemComparer
m_PageList_View.CustomSort = m_ProdItemComparer
NotifyPropertyChanged(NameOf(PageList_View))
End Sub
Friend Sub RefreshProdItemSort()
m_PageList_View.CustomSort = m_ProdItemComparer
End Sub
Friend Sub SortPageList()
' m_ProjectList = New ObservableCollection(Of ProdItem)(m_ProjectList.OrderBy(Of Integer)(Function(x) If(String.IsNullOrWhiteSpace(x.sProdId), 0, CInt(x.sProdId))))
End Sub
Protected Sub LoadColumns()
'If ProjectType = ProjectType.PROJ Then
' carico le colonne della datagrid
@@ -736,69 +650,17 @@ Public MustInherit Class NewOpenProjectFileDialogVM
Return AllFilesInDir.Any(Function(x) Path.GetExtension(x).ToLower() = ".nge")
End Function
'Protected Function ProjectFilter(Proj As Object) As Boolean
' Dim bProjectOk As Boolean = True
' 'If TypeOf Proj Is ProjFileVM Then
' Dim CurrProj As ProdItem = DirectCast(Proj, ProdItem)
' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
' (m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not CurrProj.ProjFileList.Any(Function(x) SearchDate.Contains(DirectCast(x, ProjFileVM).dtExportDate.Date))) OrElse
' (m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
' 'ElseIf TypeOf Proj Is ProdFileVM Then
' ' Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
' ' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
' ' (m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
' ' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
' ' (m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
' ' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
' ' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
' 'End If
' Return bProjectOk
'End Function
Public Overridable Function UpdatePageList() As Boolean
Dim FilteredList As IEnumerable(Of ProdItem) = m_ProjectList.Where(Function(x)
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso
((m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso x.ProjFileList.Any(Function(y) DirectCast(y, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso x.ProjFileList.Any(Function(y) DirectCast(y, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso x.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then Return False
Return True
End Function)
Dim nPageRowQty As Integer = 0
Select Case m_SelRowQuantity
Case RowQuantities.TEN
nPageRowQty = 10
Case RowQuantities.TWENTY
nPageRowQty = 20
Case RowQuantities.THIRTY
nPageRowQty = 30
End Select
Dim nStart = nPageIndex * nPageRowQty
If (nPageIndex - 1) * nPageRowQty + 1 > FilteredList.Count() Then
Return False
End If
' FilteredList = FilteredList.OrderBy(Of ProdItem)()
' m_PageList = New ObservableCollection(Of ProdItem)(FilteredList.Skip((nPageIndex - 1) * nPageRowQty + 1).Take(nPageIndex * nPageRowQty).Select(Function(x) x))
m_PageList.Clear()
For Index = (nPageIndex - 1) * nPageRowQty + 1 To nPageIndex * nPageRowQty
m_PageList.Add(FilteredList(Index))
Next
NotifyPropertyChanged(NameOf(PageList))
Return True
'Dim bProjectOk As Boolean = True
''If TypeOf Proj Is ProjFileVM Then
'Dim CurrProj As ProdItem = DirectCast(PROJ, ProdItem)
'If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
' (m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not CurrProj.ProjFileList.Any(Function(x) SearchDate.Contains(DirectCast(x, ProjFileVM).dtExportDate.Date))) OrElse
' (m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
'If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
Protected Function ProjectFilter(Proj As Object) As Boolean
Dim bProjectOk As Boolean = True
'If TypeOf Proj Is ProjFileVM Then
Dim CurrProj As ProdItem = DirectCast(Proj, ProdItem)
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not CurrProj.ProjFileList.Any(Function(x) SearchDate.Contains(DirectCast(x, ProjFileVM).dtExportDate.Date))) OrElse
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
'ElseIf TypeOf Proj Is ProdFileVM Then
' Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
@@ -808,15 +670,6 @@ Public MustInherit Class NewOpenProjectFileDialogVM
' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
'End If
' Return bProjectOk
End Function
Protected Function ProjectFilter(CurrProj As ProdItem) As Boolean
Dim bProjectOk As Boolean = True
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
Return bProjectOk
End Function
@@ -922,61 +775,98 @@ Public MustInherit Class NewOpenProjectFileDialogVM
#End Region ' Cancel
#Region "PrevPage"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property PrevPage_Command As ICommand
Get
If m_cmdPrevPage Is Nothing Then
m_cmdPrevPage = New Command(AddressOf PrevPage)
End If
Return m_cmdPrevPage
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Overridable Sub PrevPage()
If m_nPageIndex > 1 Then
m_nPageIndex -= 1
End If
UpdatePageList()
NotifyPropertyChanged(NameOf(nPageIndex))
End Sub
#End Region ' PrevPage
#Region "NextPage"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property NextPage_Command As ICommand
Get
If m_cmdNextPage Is Nothing Then
m_cmdNextPage = New Command(AddressOf NextPage)
End If
Return m_cmdNextPage
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Overridable Sub NextPage()
m_nPageIndex += 1
If Not UpdatePageList() Then
m_nPageIndex -= 1
End If
NotifyPropertyChanged(NameOf(nPageIndex))
End Sub
#End Region ' NextPage
#End Region ' Commands
End Class
Public Class ProdItem
Inherits VMBase
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
Protected m_ProdFileVM As ProdFileVM
Public ReadOnly Property ProdFileVM As ProdFileVM
Get
Return m_ProdFileVM
End Get
End Property
Private m_ProjFileList As New List(Of ProjectFileVM)
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
Get
Return m_ProjFileList
End Get
End Property
Public ReadOnly Property sProdId As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
End Get
End Property
Public Overridable Property sName As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
End Get
Set(value As String)
If Not IsNothing(m_ProdFileVM) Then
m_ProdFileVM.sName = value
End If
End Set
End Property
Public ReadOnly Property dtCreateDate As Date
Get
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
End Get
End Property
Public ReadOnly Property sCreateDate As String
Get
Return dtCreateDate.ToString()
End Get
End Property
Public ReadOnly Property sMachine As String
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.sMachine
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).sMachine
Else Return ""
End If
End Get
End Property
Public ReadOnly Property bIsArchived As Boolean
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.bIsArchived
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).bIsArchived
Else
Return True
End If
End Get
End Property
Public ReadOnly Property Archived_Visibility As Visibility
Get
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
m_ProdFileVM = ProdFileVM
m_ProjFileList.Add(ProjFileVM)
End Sub
Sub New(ProjFileVM As ProjFileVM)
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
End Sub
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
m_ProdFileVM = ProdFileVM
m_ProjFileList = ProjFileVMList
End Sub
End Class
@@ -42,8 +42,6 @@ Public MustInherit Class OpenProjectFileDialogVM
Friend Event m_CloseWindow(bDialogResult As Boolean)
Protected m_GoToProd As Boolean = False
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -440,7 +438,7 @@ Public MustInherit Class OpenProjectFileDialogVM
#Region "METHODS"
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
Public Overridable Sub RefreshProjectList()
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
End Sub
Protected Sub LoadColumns(ProjectType As ProjectType)
@@ -14,13 +14,6 @@ Public Class ProdFileM
m_nProjIdList = value
End Sub
Protected m_ProjMList As List(Of ProjFileM)
Public ReadOnly Property ProjMList As List(Of ProjFileM)
Get
Return m_ProjMList
End Get
End Property
Protected m_sName As String
Public Property sName As String
Get
@@ -67,24 +60,6 @@ Public Class ProdFileM
Return NewProjectFileM
End Function
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdFileM
Dim NewProjectFileM As New ProdFileM
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_nProjIdList = nProjIdList
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_sName = sName
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_sLockedBy = sLockedBy
NewProjectFileM.m_dtLock = dtLock
NewProjectFileM.m_bIsActive = bIsActive
NewProjectFileM.m_bIsProduced = bIsProduced
NewProjectFileM.m_bIsArchived = bIsArchived
NewProjectFileM.m_ProjMList = ProjMList
Return NewProjectFileM
End Function
#End Region ' CONSTRUCTORS
End Class
-119
View File
@@ -1,119 +0,0 @@
Imports EgtWPFLib5
Imports System.Windows
Public Class ProdItem
Inherits VMBase
Public Shared m_delUpdateNameInDb As Action(Of Integer, String)
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
Protected m_ProdFileVM As ProdFileVM
Public ReadOnly Property ProdFileVM As ProdFileVM
Get
Return m_ProdFileVM
End Get
End Property
Private m_ProjFileList As New List(Of ProjectFileVM)
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
Get
Return m_ProjFileList
End Get
End Property
Public ReadOnly Property sProdId As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
End Get
End Property
Public Overridable Property sName As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
End Get
Set(value As String)
If Not IsNothing(m_ProdFileVM) Then
m_delUpdateNameInDb(m_ProdFileVM.nProdId, value)
m_ProdFileVM.sName = value
m_delIsModifiedSetUp(False)
End If
End Set
End Property
Public ReadOnly Property dtCreateDate As Date
Get
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
End Get
End Property
Public ReadOnly Property sCreateDate As String
Get
Return dtCreateDate.ToString()
End Get
End Property
Public ReadOnly Property sMachine As String
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.sMachine
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).sMachine
Else Return ""
End If
End Get
End Property
Public ReadOnly Property bIsArchived As Boolean
Get
If Not IsNothing(m_ProdFileVM) Then
Return m_ProdFileVM.bIsArchived
ElseIf Not IsNothing(m_ProjFileList(0)) Then
Return m_ProjFileList(0).bIsArchived
Else
Return True
End If
End Get
End Property
Public ReadOnly Property Archived_Visibility As Visibility
Get
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
m_ProdFileVM = ProdFileVM
m_ProjFileList.Add(ProjFileVM)
End Sub
Sub New(ProjFileVM As ProjFileVM)
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
End Sub
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
m_ProdFileVM = ProdFileVM
m_ProjFileList = ProjFileVMList
End Sub
Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdItem
Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived)
Dim NewProdFileVM = New ProdFileVM(NewProdFileM)
Dim NewProjFileVM As IEnumerable(Of ProjectFileVM)
NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList
Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList)
Return NewProdItem
End Function
Public Shared Function CreateProdItem(ProjFileM As ProjFileM) As ProdItem
Dim NewProdItem = New ProdItem(New ProjFileVM(ProjFileM))
Return NewProdItem
End Function
End Class
@@ -2,7 +2,6 @@
using NLog;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using static EgtBEAMWALL.Core.ConstBeam;
@@ -209,11 +208,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(int NumRecord, bool OnlyActive, bool ShowArchived = false)
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
@@ -221,9 +220,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
if (numRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
numRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
@@ -236,7 +235,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
(p, e) => p)
.Distinct()
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.Take(numRecord)
.ToList();
}
@@ -248,13 +247,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="dtStart">Inizio periodo estrazione</param>
/// <param name="dtEnd">Fine periodo estrazione</param>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
public List<Core.ProdFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
@@ -262,14 +261,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
if (numRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
numRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
.ProdList
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
.Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
@@ -277,7 +276,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
(p, e) => p)
.Distinct()
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.Take(numRecord)
.ToList();
}
@@ -286,183 +285,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
// elenco prod completi
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// recupero PROD + proj relativi
dbResultProd = localDbCtx
.ProdList
.Where(x => (!x.IsArchived || ShowArchived))
//.Include(j => j.)
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null)
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
// elenco prod completi
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResultProd = localDbCtx
.ProdList
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd))
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Elenco prod
/// </summary>
/// <param name="DtStart">Inizio periodo estrazione</param>
/// <param name="DtEnd">Fine periodo estrazione</param>
/// <param name="DtIsCreation">Ture: usa data creazione / False: usa data export</param>
/// <param name="NumRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <param name="Machine">Nome Macchina (default vuoto = non usato)</param>
/// <param name="BtlFileName">Nome file BTL (default vuoto = non usato)</param>
/// <param name="ListName">Nome List (default vuoto = non usato)</param>
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
/// <returns></returns>
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, bool DtIsCreation, int NumRecord, bool OnlyActive, string Machine = "", string BtlFileName = "", string ListName = "", bool ShowArchived = false)
{
List<Core.ProdItem> result = new List<Core.ProdItem>();
List<ProdModel> dbResultProd = new List<ProdModel>();
// elenco proj "orfani"
List<ProjModel> dbResultProj = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (NumRecord == 0)
{
NumRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResultProd = localDbCtx
.ProdList
.Where(x => (!x.IsArchived || ShowArchived))
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x =>
(x.IsActive || !OnlyActive)
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains( BtlFileName.ToLower()))
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd)))
),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.Distinct()
.Include(j => j.ProjListNav)
.OrderByDescending(x => x.ProdId)
.Take(NumRecord)
.ToList();
// recupero i proj "orfani"
dbResultProj = localDbCtx
.ProjList
.Where(x =>
(x.IsActive || !OnlyActive)
&& x.Prod == null
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains(BtlFileName.ToLower()))
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd))))
.OrderByDescending(x => x.ProjId)
.Take(NumRecord)
.ToList();
}
// conversione
result = dbResultProd.Select(x => coreItemConv(x)).ToList();
var resProj = dbResultProj.Select(x => coreItemConv(x)).ToList();
// sommo i risultati
result.AddRange(resProj);
return result;
}
/// <summary>
/// Fornisce nuovo indice VUOTO da usare (allocando sul DB)
/// </summary>
@@ -1088,29 +910,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
protected Core.ProdFileM coreConv(ProdModel currProd)
{
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived);
//Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList());
return answ;
}
/// <summary>
/// Helper conversione modelli verso prodItem
/// </summary>
/// <param name="currProd"></param>
/// <returns></returns>
protected Core.ProdItem coreItemConv(ProdModel currProd)
{
Core.ProdItem answ = Core.ProdItem.CreateProdItem(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList());
return answ;
}
/// <summary>
/// Helper conversione modelli verso prodItem da singolo proj
/// </summary>
/// <param name="currProd"></param>
/// <returns></returns>
protected Core.ProdItem coreItemConv(ProjModel currProj)
{
Core.ProdItem answ = Core.ProdItem.CreateProdItem(Core.ProjFileM.CreateProjFileM(currProj.ProjId, 0, currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine, currProj.IsActive, currProj.IsActive));
return answ;
}
@@ -33,8 +33,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
var dbResult = localDbCtx
.ProjList
.Where(x => x.BTLFileName == BTLFileName)
//valutare se usare solo attivi...
//.Where(x => x.BTLFileName == BTLFileName && x.IsActive == true)
.FirstOrDefault();
//se avesse trovato-- > riporto id...
@@ -583,7 +581,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// Update record su DB x elenco BTLParts
/// </summary>
/// <param name="ProjId"></param>
/// <param name="BtlPartList"></param>
/// <param name="newBTLFileName"></param>
/// <returns></returns>
public ProjModel UpdateBtlParts(int ProjId, List<Core.BTLPartM> BtlPartList)
{
@@ -19,11 +19,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
#region Public Properties
public ProdModel()
{
ProjListNav = new HashSet<ProjModel>();
}
/// <summary>
/// Chiave univoca DB
/// </summary>
@@ -103,11 +98,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("IsArchived")]
public bool IsArchived { get; set; } = false;
/// <summary>
/// Collezione oggetti Proj associati (almeno 1 by design)
/// </summary>
public virtual ICollection<ProjModel> ProjListNav { get; set; }
#endregion Public Properties
}
}
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.8.1")]
[assembly: AssemblyFileVersion("2.5.8.1")]
[assembly: AssemblyVersion("2.5.12.2")]
[assembly: AssemblyFileVersion("2.5.12.2")]
@@ -219,6 +219,7 @@ Friend Class MyComparer
Return 0
End If
End Select
Return 0
End Function
End Class
@@ -437,6 +437,10 @@ Public Class LeftPanelVM
New OPState("Reset", OPStates.End),
New OPState("Unspecified", OPStates.Unspecified)
}
Case Else
m_OPStateList = New List(Of OPState) From {
New OPState("Unspecified", OPStates.Unspecified)
}
End Select
' seleziono in partenza unspecified
Dim UnspecifiedState As OPState = m_OPStateList.FirstOrDefault(Function(x) x.Id = OPStates.Unspecified)
@@ -317,6 +317,7 @@ Public Class MyMachGroupVM
' segno pezzo da produrre
MachGroup.m_bToBeProduced = True
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
Map.refSupervisorMachGroupPanelVM.MachGroupVMList_View.Refresh()
' sposto MachGroup in lista come ultimo dei pronti da produrre
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(MachGroup)
@@ -46,7 +46,6 @@ Public Class SupervisorMachGroupPanelVM
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Private m_MachGroupVMListComparer As MyComparer
Friend ReadOnly Property MachGroupVMListComparer As MyComparer
Get
@@ -248,8 +248,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2508, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -11,14 +11,13 @@ Public Class OpenProjectFileDialogVM
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
m_ProjectType = ProjectType
m_GoToProd = GoToProd
' carico colonne
LoadColumns(m_ProjectType)
NotifyPropertyChanged(NameOf(FilterTypeList))
m_SelFilterType = m_FilterTypeList(0)
' carico lista progetti
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
RefreshProjectList()
RefreshProjectList(GoToProd)
Else
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
NotifyPropertyChanged(NameOf(ProjectList))
@@ -27,7 +26,7 @@ Public Class OpenProjectFileDialogVM
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList()
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
m_ProjectList.Clear()
' calcolo periodo e righe
Dim dtStart As DateTime
@@ -95,9 +95,7 @@ Public Class SupervisorManagerVM
#End Region ' ToolTip
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
@@ -47,6 +47,7 @@
Visibility="{Binding ChooseMachineBtn_Visibility}">
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
</Button>
<Grid Margin="0,0,5,0" Visibility="{Binding ChooseMachine_Visibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -338,6 +338,10 @@
<DependentUpon>SetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUp\SetUpVM.vb" />
<Compile Include="SpecialPanel\SpecialPanelV.xaml.vb">
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SpecialPanel\SpecialPanelVM.vb" />
<Compile Include="StatisticsTimePanel\StatisticsTimePanelV.xaml.vb">
<DependentUpon>StatisticsTimePanelV.xaml</DependentUpon>
</Compile>
@@ -544,6 +548,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SpecialPanel\SpecialPanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="StatisticsTimePanel\StatisticsTimePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -157,6 +157,13 @@ Public Class MainWindowM
End Get
End Property
Private m_bSpecialPanel As Boolean = False
Friend ReadOnly Property bSpecialPanel As Boolean
Get
Return m_bSpecialPanel
End Get
End Property
#End Region ' FIELDS
#Region "CONSTRUCTOR"
@@ -235,8 +242,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2508, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -278,6 +285,8 @@ Public Class MainWindowM
EgtSetUiUnits(GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
' Leggo e imposto livello utilizzatore
m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Recupero flag SpecialPanel
m_bSpecialPanel = GetMainPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) = 1
' Imposto dir font Nfe e font default
Dim sNfeDir As String = String.Empty
GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -22,7 +22,6 @@ Public Class NewOpenProjectFileDialogVM
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
m_ProjectType = ProjectType
ProdItem.m_delUpdateNameInDb = AddressOf DbControllers.m_ProdController.UpdateDescription
NotifyPropertyChanged(NameOf(FilterTypeList))
m_SelFilterType = m_FilterTypeList(0)
@@ -34,9 +33,8 @@ Public Class NewOpenProjectFileDialogVM
SetFixedProjectList(True)
NotifyPropertyChanged(NameOf(ProjectList))
End If
'm_ProjectList_View = CollectionViewSource.GetDefaultView(m_ProjectList)
'm_ProjectList_View.Filter = AddressOf ProjectFilter
UpdatePageList()
m_ProjectList_View = CollectionViewSource.GetDefaultView(m_ProjectList)
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
@@ -46,19 +44,19 @@ Public Class NewOpenProjectFileDialogVM
Dim dtEnd As DateTime
Dim nRowQuantity As Integer = 20
Select Case SelRowQuantity
Case RowQuantities.TEN
nRowQuantity = 10
Case RowQuantities.TWENTY
nRowQuantity = 20
Case RowQuantities.THIRTY
nRowQuantity = 30
Case RowQuantities.FIFTY
nRowQuantity = 50
Case RowQuantities.HUNDRED
nRowQuantity = 100
Case RowQuantities.HUNDREDANDFIFTY
nRowQuantity = 150
End Select
Select Case m_SelDayType
Case DayTypes.LASTMONTH
dtEnd = DateTime.Today.AddDays(1)
dtStart = dtEnd.AddMonths(-1)
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(30.5)
Case DayTypes.LAST3MONTHS
dtEnd = DateTime.Today.AddDays(1)
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(30.5 * 3)
Case DayTypes.LAST6MONTHS
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
@@ -72,48 +70,31 @@ Public Class NewOpenProjectFileDialogVM
End Select
' leggo da db
If m_ProjectType = ProjectType.PROJ Then
'Dim DbProjList As New List(Of ProjFileM)
'If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
' DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, 100000, True, bViewArchived)
' 'DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity * 3, True, bViewArchived)
'Else
' DbProjList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity * 3, True, bViewArchived)
'End If
'For Each Project In DbProjList
' If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
' ' verifico se ha prod
' If Not IsNothing(Project.nProdId) And Project.nProdId > 0 Then
' ' verifico se prod e' gia' stato creato
' Dim SameProdItem As ProdItem = m_ProjectList.FirstOrDefault(Function(x) Not IsNothing(x.ProdFileVM) AndAlso Not IsNothing(x.ProdFileVM.nProdId) AndAlso x.ProdFileVM.nProdId = Project.nProdId)
' If Not IsNothing(SameProdItem) Then
' SameProdItem.ProjFileList.Add(New ProjFileVM(Project))
' Else
' ' recupero Prod
' Dim NewDbProd As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(Project.nProdId)
' If Not IsNothing(NewDbProd) Then
' m_ProjectList.Add(New ProdItem(New ProdFileVM(NewDbProd), New ProjFileVM(Project)))
' End If
' End If
' Else
' m_ProjectList.Add(New ProdItem(New ProjFileVM(Project)))
' End If
'Next
m_ProjectList = New ObservableCollection(Of Core.ProdItem)(DbControllers.m_ProdController.GetLastDescFull(dtStart, dtEnd, nRowQuantity * 3, True, bViewArchived))
'Dim sMachine As String = ""
'Dim sBtlFileName As String = ""
'Dim sListName As String = ""
'Dim bIsCreationDate As Boolean = True
'If SelFilterType.Id = FilterTypes.ID Then
' ' sMachine = SearchText
'ElseIf SelFilterType.Id = FilterTypes.BTLFILENAME Then
' sBtlFileName = SearchText
'ElseIf SelFilterType.Id = FilterTypes.LISTNAME Then
' sListName = SearchText
'ElseIf SelFilterType.Id = FilterTypes.MACHINE Then
' sMachine = SearchText
'End If
'm_ProjectList = New ObservableCollection(Of Core.ProdItem)(DbControllers.m_ProdController.GetLastDescFull(dtStart, dtEnd, bIsCreationDate, nRowQuantity * 3, True, sMachine, sBtlFileName, sListName, bViewArchived))
NotifyPropertyChanged(NameOf(ProjectList))
Dim DbProjList As New List(Of ProjFileM)
If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity * 3, True, bViewArchived)
Else
DbProjList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity * 3, True, bViewArchived)
End If
For Each Project In DbProjList
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
' verifico se ha prod
If Not IsNothing(Project.nProdId) And Project.nProdId > 0 Then
' verifico se prod e' gia' stato creato
Dim SameProdItem As ProdItem = m_ProjectList.FirstOrDefault(Function(x) Not IsNothing(x.ProdFileVM) AndAlso Not IsNothing(x.ProdFileVM.nProdId) AndAlso x.ProdFileVM.nProdId = Project.nProdId)
If Not IsNothing(SameProdItem) Then
SameProdItem.ProjFileList.Add(New ProjFileVM(Project))
Else
' recupero Prod
Dim NewDbProd As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(Project.nProdId)
If Not IsNothing(NewDbProd) Then
m_ProjectList.Add(New ProdItem(New ProdFileVM(NewDbProd), New ProjFileVM(Project)))
End If
End If
Else
m_ProjectList.Add(New ProdItem(New ProjFileVM(Project)))
End If
Next
ElseIf m_ProjectType = ProjectType.PROD Then
Dim DbProdList As New List(Of ProdFileM)
DbProdList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True, bViewArchived)
@@ -154,59 +135,6 @@ Public Class NewOpenProjectFileDialogVM
End If
End Sub
Public Overrides Function UpdatePageList() As Boolean
Dim FilteredList As IEnumerable(Of Core.ProdItem) = m_ProjectList.Where(Function(x)
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso
((m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso x.ProjFileList.Any(Function(y) DirectCast(y, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso x.ProjFileList.Any(Function(y) DirectCast(y, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso x.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then Return False
Return True
End Function)
Dim nPageRowQty As Integer = 0
Select Case m_SelRowQuantity
Case RowQuantities.TEN
nPageRowQty = 10
Case RowQuantities.TWENTY
nPageRowQty = 20
Case RowQuantities.THIRTY
nPageRowQty = 30
End Select
Dim nStart = (nPageIndex - 1) * nPageRowQty
Dim nEnd = Math.Min((nPageIndex * nPageRowQty), FilteredList.Count())
If nStart > FilteredList.Count() Then
Return False
End If
' FilteredList = FilteredList.OrderBy(Of ProdItem)()
m_PageList = New ObservableCollection(Of ProdItem)(FilteredList.Skip(nStart).Take(nPageRowQty).Select(Function(x) x))
'm_PageList.Clear()
'For Index = nStart To nEnd
' m_PageList.Add(FilteredList(Index))
'Next
NotifyPropertyChanged(NameOf(PageList))
Return True
'Dim bProjectOk As Boolean = True
''If TypeOf Proj Is ProjFileVM Then
'Dim CurrProj As ProdItem = DirectCast(PROJ, ProdItem)
'If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
' (m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not CurrProj.ProjFileList.Any(Function(x) SearchDate.Contains(DirectCast(x, ProjFileVM).dtExportDate.Date))) OrElse
' (m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
'If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
'ElseIf TypeOf Proj Is ProdFileVM Then
' Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
' (m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
' If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
' (m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
' (m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
' (m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
'End If
' Return bProjectOk
End Function
Public Overrides Sub Archive()
If IsNothing(SelProject) Then Return
If Not IsNothing(SelProject.ProdFileVM) Then
@@ -322,3 +250,33 @@ Public Class NewOpenProjectFileDialogVM
#End Region ' METHODS
End Class
Public Class ProdItem
Inherits Core.ProdItem
Public Overrides Property sName As String
Get
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
End Get
Set(value As String)
If Not IsNothing(m_ProdFileVM) Then
DbControllers.m_ProdController.UpdateDescription(m_ProdFileVM.nProdId, value)
m_ProdFileVM.sName = value
m_delIsModifiedSetUp(False)
End If
End Set
End Property
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
MyBase.New(ProdFileVM, ProjFileVM)
End Sub
Sub New(ProjFileVM As ProjFileVM)
MyBase.New(ProjFileVM)
End Sub
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
MyBase.New(ProdFileVM, ProjFileVMList)
End Sub
End Class
@@ -12,7 +12,6 @@ Public Class OpenProjectFileDialogVM
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
m_ProjectType = ProjectType
m_GoToProd = GoToProd
' carico colonne
LoadColumns(ProjectType)
NotifyPropertyChanged(NameOf(FilterTypeList))
@@ -20,7 +19,7 @@ Public Class OpenProjectFileDialogVM
' carico lista progetti
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
SetFixedProjectList(False)
RefreshProjectList()
RefreshProjectList(GoToProd)
Else
SetFixedProjectList(True)
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
@@ -30,7 +29,7 @@ Public Class OpenProjectFileDialogVM
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList()
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
m_ProjectList.Clear()
' calcolo periodo e righe
Dim dtStart As DateTime
@@ -67,15 +66,30 @@ Public Class OpenProjectFileDialogVM
Else
DbProjectList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False)
End If
If m_GoToProd Then
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProjFileVM(Project))
Else
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
End If
Next
ElseIf m_ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
If GoToProd Then
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
If File.Exists(sPath) Then
m_ProjectList.Add(New ProjFileVM(Project))
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId, True)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
@@ -85,31 +99,16 @@ Public Class OpenProjectFileDialogVM
Else
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProjFileVM(Project))
m_ProjectList.Add(New ProdFileVM(Project))
Else
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
DbControllers.m_ProdController.DeleteProd(Project.nProdId, True)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
Next
End If
ElseIf m_ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId, True)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
Next
End If
End Sub
@@ -438,7 +438,7 @@ Public Class ProjManagerVM
Dim OpenFile As New NewOpenProjectFileDialogV(Application.Current.MainWindow, OpenProdFileDialogVM)
Dim DialogResult As Boolean? = OpenFile.EgtShowDialog(ProjectType.PROJ)
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
Dim TempProd As Core.ProdItem = OpenProdFileDialogVM.SelProject
Dim TempProd As ProdItem = OpenProdFileDialogVM.SelProject
If TempProd.ProjFileList.Count > 1 Then
' apro dialogo di scelta Proj
Dim OpenProjFileDialogVM As OpenProjectFileDialogVM = Nothing
@@ -52,6 +52,8 @@
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"
Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
</WrapPanel>
@@ -3,6 +3,7 @@ Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.DataLayer.Controllers
Public Class ProjectVM
Inherits VMBase
@@ -11,6 +12,12 @@ Public Class ProjectVM
Private m_Calc_Timer As New DispatcherTimer
Friend Event OnPreControllerExec(sFilePath As String)
Friend Event OnPostControllerExec()
' Flag per non salvare Script appena eseguito in elenco MruScript
Private m_bScriptInMru As Boolean = True
Private Property m_GridDims As New ObservableCollection(Of GridDimension)
Public Property GridDims As ObservableCollection(Of GridDimension)
Get
@@ -189,6 +196,13 @@ Public Class ProjectVM
NotifyPropertyChanged("FreeContourManager_Visibility")
End Sub
Public ReadOnly Property SpecialPanel_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bSpecialPanel AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Friend Sub NotifyAllPanelVisibility()
NotifyPropertyChanged("LeftPanel_Visibility")
NotifyPropertyChanged("TopPanel_Visibility")
@@ -59,6 +59,8 @@ Public Class MySceneHostVM
PostInitializeScene()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
' Imposto focus pulsante su false
MainScene.SetFocusOnMove(False)
' Recupero e imposto handle finestra principale
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd)
@@ -0,0 +1,24 @@
<EgtFloating:EgtFloatingPanel x:Class="SpecialPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}"
Visibility="{Binding Btn_Visibility}" IsEnabled="{Binding Btn_IsEnabled}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
@@ -0,0 +1,3 @@
Public Class SpecialPanelV
End Class
@@ -0,0 +1,202 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class SpecialPanelVM
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
End Property
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefSpecialPanelVM(Me)
' se attivo, inizializzo i bottoni leggendoli da file ini
If Map.refMainWindowVM.MainWindowM.bSpecialPanel Then
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
#Region "METHODS"
Public Function SetSpecialPanelButtonsVisibility(IsMachMode As Boolean) As Boolean
Dim bSpecialPanel_Visible As Boolean = False
For Each BtnItem In m_ButtonList
' verifico il valore di nDrawMachOrBoth del bottone e IsMachMode per rendere visibile o meno il bottone in ButtonList
Select Case BtnItem.nDrawMachOrBoth
Case 0 ' bottone nascosto
BtnItem.m_Btn_Visibility = Visibility.Collapsed
Case 1 ' bottone visibile solo in Draw
BtnItem.m_Btn_Visibility = If(Not IsMachMode, Visibility.Visible, Visibility.Collapsed)
Case 2 ' bottone visibile solo in Machining
BtnItem.m_Btn_Visibility = If(IsMachMode, Visibility.Visible, Visibility.Collapsed)
Case 3 ' bottone visibile sia in Draw che in Machining
BtnItem.m_Btn_Visibility = Visibility.Visible
End Select
' se anche uno solo è visibile anche lo SpecialPanel dovrà esserlo
If BtnItem.Btn_Visibility = Visibility.Visible Then bSpecialPanel_Visible = True
'BtnItem.OnPropertyChanged(NameOf(BtnItem.Btn_Visibility))
BtnItem.NotifyPropertyChanged(NameOf(BtnItem.Btn_Visibility))
Next
Return bSpecialPanel_Visible
End Function
Friend Sub SpecialPanelIsEnabled(SpecialPanelBtn_IsEnabled As Boolean)
For Each BtnItem In m_ButtonList
BtnItem.m_Btn_IsEnabled = SpecialPanelBtn_IsEnabled
'BtnItem.OnPropertyChanged(NameOf(BtnItem.Btn_IsEnabled))
BtnItem.NotifyPropertyChanged(NameOf(BtnItem.Btn_IsEnabled))
Next
End Sub
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadButtonItem As ButtonItem) As Boolean
ReadButtonItem = Nothing
Dim sVal As String = String.Empty
GetMainPrivateProfileString(sSection, sKey, "", sVal)
If String.IsNullOrWhiteSpace(sVal) Then Return False
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() >= 1 Then
Dim sLuaPath As String = sItems(0)
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
Dim sDrawMachOrBoth As String = If(sItems.Count() >= 4 AndAlso Not String.IsNullOrWhiteSpace(sItems(3)), sItems(3), "1")
If Not String.IsNullOrWhiteSpace(sBaseDir) And Not String.IsNullOrWhiteSpace(sLuaPath) Then
If sLuaPath.Contains(".lua") Then sLuaPath = sBaseDir & "\" & sLuaPath
If Not String.IsNullOrWhiteSpace(sImagePath) Then sImagePath = sBaseDir & "\" & sImagePath
End If
ReadButtonItem = New ButtonItem(sSection, sLuaPath, sImagePath, sToolTip, sDrawMachOrBoth)
Return True
End If
Return False
End Function
#End Region ' Methods
End Class
Public Class ButtonItem
Inherits VMBase
Friend Shared WithEvents m_ProjectVM As ProjectVM
Private Shared m_sCurrBarName As String
Private m_sBarName As String
Private m_sImagePath As String
Public ReadOnly Property ImagePath As String
Get
Return m_sImagePath
End Get
End Property
Private m_sLuaCmdPath As String
Private m_sToolTip As String
Public ReadOnly Property ToolTip As String
Get
Return m_sToolTip
End Get
End Property
Private m_nDrawMachOrBoth As Integer
Public ReadOnly Property nDrawMachOrBoth As Integer
Get
Return m_nDrawMachOrBoth
End Get
End Property
Friend m_Btn_Visibility As Visibility
Public ReadOnly Property Btn_Visibility As Visibility
Get
Return m_Btn_Visibility
End Get
End Property
Friend m_Btn_IsEnabled As Boolean = True
Public ReadOnly Property Btn_IsEnabled As Boolean
Get
Return m_Btn_IsEnabled
End Get
End Property
' Definizione comandi
Private m_cmdLuaExec As ICommand
Sub New( sBarName As String, sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
m_sBarName = sBarName
If File.Exists(sImagePath) Then
' per lasciare libere le immagini le copio (potrebbe fallire perchè bloccate da altro eseguibile)
Dim sNewPath As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sResourcesRoot, sBarName & "_" & Path.GetFileName(sImagePath))
Try
File.Copy( sImagePath, sNewPath, True)
Catch ex As Exception
End Try
m_sImagePath = sNewPath
Else
m_sImagePath = Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\" & sImagePath
End If
m_sLuaCmdPath = sLuaCmdPath
m_sToolTip = sToolTip
If Not Integer.TryParse(sDrawMachOrBoth, m_nDrawMachOrBoth) Then m_nDrawMachOrBoth = 0
End Sub
#Region "COMMANDS"
#Region "LuaExecCommand"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property LuaExecCommand As ICommand
Get
If m_cmdLuaExec Is Nothing Then
m_cmdLuaExec = New Command(AddressOf LuaExec)
End If
Return m_cmdLuaExec
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Sub LuaExec(ByVal param As Object)
If String.IsNullOrWhiteSpace(m_sLuaCmdPath) Then Return
If Not File.Exists(m_sLuaCmdPath) Then Return
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return
' Abilito eventi se comando lua termina con Beam\Process.lua
m_sCurrBarName = m_sBarName
Dim bRaiseEvent As Boolean = ( m_sBarName = "Beam" OrElse m_sBarName = "Wall")
' eseguo file Lua
EgtBEAMWALL.ViewerOptimizer.LuaExec.ExecScript(m_sLuaCmdPath, bRaiseEvent)
m_sCurrBarName = Nothing
End Sub
'Private Shared Sub OnPreControllerExec(sFilePath As String) Handles m_ProjectVM.OnPreControllerExec
' If m_sCurrBarName = "Beam" Then
' EgtLuaCreateGlobTable("BEAM")
' EgtLuaSetGlobStringVar("BEAM.BASEDIR", IniFile.m_sBeamDirPath)
' If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("BEAM.BW", true)
' ElseIf m_sCurrBarName = "Wall" Then
' EgtLuaCreateGlobTable("WALL")
' EgtLuaSetGlobStringVar("WALL.BASEDIR", IniFile.m_sWallDirPath)
' If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("WALL.BW", true)
' End If
'End Sub
'Private Shared Sub OnPostControllerExec() Handles m_ProjectVM.OnPostControllerExec
' If m_sCurrBarName = "Beam" Then
' EgtLuaResetGlobVar("BEAM")
' ElseIf m_sCurrBarName = "Wall" Then
' EgtLuaResetGlobVar("WALL")
' End If
'End Sub
#End Region ' LuaExecCommand
#End Region ' Commands
End Class
@@ -68,6 +68,8 @@ Public Module DbControllers
DataLayer.DbConfig.CheckMigrateDb()
DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
DataLayer.DbConfig.CheckViews(sUser, sPwd)
' riattivare il dump per il backup
'DataLayer.DbConfig.DumpDB("C:\Program Files\MariaDB 10.5\bin\mysqldump", "c:\Temp\Pippo.sql")
If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
' imposto cartella condivisa
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder)
@@ -51,6 +51,7 @@
<OmagOFFICE:MachiningTabVM x:Key="MachiningTabVM"/>
<OmagOFFICE:SimulTabVM x:Key="SimulTabVM"/>-->
<EgtBEAMWALL:MyMachGroupPanelVM x:Key="MachGroupPanelVM"/>
<EgtBEAMWALL:SpecialPanelVM x:Key="SpecialPanelVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
@@ -310,6 +311,13 @@
</Style.Triggers>
</Style>
<Style x:Key="DrawPanelButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBlock -->
@@ -1,4 +1,5 @@
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.DataLayer.Controllers
Imports EgtUILib
Imports EgtWPFLib5
@@ -203,4 +204,17 @@ Module LuaExec
Return bOk
End Function
' Special Panel
Friend Sub ExecScript(sFilePath As String, Optional bRaiseEvent As Boolean = False)
EgtLuaExecFile(sFilePath)
'Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
'If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
' Dim nCurrPart As Integer = EgtGetCurrPart()
' If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
' EgtResetCurrPartLayer()
' End If
'End If
End Sub
End Module
+14 -1
View File
@@ -34,6 +34,7 @@ Module Map
Private m_refFeatureManagerVM As FeatureManagerVM
Private m_refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM
Private m_refStatisticsTimePanelVM As StatisticsTimePanelVM
Private m_refSpecialPanelVM As SpecialPanelVM
'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
'Private m_refRawPartTabVM As RawPartTabVM
'Private m_refNestingTabVM As NestingTabVM
@@ -241,6 +242,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
Get
Return m_refSpecialPanelVM
End Get
End Property
'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
' Get
' Return m_refOpenProjectFileDialogVM
@@ -453,6 +460,12 @@ Module Map
Return Not IsNothing(m_refStatisticsTimePanelVM)
End Function
Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean
m_refSpecialPanelVM = SpecialPanelVM
Return Not IsNothing(m_refSpecialPanelVM)
End Function
'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
' Return Not IsNothing(m_refOpenProjectFileDialogVM)
@@ -526,7 +539,7 @@ Module Map
Not IsNothing(m_refStatisticsVM) AndAlso Not IsNothing(m_refPParameterListVM) AndAlso
Not IsNothing(m_refQParameterListVM) AndAlso Not IsNothing(m_refFeatureManagerVM) AndAlso
Not IsNothing(m_refAddSectionXMaterialWndVM) AndAlso Not IsNothing(m_refStatisticsTimePanelVM) AndAlso
LibMap.EndInit()
Not IsNothing(m_refSpecialPanelVM) AndAlso LibMap.EndInit()
End Function
#End Region ' Init
Binary file not shown.
Binary file not shown.