diff --git a/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb b/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb
index 4db731de..da9998bd 100644
--- a/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb
+++ b/EgtBEAMWALL.Core/BTLModel/BTLFeatureM.vb
@@ -174,7 +174,7 @@ Public Class BTLFeatureM
Protected m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
- Return m_sCALC_MSG
+ Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
diff --git a/EgtBEAMWALL.Core/BTLModel/BTLPartM.vb b/EgtBEAMWALL.Core/BTLModel/BTLPartM.vb
index 28d25150..a82014f3 100644
--- a/EgtBEAMWALL.Core/BTLModel/BTLPartM.vb
+++ b/EgtBEAMWALL.Core/BTLModel/BTLPartM.vb
@@ -666,7 +666,7 @@ Public Class BTLPartM
Private m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
- Return m_sCALC_MSG
+ Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
@@ -703,6 +703,16 @@ Public Class BTLPartM
End Set
End Property
+ Private m_nFeaturesGlobalState As CalcStates
+ Public Property nFeaturesGlobalState As CalcStates
+ Get
+ Return m_nFeaturesGlobalState
+ End Get
+ Set(value As CalcStates)
+ m_nFeaturesGlobalState = value
+ End Set
+ End Property
+
Private m_nCALC_GlobalERR As Integer
Public Property nCALC_GlobalERR As Integer
Get
diff --git a/EgtBEAMWALL.Core/CALCPanel/CalcIntegration.vb b/EgtBEAMWALL.Core/CALCPanel/CalcIntegration.vb
index 9fe464ea..58049142 100644
--- a/EgtBEAMWALL.Core/CALCPanel/CalcIntegration.vb
+++ b/EgtBEAMWALL.Core/CALCPanel/CalcIntegration.vb
@@ -162,7 +162,8 @@ Public Module CalcIntegration
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
ElseIf vBar(nCurrBar).nCmdType = CmdTypes.GENERATE Then
- RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
+ RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
+ 'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
nCurrBar += 1
@@ -177,7 +178,8 @@ Public Module CalcIntegration
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
- RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
+ RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
+ 'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
@@ -199,7 +201,8 @@ Public Module CalcIntegration
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
- RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
+ RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
+ 'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
diff --git a/EgtBEAMWALL.Core/Constants/ConstBeam.vb b/EgtBEAMWALL.Core/Constants/ConstBeam.vb
index 3bec8591..f652378b 100644
--- a/EgtBEAMWALL.Core/Constants/ConstBeam.vb
+++ b/EgtBEAMWALL.Core/Constants/ConstBeam.vb
@@ -126,6 +126,8 @@
' layer per assemblato
Public Const ASSEBASE As String = "AsseBase"
+ ' info parametri assemblato
+ Public Const BTL_ASSEBASE_N As String = "N"
' info parametri BTL
Public Const BTL_PRT_PROJ As String = "PROJ"
@@ -284,6 +286,7 @@
Public Const WRH_CURRENT As String = "Current"
Public Const WRH_STARTOFFSET As String = "StartOffset"
Public Const WRH_OFFSET As String = "Offset"
+ Public Const WRH_RANGE As String = "Range"
Public Const WRH_QUANTITY As String = "Quantity"
Public Const WRH_L As String = "L"
Public Const WRH_KERF As String = "Kerf"
diff --git a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb
index 89908849..9f0d6112 100644
--- a/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb
+++ b/EgtBEAMWALL.Core/Constants/ConstDataGridColumnsIni.vb
@@ -27,5 +27,8 @@
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
+ Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
+
+ Public Const K_LOCKTABLE As String = "LockTable"
End Module
diff --git a/EgtBEAMWALL.Core/Constants/ConstIni.vb b/EgtBEAMWALL.Core/Constants/ConstIni.vb
index a81463d8..3d38a25b 100644
--- a/EgtBEAMWALL.Core/Constants/ConstIni.vb
+++ b/EgtBEAMWALL.Core/Constants/ConstIni.vb
@@ -30,11 +30,14 @@ Public Module ConstIni
'Public Const K_LASTPROJ As String = "LastProj"
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
Public Const K_LASTIMPDIR As String = "LastImpDir"
+ Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
+ Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
Public Const K_PROJSINDEX As String = "ProjsIndex"
Public Const K_PRODSINDEX As String = "ProdsIndex"
'Public Const K_SUPPORT As String = "Support"
Public Const K_WAREHOUSE As String = "Warehouse"
Public Const K_DBADDRESS As String = "DbAddress"
+ Public Const K_UPDATEBTL As String = "UpdateBtl"
'Public Const S_LANGUAGES As String = "Languages"
'Public Const K_LANGUAGE As String = "Language"
diff --git a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj
index 77779186..2bea0360 100644
--- a/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj
+++ b/EgtBEAMWALL.Core/EgtBEAMWALL.Core.vbproj
@@ -59,6 +59,7 @@
+
@@ -108,12 +109,18 @@
+
+
+ LoadingWndV.xaml
+
+
+
@@ -135,6 +142,7 @@
+ OpenProjectFileDialogV.xaml
@@ -180,6 +188,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ XamlIntelliSenseFileGenerator
+ MSBuild:CompileDesigner
diff --git a/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb b/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
index 6e15a6ae..2ab6446b 100644
--- a/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
+++ b/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.Windows.Controls
+Imports System.Windows.Forms
Imports EgtUILib
Imports EgtWPFLib5
@@ -31,7 +32,8 @@ Public Module DataGridColumnsIniFile
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
- ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
+ Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
+ ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection))
End If
colIndex += 1
End While
@@ -67,7 +69,8 @@ Public Module DataGridColumnsIniFile
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
- Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible)
+ Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
+ Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection)
Exit While
End If
End If
diff --git a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml
index 0a9480a2..fb9c0d9e 100644
--- a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml
+++ b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml
@@ -2,11 +2,16 @@
x:Name="CurrDataGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
-
+
+
+
diff --git a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb
index ea867313..0b5c1be4 100644
--- a/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb
+++ b/EgtBEAMWALL.Core/EgtDataGrid/EgtDataGrid.xaml.vb
@@ -1,12 +1,27 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
+Imports System.ComponentModel
Imports System.Windows
Imports System.Windows.Controls
+Imports System.Windows.Data
+Imports System.Windows.Controls.Primitives
+Imports System.Windows.Input
+Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtDataGrid
+ ' vecchio indice da salvare per il Reorder delle colonne
+ Public OldIndex As Integer = 0
+ ' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
+ Private HeaderDispIndex As Integer = 0
+ ' somma delle larghezze delle colonne di EgtDataGrid
+ Private columnsWidth As Double = 0
+
+ ' larghezza minima dell'ultima colonna per attivare/disattivare ScrollBar orizzontale
+ Private Const LASTCOLUMN_MINWIDTH As Double = 40
+
Sub New()
InitializeComponent()
End Sub
@@ -28,8 +43,8 @@ Public Class EgtDataGrid
If oldItems IsNot Nothing Then
- For Index = 0 To oldItems.Count - 1
- Dim Column As DataGridColumn = context.FindResource(oldItems(Index))
+ For index = 0 To oldItems.Count - 1
+ Dim Column As DataGridColumn = context.FindResource(oldItems(index))
context.Columns.Remove(Column)
Next
@@ -40,13 +55,13 @@ Public Class EgtDataGrid
If newItems IsNot Nothing Then
- For Index = 0 To newItems.Count - 1
+ For index = 0 To newItems.Count - 1
Try
- Dim col As DataGridColumn = context.FindResource(newItems(Index).Name)
- newItems(Index).InitColumn(col)
+ Dim col As DataGridColumn = context.FindResource(newItems(index).Name)
+ newItems(index).InitColumn(col)
context.Columns.Add(col)
Catch ex As Exception
- MessageBox.Show(String.Format(EgtMsg(61883), newItems(Index).Name, newItems(Index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
+ MessageBox.Show(String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
End Try
Next
@@ -116,7 +131,127 @@ Public Class EgtDataGrid
End If
End Sub
- Public OldIndex As Integer = 0
+ Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles CurrDataGrid.SizeChanged
+ ' confronto la larghezza effettiva della EgtDataGrid con la somma delle larghezze delle colonne
+ UpdateColumnsWidth()
+ If BindingColumns.Count > 0 Then
+ If CurrDataGrid.ActualWidth - LASTCOLUMN_MINWIDTH > columnsWidth Then
+ ' nascondo la ScrollBar orizzontale e setto lo UnitType dell'ultima colonna visibile a Star
+ ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Hidden)
+ BindingColumns.Last(Function(x) x.Visible = True).Width = New DataGridLength(1, DataGridLengthUnitType.Star)
+ Else
+ ' mostro la ScrollBar orizzontale e se UnitType delle colonne è Star lo setto a Pixel
+ ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Visible)
+ For Each bc In BindingColumns
+ If bc.Width.IsStar Then
+ bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
+ End If
+ Next
+ End If
+ ' scrivo nell'INI la Width dell'ultima colonna visibile
+ BindingColumns.Last(Function(x) x.Visible = True).SaveDataGridColumn()
+ End If
+ End Sub
+
+ Public Sub UpdateColumnsWidth()
+ ' ricalcolo la somma delle larghezze delle colonne visibili
+ columnsWidth = 0
+ For Each col In BindingColumns
+ If col.ColumnVisibility = Visibility.Visible Then
+ columnsWidth += col.ActualWidth
+ End If
+ Next
+ ' alla somma calcolata tolgo la larghezza dell'ultima colonna visibile e aggiungo LASTCOLUMN_MINWIDTH
+ ' (in questo modo si attiva/disattiva la ScrollBar orizzontale non appena l'ultima colonna viene ristretta/estesa a LASTCOLUMN_MINWIDTH px)
+ If BindingColumns.Count > 0 AndAlso
+ BindingColumns.Any(Function(x) x.Visible = True) Then
+ columnsWidth = columnsWidth - BindingColumns.Last(Function(x) x.Visible = True).ActualWidth + LASTCOLUMN_MINWIDTH
+ End If
+ End Sub
+
+ Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
+ Dim nDispIndex As Integer = sender.DisplayIndex
+ ' creo il ContextMenu con gli item checkabili
+ Dim cm As ContextMenu = New ContextMenu()
+ Dim miReorder As MenuItem = New MenuItem()
+ Dim miResize As MenuItem = New MenuItem()
+ Dim miSort As MenuItem = New MenuItem()
+ Dim sep1 As Separator = New Separator()
+ Dim miVis As MenuItem = New MenuItem()
+ Dim sep2 As Separator = New Separator()
+ Dim miLock As MenuItem = New MenuItem()
+ Dim miResetSort As MenuItem = New MenuItem()
+ miReorder.Header = NameOf(EgtDataGridColumn.CanUserReorder)
+ miResize.Header = NameOf(EgtDataGridColumn.CanUserResize)
+ miSort.Header = NameOf(EgtDataGridColumn.CanUserSort)
+ miVis.Header = "Columns Visibility"
+ miLock.Header = "Lock Table"
+ miResetSort.Header = "Reset Sort"
+ miReorder.IsCheckable = True
+ miResize.IsCheckable = True
+ miSort.IsCheckable = True
+ miLock.IsCheckable = True
+ miResetSort.IsCheckable = False
+ miReorder.StaysOpenOnClick = True
+ miResize.StaysOpenOnClick = True
+ miSort.StaysOpenOnClick = True
+ miLock.StaysOpenOnClick = True
+ miResetSort.StaysOpenOnClick = True
+ ' setto il binding
+ Dim miReorderBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserReorder))
+ Dim miResizeBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserResize))
+ Dim miSortBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserSort))
+ miReorderBinding.Mode = BindingMode.TwoWay
+ miResizeBinding.Mode = BindingMode.TwoWay
+ miSortBinding.Mode = BindingMode.TwoWay
+ miReorder.DataContext = BindingColumns(nDispIndex)
+ miResize.DataContext = BindingColumns(nDispIndex)
+ miSort.DataContext = BindingColumns(nDispIndex)
+ miReorder.SetBinding(MenuItem.IsCheckedProperty, miReorderBinding)
+ miResize.SetBinding(MenuItem.IsCheckedProperty, miResizeBinding)
+ miSort.SetBinding(MenuItem.IsCheckedProperty, miSortBinding)
+ ' setto check e enable associati a LockTable
+ miLock.IsChecked = (GetPrivateProfileInt(BindingColumns(nDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile) > 0)
+ miReorder.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserReorder)
+ miResize.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserResize)
+ miReorder.IsEnabled = Not miLock.IsChecked
+ miResize.IsEnabled = Not miLock.IsChecked
+ HeaderDispIndex = nDispIndex
+ AddHandler miLock.Checked, AddressOf miLock_Checked
+ AddHandler miLock.Unchecked, AddressOf miLock_Unchecked
+ AddHandler miResetSort.Click, AddressOf miResetSort_Click
+ ' aggiungo i MenuItem al ContextMenu
+ cm.Items.Add(miReorder)
+ cm.Items.Add(miResize)
+ cm.Items.Add(miSort)
+ cm.Items.Add(sep1)
+ cm.Items.Add(miVis)
+ cm.Items.Add(sep2)
+ cm.Items.Add(miLock)
+ cm.Items.Add(miResetSort)
+ ' creo e aggiungo gli item figli di Columns Visibility
+ For Each Column In BindingColumns
+ Dim mi As MenuItem = New MenuItem()
+ mi.Header = Column.Name
+ mi.IsCheckable = True
+ Dim miBinding As Binding = New Binding(NameOf(EgtDataGridColumn.Visible))
+ miBinding.Mode = BindingMode.TwoWay
+ mi.DataContext = Column
+ mi.SetBinding(MenuItem.IsCheckedProperty, miBinding)
+ mi.StaysOpenOnClick = True
+ mi.IsEnabled = Column.CanUserEditVisible
+ miVis.Items.Add(mi)
+ Next
+ ' disabilito Columns Visibility se tutti i suoi figli sono disabilitati
+ Dim bIsEnabled As Boolean = False
+ For Each visMenuItem In miVis.Items
+ bIsEnabled = visMenuItem.IsEnabled
+ Next
+ cm.Items(4).IsEnabled = bIsEnabled
+
+ cm.PlacementTarget = TryCast(sender, Button)
+ cm.IsOpen = True
+ End Sub
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
@@ -136,6 +271,99 @@ Public Class EgtDataGrid
Next
End Sub
+ Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
+ Dim miLock = DirectCast(sender, MenuItem)
+ ' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
+ For Each Column In BindingColumns
+ Column.OldCanUserReorder = Column.CanUserReorder
+ Column.OldCanUserResize = Column.CanUserResize
+ Column.CanUserReorder = False
+ Column.CanUserResize = False
+ Next
+ ' aggiorno il ContextMenu correntemente aperto
+ Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
+ Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
+ miReorder.IsChecked = False
+ miResize.IsChecked = False
+ miReorder.IsEnabled = False
+ miResize.IsEnabled = False
+ ' scrivo il valore di LockTable nell'INI
+ WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 1, m_sDataGridColumnsIniFile)
+ End Sub
+
+ Private Sub miLock_Unchecked(sender As Object, e As RoutedEventArgs)
+ Dim miLock = DirectCast(sender, MenuItem)
+ ' abilito Reorder e Resize di tutte le colonne ripristinando il valore precedente, se presente
+ For Each Column In BindingColumns
+ If Not IsNothing(Column.OldCanUserReorder) Then Column.CanUserReorder = Column.OldCanUserReorder
+ If Not IsNothing(Column.OldCanUserResize) Then Column.CanUserResize = Column.OldCanUserResize
+ Next
+ ' aggiorno il ContextMenu correntemente aperto
+ Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
+ Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
+ miReorder.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserReorder), BindingColumns(HeaderDispIndex).CanUserReorder, BindingColumns(HeaderDispIndex).OldCanUserReorder)
+ miResize.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserResize), BindingColumns(HeaderDispIndex).CanUserResize, BindingColumns(HeaderDispIndex).OldCanUserResize)
+ miReorder.IsEnabled = True
+ miResize.IsEnabled = True
+ ' scrivo il valore di LockTable nell'INI
+ WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile)
+ End Sub
+
+ Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
+ ' resetto le SortDirection di tutte le colonne della datagrid
+ ResetSortDirections()
+ End Sub
+
+ Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
+ ' setto la SortDirection, se attiva, sulla colonna su cui è attiva
+ Dim colIndex As Integer = 0
+ For Each col In BindingColumns
+ If col.SortDirection > 0 Then
+ CurrDataGrid.Items.SortDescriptions.Add(New SortDescription(CurrDataGrid.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
+ Exit For
+ End If
+ colIndex += 1
+ Next
+ ' calcolo la somma delle larghezze delle colonne visibili
+ For Each col In BindingColumns
+ If col.ColumnVisibility = Visibility.Visible Then
+ columnsWidth += col.ActualWidth
+ End If
+ Next
+ End Sub
+
+ Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
+ ' salvo la SortDirection corrente della colonna prima di resettarla per tutte le colonne
+ Dim CurrSortDirection As ListSortDirection? = e.Column.SortDirection
+ ResetSortDirections(True)
+ ' ora applico la SortDirection corretta
+ Select Case CurrSortDirection
+ Case ListSortDirection.Ascending
+ BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la setto a Descending
+ Case ListSortDirection.Descending
+ BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
+ Case Else
+ BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
+ End Select
+ End Sub
+
+ Private Sub ResetSortDirections(Optional bUserClick As Boolean = False)
+ If bUserClick Then
+ ' nel caso di click dell'utente sulla colonna da sortare occorre solamente settare a 0 la SortDirection di tutte le colonne
+ For Each column In BindingColumns
+ column.SortDirection = 0
+ Next
+ Else
+ ' altrimenti (caso ResetSort da ContextMenu) è necessatio un Clear più ampio e anche grafico
+ CurrDataGrid.Items.SortDescriptions.Clear()
+ For Each column In BindingColumns
+ column.SortDirection = 0
+ ' resetto graficamente anche l'header della colonna
+ CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
+ Next
+ End If
+ End Sub
+
End Class
Public Class EgtDataGridColumn
@@ -176,6 +404,12 @@ Public Class EgtDataGridColumn
End Set
End Property
+ Public ReadOnly Property ActualWidth As Double
+ Get
+ Return m_dgColumn.ActualWidth
+ End Get
+ End Property
+
Private Property m_DisplayIndex As Integer
Public Property DisplayIndex As Integer
Get
@@ -204,6 +438,7 @@ Public Class EgtDataGridColumn
End Set
End Property
+ Friend OldCanUserReorder As Boolean?
Private m_CanUserReorder As Boolean
Public Property CanUserReorder As Boolean
Get
@@ -219,6 +454,7 @@ Public Class EgtDataGridColumn
End Set
End Property
+ Friend OldCanUserResize As Boolean?
Private m_CanUserResize As Boolean
Public Property CanUserResize As Boolean
Get
@@ -270,6 +506,17 @@ Public Class EgtDataGridColumn
m_ColumnVisibility = value
If Not IsNothing(m_dgColumn) Then
m_dgColumn.Visibility = value
+ ' ricavo la EgtDataGrid a cui appartiene la DataGridColumn
+ Dim propertyInfo As Reflection.PropertyInfo = m_dgColumn.GetType().GetProperty("DataGridOwner",
+ Reflection.BindingFlags.Instance Or
+ Reflection.BindingFlags.NonPublic)
+ Dim dg As EgtDataGrid = propertyInfo.GetValue(m_dgColumn, Nothing)
+ ' ogni colonna visibile con UnitType a Star tranne l'ultima verrà settata a Pixel
+ For Each bc In dg.BindingColumns
+ If bc.Width.IsStar And Not bc.Name = dg.BindingColumns.Last(Function(x) x.Visible = True).Name Then
+ bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
+ End If
+ Next
End If
End Set
End Property
@@ -285,11 +532,30 @@ Public Class EgtDataGridColumn
End Set
End Property
+ Private m_SortDirection As Forms.SortOrder = Forms.SortOrder.None
+ Public Property SortDirection As Forms.SortOrder
+ Get
+ Return m_SortDirection 'If(IsNothing(m_dgColumn.SortDirection), 0, m_dgColumn.SortDirection + 1)
+ End Get
+ Set(value As Forms.SortOrder)
+ 'If Not IsNothing(m_dgColumn) Then
+ ' If value = 0 Then
+ ' m_dgColumn.SortDirection = Nothing
+ ' Else
+ ' m_dgColumn.SortDirection = value - 1
+ ' End If
+ 'Else
+ m_SortDirection = value
+ 'End If
+ SaveDataGridColumn()
+ End Set
+ End Property
+
Sub New(sName As String)
m_Name = sName
End Sub
- Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
+ Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean, nSortDirection As Integer)
m_ParentDataGridName = sParentDG
m_Name = sName
m_CanUserReorder = bCanUserReorder
@@ -299,6 +565,7 @@ Public Class EgtDataGridColumn
m_Width = Width
m_Visible = bVisible
m_CanUserEditVisible = bCanUserEditVisible
+ m_SortDirection = nSortDirection
End Sub
Friend Sub InitColumn(dgColumn As DataGridColumn)
@@ -310,13 +577,18 @@ Public Class EgtDataGridColumn
'm_dgColumn.DisplayIndex = m_DisplayIndex
m_dgColumn.Width = m_Width
m_dgColumn.Visibility = m_ColumnVisibility
+ If CInt(m_SortDirection) > 0 Then
+ m_dgColumn.SortDirection = m_SortDirection - 1 'If(CInt(m_SortDirection) = 0, Nothing, m_SortDirection - 1)
+ Else
+ m_dgColumn.SortDirection = Nothing
+ End If
End Sub
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
Public Function SaveDataGridColumn() As Boolean
Dim bOk As Boolean
Dim sColumnParams = String.Empty
- sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0)
+ sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
Return bOk
End Function
diff --git a/EgtBEAMWALL.Core/LoadingWnd/LoadingWndHelper.vb b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndHelper.vb
new file mode 100644
index 00000000..e91c42ba
--- /dev/null
+++ b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndHelper.vb
@@ -0,0 +1,99 @@
+Imports System.Threading
+Imports System.Windows.Threading
+
+Public Module LoadingWndHelper
+
+ Public Enum ActiveIds As Integer
+ OPENPROJ = 1
+ SAVEPROJ = 2
+ IMPORTBTL = 3
+ GOTOPROD = 4
+ OPENPROD = 5
+ SAVEPROD = 6
+ GOTOPROJ = 7
+ EXPORTPROJECT = 8
+ IMPORTPROJECT = 9
+ CHANGEPARAM = 10
+ CREATINGPDF = 11
+ CHANGEMATERIAL = 12
+ End Enum
+
+ Dim m_MainWindow As Windows.Window
+ Public Function SetMainWindow(MainWindow As Windows.Window)
+ m_MainWindow = MainWindow
+ End Function
+
+ Private m_bMainWindow_IsActive As Boolean = True
+ Public Function SetMainWindowIsActive(IsActive As Boolean)
+ m_bMainWindow_IsActive = IsActive
+ End Function
+
+ Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
+
+ Private m_thread As Thread
+ Private m_LoadingWndVM As Core.LoadingWndVM
+ Private m_CurrStep As Integer
+ Private m_StepText As String
+ Private m_nProgress As Integer
+ Private m_nNextProgress As Integer
+ Private m_bClose As Boolean
+ Private m_bActiveId As Integer = -1
+
+ Public Function OpenLoadingWnd(Id As Integer, nSteps As Integer, TotText As String, FirstStepText As String, nNextProgress As Integer) As Boolean
+ If m_bActiveId > 0 Then Return False
+ m_bActiveId = Id
+ m_LoadingWndVM = Nothing
+ m_CurrStep = 1
+ m_StepText = FirstStepText
+ m_nProgress = 1
+ m_nNextProgress = nNextProgress
+ m_bClose = False
+ Dim Top As Double = m_MainWindow.Top + (m_MainWindow.Height / 2) - 100
+ Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
+ Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
+ If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
+ WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
+ End If
+ m_thread = New Thread(Sub()
+ m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
+ m_LoadingWndVM.UpdateProgress(m_CurrStep, m_StepText, m_nProgress, m_nNextProgress)
+ Dim LoadingWnd As New LoadingWndV(Nothing, m_LoadingWndVM)
+ ' posiziono la finestra
+ If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
+ LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
+ Else
+ LoadingWnd.Top = Top
+ LoadingWnd.Left = Left
+ End If
+ LoadingWnd.Show()
+ Dispatcher.Run()
+ End Sub)
+ m_thread.SetApartmentState(ApartmentState.STA)
+ m_thread.Start()
+ Return True
+ End Function
+
+ Private Sub LoadingCallback(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
+ CurrStep = m_CurrStep
+ StepText = m_StepText
+ nProgress = m_nProgress
+ nNextProgress = m_nNextProgress
+ m_bMainWindow_IsActive = MainWindow_IsActive
+ bClose = m_bClose
+ End Sub
+
+ Public Sub UpdateLoadingWnd(Id As Integer, CurrStep As Integer, StepText As String, nProgress As Integer, nNextProgress As Integer)
+ If Id <> m_bActiveId Then Return
+ m_CurrStep = CurrStep
+ m_StepText = StepText
+ m_nProgress = nProgress
+ m_nNextProgress = nNextProgress
+ End Sub
+
+ Public Sub CloseLoadingWnd(Id As Integer)
+ If Id <> m_bActiveId Then Return
+ m_bClose = True
+ m_bActiveId = -1
+ End Sub
+
+End Module
diff --git a/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml
new file mode 100644
index 00000000..6eab8aec
--- /dev/null
+++ b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml.vb b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml.vb
new file mode 100644
index 00000000..8ed0b58c
--- /dev/null
+++ b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndV.xaml.vb
@@ -0,0 +1,28 @@
+Imports System.Windows
+
+Public Class LoadingWndV
+
+ Private WithEvents m_LoadingWndVM As LoadingWndVM
+
+ Sub New(Owner As Window, LoadingWndVM As LoadingWndVM)
+ MyBase.New(Owner)
+ ' This call is required by the designer.
+ InitializeComponent()
+ Me.DataContext = LoadingWndVM
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ m_LoadingWndVM = LoadingWndVM
+ End Sub
+
+ Private Sub CloseWindow(bDialogResult As Boolean) Handles m_LoadingWndVM.m_CloseWindow
+ Me.Close()
+ End Sub
+
+ Private Sub ActivateWindow() Handles m_LoadingWndVM.m_ActivateWindow
+ Me.Activate()
+ End Sub
+
+ Private Sub Me_ContentRendered() Handles Me.ContentRendered
+ m_LoadingWndVM.StartFunction()
+ End Sub
+
+End Class
diff --git a/EgtBEAMWALL.Core/LoadingWnd/LoadingWndVM.vb b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndVM.vb
new file mode 100644
index 00000000..e6c72f36
--- /dev/null
+++ b/EgtBEAMWALL.Core/LoadingWnd/LoadingWndVM.vb
@@ -0,0 +1,233 @@
+Imports System.Timers
+Imports System.Windows
+Imports System.Windows.Input
+Imports System.Windows.Threading
+Imports EgtBEAMWALL.Core
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class LoadingWndVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Enum LoadingTypes As Integer
+ NULL = 0
+ OPEN = 1
+ IMPORT = 2
+ End Enum
+
+ Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
+
+ Friend Event m_CloseWindow(bDialogResult As Boolean)
+ Friend Event m_ActivateWindow()
+
+ Private m_CallbackLoading As CallbackLoadingDlg
+ Private m_Waiting_Timer As New DispatcherTimer
+
+ ' numero di passaggi di caricamento
+ Private m_nSteps As Integer
+ ' titolo testo di caricamento
+ Private m_TotText As String
+ ' numero passaggio corrente
+ Private m_CurrStep As Integer
+ ' testo del passaggio corrente
+ Private m_StepText As String
+ ' indice d'inizio di questo passaggio
+ Private m_nStartProgress As Integer
+ ' indice d'inizio del prossimo passaggio
+ Private m_nNextProgress As Integer
+ ' variabile che indica richiesta chiusura della finestra
+ Private m_bClosing As Boolean = False
+ Private m_bMainWindow_IsActive As Boolean = True
+
+ Private m_StepProgress_Value As Double = 0
+ Public Property StepProgress_Value As Double
+ Get
+ Return m_StepProgress_Value
+ End Get
+ Set(value As Double)
+ m_StepProgress_Value = value
+ End Set
+ End Property
+
+ Private m_TotProgress_Value As Double = 0
+ Public Property TotProgress_Value As Double
+ Get
+ Return Math.Floor(m_TotProgress_Value)
+ End Get
+ Set(value As Double)
+ m_TotProgress_Value = value
+ End Set
+ End Property
+
+ Private m_StepText_Visibility As Visibility
+ Public ReadOnly Property StepText_Visibility As Visibility
+ Get
+ Return m_StepText_Visibility
+ End Get
+ End Property
+
+ Private m_StepProgress_Visibility As Visibility
+ Public ReadOnly Property StepProgress_Visibility As Visibility
+ Get
+ Return m_StepProgress_Visibility
+ End Get
+ End Property
+
+#Region "Messages"
+
+ Public ReadOnly Property TotText_Msg As String
+ Get
+ Return If(m_nSteps > 0, m_TotText & " (" & m_CurrStep & "/" & m_nSteps & ")", m_TotText)
+ End Get
+ End Property
+
+ Public ReadOnly Property StepText_Msg As String
+ Get
+ Return m_StepText
+ End Get
+ End Property
+
+ Public ReadOnly Property TotProgress_Msg As String
+ Get
+ Return m_TotProgress_Value.ToString("0.#") & "%"
+ End Get
+ End Property
+
+#End Region ' Messages
+
+ ' Definizione comandi
+ Private m_cmdCancel As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+ Sub New(Steps As Integer, TotText As String, callback As CallbackLoadingDlg)
+ m_nSteps = Steps
+ m_TotText = TotText
+ m_CallbackLoading = callback
+ m_bClosing = False
+ If Steps = 1 Then
+ m_StepText_Visibility = Visibility.Collapsed
+ m_StepProgress_Visibility = Visibility.Collapsed
+ Else
+ m_StepText_Visibility = Visibility.Visible
+ m_StepProgress_Visibility = Visibility.Visible
+ End If
+ ' imposto contatore
+ m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(200)
+ AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
+ End Sub
+
+ Public Sub UpdateProgress(CurrStep As Integer, StepText As String, nStartProgress As Integer, nNextProgress As Integer)
+ m_CurrStep = CurrStep
+ m_StepText = StepText
+ m_StepProgress_Value = nStartProgress
+ m_nNextProgress = nNextProgress
+ NotifyPropertyChanged(NameOf(StepText_Msg))
+ NotifyPropertyChanged(NameOf(TotText_Msg))
+ End Sub
+
+ Public Overridable Sub StartFunction()
+ m_Waiting_Timer.Start()
+ End Sub
+
+ Protected Overridable Sub WaitingTimer_Tick()
+ ' leggo eventuali nuovi valori
+ Dim CurrStep As Integer = 0
+ Dim StepText As String = ""
+ Dim nStartProgress As Integer = 0
+ Dim nNextProgress As Integer = 0
+ Dim bMainWindow_IsActive As Boolean = True
+ Dim bClose As Boolean = False
+ m_CallbackLoading(CurrStep, StepText, nStartProgress, nNextProgress, bMainWindow_IsActive, bClose)
+ If bMainWindow_IsActive <> m_bMainWindow_IsActive Then
+ RaiseEvent m_ActivateWindow()
+ End If
+ If m_bClosing Then
+ Close()
+ Dispatcher.CurrentDispatcher.InvokeShutdown()
+ Return
+ ElseIf bClose Then
+ m_bClosing = True
+ ' mostro completamento caricamento
+ m_CurrStep = m_nSteps
+ m_StepProgress_Value = 100
+ m_TotProgress_Value = 100
+ m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(1000)
+ Else
+ If m_CurrStep <> CurrStep Then
+ If m_StepProgress_Value < 100 Then
+ m_StepProgress_Value = 100
+ ElseIf m_StepProgress_Value = 100 Then
+ m_StepProgress_Value = 0
+ m_CurrStep = CurrStep
+ m_StepText = StepText
+ m_nStartProgress = nStartProgress
+ m_nNextProgress = nNextProgress
+ End If
+ Else
+ ' incremento Step corrente
+ If m_StepProgress_Value < 80 Then
+ m_StepProgress_Value += 1
+ ElseIf m_StepProgress_Value < 90 Then
+ m_StepProgress_Value += 0.4
+ ElseIf m_StepProgress_Value < 98 Then
+ m_StepProgress_Value += 0.1
+ Else
+ m_StepProgress_Value += 0.01
+ End If
+ End If
+ ' calcolo totale
+ Dim dStepStart As Double = If(m_CurrStep > 1, m_nStartProgress, 0)
+ Dim dStepEnd As Double = m_nNextProgress
+ m_TotProgress_Value = dStepStart + ((dStepEnd - dStepStart) / 100 * m_StepProgress_Value)
+ End If
+ ' aggiorno grafica
+ NotifyPropertyChanged(NameOf(StepText_Msg))
+ NotifyPropertyChanged(NameOf(TotText_Msg))
+ NotifyPropertyChanged(NameOf(StepProgress_Value))
+ NotifyPropertyChanged(NameOf(TotProgress_Value))
+ NotifyPropertyChanged(NameOf(TotProgress_Msg))
+ End Sub
+
+ Public Sub Close()
+ ' fermo timer
+ m_Waiting_Timer.Stop()
+ ' chiudo finestra
+ RaiseEvent m_CloseWindow(True)
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "Cancel"
+
+ '''
+ ''' Returns a command that do Open.
+ '''
+ Public ReadOnly Property Cancel_Command As ICommand
+ Get
+ If m_cmdCancel Is Nothing Then
+ m_cmdCancel = New Command(AddressOf Cancel)
+ End If
+ Return m_cmdCancel
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Open. This method is invoked by the OpenCommand.
+ '''
+ Friend Sub Cancel()
+ '' chiedo conferma
+ 'If MessageBox.Show("Are you sure you want to stop the nesting?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then Return
+ '' fermo il nesting
+ 'Map.refOptimizePanelVM.m_StopNesting = True
+ '' fermo timer e chiudo finestra
+ 'CloseNesting()
+ End Sub
+
+#End Region ' Cancel
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupM.vb b/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupM.vb
index 4eb13ce1..2e4f257d 100644
--- a/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupM.vb
+++ b/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupM.vb
@@ -176,7 +176,7 @@ Public Class MyMachGroupM
Private m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
- Return m_sCALC_MSG
+ Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
@@ -213,6 +213,16 @@ Public Class MyMachGroupM
End Set
End Property
+ Private m_bCALC_PartsGlobalState As CalcStates
+ Public Property bCALC_PartsGlobalState As CalcStates
+ Get
+ Return m_bCALC_PartsGlobalState
+ End Get
+ Set(value As CalcStates)
+ m_bCALC_PartsGlobalState = value
+ End Set
+ End Property
+
Private m_nCALC_GlobalERR As Integer
Public Property nCALC_GlobalERR As Integer
Get
diff --git a/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupPanelM.vb b/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupPanelM.vb
index 8e01f471..56718f79 100644
--- a/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupPanelM.vb
+++ b/EgtBEAMWALL.Core/MachGroupModel/MyMachGroupPanelM.vb
@@ -207,8 +207,11 @@ Public Class MyMachGroupPanelM
DuploArray = DuploList.ToArray()
' recupero ROT (gradi) e FLIP (0/1) per non perderli
For Duploindex = 0 To DuploArray.Length - 1
+ RotArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
+ FlipArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
+ If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
If nBWType = BWType.WALL Then
' salvo parametri Q
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
@@ -267,23 +270,9 @@ Public Class MyMachGroupPanelM
Next
' aggiornamento dei Duplo
EgtDuploUpdate(nPartId)
- ' recupero flip e rot dell'originale
- Dim dRotated As Double
- Dim dInverted As Double
- Dim dRotAng As Double
- Dim dFlipAng As Double
- EgtGetInfo(nPartId, BTL_PRT_ROTATED, dRotated)
- EgtGetInfo(nPartId, BTL_PRT_INVERTED, dInverted)
' ripristino i valori di ROT e FLIP
For Duploindex = 0 To DuploArray.Length - 1
- ' recupero box del pezzo
- Dim b3Part As New BBox3d
- EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
- ' faccio flip e rotazione rispetto all'originale che ha sovrascritto posizione del duplo
- dRotAng = RotArray(Duploindex) - dRotated
- EgtRotate(DuploArray(Duploindex), b3Part.Center, -Vector3d.Z_AX, dRotAng)
- dFlipAng = FlipArray(Duploindex) * 180.0 - dInverted
- EgtRotate(DuploArray(Duploindex), b3Part.Center, Vector3d.X_AX, dFlipAng)
+ ' ripristino info rot e flip
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If nBWType = BWType.WALL Then
diff --git a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb
index 6eaf442d..b989a976 100644
--- a/EgtBEAMWALL.Core/MachGroupModel/PartM.vb
+++ b/EgtBEAMWALL.Core/MachGroupModel/PartM.vb
@@ -139,21 +139,28 @@ Public Class PartM
Public Property dPOSX As Double
Get
If nType = BWType.WALL Then
- ' recupero box pezzo
- Dim b3Part As New BBox3d
- EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
- ' recupero layer del box
- Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
- ' recupero box del layer box
- Dim b3Box As New BBox3d
- EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
- ' recupero origine grezzo
- Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
- Dim b3Raw As New BBox3d
- EgtGetRawPartBBox(nrawPartId, b3Raw)
- ' calcolo distanza tra origine pezzo e tavolo
- Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
- Return vtPartRef.x
+ ' verifico che sia attivo MachGroup di questo pezzo
+ If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
+ ' recupero box pezzo
+ Dim b3Part As New BBox3d
+ EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
+ ' recupero layer del box
+ Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
+ ' recupero box del layer box
+ Dim b3Box As New BBox3d
+ EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
+ ' recupero origine grezzo
+ Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
+ Dim b3Raw As New BBox3d
+ EgtGetRawPartBBox(nrawPartId, b3Raw)
+ ' calcolo distanza tra origine pezzo e tavolo
+ Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
+ m_dPOSX = vtPartRef.x
+ Return vtPartRef.x
+ ' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
+ Else
+ Return m_dPOSX
+ End If
Else ' nType = BWType.BEAM
Return m_dPOSX
End If
@@ -203,6 +210,16 @@ Public Class PartM
End Set
End Property
+ Public m_sSTOREY As String
+ Public Property sSTOREY As String
+ Get
+ Return m_sSTOREY
+ End Get
+ Set(value As String)
+ m_sSTOREY = value
+ End Set
+ End Property
+
Public m_sGROUP As String
Public Property sGROUP As String
Get
@@ -260,21 +277,28 @@ Public Class PartM
Protected m_dPOSY As Double
Public Property dPOSY As Double
Get
- ' recupero box pezzo
- Dim b3Part As New BBox3d
- EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
- ' recupero layer del box
- Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
- ' recupero box del layer box
- Dim b3Box As New BBox3d
- EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
- ' recupero origine grezzo
- Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
- Dim b3Raw As New BBox3d
- EgtGetRawPartBBox(nrawPartId, b3Raw)
- ' calcolo distanza tra origine pezzo e tavolo
- Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
- Return vtPartRef.y
+ ' verifico che sia attivo MachGroup di questo pezzo
+ If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
+ ' recupero box pezzo
+ Dim b3Part As New BBox3d
+ EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
+ ' recupero layer del box
+ Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
+ ' recupero box del layer box
+ Dim b3Box As New BBox3d
+ EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
+ ' recupero origine grezzo
+ Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
+ Dim b3Raw As New BBox3d
+ EgtGetRawPartBBox(nrawPartId, b3Raw)
+ ' calcolo distanza tra origine pezzo e tavolo
+ Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
+ m_dPOSY = vtPartRef.y
+ Return vtPartRef.y
+ ' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
+ Else
+ Return m_dPOSY
+ End If
'Return m_dPOSY
End Get
Set(value As Double)
@@ -292,13 +316,13 @@ Public Class PartM
End Set
End Property
- Protected m_bFLIP As Boolean
- Public Property bFLIP As Boolean
+ Protected m_nFLIP As Integer
+ Public Property nFLIP As Integer
Get
- Return m_bFLIP
+ Return m_nFLIP
End Get
- Set(value As Boolean)
- m_bFLIP = value
+ Set(value As Integer)
+ m_nFLIP = value
End Set
End Property
@@ -359,7 +383,7 @@ Public Class PartM
Protected m_sCALC_MSG As String = String.Empty
Public Property sCALC_MSG As String
Get
- Return m_sCALC_MSG
+ Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
@@ -456,6 +480,7 @@ Public Class PartM
EgtGetInfo(nPartId, BTL_PRT_H, NewPartM.m_dBtlH)
EgtGetInfo(nPartId, BTL_PRT_CNT, NewPartM.m_nCNT)
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
+ EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
@@ -490,7 +515,7 @@ Public Class PartM
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
- EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_bFLIP)
+ EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
End If
' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
diff --git a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb
index 4cf8c755..dea2d8ff 100644
--- a/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb
+++ b/EgtBEAMWALL.Core/MachGroupPanel/MyMachGroupVM.vb
@@ -235,6 +235,12 @@ Public MustInherit Class MyMachGroupVM
End Set
End Property
+ Public ReadOnly Property nPartsGlobalState As CalcStates
+ Get
+ Return MyMachGroupM.bCALC_PartsGlobalState
+ End Get
+ End Property
+
Public Property nCALC_State As CalcStates
Get
Return MyMachGroupM.nCALC_State
@@ -431,185 +437,6 @@ Public MustInherit Class MyMachGroupVM
Public Sub SetSupervisorId(SupervisorId As String)
m_SupervisorId = SupervisorId
End Sub
- Public Sub ResetSupervisorId()
- ' resetto stato per MachGroup
- nProduction_State = ItemState.ND
- m_SupervisorId = ""
- ' sblocco duplo di tutti i part
- For Each Part In PartVMList
- Dim nPartId As Integer = Part.nPartId
- ' verifico tipo di progetto
- Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
- Dim nBWType As Integer = 0
- EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
- Dim bTotIsModified As Boolean = False
- ' verifico se c'é PRID sugli outline
- Dim nPRId As Integer = 1
- Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
- If nOutlineLayer <> GDB_ID.NULL Then
- Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
- While nOutlineId <> GDB_ID.NULL
- ' verifico che sia feature
- If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
- If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
- nOutlineId = EgtGetNext(nOutlineId)
- Continue While
- Else
- EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
- nPRId += 1
- End If
- End If
- nOutlineId = EgtGetNext(nOutlineId)
- End While
- End If
- bTotIsModified = True
- Dim DuploList As New List(Of Integer)
- EgtDuploList(nPartId, DuploList)
- Dim DuploArray() As Integer
- Dim RotArray(DuploList.Count) As Integer
- Dim FlipArray(DuploList.Count) As Integer
- Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
- DuploArray = DuploList.ToArray()
- ' recupero ROT (gradi) e FLIP (0/1) per non perderli
- For Duploindex = 0 To DuploArray.Length - 1
- EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
- EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
- If nBWType = BWType.WALL Then
- ' salvo parametri Q
- QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
- ' ciclo sugli outline
- nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
- If nOutlineLayer <> GDB_ID.NULL Then
- Dim nGlobPRId As Integer = 1
- Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
- While nOutlineId <> GDB_ID.NULL
- ' verifico che sia feature
- Dim nPRC As Integer
- If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
- nPRId = 0
- If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
- EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
- nPRId = nGlobPRId
- nGlobPRId += 1
- End If
- Dim sKey As String = nPRId & "." & nPRC
- QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
- For QIndex = 1 To 10
- Dim QKey As String = "Q" & QIndex.ToString("D2")
- Dim QValue As Integer = 0
- If EgtGetInfo(nOutlineId, QKey, QValue) Then
- QArray(Duploindex)(sKey).Add(QKey, QValue)
- End If
- Next
- End If
- nOutlineId = EgtGetNext(nOutlineId)
- End While
- End If
- ' ciclo sulle feature
- Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
- If nFeatureLayer <> GDB_ID.NULL Then
- Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
- While nFeatureId <> GDB_ID.NULL
- ' verifico che sia feature
- Dim nPRC As Integer
- If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
- nPRId = 0
- EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
- Dim sKey As String = nPRId & "." & nPRC
- QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
- For QIndex = 1 To 10
- Dim QKey As String = "Q" & QIndex.ToString("D2")
- Dim QValue As Integer = 0
- If EgtGetInfo(nFeatureId, QKey, QValue) Then
- QArray(Duploindex)(sKey).Add(QKey, QValue)
- End If
- Next
- End If
- nFeatureId = EgtGetNext(nFeatureId)
- End While
- End If
- End If
- Next
- ' sblocco Duplo
- EgtDuploResetLocked(nPartId)
- ' recupero flip e rot dell'originale
- Dim dRotated As Double
- Dim dInverted As Double
- Dim dRotAng As Double
- Dim dFlipAng As Double
- EgtGetInfo(nPartId, BTL_PRT_ROTATED, dRotated)
- EgtGetInfo(nPartId, BTL_PRT_INVERTED, dInverted)
- ' ripristino i valori di ROT e FLIP
- For Duploindex = 0 To DuploArray.Length - 1
- ' recupero box del pezzo
- Dim b3Part As New BBox3d
- EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, b3Part)
- ' faccio flip e rotazione rispetto all'originale che ha sovrascritto posizione del duplo
- dRotAng = RotArray(Duploindex) - dRotated
- EgtRotate(DuploArray(Duploindex), b3Part.Center, -Vector3d.Z_AX, dRotAng)
- dFlipAng = FlipArray(Duploindex) * 180.0 - dInverted
- EgtRotate(DuploArray(Duploindex), b3Part.Center, Vector3d.X_AX, dFlipAng)
- EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
- EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
- If nBWType = BWType.WALL Then
- ' ciclo sugli outline
- nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
- If nOutlineLayer <> GDB_ID.NULL Then
- Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
- While nOutlineId <> GDB_ID.NULL
- ' verifico che sia feature
- Dim nPRC As Integer
- If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
- nPRId = 0
- EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
- Dim sKey As String = nPRId & "." & nPRC
- ' ripristino parametri Q
- If QArray(Duploindex).ContainsKey(sKey) Then
- For Each QPar In QArray(Duploindex)(sKey)
- EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
- Next
- End If
- End If
- nOutlineId = EgtGetNext(nOutlineId)
- End While
- End If
- ' ciclo sulle feature
- Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
- If nFeatureLayer <> GDB_ID.NULL Then
- Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
- While nFeatureId <> GDB_ID.NULL
- ' verifico che sia feature
- Dim nPRC As Integer
- If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
- nPRId = 0
- EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
- Dim sKey As String = nPRId & "." & nPRC
- ' ripristino parametri Q
- If QArray(Duploindex).ContainsKey(sKey) Then
- For Each QPar In QArray(Duploindex)(sKey)
- EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
- Next
- End If
- End If
- nFeatureId = EgtGetNext(nFeatureId)
- End While
- End If
- End If
- Next
- If bTotIsModified Then
- Dim CurrFilePath As String = ""
- EgtGetCurrFilePath(CurrFilePath)
- EgtSaveFile(CurrFilePath, NGE.CMPTEXT)
- End If
- Next
- ' resetto stato per tutti i Part
- For Each Part In PartVMList
- Part.nProduction_State = ItemState.ND
- Part.NotifyPropertyChanged(NameOf(Part.Background))
- Next
- NotifyPropertyChanged(NameOf(IsReadOnly))
- NotifyPropertyChanged(NameOf(Background))
- End Sub
Private m_cc As StateChangeEventArgs
@@ -718,6 +545,8 @@ Public MustInherit Class MyMachGroupVM
Public Overridable Sub CalcGlobalUpdate()
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
MyMachGroupM.nCALC_GlobalState = nCALC_State
+ ' stato globale dei pezzi
+ MyMachGroupM.bCALC_PartsGlobalState = CalcStates.NOTCALCULATED
For Each Part In MyMachGroupM.PartMList
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED And nCALC_State < CalcStates.ERROR_ Then
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
@@ -727,6 +556,9 @@ Public MustInherit Class MyMachGroupVM
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
End If
+ If Part.nCALC_GlobalState > MyMachGroupM.bCALC_PartsGlobalState Then
+ MyMachGroupM.bCALC_PartsGlobalState = Part.nCALC_GlobalState
+ End If
If Part.nCALC_ROT <> 0 Then
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
End If
@@ -734,6 +566,7 @@ Public MustInherit Class MyMachGroupVM
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
End If
Next
+
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
diff --git a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
index 2138f705..15a8cb0e 100644
--- a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
+++ b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
@@ -162,6 +162,18 @@ Public MustInherit Class PartVM
End Set
End Property
+ Public ReadOnly Property sSTOREY As String
+ Get
+ Return m_PartM.sSTOREY
+ End Get
+ End Property
+
+ Public ReadOnly Property sGROUP As String
+ Get
+ Return m_PartM.sGROUP
+ End Get
+ End Property
+
Public ReadOnly Property dVolume As Double
Get
Return m_PartM.dVolume
@@ -248,12 +260,12 @@ Public MustInherit Class PartVM
End Get
End Property
- Public Overridable Property bFLIP As Boolean
+ Public Overridable Property nFLIP As Integer
Get
- Return m_PartM.bFLIP
+ Return m_PartM.nFLIP
End Get
- Set(value As Boolean)
- m_PartM.bFLIP = value
+ Set(value As Integer)
+ m_PartM.nFLIP = value
End Set
End Property
diff --git a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb
index 96ad8e94..93801d43 100644
--- a/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb
+++ b/EgtBEAMWALL.Core/My Project/AssemblyInfo.vb
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogV.xaml b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
index 48149272..29904ebe 100644
--- a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
+++ b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogV.xaml
@@ -65,7 +65,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
diff --git a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb
index dc1109ed..7c87dd58 100644
--- a/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb
+++ b/EgtBEAMWALL.Core/OpenProjectFileDialog/OpenProjectFileDialogVM.vb
@@ -267,6 +267,10 @@ Public MustInherit Class OpenProjectFileDialogVM
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
End If
+ ' setto la visibilità delle colonne delle EgtDataGrid
+ For Each col In ProjectColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
End Sub
Friend Function VerifySelected() As Boolean
diff --git a/EgtBEAMWALL.Core/Utility/Enum.vb b/EgtBEAMWALL.Core/Utility/Enum.vb
index ae322c1b..1e9713ee 100644
--- a/EgtBEAMWALL.Core/Utility/Enum.vb
+++ b/EgtBEAMWALL.Core/Utility/Enum.vb
@@ -58,6 +58,9 @@ Public Enum StatusMapOpType
SupervisorReleaseStop = 11
ResetPartStart = 12
ResetPartEnd = 13
+ ChangeProdInSupervisorRequest = 14
+ ChangeProdInProdRequest = 15
+ OpenPageInViewOptimRequest = 16
End Enum
Public Enum DimensionType
diff --git a/EgtBEAMWALL.Core/Utility/GridDimension.vb b/EgtBEAMWALL.Core/Utility/GridDimension.vb
index 5261bb00..f680a835 100644
--- a/EgtBEAMWALL.Core/Utility/GridDimension.vb
+++ b/EgtBEAMWALL.Core/Utility/GridDimension.vb
@@ -6,6 +6,8 @@ Imports EgtWPFLib5
Public Class GridDimension
Inherits VMBase
+ Private Shared m_SoftwareModActive As Boolean = False
+
Private Property m_GridName As String
Public Property GridName As String
Get
@@ -43,7 +45,7 @@ Public Class GridDimension
End Get
Set(value As GridLength)
m_GridLen = value
- DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
+ If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
End Set
End Property
@@ -64,4 +66,8 @@ Public Class GridDimension
m_GridLen = GridLen
End Sub
+ Public Shared Sub SetSoftwareMod(bActive As Boolean)
+ m_SoftwareModActive = bActive
+ End Sub
+
End Class
diff --git a/EgtBEAMWALL.Core/Utility/LuaMsgManager.vb b/EgtBEAMWALL.Core/Utility/LuaMsgManager.vb
new file mode 100644
index 00000000..174f5d62
--- /dev/null
+++ b/EgtBEAMWALL.Core/Utility/LuaMsgManager.vb
@@ -0,0 +1,30 @@
+Imports EgtUILib
+
+Public Module LuaMsgManager
+
+ Public Function MessageFromLuaMsg(LuaMsg As String) As String
+ ' verifico se inizia con $$
+ If Not String.IsNullOrWhiteSpace(LuaMsg) AndAlso LuaMsg.Length >= 2 AndAlso LuaMsg.Substring(0, 2) = "$$" Then
+ Dim sMsgArgs() As String = LuaMsg.Substring(2).Split(",")
+ Dim nMsg As Integer = -1
+ If sMsgArgs.Count > 1 AndAlso Integer.TryParse(sMsgArgs(0), nMsg) AndAlso nMsg > 0 Then
+ If sMsgArgs.Count > 1 Then
+ Dim sArgs() As String = sMsgArgs.Skip(1).ToArray()
+ Dim sMsg As String = String.Format(EgtMsg(65000 + nMsg), sArgs)
+ If Not String.IsNullOrWhiteSpace(sMsg) Then
+ Return sMsg
+ Else
+ EgtMsg(65000 + nMsg)
+ End If
+ Else
+ Return EgtMsg(65000 + nMsg)
+ End If
+ Else
+ Return LuaMsg
+ End If
+ Else
+ Return LuaMsg
+ End If
+ End Function
+
+End Module
diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/ManageWindow.vb b/EgtBEAMWALL.Core/Utility/ManageWindow.vb
similarity index 95%
rename from EgtBEAMWALL.ViewerOptimizer/Utility/ManageWindow.vb
rename to EgtBEAMWALL.Core/Utility/ManageWindow.vb
index 3f32235d..4e9aebb3 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Utility/ManageWindow.vb
+++ b/EgtBEAMWALL.Core/Utility/ManageWindow.vb
@@ -1,6 +1,6 @@
Imports System.Runtime.InteropServices
-Module ManageWindow
+Public Module ManageWindow
@@ -41,7 +41,7 @@ Module ManageWindow
Public rcNormalPosition As System.Drawing.Rectangle
End Structure
- Friend Sub BringWindowToFront(wdwIntPtr As IntPtr)
+ Public Sub BringWindowToFront(wdwIntPtr As IntPtr)
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
Dim placement As Windowplacement = New Windowplacement()
GetWindowPlacement(wdwIntPtr, placement)
diff --git a/EgtBEAMWALL.Core/ViewPanel/ViewPanelVM.vb b/EgtBEAMWALL.Core/ViewPanel/ViewPanelVM.vb
index 6efe9075..3b75529b 100644
--- a/EgtBEAMWALL.Core/ViewPanel/ViewPanelVM.vb
+++ b/EgtBEAMWALL.Core/ViewPanel/ViewPanelVM.vb
@@ -13,7 +13,7 @@ Public Class ViewPanelVM
End Property
' Posizione vista
- Private Shared m_nViewDir As VT
+ Private Shared m_nViewDir As VT = VT.ISO_SW
Public Shared Function BWSetView(nView As VT, Optional bRedraw As Boolean = True)
' condizioni che cambiano la vista del progetto
diff --git a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs
index f4acc11d..3b3c698b 100644
--- a/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs
+++ b/EgtBEAMWALL.DataLayer/Controllers/MachGroupController.cs
@@ -239,10 +239,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
///
public MachGroupModel FindByMachGroupId(int ProdId, int MachGroupId)
{
- return dbCtx
+
+ using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
+ {
+ return localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.SingleOrDefault();
+ }
}
///
diff --git a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs
index 58babf06..4e5120e3 100644
--- a/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs
+++ b/EgtBEAMWALL.DataLayer/Properties/AssemblyInfo.cs
@@ -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.4.1.5")]
-[assembly: AssemblyFileVersion("2.4.1.5")]
+[assembly: AssemblyVersion("2.4.3.2")]
+[assembly: AssemblyFileVersion("2.4.3.2")]
diff --git a/EgtBEAMWALL.Supervisor/AxesPanel/AxesPanelVM.vb b/EgtBEAMWALL.Supervisor/AxesPanel/AxesPanelVM.vb
index e9ec2012..181c6849 100644
--- a/EgtBEAMWALL.Supervisor/AxesPanel/AxesPanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/AxesPanel/AxesPanelVM.vb
@@ -101,27 +101,35 @@ Public Class Axis
Public ReadOnly Property sValue As String
Get
Dim nDec As Integer = 0
- Select Case Type
- Case AxisTypes.LINEAR
- nDec = -3
- Case AxisTypes.ROTATIONAL
- nDec = -4
- Case Else
- nDec = 0
- End Select
+ If CurrentMachine.NCType = NCTypes.TPA Then
+ nDec = -3
+ Else
+ Select Case Type
+ Case AxisTypes.LINEAR
+ nDec = -3
+ Case AxisTypes.ROTATIONAL
+ nDec = -4
+ Case Else
+ nDec = 0
+ End Select
+ End If
Return DoubleToString(m_dValue, nDec)
End Get
End Property
Friend Sub SetValue(value As Double)
- Select Case Type
- Case AxisTypes.LINEAR
- m_dValue = value / 1000
- Case AxisTypes.ROTATIONAL
- m_dValue = value / 10000
- Case Else
- m_dValue = value
- End Select
+ If CurrentMachine.NCType = NCTypes.TPA Then
+ m_dValue = value
+ Else
+ Select Case Type
+ Case AxisTypes.LINEAR
+ m_dValue = value / 1000
+ Case AxisTypes.ROTATIONAL
+ m_dValue = value / 10000
+ Case Else
+ m_dValue = value
+ End Select
+ End If
NotifyPropertyChanged(NameOf(sValue))
End Sub
diff --git a/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb b/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb
index 372a421c..4159ecd2 100644
--- a/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/CALCPanel/CALCPanelVM.vb
@@ -21,6 +21,8 @@ Public Class CALCPanelVM
Private m_cmdVerifyAll As ICommand
Private m_cmdSimulate As ICommand
+ Private m_ProcessResultList As New List(Of Integer)
+
#Region "Messages"
Public ReadOnly Property Verify_ToolTip As String
@@ -58,6 +60,7 @@ Public Class CALCPanelVM
End Sub
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
+ m_ProcessResultList.Add(e.m_Result.nBarId)
ProcessResults(e.m_Result)
Dim nRawid As Integer = e.m_Result.nBarId
If nRawid <= 0 Then Return
@@ -69,15 +72,26 @@ Public Class CALCPanelVM
If e.End_ <> CalcEndEventArgs.Results.OK Then
MessageBox.Show("Execution error (all processes are disabled)")
End If
+ ' ciclo sui pezzi
+ Dim bNotOkFound As Boolean = False
+ Dim MachGroupList As List(Of MachGroupVM) = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Where(Function(x) m_ProcessResultList.Contains(x.Id)).ToList()
+ For Each MachGroup As MyMachGroupVM In MachGroupList
+ ' se trovo pezzo errato, resetto tutti i successivi
+ If Not bNotOkFound AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.OK AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.INFO Then
+ bNotOkFound = True
+ End If
+ If bNotOkFound Then MachGroup.ResetProduce()
+ Next
+ m_ProcessResultList = New List(Of Integer)
Map.refProjectVM.ManageIsEnabled(True)
Map.refMyStatusBarVM.ResetStopProgress()
End Sub
Private Sub Calc_ProcessEnded(sender As Object, e As CalcProcessEndEventArgs)
- Dim nRawid As Integer = e.m_Result.nBarId
- If nRawid <= 0 Then Return
- Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nRawid)
- Machgroup.CALCEnd()
+ 'Dim nRawid As Integer = e.m_Result.nBarId
+ 'If nRawid <= 0 Then Return
+ 'Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nRawid)
+ 'Machgroup.CALCEnd()
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
@@ -337,8 +351,6 @@ Public Class CALCPanelVM
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
- Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & MachGroup.Name.ToString() & ".ori.bwe"
- If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(MachGroupIndex) = Bar
diff --git a/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb b/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb
index 817602b2..85d87e84 100644
--- a/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb
+++ b/EgtBEAMWALL.Supervisor/Comms/TPAComm.vb
@@ -68,7 +68,7 @@ Public Class TPAComm
Private m_Proxy_ListInfoEventHandler As New ListInfoEventHandler(AddressOf RemoteObject_ListInfoResponse)
Private m_Proxy_RPCUpdateEventHandler As New RPCUpdateEventHandler(AddressOf RemoteObject_RPCUpdate)
Private m_Proxy_VariableCommandExecutedEventHandler As New VariableCommandExecutedEventHandler(AddressOf RemoteObject_VariableCommandExecuted)
- Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
+ 'Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
Private m_Rem_CommandExecutedEventHandler As CommandExecutedEventHandler
Private m_Rem_ServerErrorEventHandler As ServerErrorEventHandler
Private m_Rem_AxesCoordinatesUpdateEventHandler As AxesCoordinatesUpdateEventHandler
@@ -77,7 +77,7 @@ Public Class TPAComm
Private m_Rem_ListInfoEventHandler As ListInfoEventHandler
Private m_Rem_RPCUpdateEventHandler As RPCUpdateEventHandler
Private m_Rem_VariableCommandExecutedEventHandler As VariableCommandExecutedEventHandler
-
+ 'Private m_Rem_TickUpdateEventHandler As TickUpdateEventHandler
Public Sub New(MachManaging As MachManaging)
@@ -110,7 +110,7 @@ Public Class TPAComm
AddHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
AddHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
AddHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
- AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
+ 'AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
_remObject = CType(Activator.GetObject(GetType(ISOCNC.Remoting_Server), serverURI), ISOCNC.Remoting_Server)
Try
@@ -122,6 +122,7 @@ Public Class TPAComm
m_Rem_ListInfoEventHandler = New ListInfoEventHandler(AddressOf m_eventProxy.LocallyHandleListInfo)
m_Rem_RPCUpdateEventHandler = New RPCUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleRPCUpdate)
m_Rem_VariableCommandExecutedEventHandler = New VariableCommandExecutedEventHandler(AddressOf m_eventProxy.LocallyHandleVariableCommandExecuted)
+ 'm_Rem_TickUpdateEventHandler = New TickUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleTickUpdate)
AddHandler _remObject.CommandExecuted, m_Rem_CommandExecutedEventHandler
AddHandler _remObject.ServerError, m_Rem_ServerErrorEventHandler
AddHandler _remObject.AxisCoordinatesUpdate, m_Rem_AxesCoordinatesUpdateEventHandler
@@ -130,6 +131,7 @@ Public Class TPAComm
AddHandler _remObject.ListInfoResponse, m_Rem_ListInfoEventHandler
AddHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler
AddHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler
+ 'AddHandler _remObject.TickUpdate, m_Rem_TickUpdateEventHandler
Catch ex As System.Runtime.Remoting.RemotingException
Dim dR As MessageBoxResult = MessageBox.Show(ex.Message)
End Try
@@ -154,9 +156,10 @@ Public Class TPAComm
RemoveHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
RemoveHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
RemoveHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
- RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
+ 'RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
End Sub
+
Private Sub RemoteObject_OpStateUpdate(ByVal newOpState As ISOCNC.Remoting.MachineOperatingState)
' resetto stato pending iniziale
If Map.refMachManaging.StartPending AndAlso newOpState = MachineOperatingState.Pending Then
@@ -239,6 +242,7 @@ Public Class TPAComm
End Sub
Private Sub RemoteObject_TickUpdate(ByVal newTick As ULong)
+ 'EgtUILib.EgtOutLog("Tick: " & newTick)
End Sub
End Class
diff --git a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageV.xaml b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageV.xaml
index b67d98b7..76155c07 100644
--- a/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageV.xaml
+++ b/EgtBEAMWALL.Supervisor/ConfigurationPage/ConfigurationPageV.xaml
@@ -243,7 +243,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding VariablesColumns}">
@@ -289,50 +289,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- DGColumnsListV.xaml
- FeatureInPartInRawPartListV.xaml
@@ -366,10 +363,6 @@
MSBuild:CompileDesigner
-
- MSBuild:Compile
- Designer
- MSBuild:CompileDesigner
@@ -510,17 +503,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -565,6 +547,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/FeatureInPartInRawPartListV.xaml
index 34cec1b2..325c5409 100644
--- a/EgtBEAMWALL.Supervisor/ItemParamList/FeatureInPartInRawPartListV.xaml
+++ b/EgtBEAMWALL.Supervisor/ItemParamList/FeatureInPartInRawPartListV.xaml
@@ -16,13 +16,12 @@
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
- CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding FeatureInPartInRawPartColumns}"
Style="{StaticResource DataGrid_CustomHighLight}">
diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListV.xaml
index 71a03a42..26271fae 100644
--- a/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListV.xaml
+++ b/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListV.xaml
@@ -15,7 +15,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding PartInRawPartColumns}"
Style="{StaticResource DataGrid_CustomHighLight}">
@@ -156,6 +156,18 @@
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListVM.vb
index b7fcf0bc..647252e0 100644
--- a/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListVM.vb
+++ b/EgtBEAMWALL.Supervisor/ItemParamList/PartInRawPartListVM.vb
@@ -113,6 +113,18 @@ Public Class PartInRawPartListVM
End Get
End Property
+ Public ReadOnly Property GRP_Msg As String
+ Get
+ Return EgtMsg(61624)
+ End Get
+ End Property
+
+ Public ReadOnly Property STOREY_Msg As String
+ Get
+ Return EgtMsg(61623)
+ End Get
+ End Property
+
#End Region ' Messages
#Region "CONSTRUCTOR"
@@ -130,6 +142,10 @@ Public Class PartInRawPartListVM
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
+ ' aggiorno la visibilità delle colonne
+ For Each col In PartInRawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
' nascondo colonna redo
If Not IsNothing(colPartInRawPart_Redo) Then
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
@@ -143,6 +159,13 @@ Public Class PartInRawPartListVM
If Not IsNothing(m_colPartInRawPart_Offset) Then
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Visible
End If
+ ' aggiorno la visibilità delle colonne
+ For Each col In PartInRawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
+ If Not IsNothing(colPartInRawPart_Redo) Then
+ colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
+ End If
If Not IsNothing(m_colPartInRawPart_Rot) Then
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Collapsed
End If
@@ -158,9 +181,6 @@ Public Class PartInRawPartListVM
'PartInRawPartColumns.Clear()
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
ElseIf nMachType = MachineType.WALL Then
- If Not IsNothing(m_colPartInRawPart_Offset) Then
- m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
- End If
If Not IsNothing(m_colPartInRawPart_Rot) Then
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Visible
End If
@@ -173,6 +193,16 @@ Public Class PartInRawPartListVM
If Not IsNothing(m_colPartInRawPart_PosY) Then
m_colPartInRawPart_PosY.ColumnVisibility = Visibility.Visible
End If
+ ' aggiorno la visibilità delle colonne
+ For Each col In PartInRawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
+ If Not IsNothing(colPartInRawPart_Redo) Then
+ colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
+ End If
+ If Not IsNothing(m_colPartInRawPart_Offset) Then
+ m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
+ End If
' PartInRawPartColumns.Clear()
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, PartInRawPartColumns)
End If
diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListV.xaml b/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListV.xaml
index d7991674..48619e52 100644
--- a/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListV.xaml
+++ b/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListV.xaml
@@ -14,7 +14,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding RawPartColumns}"
Style="{StaticResource DataGrid_CustomHighLight}">
@@ -82,7 +82,7 @@
-
+
diff --git a/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListVM.vb b/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListVM.vb
index a23ca2fd..0d2bbcd4 100644
--- a/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListVM.vb
+++ b/EgtBEAMWALL.Supervisor/ItemParamList/RawPartListVM.vb
@@ -97,7 +97,15 @@ Public Class RawPartListVM
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
+ ' aggiorno la visibilità delle colonne
+ For Each col In RawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
ElseIf nMachType = MachineType.WALL Then
+ ' aggiorno la visibilità delle colonne
+ For Each col In RawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
End If
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
index 39e30e7b..7dcae299 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
@@ -410,9 +410,6 @@ Public Class LeftPanelVM
m_OPModeList = New List(Of OPState) From {
New OPState("Manual", OPModes.Manual)
}
- ' imposto stato manuale
- Dim ManualMode As OPState = m_OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
- SetOPState(ManualMode)
Case NCTypes.NUM_FLEXIUM
m_OPModeList = New List(Of OPState) From {
New OPState("Auto", OPModes.Auto),
@@ -455,7 +452,7 @@ Public Class LeftPanelVM
If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList) OrElse Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0 Then Return
If Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State <= ItemState.Confirmed) Then Return
- If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.dtStartTime <> DateTime.MinValue) Then Return
+ If Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.dtStartTime = DateTime.MinValue) Then Return
Dim ToDoList As List(Of MachGroupVM) = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Where(Function(x As MyMachGroupVM) x.nProduction_State <= 1 AndAlso Not x.bResetWhileCutting AndAlso x.dtStartTime = DateTime.MinValue AndAlso Not x.bToBeProduced).ToList()
If Not IsNothing(ToDoList) AndAlso ToDoList.Count > 0 Then
MyMachGroupVM.Produce(ToDoList)
@@ -494,6 +491,8 @@ Public Class LeftPanelVM
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
SetDonePart(SelMachGroup, Part)
Next
+ ' riseleziono il gruppo
+ Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
' aggiorno bottoni
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
@@ -586,32 +585,8 @@ Public Class LeftPanelVM
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, SelMachGroup.nProductionIndex)
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex - 1)
-
-
-
- '' scrivo tutti pezzi completati
- 'For PartIndex = 0 To SelMachGroup.PartVMList.Count - 1
- ' Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
- ' ' reset start, end e stato pezzo
- ' DbControllers.m_PartController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
- ' DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
- ' DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
- ' Part.dtStartTime = DateTime.MinValue
- ' Part.dtEndTime = DateTime.MinValue
- ' Part.nProduction_State = ItemState.ND
-
- ' Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
- 'Next
- '' reset start, end e stato MachGroup
- 'DbControllers.m_MachGroupController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
- 'DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
- 'DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, ItemState.WIP)
- 'SelMachGroup.dtStartTime = DateTime.MinValue
- 'SelMachGroup.dtEndTime = DateTime.MinValue
- 'SelMachGroup.nProduction_State = ItemState.ND
- 'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Production_Background))
- 'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Produce_IsEnabled))
-
+ ' riseleziono il gruppo
+ Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
' aggiorno bottoni
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
@@ -709,10 +684,15 @@ Public Class LeftPanelVM
For Each Part In SelMachGroup.PartVMList
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
Next
+ Dim nRemovedIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(SelMachGroup)
' se rimozione da Db ok, lo rimuovo da lista
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Remove(SelMachGroup)
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0 Then
+ EgtResetCurrMachGroup()
ManageBTLParts.HideAll()
+ Else
+ If nRemovedIndex >= Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count Then nRemovedIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1
+ Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList(nRemovedIndex)
End If
End If
End Sub
diff --git a/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml b/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml
index 5f0c602f..1389cef9 100644
--- a/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml
+++ b/EgtBEAMWALL.Supervisor/MDIPage/MDIPageV.xaml
@@ -17,7 +17,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5"
BindingColumns="{Binding MDICommandColumns}"
Style="{StaticResource DataGrid_CustomHighLight}">
diff --git a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelVM.vb b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelVM.vb
index a2acd25d..7fdd69f7 100644
--- a/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachCommandMessagePanel/MachCommandMessagePanelVM.vb
@@ -521,6 +521,9 @@ Public Class MachCommandMessagePanelVM
_Connected = True
NotifyPropertyChanged(NameOf(Connect_Background))
If ResultType = ResultTypes.EXECUTED Then
+ ' avvio tick di comunicazione con la macchina
+ MachineCommThread.StartTick()
+ ' inizializzo variabili
Init()
End If
End If
@@ -549,9 +552,9 @@ Public Class MachCommandMessagePanelVM
Select Case AlarmType
Case CInt(ISOCNC.Remoting.AlarmType.Cycle)
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
- m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
+ m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
Else
- m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
+ m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
'Dim ToRemove As Alarm = m_ErrCycle.FirstOrDefault(Function(x) x.sCode = AlarmCode)
'If Not IsNothing(ToRemove) Then
' m_ErrCycle.Remove(ToRemove)
@@ -559,9 +562,9 @@ Public Class MachCommandMessagePanelVM
End If
Case CInt(ISOCNC.Remoting.AlarmType.ISO)
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
- m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
+ m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
Else
- m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
+ m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
'Dim ToRemove As Alarm = m_Iso.FirstOrDefault(Function(x) x.sCode = AlarmCode)
'If Not IsNothing(ToRemove) Then
' m_Iso.Remove(ToRemove)
@@ -580,9 +583,9 @@ Public Class MachCommandMessagePanelVM
Case CInt(ISOCNC.Remoting.AlarmType.None)
Case CInt(ISOCNC.Remoting.AlarmType.System)
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
- m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
+ m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
Else
- m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
+ m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
'Dim ToRemove As Alarm = m_ErrSystem.FirstOrDefault(Function(x) x.sCode = AlarmCode)
'If Not IsNothing(ToRemove) Then
' m_ErrSystem.Remove(ToRemove)
diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb
index 2c006d6c..8485abb0 100644
--- a/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/MyMachGroupVM.vb
@@ -124,7 +124,19 @@ Public Class MyMachGroupVM
End Sub
Public Overrides Sub RefreshPartList()
-
+ If nType = BWType.BEAM Then
+ ' leggo StartCut da posizione primo pezzo
+ Dim sInfo As String = ""
+ Dim sSplitInfo() As String
+ Dim bFound As Boolean = False
+ EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
+ If Not String.IsNullOrWhiteSpace(sInfo) Then
+ sSplitInfo = sInfo.Split(","c)
+ StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
+ Else
+ MyMachGroupM.dStartCut = 0
+ End If
+ End If
End Sub
#End Region ' Parts
@@ -134,8 +146,13 @@ Public Class MyMachGroupVM
Public Overrides Sub CALCEnd()
' aggiorno stato per lancio in macchina
If MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.OK OrElse MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.INFO Then
- m_bCNReCalculated = True
- NotifyPropertyChanged(NameOf(Production_Background))
+ If m_bToBeProduced AndAlso Not m_bCNReCalculated Then
+ m_bCNReCalculated = True
+ NotifyPropertyChanged(NameOf(Production_Background))
+ End If
+ Else
+ ResetProduce()
+ UpdateProduceIsEnabledForAll()
End If
End Sub
@@ -351,7 +368,7 @@ Public Class MyMachGroupVM
EgtBeamEnableProcess(Feature.nFeatureId, bOk)
Next
' scrivo dati costruzione grezzo in gruppo di lavorazione
- EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nDone, nPartDuploId & "," & CurrPart.sPOSX - dInitialCutOut)
+ EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nDone, nPartDuploId & "," & DoubleToString(CurrPart.dPOSX - dInitialCutOut, 3))
Else
dInitialCutOut += CurrPart.dOffset + CurrPart.dL
End If
diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/PartVM.vb
index 6d30358c..dec09e14 100644
--- a/EgtBEAMWALL.Supervisor/MachGroupPanel/PartVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/PartVM.vb
@@ -32,6 +32,15 @@ Public Class PartVM
NotifyPropertyChanged(NameOf(bDO))
End Sub
+ Public Property bFLIP As Boolean
+ Get
+ Return m_PartM.nFLIP <> 0
+ End Get
+ Set(value As Boolean)
+ Return
+ End Set
+ End Property
+
#End Region ' Supervisor
#End Region ' FIELDS & PROPERTIES
diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/SupervisorMachGroupPanelVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/SupervisorMachGroupPanelVM.vb
index 5d36a4d7..c080578b 100644
--- a/EgtBEAMWALL.Supervisor/MachGroupPanel/SupervisorMachGroupPanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/SupervisorMachGroupPanelVM.vb
@@ -12,6 +12,9 @@ Public Class SupervisorMachGroupPanelVM
#Region "FIELDS & PROPERTIES"
+ Private m_ReloadProj_Timer As New DispatcherTimer
+ Private m_bReloadProj As Boolean = False
+
' lock per aggiunta elemento a lista MachGroup
Private m_Lock_AddMachGroup As New Object
@@ -37,8 +40,8 @@ Public Class SupervisorMachGroupPanelVM
Map.SetRefSupervisorMachGroupPanelVM(Me)
BindingOperations.EnableCollectionSynchronization(m_MachGroupVMList, m_Lock_AddMachGroup)
m_ReloadProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
- m_ReloadProj_Timer.Start()
AddHandler m_ReloadProj_Timer.Tick, AddressOf ReloadProject_Tick
+ m_ReloadProj_Timer.Start()
End Sub
#End Region ' CONSTRUCTOR
@@ -56,9 +59,6 @@ Public Class SupervisorMachGroupPanelVM
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
End Sub
- Private m_bReloadProj As Boolean = False
- Private m_ReloadProj_Timer As New DispatcherTimer
-
Public Sub ReloadProjectFile()
m_bReloadProj = True
End Sub
diff --git a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb
index d5a4085a..24481118 100644
--- a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb
+++ b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManaging.vb
@@ -403,6 +403,14 @@ Public Class MachManaging
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
+ ' se non impostata data start
+ If Part.dtStartTime = DateTime.MinValue Then
+ ' scrivo data start su Db pezzo
+ Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
+ DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
+ Part.dtStartTime = dtStart
+ End If
+
Next
Else
' scrivo data end su Db pezzo
@@ -417,12 +425,6 @@ Public Class MachManaging
' resetto stato redo
Part.bRedo = False
End If
- 'Select Case CurrentMachine.NCType
- ' Case NCTypes.TPA
- ' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
- ' Case NCTypes.NUM_FLEXIUM
- ' StateVariable.sValue = "0"
- 'End Select
' se tutti i pezzi della barra sono in end
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
@@ -438,15 +440,24 @@ Public Class MachManaging
MachGroupVariable.sValue = "0"
PartVariable.sValue = "0"
StateVariable.sValue = "0"
- ' azzero variabile per far ripartire macchina
- 'Select Case CurrentMachine.NCType
- ' 'Case NCTypes.TPA
- ' ' Tpa.RWVariableManager.WriteVar(P_PROD, 0)
- ' ' Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
- ' ' Tpa.RWVariableManager.WriteVar(P_PART, 0)
- ' ' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
- 'End Select
+ ' se non impostata data start
+ If MachGroup.dtStartTime = DateTime.MinValue Then
+ EgtOutLog("Start date not set on Prod " & nP_Prod & " Machgroup " & nP_Machgroup)
+ Dim dtStart As DateTime = MachGroup.dtEndTime - TimeSpan.FromSeconds(60)
+ ' provo a recuperare tempo stimato
+ If MachGroup.nCALC_TIME > 0 Then
+ Dim MinPartStart As DateTime = MachGroup.PartVMList.Min(Function(x) x.dtStartTime)
+ If MinPartStart > DateTime.MinValue Then
+ dtStart = New DateTime(Math.Min((MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)).Ticks, MinPartStart.Ticks))
+ Else
+ dtStart = MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)
+ End If
+ End If
+ ' scrivo data start su Db barra
+ DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
+ MachGroup.dtStartTime = dtStart
+ End If
' resetto stati di produzione
MachGroup.ResetProduce()
' se partenza pezzi uno a uno
@@ -605,6 +616,9 @@ Public Class MachManaging
m_CN = New TPAComm(Me)
m_bConnected = Tpa.remObject.OnConnect()
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
+ ' imposto stato manuale
+ Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
+ Map.refLeftPanelVM.SetOPMode(ManualMode)
' creo classe di gestione variabili
Catch ex As Exception
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
diff --git a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManagingThread.vb b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManagingThread.vb
index a602c688..555b29f4 100644
--- a/EgtBEAMWALL.Supervisor/MachManagingThread/MachManagingThread.vb
+++ b/EgtBEAMWALL.Supervisor/MachManagingThread/MachManagingThread.vb
@@ -4,10 +4,14 @@ Class MachineCommThread
' variabile che ferma il ciclo
Private Shared m_Stop As Boolean = False
+ Private Shared m_StartTick As Boolean = False
Friend Shared Sub StopThread()
m_Stop = True
End Sub
+ Friend Shared Sub StartTick()
+ m_StartTick = True
+ End Sub
' variabile in cui ci sono stati inizio e fine pezzo
Private Shared sP1VarName As String = "0.FUNM.E81295"
@@ -37,7 +41,9 @@ Class MachineCommThread
While Not m_Stop
' eseguo ciclo principale che tiene vivo il thread
- m_MachManaging.Timer_Tick()
+ If m_StartTick Then
+ m_MachManaging.Timer_Tick()
+ End If
Threading.Thread.Sleep(TimeSpan.FromMilliseconds(1000))
End While
diff --git a/EgtBEAMWALL.Supervisor/MainMenu/MainMenuV.xaml b/EgtBEAMWALL.Supervisor/MainMenu/MainMenuV.xaml
index 161146c1..40541622 100644
--- a/EgtBEAMWALL.Supervisor/MainMenu/MainMenuV.xaml
+++ b/EgtBEAMWALL.Supervisor/MainMenu/MainMenuV.xaml
@@ -6,14 +6,22 @@
+
+
0 Then
+ For Each p As Process In localProc
+ ' porto in primo piano il ViewerOptimizer
+ BringWindowToFront(p.MainWindowHandle)
+ DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.VIEW, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
+ Exit For
+ Next
+ Else
+ Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
+ Try
+ Process.Start(sViewerOptimizerPath, "2 " & Pages.VIEW)
+ Catch ex As Exception
+ EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
+ End Try
+ End If
+ End Sub
+
+#End Region ' Viewer
+
+#Region "Optimizer"
+
+ Public ReadOnly Property Optimizer_Command As ICommand
+ Get
+ If m_cmdOptimizer Is Nothing Then
+ m_cmdOptimizer = New Command(AddressOf Optimizer)
+ End If
+ Return m_cmdOptimizer
+ End Get
+ End Property
+
+ Public Sub Optimizer()
+ Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
+ ' recupero processo del supervisore
+ Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
+ If localProc.Length > 0 Then
+ For Each p As Process In localProc
+ ' porto in primo piano il ViewerOptimizer
+ BringWindowToFront(p.MainWindowHandle)
+ DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.MACHINING, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
+ Exit For
+ Next
+ Else
+ Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
+ Try
+ Process.Start(sViewerOptimizerPath, "2 " & Pages.MACHINING)
+ Catch ex As Exception
+ EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
+ End Try
+ End If
+ End Sub
+
+#End Region ' Optimizer
+
+#End Region ' COMMANDS
+
End Class
\ No newline at end of file
diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb
index 479e0db5..554257f0 100644
--- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb
+++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowM.vb
@@ -229,8 +229,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
- Dim bKey As Boolean = EgtGetKeyLevel(5327, 2401, 1, m_nKeyLevel) And
- EgtGetKeyOptions(5327, 2401, 1, m_nKeyOptions)
+ Dim bKey As Boolean = EgtGetKeyLevel(5327, 2403, 1, m_nKeyLevel) And
+ EgtGetKeyOptions(5327, 2403, 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())
diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
index affd1e30..8097d818 100644
--- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
+++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
@@ -101,25 +101,35 @@ Public Class MainWindowVM
' apro in modalita' VIEW
' Map.refMainMenuVM.SelPage = Pages.VIEW
- ' setto il primo file dalla lista degli MRU come prod corrente da aprire
- Dim sLastProdPath As String = String.Empty
- GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
- If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
- ' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
- Dim PdId As Integer = 0
- Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
- Integer.TryParse(sPdId, PdId)
- Map.refSupervisorManagerVM.SetCurrProd(PdId)
- ' apro prod
- If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
- End If
+ ' imposto MainWindow per finestra di Loading
+ LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
+
+ ' leggo riga di comando
+ Dim nCommandType As Integer = 0
+ Dim nPage As Pages = Pages.VIEW
+ Dim nProdId As Integer = 0
+ If ProcessCommandLine(nCommandType, nProdId) AndAlso nCommandType = 1 Then
+ Map.refSupervisorManagerVM.SetCurrProd(nProdId)
+ Else
+ ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
+ Dim sLastProdPath As String = String.Empty
+ GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
+ If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
+ ' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
+ Dim PdId As Integer = 0
+ Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
+ Integer.TryParse(sPdId, PdId)
+ Map.refSupervisorManagerVM.SetCurrProd(PdId)
+ End If
+ End If
+ ' apro prod
+ If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
' apro in modalita' SUPERVISOR
Map.refMainMenuVM.SelPage = Pages.SUPERVISOR
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.FeatureList_Visibility))
-
' inizializzo thread di aggiornamento e comunicazione con DB
' creo thread gestione macchina
m_ViewerOptimizerCommThread = New Thread(Sub()
@@ -128,10 +138,23 @@ Public Class MainWindowVM
m_ViewerOptimizerCommThread.SetApartmentState(ApartmentState.STA)
' avvio thread di gestione della macchina che avvia la connessione
m_ViewerOptimizerCommThread.Start()
-
-
End Sub
+ Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nProdId As Integer) As Boolean
+ ' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
+ If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
+ ' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
+ Dim sFile As String = Environment.GetCommandLineArgs(1)
+ If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
+ Select Case nCommandType
+ Case 1 ' apri progetto in supervisore
+ ' recupero secondo parametro
+ Dim sProdId As String = Environment.GetCommandLineArgs(2)
+ If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
+ Return True
+ End Select
+ End Function
+
Friend Sub KeyDown(PressedKey As Key)
' Con ESC esco dall'azione corrente
If PressedKey = Key.Escape Then
diff --git a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb
index f0c44735..c2cf70b2 100644
--- a/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb
+++ b/EgtBEAMWALL.Supervisor/My Project/AssemblyInfo.vb
@@ -55,5 +55,5 @@ Imports System.Windows
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb
index cafad4e7..22a263ba 100644
--- a/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb
+++ b/EgtBEAMWALL.Supervisor/OutputsPage/OutputsPageVM.vb
@@ -25,7 +25,7 @@ Public Class OutputsPageVM
Sub New()
'' imposto riferimento in Map
'Map.SetRefOutputsPageVM(Me)
- m_OutputVariableListVM = New VariablesListVM(S_outPUTVARIABLES)
+ m_OutputVariableListVM = New VariablesListVM(S_OUTPUTVARIABLES)
End Sub
#End Region ' Constructor
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/DxfOut.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/DxfOut.png
deleted file mode 100644
index 85420e4e..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/DxfOut.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Export.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Export.png
deleted file mode 100644
index 472f5dd9..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Export.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/GoToProd.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/GoToProd.png
new file mode 100644
index 00000000..8eb96660
Binary files /dev/null and b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/GoToProd.png differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Import.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Import.png
deleted file mode 100644
index 1e19eab7..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Import.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/New.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/New.png
deleted file mode 100644
index 78a5a0b3..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/New.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Options.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Options.png
deleted file mode 100644
index 6fb84bbc..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Options.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/SaveAs.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/SaveAs.png
deleted file mode 100644
index 1d5cfaef..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/SaveAs.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Send.png b/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Send.png
deleted file mode 100644
index a9bcbe4c..00000000
Binary files a/EgtBEAMWALL.Supervisor/Resources/ProjectManager/Send.png and /dev/null differ
diff --git a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb
index d0d85ffa..753497b0 100644
--- a/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb
+++ b/EgtBEAMWALL.Supervisor/SceneHost/MySceneHostVM.vb
@@ -235,6 +235,7 @@ Public Class MySceneHostVM
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
' Procedo a seconda del risultato
If bOk Then
+ LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 2, EgtMsg(63003), 50, 70) ' Loading machining groups
' leggo MachGroup
Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml
index c618c841..a70f8630 100644
--- a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml
+++ b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerV.xaml
@@ -6,7 +6,7 @@
IsRightDockable="False"
IsEnabled="{Binding SupervisorManager_IsEnabled}"
Style="{StaticResource ToolBar_EgtFloatingPanel}">
-
+
-
-
-
-
diff --git a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb
index 828e33ae..80fca4de 100644
--- a/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb
+++ b/EgtBEAMWALL.Supervisor/SupervisorManager/SupervisorManagerVM.vb
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.IO
+Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtBEAMWALL.DataLayer.DatabaseModels
@@ -11,6 +12,10 @@ Public Class SupervisorManagerVM
#Region "FIELDS & PROPERTIES"
+ Private m_OpenProj_Timer As New DispatcherTimer
+ Private m_bOpenProj As Boolean = False
+ Private m_nProjIdToOpen As Integer = GDB_ID.NULL
+
Private m_SupervisorManager_IsEnabled As Boolean = True
Public ReadOnly Property SupervisorManager_IsEnabled As Boolean
Get
@@ -70,7 +75,7 @@ Public Class SupervisorManagerVM
Private m_cmdOpen As ICommand
Private m_cmdOpenMruFile As ICommand
'Private m_cmdSave As ICommand
- 'Private m_cmdGoToProj As ICommand
+ Private m_cmdGoToProd As ICommand
'#Region "ToolTip"
@@ -97,6 +102,10 @@ Public Class SupervisorManagerVM
Map.SetRefSupervisorManagerVM(Me)
' Impostazioni MruLists
m_MruFiles.Init(S_MRUSUPERVISORPRODFILES, 8)
+ ' imposto timer di apertura da ottimizzatore
+ m_OpenProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
+ AddHandler m_OpenProj_Timer.Tick, AddressOf OpenProject_Tick
+ m_OpenProj_Timer.Start()
End Sub
#End Region ' CONSTRUCTOR
@@ -129,6 +138,24 @@ Public Class SupervisorManagerVM
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList)
End Sub
+ Public Sub OpenProjectFromOptimizer(ProjIdToOpen As Integer)
+ If ProjIdToOpen <> Map.refSupervisorManagerVM.m_CurrProd.nProdId Then
+ m_nProjIdToOpen = ProjIdToOpen
+ m_bOpenProj = True
+ End If
+ End Sub
+
+ Public Sub OpenProject_Tick()
+ If Not m_bOpenProj Then Return
+ m_bOpenProj = False
+ ' recupero progetto da Id
+ Dim DbProject As ProdFileM
+ DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
+ Dim ProjectVM As New ProdFileVM(DbProject)
+ OpenProject(ProjectVM)
+ m_nProjIdToOpen = GDB_ID.NULL
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -194,9 +221,12 @@ Public Class SupervisorManagerVM
m_bLoadingProd = False
Return
End If
+ LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
m_CurrProd = TempCurrProd
Map.refMainWindowVM.UpdateTitle()
+ ' inizializzo visibilita' bottone done per i Part
+ Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
'If Map.refMachGroupPanelVM.InitMachGroupList() Then
' m_CurrProd = TempCurrProd
' Map.refMainWindowVM.SetTitle(CurrProd.nProdId.ToString("0000") & " - EgtBEAMWALL")
@@ -215,6 +245,7 @@ Public Class SupervisorManagerVM
Map.refSceneHostVM.MainController.NewProject()
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
End If
+ LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
' apro sessione di comunicazione e fisso indice a 0
DbControllers.m_StatusMapController.StartProd(Map.refSupervisorManagerVM.CurrProd.nProdId, m_SupervisorId)
@@ -257,6 +288,7 @@ Public Class SupervisorManagerVM
Map.refProjectVM.SupervisorMachGroupPanelVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList))
m_bLoadingProd = False
NotifyPropertyChanged(NameOf(MruFileNames))
+ LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
End Sub
#End Region ' OpenCommand
@@ -292,6 +324,49 @@ Public Class SupervisorManagerVM
#End Region ' OpenMruFileCommand
+#Region "GoToProd"
+
+ '''
+ ''' Returns a command that do Open.
+ '''
+ Public ReadOnly Property GoToProd_Command As ICommand
+ Get
+ If m_cmdGoToProd Is Nothing Then
+ m_cmdGoToProd = New Command(AddressOf GoToProd)
+ End If
+ Return m_cmdGoToProd
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Open. This method is invoked by the OpenCommand.
+ '''
+ Friend Sub GoToProd()
+ If IsNothing(m_CurrProd) Then Return
+ ' apro ottimizzatore
+ Dim sOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
+ ' recupero processo del supervisore
+ Dim localProc As Process() = Process.GetProcessesByName(sOptimizerName)
+ If localProc.Length > 0 Then
+ For Each p As Process In localProc
+ ' porto in primo piano il Supervisor
+ BringWindowToFront(p.MainWindowHandle)
+ Exit For
+ Next
+ Else
+ Dim sOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sOptimizerName & ".exe"
+ Try
+ Process.Start(sOptimizerPath, "1 " & CurrProd.nProdId)
+ Catch ex As Exception
+ EgtOutLog("Error: impossible starting optimizer from path " & sOptimizerPath)
+ End Try
+ End If
+ ' mando richiesta di apertura progetto in ottimizzatore
+ DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInProdRequest, "")
+ End Sub
+
+#End Region ' GoToProd
+
#End Region ' Commands
End Class
diff --git a/EgtBEAMWALL.Supervisor/Utility/CurrentMachine.vb b/EgtBEAMWALL.Supervisor/Utility/CurrentMachine.vb
index dbb9cf73..23e380dc 100644
--- a/EgtBEAMWALL.Supervisor/Utility/CurrentMachine.vb
+++ b/EgtBEAMWALL.Supervisor/Utility/CurrentMachine.vb
@@ -160,6 +160,8 @@ Public Module CurrentMachine
' inizializzo assi
Map.refAxesPanelVM.LoadAxes()
+ ' imposto visibilita' input output
+ Map.refMainMenuVM.SetInputOutputVisibility()
' leggo parametri macchina da WallData
If nType = MachineType.WALL Then
' Assegno i dati
@@ -201,8 +203,6 @@ Public Module CurrentMachine
Map.refLeftPanelVM.LoadChannels()
Map.refLeftPanelVM.LoadOPStates()
Map.refLeftPanelVM.LoadOPModes()
- ' inizializzo visibilita' bottone done per i Part
- Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
End Sub
#End Region 'Init
diff --git a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml
index 72af53ff..9c013a1a 100644
--- a/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml
+++ b/EgtBEAMWALL.Supervisor/Utility/Dictionary.xaml
@@ -276,6 +276,14 @@
+
+
-
-
-
-
-
-
-
-
- DGColumnsListV.xaml
- FreeContourManagerV.xaml
@@ -251,10 +256,17 @@
+
+
+ UpdateBTLWndV.xaml
+
+
+
+ UpdateOrAppendWndV.xaml
+
-
@@ -356,6 +368,14 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -404,10 +424,6 @@
DesignerMSBuild:Compile
-
- MSBuild:Compile
- Designer
- DesignerMSBuild:Compile
@@ -436,6 +452,14 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -848,6 +872,15 @@
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
index 9de74afc..4ea21a8a 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
@@ -28,6 +28,15 @@
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
index afcc8a1b..d07dbb00 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
@@ -13,6 +13,12 @@ Public Class MyInstrumentPanelVM
End Get
End Property
+ Public ReadOnly Property ChangeMaterial_Visibility As Visibility
+ Get
+ Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
+ End Get
+ End Property
+
Private m_InstrumentPanel_IsEnabled As Boolean = True
Public Property InstrumentPanel_IsEnabled As Boolean
Get
@@ -48,7 +54,7 @@ Public Class MyInstrumentPanelVM
' aggiorno valori totali
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
' aggiorno conto materiali usati
- Map.refStatisticsVM.LoadRawPart()
+ If Not IsNothing(Map.refProdManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
' seleziono pagina Statistics
Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.STATISTICS)
Else
@@ -66,6 +72,7 @@ Public Class MyInstrumentPanelVM
' Definizione comandi
Private m_cmdData As ICommand
Private m_cmdChangeParameter As ICommand
+ Private m_cmdChangeMaterial As ICommand
Private m_cmdStatistics As ICommand
#Region "Messages"
@@ -76,6 +83,12 @@ Public Class MyInstrumentPanelVM
End Get
End Property
+ Public ReadOnly Property ChangeMaterial_ToolTip As String
+ Get
+ Return EgtMsg(61961)
+ End Get
+ End Property
+
Public ReadOnly Property Statistics_Msg As String
Get
Return EgtMsg(61923)
@@ -167,6 +180,7 @@ Public Class MyInstrumentPanelVM
Dim ChangeParameterWndVM As New ChangeParameterWndVM
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
If ChangeParameterWnd.ShowDialog() Then
+ LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEPARAM, 1, EgtMsg(63014), "", 100) ' Modifying parameters
' faccio passare pezzi
If Not IsNothing(ChangeParameterWndVM.SelParam) Then
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
@@ -228,11 +242,48 @@ Public Class MyInstrumentPanelVM
'Next
Next
End If
+ LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
End If
End Sub
#End Region ' ChangeParameter
+#Region "ChangeMaterial"
+
+ '''
+ ''' Returns a command that do Open.
+ '''
+ Public ReadOnly Property ChangeMaterial_Command As ICommand
+ Get
+ If m_cmdChangeMaterial Is Nothing Then
+ m_cmdChangeMaterial = New Command(AddressOf ChangeMaterial)
+ End If
+ Return m_cmdChangeMaterial
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Open. This method is invoked by the OpenCommand.
+ '''
+ Friend Sub ChangeMaterial()
+ If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
+ (Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
+ Dim ChangeMaterialWndVM As New ChangeMaterialWndVM
+ Dim ChangeMaterialWnd As New ChangeMaterialWndV(Application.Current.MainWindow, ChangeMaterialWndVM)
+ If ChangeMaterialWnd.ShowDialog() Then
+ LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEMATERIAL, 1, EgtMsg(63021), "", 100) ' Modifying materials
+ ' faccio passare pezzi
+ If Not IsNothing(ChangeMaterialWndVM.SelProjMaterial) AndAlso Not IsNothing(ChangeMaterialWndVM.SelWhMaterial) Then
+ For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.sMATERIAL = ChangeMaterialWndVM.SelProjMaterial)
+ Part.sMATERIAL = ChangeMaterialWndVM.SelWhMaterial
+ Next
+ End If
+ LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEMATERIAL)
+ End If
+ End Sub
+
+#End Region ' ChangeMaterial
+
#End Region ' COMMANDS
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml
index a3df9bc6..c24d67a4 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml
@@ -95,9 +95,11 @@
-
+
-
+
@@ -133,13 +135,15 @@
-
+
-
+
+
@@ -143,7 +154,7 @@
-
+
@@ -156,7 +167,7 @@
-
+
@@ -187,6 +198,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb
index 2688e8ad..8509aff8 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/PartInRawPartListVM.vb
@@ -102,6 +102,18 @@ Public Class PartInRawPartListVM
End Get
End Property
+ Public ReadOnly Property GRP_Msg As String
+ Get
+ Return EgtMsg(61624)
+ End Get
+ End Property
+
+ Public ReadOnly Property STOREY_Msg As String
+ Get
+ Return EgtMsg(61623)
+ End Get
+ End Property
+
#End Region ' Messages
#Region "CONSTRUCTOR"
@@ -110,7 +122,7 @@ Public Class PartInRawPartListVM
' aggiungo riferimento a map
Map.SetRefPartInRawPartListVM(Me)
' carico le colonne della datagrid
- GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
+ 'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
End Sub
#End Region ' CONSTRUCTOR
@@ -129,6 +141,10 @@ Public Class PartInRawPartListVM
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
+ ' aggiorno la visibilità delle colonne
+ For Each col In PartInRawPartColumns
+ col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
+ Next
End Sub
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml
index 370ae2ba..b4af8f1c 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParamListV.xaml
@@ -96,7 +96,7 @@
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5">
diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml
index fdee02f5..7d9b4783 100644
--- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/QParameterListV.xaml
@@ -4,19 +4,19 @@
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
-
+
+
@@ -88,7 +99,7 @@
+ RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>