diff --git a/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb b/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
index 3ee4b5b6..0a71bddb 100644
--- a/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
+++ b/EgtBEAMWALL.Core/EgtDataGrid/DataGridColumnsIniFile.vb
@@ -33,8 +33,6 @@ Public Module DataGridColumnsIniFile
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
If bVisible Then
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
- Else
- Exit While
End If
End If
colIndex += 1
@@ -46,4 +44,38 @@ Public Module DataGridColumnsIniFile
Return WritePrivateProfileString(ParentDataGridName, DisplayIndex, sColumnParams, m_sDataGridColumnsIniFile)
End Function
+ ' funzione per ottenere dal file INI le colonne da caricare nelle EgtDataGrid del programma
+ Public Function GetPrivateProfileColumn(ParentDGName As String, ByRef Column As EgtDataGridColumn) As Boolean
+ Dim colIndex As Integer = 0
+ Dim str = String.Empty
+ While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
+ Dim sColumnParams() As String = str.Split(","c)
+ ' verifico numero minimo di parametri
+ If sColumnParams.Count >= 9 Then
+ If Column.Name = sColumnParams(0) Then
+ ' cancello spazi
+ For index = 0 To sColumnParams.Count - 1
+ sColumnParams(index) = sColumnParams(index).Trim()
+ Next
+ ' creo colonna
+ Dim sName = sColumnParams(0)
+ Dim bReorder As Boolean = sColumnParams(1).Equals("1")
+ Dim bResize As Boolean = sColumnParams(2).Equals("1")
+ Dim bSort As Boolean = sColumnParams(3).Equals("1")
+ Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
+ Dim Width As Double
+ Dim WidthType As DataGridLengthUnitType
+ StringToDouble(sColumnParams(5), Width)
+ 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)
+ Exit While
+ End If
+ End If
+ colIndex += 1
+ End While
+ Return Not IsNothing(Column)
+ End Function
+
End Module
\ No newline at end of file
diff --git a/EgtBEAMWALL.Core/Enum.vb b/EgtBEAMWALL.Core/Enum.vb
index 8a1ff3cc..f8839a84 100644
--- a/EgtBEAMWALL.Core/Enum.vb
+++ b/EgtBEAMWALL.Core/Enum.vb
@@ -38,6 +38,7 @@ Public Enum StatusMapItemType
Prod = 0
MachGroup = 1
Part = 2
+ Comm = 3
End Enum
Public Enum StatusMapOpType
diff --git a/EgtBEAMWALL.Core/Integration/CalcIntegration.vb b/EgtBEAMWALL.Core/Integration/CalcIntegration.vb
index d52c9b75..5db735ba 100644
--- a/EgtBEAMWALL.Core/Integration/CalcIntegration.vb
+++ b/EgtBEAMWALL.Core/Integration/CalcIntegration.vb
@@ -173,8 +173,12 @@ Public Module CalcIntegration
End If
If bDone Then
- ' se non sono in simulazione
+ ' se sono in simulazione
If bIsSimulation Then
+ ' aggiorno progetto
+ Dim sOriPath As String = Path.ChangeExtension(vBar(0).sBarPath, ".ori.bwe")
+ If File.Exists(vBar(0).sBarPath) Then File.Copy(vBar(0).sBarPath, sOriPath, True)
+ ' messaggio di completamento simulazione
callback(0, "Simulation closing", bCancel)
Else
' Dialog con Progress Bar
diff --git a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
index daef3981..e36aaf61 100644
--- a/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
+++ b/EgtBEAMWALL.Core/MachGroup Model/MyMachGroupM.vb
@@ -220,7 +220,7 @@ Public MustInherit Class MyMachGroupM
End Set
End Property
- Protected m_nProductionState As ItemState = 0
+ Protected m_nProductionState As ItemState = ItemState.ND
Public ReadOnly Property nProductionState As ItemState
Get
Return m_nProductionState
diff --git a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
index 7d1dbf63..bb2752b4 100644
--- a/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
+++ b/EgtBEAMWALL.Core/MachGroupPanel/PartVM.vb
@@ -205,6 +205,8 @@ Public MustInherit Class PartVM
Return Brushes.LightGray
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
Return Brushes.Green
+ ElseIf nProduction_State = ItemState.Scrapped Then
+ Return Brushes.Red
Else ' barra in coda
Return Brushes.White
End If
diff --git a/EgtBEAMWALL.DataLayer/Controllers/StatusMapController.cs b/EgtBEAMWALL.DataLayer/Controllers/StatusMapController.cs
index 948a86d9..76ec3358 100644
--- a/EgtBEAMWALL.DataLayer/Controllers/StatusMapController.cs
+++ b/EgtBEAMWALL.DataLayer/Controllers/StatusMapController.cs
@@ -218,14 +218,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
prodData = dbCtx
.StatusMapList
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.ItemId == ProdId)
- .SingleOrDefault();
+ .FirstOrDefault();
}
else
{
prodData = dbCtx
.StatusMapList
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.Session == Session)
- .SingleOrDefault();
+ .FirstOrDefault();
}
// se ho trovato
if (prodData != null)
diff --git a/EgtBEAMWALL.Supervisor/BTLParam/BTLFeatureVM.vb b/EgtBEAMWALL.Supervisor/BTLParam/BTLFeatureVM.vb
index ea2af965..ce4807d1 100644
--- a/EgtBEAMWALL.Supervisor/BTLParam/BTLFeatureVM.vb
+++ b/EgtBEAMWALL.Supervisor/BTLParam/BTLFeatureVM.vb
@@ -27,8 +27,6 @@ Public Class BTLFeatureVM
If EgtBeamEnableProcess(nFeatureId, value) Then
m_BTLFeatureM.bDO = value
EgtDraw()
- NotifyPropertyChanged("Calc_Background")
- NotifyPropertyChanged("bDO")
End If
End Set
End Property
diff --git a/EgtBEAMWALL.Supervisor/Constants/ConstBeam.vb b/EgtBEAMWALL.Supervisor/Constants/ConstBeam.vb
index 03b52970..140b0a07 100644
--- a/EgtBEAMWALL.Supervisor/Constants/ConstBeam.vb
+++ b/EgtBEAMWALL.Supervisor/Constants/ConstBeam.vb
@@ -202,6 +202,7 @@
Friend Const MGR_PRT_DES As String = "DES"
Friend Const MGR_PRT_STARTCUT As String = "STARTCUT"
Friend Const MGR_PRT_MATERIAL As String = "MATERIAL"
+ Friend Const MGR_PRT_DO As String = "DO"
Friend Const MGR_FTR_GRP As String = "GRP"
Friend Const MGR_FTR_PRC As String = "PRC"
diff --git a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj
index 5e6cba8d..f5bb460b 100644
--- a/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj
+++ b/EgtBEAMWALL.Supervisor/EgtBEAMWALL.Supervisor.vbproj
@@ -308,6 +308,10 @@
ViewPanelV.xaml
+
+ WaitingWndV.xaml
+
+ MSBuild:Compile
@@ -393,6 +397,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml
index a5c14bdf..858df0d8 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListV.xaml
@@ -2,8 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Supervisor"
- xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
- Visibility="{Binding FeatureList_Visibility}">
+ xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
-
+
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListVM.vb b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListVM.vb
index 6dc0c5ff..2f8129ea 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListVM.vb
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/FeatureInPartInRawPartListVM.vb
@@ -7,6 +7,8 @@ Public Class FeatureInPartInRawPartListVM
#Region "FIELDS & PROPERTIES"
+ Private m_colRedo As New EgtDataGridColumn("colREDO")
+
Private m_FeatureInPartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -49,12 +51,23 @@ Public Class FeatureInPartInRawPartListVM
Map.SetRefFeatureInPartInRawPartListVM(Me)
' carico le colonne della datagrid
Core.GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, FeatureInPartInRawPartColumns)
+ ' carico colonna Redo
+ Core.GetPrivateProfileColumn(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, m_colRedo)
+ m_colRedo.ColumnVisibility = Visibility.Visible
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
+ Public Sub AddColRedo()
+ FeatureInPartInRawPartColumns.Insert(0, m_colRedo)
+ End Sub
+
+ Public Sub RemoveColRedo()
+ FeatureInPartInRawPartColumns.Remove(m_colRedo)
+ End Sub
+
Sub SetFeatureListVisibility(bVisible As Boolean)
m_FeatureList_Visibility = If(bVisible, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(FeatureList_Visibility))
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelV.xaml
index 13fe2c44..e6bd0250 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelV.xaml
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelV.xaml
@@ -33,12 +33,12 @@
-
+ Style="{StaticResource LeftPanel_SmallButton}"/>
@@ -47,8 +47,9 @@
Style="{StaticResource LeftPanel_SmallButton}"/>
-
+
+
+
-
@@ -92,6 +94,6 @@
-
+ -->
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
index 3fa65c2e..29dedffd 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/LeftPanelVM.vb
@@ -28,6 +28,13 @@ Public Class LeftPanelVM
End Get
Set(value As Boolean)
m_bRestart = value
+ If value Then
+ Map.refPartInRawPartListVM.AddColRedo()
+ Map.refFeatureInPartInRawPartListVM.AddColRedo()
+ Else
+ Map.refPartInRawPartListVM.RemoveColRedo()
+ Map.refFeatureInPartInRawPartListVM.RemoveColRedo()
+ End If
NotifyPropertyChanged(NameOf(FeatureList_Visibility))
End Set
End Property
@@ -81,6 +88,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub DoneRawPart()
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
' scrivo tutti pezzi completati
@@ -110,6 +118,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub DeleteRawPart()
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
' se gia' prodotto, o in produzione non lo posso eliminare
@@ -143,6 +152,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub DonePart()
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup.SelPart) Then Return
@@ -214,8 +224,15 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub MoveUpRawPart()
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
- DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id, ItemState.Produced)
+ Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
+ If SelMachGroup.nProduction_State >= ItemState.WIP Or SelMachGroup.bReadyForMachining Then Return
+ Dim nSelMGIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(SelMachGroup)
+ If nSelMGIndex = 0 Then Return
+ Dim PreviousMG As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList(nSelMGIndex - 1)
+ If PreviousMG.nProduction_State >= ItemState.WIP Or PreviousMG.bReadyForMachining Then Return
+ Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(nSelMGIndex, nSelMGIndex - 1)
End Sub
#End Region ' MoveUpRawPart
@@ -238,8 +255,13 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub MoveDownRawPart()
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup) Then Return
- DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup.Id, ItemState.Produced)
+ Dim SelMachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup
+ If SelMachGroup.nProduction_State >= ItemState.WIP Or SelMachGroup.bReadyForMachining Then Return
+ Dim nSelMGIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(SelMachGroup)
+ If nSelMGIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1 Then Return
+ Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(nSelMGIndex, nSelMGIndex + 1)
End Sub
#End Region ' MoveDownRawPart
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListV.xaml b/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListV.xaml
index ebbf7632..7ef70a9e 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListV.xaml
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListV.xaml
@@ -24,6 +24,12 @@
-->
+
+
+
+
diff --git a/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListVM.vb b/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListVM.vb
index 386eba6b..13350f36 100644
--- a/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListVM.vb
+++ b/EgtBEAMWALL.Supervisor/LeftPanel/PartInRawPartListVM.vb
@@ -4,6 +4,8 @@ Imports EgtUILib
Public Class PartInRawPartListVM
+ Private m_colRedo As New EgtDataGridColumn("colREDO")
+
Private m_PartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property PartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -76,11 +78,22 @@ Public Class PartInRawPartListVM
Sub New()
'' aggiungo riferimento a map
- 'Map.SetRefPartInRawPartListVM(Me)
+ Map.SetRefPartInRawPartListVM(Me)
' carico le colonne della datagrid
Core.GetPrivateProfileColumns(S_PARTINRAWPARTLIST_SUPERVISOR, PartInRawPartColumns)
+ ' carico colonna Redo
+ Core.GetPrivateProfileColumn(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, m_colRedo)
+ m_colRedo.ColumnVisibility = Visibility.Visible
End Sub
#End Region ' CONSTRUCTOR
+ Public Sub AddColRedo()
+ PartInRawPartColumns.Insert(0, m_colRedo)
+ End Sub
+
+ Public Sub RemoveColRedo()
+ PartInRawPartColumns.Remove(m_colRedo)
+ End Sub
+
End Class
diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamMachGroupVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamMachGroupVM.vb
index d24281da..21918cdb 100644
--- a/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamMachGroupVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamMachGroupVM.vb
@@ -77,14 +77,49 @@ Public Class BeamMachGroupVM
' se gia' in produzione, non devo fare nulla
If m_bToBeProduced Then Return
SetResetWhileCutting(True)
+ If Map.refLeftPanelVM.bRestart Then
+ ' mando notifica ad eventuale ottimizzatore di salvare
+ DbControllers.m_StatusMapController.UpdateAction("", Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.SupervisorStopRequest, "")
+ ' aspetto risposta
+ Dim WaitingWnd As New WaitingWndV(Application.Current.MainWindow, New WaitingWndVM)
+ Dim WaitingResult As Boolean = WaitingWnd.ShowDialog()
+ If Not WaitingResult Then
+ Return
+ End If
+ ' ricarico progetto corrente
+ EgtOpenFile(Map.refSupervisorManagerVM.CurrProd.sProdPath)
+ ' creo nuova barra
+ Dim RedoMachGroupVM As MyMachGroupVM = RedoRawPart()
+ ' salvo progetto con nuova barra
+ Map.refSceneHostVM.SaveProject()
+ Dim MyMachGroupList As New List(Of MyMachGroupM)
+ If Not IsNothing(Map.refProjectVM.ProdMachGroupPanelVM) Then
+ For Each MachGroup In Map.refProjectVM.ProdMachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList
+ MyMachGroupList.Add(MachGroup)
+ Next
+ End If
+ ' aggiorno pezzi su Db
+ DbControllers.m_ProdController.UpdateMachGroup(Map.refSupervisorManagerVM.CurrProd.nProdId, MyMachGroupList)
+ ' mando notifica di barra creata (sblocco ottimizzatore)
+ DbControllers.m_StatusMapController.UpdateAction("", Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.SupervisorReleaseStop, "")
+ ' resetto eventuali stati di ripartenza
+ If bResetWhileCutting Then
+ SetResetWhileCutting(False)
+ If Map.refLeftPanelVM.bRestart Then
+ Map.refLeftPanelVM.bRestart = False
+ End If
+ End If
+ '' lancio produzione del nuovo
+ 'RedoMachGroupVM.ProduceMachGroup()
+ Return
+ End If
' se lavorazione interrotta da reset
- If bResetWhileCutting Then
+ If bResetWhileCutting And Not Map.refLeftPanelVM.bRestart Then
' chiedo se riprendere o rimandare i pezzi non fatti all'ottimizzatore
If MessageBox.Show("Riprendere lavorazione barra corrente?", "", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
' se ripresa, mostro lista feature e colonne Redo
Map.refLeftPanelVM.bRestart = True
- ' creo nuova barra
- RedoRawPart()
+ Return
End If
End If
' cerco primo indice di pezzo non in produzione
@@ -97,37 +132,13 @@ Public Class BeamMachGroupVM
' sposto MachGroup in lista come ultimo dei pronti da produrre
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me)
- DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex)
+ DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, Id, NewIndex + 1)
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex)
NotifyPropertyChanged(NameOf(Produce_IsEnabled))
- ' resetto eventuali stati di ripartenza
- SetResetWhileCutting(False)
- Map.refLeftPanelVM.bRestart = False
End Sub
- Public Sub RedoRawPart()
- If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return
- 'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
- 'If IsNothing(SelPart) Then Return
- '' verifico se sono gia' stati messi tutti i pezzi richiesti
- 'If Not VerifyPartCount(SelPart) Then Return
- '' chiedo lunghezza grezzo
- 'Dim dRawL As Double = SelPart.dL
- 'Dim dRawW As Double = SelPart.dW
- 'Dim dStartOffset As Double = 0
- 'Dim dKerf As Double = 0
- 'Dim sWarehouseIniPath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
- 'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
- ' dStartOffset = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_BEAM, WRH_STARTOFFSET, 0, sWarehouseIniPath)
- ' dRawL += dStartOffset
- 'Else
- ' dKerf = EgtUILib.GenInterface.GetPrivateProfileDouble(WRH_WALL, WRH_KERF, 0, sWarehouseIniPath)
- ' dRawL += 2 * dKerf
- ' dRawW += 2 * dKerf
- 'End If
- 'Dim AddRawPartWndVM As New AddRawPartWndVM(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dRawL, dRawW, dStartOffset)
- 'Dim AddRawPartWnd As New AddRawPartWndV(Application.Current.MainWindow, AddRawPartWndVM)
- 'If Not AddRawPartWnd.ShowDialog() Then Return
+ Public Function RedoRawPart() As MyMachGroupVM
+ If IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Return Nothing
' creo nuovo gruppo di lavorazione
Map.refProjectVM.ProdMachGroupPanelVM.AddMachGroup()
Dim nCurrMachGroup As Integer = EgtGetCurrMachGroup()
@@ -147,36 +158,36 @@ Public Class BeamMachGroupVM
Next
' analizzo barra di origine
Dim dInitialCutOut As Double = 0
- Dim nFirstPartIndex As Integer = 0
- For Index = 0 To PartVMList.Count - 1
- Dim CurrPart As BeamVM = PartVMList(Index)
- If CurrPart.bRedo Then
- nFirstPartIndex = Index
+ ' scrivo dati costruzione grezzo in gruppo di lavorazione
+ Dim nDone As Integer = 0
+ For Index = 0 To m_PartVMList.Count - 1
+ Dim CurrPart As BeamVM = m_PartVMList(Index)
+ If CurrPart.bDO Then
+ nDone += 1
+ ' creo copia del pezzo
+ Dim nPartDuploId As Integer = EgtDuploNew(PartList(Index))
+ ' elimino valori calcolo dell'originale
+ MyMachGroupPanelVM.DuploRemoveProjCalc(nPartDuploId)
+ ' lo rendo std
+ EgtSetMode(nPartDuploId, GDB_MD.STD)
+ ' scrivo dati costruzione grezzo in gruppo di lavorazione
+ EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nDone, nPartDuploId & "," & CurrPart.sPOSX - dInitialCutOut)
Else
dInitialCutOut += CurrPart.dOffset + CurrPart.dL
End If
Next
- ' scrivo dati costruzione grezzo in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dL - dInitialCutOut)
- For Index = nFirstPartIndex To m_PartVMList.Count - 1
- ' creo copia del pezzo
- Dim nPartDuploId As Integer = EgtDuploNew(PartList(Index))
- ' elimino valori calcolo dell'originale
- MyMachGroupPanelVM.DuploRemoveProjCalc(nPartDuploId)
- ' lo rendo std
- EgtSetMode(nPartDuploId, GDB_MD.STD)
- ' scrivo dati costruzione grezzo in gruppo di lavorazione
- EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1, nPartDuploId & "," & m_PartVMList(Index).sPOSX)
- Next
- Dim BeamMachGroup As BeamMachGroupVM = Map.refMachGroupPanelVM.GetLastMachGroup()
+ Dim BeamMachGroup As BeamMachGroupVM = Map.refProjectVM.ProdMachGroupPanelVM.GetLastMachGroup()
' eseguo script creazione grezzo
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdType.RAWPART, False) Then
BeamMachGroup.DeleteMachGroup()
- Dim LogFile As String() = File.ReadAllLines(sLogPath)
- If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
- MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
+ If File.Exists(sLogPath) Then
+ Dim LogFile As String() = File.ReadAllLines(sLogPath)
+ If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
+ MessageBox.Show(LogFile(1), EgtMsg(30007), MessageBoxButton.OK, MessageBoxImage.Error)
+ End If
End If
- Return
+ Return Nothing
End If
'aggiorno lista pezzi
BeamMachGroup.m_BeamMachGroupM.RefreshPartList()
@@ -185,26 +196,29 @@ Public Class BeamMachGroupVM
''BeamMachGroup.UpdateUsage()
EgtSetView(VT.ISO_SW, False)
' segno pezzi non completati come scrap
- For Index = nFirstPartIndex To m_PartVMList.Count - 1
- Dim Part As PartVM = m_PartVMList(Index)
- Dim nP_Prod As Integer = Map.refSupervisorManagerVM.CurrProd.nProdId
- Dim nP_Machgroup As Integer = Id
- Dim nP_Part As Integer = m_PartVMList(Index).nPartId
- DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, DateTime.MinValue)
- DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Scrapped)
- ' scrivo stato end
- Part.nProduction_State = 2
- Part.dtEndTime = DateTime.MinValue
- Part.NotifyPropertyChanged(NameOf(Part.nCALC_State))
- ' resetto stato redo
- Part.bRedo = False
- ' scrivo data end su Db barra
- DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, DateTime.MinValue)
- DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
- ' scrivo stato end
- MyMachGroupM.SetProductionState(2)
- dtEndTime = DateTime.MinValue
- NotifyPropertyChanged(NameOf(nCALC_State))
+ For Index = 0 To m_PartVMList.Count - 1
+ Dim CurrPart As BeamVM = m_PartVMList(Index)
+ If CurrPart.bDO Then
+ Dim Part As PartVM = m_PartVMList(Index)
+ Dim nP_Prod As Integer = Map.refSupervisorManagerVM.CurrProd.nProdId
+ Dim nP_Machgroup As Integer = Id
+ Dim nP_Part As Integer = m_PartVMList(Index).nPartId
+ DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, DateTime.MinValue)
+ DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Scrapped)
+ ' scrivo stato end
+ Part.nProduction_State = 2
+ Part.dtEndTime = DateTime.MinValue
+ Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
+ ' resetto stato redo
+ Part.bRedo = False
+ ' scrivo data end su Db barra
+ DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, DateTime.MinValue)
+ DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
+ ' scrivo stato end
+ MyMachGroupM.SetProductionState(2)
+ dtEndTime = DateTime.MinValue
+ NotifyPropertyChanged(NameOf(nProduction_State))
+ End If
Next
MachGroup = BeamMachGroup
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
@@ -242,12 +256,16 @@ Public Class BeamMachGroupVM
'WallMachGroup.UpdateUsage()
'EgtSetView(VT.TOP, False)
End If
+ 'passo machgroup a supervisor su Db
+ DbControllers.m_MachGroupController.UpdateSupervisor(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, DbControllers.m_SupervisorId)
+ DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, 10000)
' aggiungo Machgroup a lista supervisor
If Not IsNothing(MachGroup) Then Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(MachGroup)
' lo posiziono subito dopo il gruppo di ripartenza (devo cambiare indice anche su DB??)
- Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1, Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me))
+ Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1, Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(Me) + 1)
EgtZoom(ZM.ALL)
- End Sub
+ Return MachGroup
+ End Function
#End Region ' ProduceMachGroup
diff --git a/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamVM.vb b/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamVM.vb
index eb7a0a2a..69b2ed63 100644
--- a/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamVM.vb
+++ b/EgtBEAMWALL.Supervisor/MachGroupPanel/BeamVM.vb
@@ -7,6 +7,17 @@ Imports EgtWPFLib5
Public Class BeamVM
Inherits Core.BeamVM
+ Private m_bDo As Boolean
+ Public Property bDO As Boolean
+ Get
+ Return m_bDo
+ End Get
+ Set(value As Boolean)
+ m_bDo = value
+ EgtSetInfo(m_BeamM.nPartId, MGR_PRT_DO, If(value, 1, 0))
+ End Set
+ End Property
+
#Region "CONSTRUCTOR"
Sub New(BeamM As BeamM, ParentMachGroupVM As BeamMachGroupVM)
diff --git a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
index 1989b791..0f9e5a06 100644
--- a/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
+++ b/EgtBEAMWALL.Supervisor/MainWindow/MainWindowVM.vb
@@ -88,6 +88,8 @@ Public Class MainWindowVM
' apro in modalita' VIEW
' Map.refMainMenuVM.SelPage = Pages.VIEW
+ Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.FeatureList_Visibility))
+
' inizializzo thread di aggiornamento e comunicazione con DB
' creo thread gestione macchina
diff --git a/EgtBEAMWALL.Supervisor/Utility/Map.vb b/EgtBEAMWALL.Supervisor/Utility/Map.vb
index f7c745ee..81a212b2 100644
--- a/EgtBEAMWALL.Supervisor/Utility/Map.vb
+++ b/EgtBEAMWALL.Supervisor/Utility/Map.vb
@@ -27,6 +27,7 @@ Module Map
Private m_refCALCPanelVM As CALCPanelVM
Private m_refSupervisorMachGroupPanelVM As SupervisorMachGroupPanelVM
Private m_refFeatureInPartInRawPartListVM As FeatureInPartInRawPartListVM
+ Private m_refPartInRawPartListVM As PartInRawPartListVM
#Region "Get"
@@ -191,6 +192,12 @@ Module Map
End Get
End Property
+ Public ReadOnly Property refPartInRawPartListVM As PartInRawPartListVM
+ Get
+ Return m_refPartInRawPartListVM
+ End Get
+ End Property
+
Public ReadOnly Property refMachManaging As MachManaging
Get
Return m_refMachManaging
@@ -336,6 +343,11 @@ Module Map
Return Not IsNothing(m_refFeatureInPartInRawPartListVM)
End Function
+ Friend Function SetRefPartInRawPartListVM(PartInRawPartListVM As PartInRawPartListVM) As Boolean
+ m_refPartInRawPartListVM = PartInRawPartListVM
+ Return Not IsNothing(m_refPartInRawPartListVM)
+ End Function
+
#End Region ' Set
#Region "Init"
@@ -357,6 +369,7 @@ Module Map
Return Not IsNothing(m_refMainWindowVM) AndAlso 'Not IsNothing(m_refMainMenuVM) AndAlso
Not IsNothing(LibMap.refStatusBarVM) AndAlso 'Not IsNothing(m_refProjManagerVM) AndAlso Not IsNothing(m_refProdManagerVM) AndAlso
Not IsNothing(m_refConfigurationPageVM) AndAlso Not IsNothing(m_refFeatureInPartInRawPartListVM) AndAlso
+ Not IsNothing(m_refPartInRawPartListVM) AndAlso
Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM) AndAlso 'Not IsNothing(m_refRawPartListVM) AndAlso Not IsNothing(m_refWarehouseWndVM) AndAlso Not IsNothing(m_refShowBeamPanelVM) AndAlso
Not IsNothing(m_refMachCommandMessagePanelVM) AndAlso LibMap.EndInit()
diff --git a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb
index f3ad2bb8..f5cd82c1 100644
--- a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb
+++ b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerComm.vb
@@ -45,6 +45,8 @@ Public Class ViewerOptimizerComm
Map.refProjectVM.SupervisorMachGroupPanelVM.AddMachGroupToSupervisor(Map.refProjectVM.ProdMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = MachGroupModification.ItemId))
End If
End Select
+ ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm AndAlso MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
+ ViewerOptimizerCommThread.SetViewerOptimizerBlocked(True)
End If
Next
' se devo ricaricare il file
diff --git a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerCommThread.vb b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerCommThread.vb
index 282b3aee..693ffd69 100644
--- a/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerCommThread.vb
+++ b/EgtBEAMWALL.Supervisor/ViewerOptimizerCommThread/ViewerOptimizerCommThread.vb
@@ -3,6 +3,16 @@
' variabile che ferma il ciclo
Private Shared m_Stop As Boolean = False
+ Private Shared m_bViewerOptimizerBlocked As Boolean = False
+ Public Shared ReadOnly Property bViewerOptimizerBlocked As Boolean
+ Get
+ Return m_bViewerOptimizerBlocked
+ End Get
+ End Property
+ Friend Shared Sub SetViewerOptimizerBlocked(value As Boolean)
+ m_bViewerOptimizerBlocked = value
+ End Sub
+
Friend Shared Sub StopThread()
m_Stop = True
End Sub
diff --git a/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml
new file mode 100644
index 00000000..024921ce
--- /dev/null
+++ b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml.vb b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml.vb
new file mode 100644
index 00000000..47e4271a
--- /dev/null
+++ b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndV.xaml.vb
@@ -0,0 +1,18 @@
+Public Class WaitingWndV
+
+ Private WithEvents m_WaitingWndVM As WaitingWndVM
+
+ Sub New(Owner As Window, WaitingWndVM As WaitingWndVM)
+ MyBase.New(Owner)
+ ' This call is required by the designer.
+ InitializeComponent()
+ Me.DataContext = WaitingWndVM
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ m_WaitingWndVM = WaitingWndVM
+ End Sub
+
+ Private Sub CloseWindow(bDialogResult As Boolean) Handles m_WaitingWndVM.m_CloseWindow
+ Me.DialogResult = bDialogResult
+ End Sub
+
+End Class
diff --git a/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndVM.vb b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndVM.vb
new file mode 100644
index 00000000..e6071662
--- /dev/null
+++ b/EgtBEAMWALL.Supervisor/WaitingWnd/WaitingWndVM.vb
@@ -0,0 +1,37 @@
+Imports System.Windows.Threading
+
+Public Class WaitingWndVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Friend Event m_CloseWindow(bDialogResult As Boolean)
+
+ Private m_Waiting_Timer As New DispatcherTimer
+
+ Private m_nProgress_Value As Integer = 0
+ Public ReadOnly Property nProgress_Value As Integer
+ Get
+ Return m_nProgress_Value
+ End Get
+ End Property
+
+#End Region ' FIELDS & PROPERTIES
+
+ Sub New()
+ ' avvio contatore
+ m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(500)
+ AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
+ m_Waiting_Timer.Start()
+ End Sub
+
+ Private Sub WaitingTimer_Tick()
+ m_nProgress_Value += 1
+ NotifyPropertyChanged(NameOf(nProgress_Value))
+ If ViewerOptimizerCommThread.bViewerOptimizerBlocked Then 'OrElse nProgress_Value = 20 Then
+ m_Waiting_Timer.Stop()
+ RaiseEvent m_CloseWindow(True)
+ End If
+ End Sub
+
+End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
index 1c3c23b9..1d9b76b7 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLPartVM.vb
@@ -366,10 +366,39 @@ Public Class BTLPartVM
Return m_BTLPartM.sMATERIAL
End Get
Set(value As String)
- If EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_MATERIAL, value) Then
- m_BTLPartM.sMATERIAL = value
+ If value <> m_BTLPartM.sMATERIAL Then
+ If EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_MATERIAL, value) Then
+ ' verifico se ci sono altri pezzi con la sezione vecchia
+ Dim bOtherSection As Boolean = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot Me AndAlso x.Section = Section)
+ Dim OldSection As SectionXMaterial
+ If Not bOtherSection Then
+ ' recupero indice
+ OldSection = Map.refProjectVM.BTLStructureVM.SectionList.FirstOrDefault(Function(x) x = Section)
+ End If
+ m_BTLPartM.sMATERIAL = value
+ ' aggiorno sezione
+ If bOtherSection Then
+ ' se sezione nuova non presente
+ If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(Section) Then
+ ' creo nuova sezione
+ Map.refProjectVM.BTLStructureVM.SectionList.Add(Section)
+ End If
+ Else
+ ' se sezione nuova gia' presente
+ If Map.refProjectVM.BTLStructureVM.SectionList.Contains(Section) Then
+ ' cancello sezione vecchia
+ Map.refProjectVM.BTLStructureVM.SectionList.Remove(OldSection)
+ Else
+ ' altrimenti la modifico
+ If Not IsNothing(OldSection) Then
+ OldSection.sMaterial.Clear()
+ OldSection.sMaterial.Add(sMATERIAL)
+ End If
+ End If
+ End If
+ End If
+ NotifyPropertyChanged(NameOf(sMATERIAL))
End If
- NotifyPropertyChanged(NameOf(sMATERIAL))
End Set
End Property
@@ -1105,6 +1134,7 @@ Public Class BTLPartVM
Public ReadOnly Property sCALC_MSG As String
Get
+ NotifyPropertyChanged(NameOf(CALC_MSG_Visibility))
Return m_BTLPartM.sCALC_MSG
End Get
End Property
@@ -1209,6 +1239,12 @@ Public Class BTLPartVM
End Get
End Property
+ Public ReadOnly Property CALC_MSG_Visibility As Visibility
+ Get
+ Return If(String.IsNullOrWhiteSpace(m_BTLPartM.sCALC_MSG), Visibility.Collapsed, Visibility.Visible)
+ End Get
+ End Property
+
Public ReadOnly Property Section As SectionXMaterial
Get
Dim frBeam As New Frame3d
@@ -1671,7 +1707,7 @@ Public Class BTLPartVM
m_BTLPartM.nGlobalState = nState
For Each Feature In BTLFeatureVMList
If Not Feature.bDO Then
- ElseIf Feature.nState = CalcStates.NOTCALCULATED Then
+ ElseIf Feature.nState = CalcStates.NOTCALCULATED And (m_BTLPartM.nGlobalState = CalcStates.OK Or m_BTLPartM.nGlobalState = CalcStates.INFO) Then
m_BTLPartM.nGlobalState = CalcStates.NOTCALCULATED
Exit For
ElseIf Feature.nState = CalcStates.INFO And m_BTLPartM.nGlobalState = CalcStates.OK Then
diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
index 72a534fb..a1e4b66e 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/BTLParam/BTLStructureVM.vb
@@ -937,8 +937,8 @@ Public Class BTLStructureVM
Private Sub OnBTLPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case NameOf(sender.sMATERIAL)
- If Not MaterialList.Contains(sender.m_sMATERIAL) Then
- MaterialList.Add(sender.m_sMATERIAL)
+ If Not MaterialList.Contains(sender.sMATERIAL) Then
+ MaterialList.Add(sender.sMATERIAL)
End If
Case NameOf(sender.sW), NameOf(sender.sH), NameOf(sender.sL)
'If Not SectionList.Contains(sender.Section) Then
diff --git a/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml
new file mode 100644
index 00000000..17eae615
--- /dev/null
+++ b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml.vb
new file mode 100644
index 00000000..07d2074b
--- /dev/null
+++ b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndV.xaml.vb
@@ -0,0 +1,18 @@
+Public Class BlockedWndV
+
+ Private WithEvents m_BlockedWndVM As BlockedWndVM
+
+ Sub New(Owner As Window, BlockedWndVM As BlockedWndVM)
+ MyBase.New(Owner)
+ ' This call is required by the designer.
+ InitializeComponent()
+ Me.DataContext = BlockedWndVM
+ ' Assegno al riferimento locale al VM il VM preso dal DataContext
+ m_BlockedWndVM = BlockedWndVM
+ End Sub
+
+ Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BlockedWndVM.m_CloseWindow
+ Me.DialogResult = bDialogResult
+ End Sub
+
+End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndVM.vb b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndVM.vb
new file mode 100644
index 00000000..57beed04
--- /dev/null
+++ b/EgtBEAMWALL.ViewerOptimizer/BlockedWnd/BlockedWndVM.vb
@@ -0,0 +1,119 @@
+Imports System.Windows.Threading
+Imports EgtBEAMWALL.Core
+Imports EgtUILib
+
+Public Class BlockedWndVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Friend Event m_CloseWindow(bDialogResult As Boolean)
+
+ Private m_Waiting_Timer As New DispatcherTimer
+
+ Private m_Msg_Text As String
+ Public ReadOnly Property Msg_Text As String
+ Get
+ Return m_Msg_Text
+ End Get
+ End Property
+
+ Private m_Buttons_Visibility As Visibility = Visibility.Visible
+ Public ReadOnly Property Buttons_Visibility As Visibility
+ Get
+ Return m_Buttons_Visibility
+ End Get
+ End Property
+
+ Private m_nIndex As Integer = 0
+
+ ' Definizione comandi
+ Private m_cmdSave As ICommand
+ Private m_cmdDoNotSave As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+ Sub New()
+ m_Msg_Text = "Ottimizzatore bloccato per ricalcolo trave. Salvare le modifiche apportate al progetto?"
+ NotifyPropertyChanged(NameOf(Msg_Text))
+ ' avvio contatore
+ m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(500)
+ AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
+ m_Waiting_Timer.Start()
+ End Sub
+
+ Private Sub WaitingTimer_Tick()
+ m_nIndex += 1
+
+ If m_nIndex = 17 Then
+ m_Msg_Text = "In attesa del ricalcolo da parte del supervisore."
+ m_Buttons_Visibility = Visibility.Collapsed
+ NotifyPropertyChanged(NameOf(Buttons_Visibility))
+ NotifyPropertyChanged(NameOf(Msg_Text))
+ ElseIf m_nIndex > 17 Then
+ If m_Waiting_Timer.IsEnabled Then m_Waiting_Timer.Stop()
+ If Not SupervisorCommThread.bViewerOptimizerBlocked Then
+ ' ricarico progetto
+ Dim sCurrFilePath As String = ""
+ EgtGetCurrFilePath(sCurrFilePath)
+ EgtOpenFile(sCurrFilePath)
+ RaiseEvent m_CloseWindow(True)
+ End If
+ End If
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "Save"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property Save_Command As ICommand
+ Get
+ If m_cmdSave Is Nothing Then
+ m_cmdSave = New Command(AddressOf Save)
+ End If
+ Return m_cmdSave
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub Save()
+ ' salvo progetto
+ Map.refProdManagerVM.Save()
+ ' mando messaggio di blocco avvenuto
+ DbControllers.m_StatusMapController.UpdateAction("", Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
+ End Sub
+
+#End Region ' Save
+
+#Region "DoNotSave"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property DoNotSave_Command As ICommand
+ Get
+ If m_cmdDoNotSave Is Nothing Then
+ m_cmdDoNotSave = New Command(AddressOf DoNotSave)
+ End If
+ Return m_cmdDoNotSave
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub DoNotSave()
+ ' mando messaggio di blocco avvenuto
+ DbControllers.m_StatusMapController.UpdateAction("", Map.refProdManagerVM.CurrProd.nProdId, Map.refProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
+ End Sub
+
+#End Region ' DoNotSave
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml
index 9c4925de..b3cf68a2 100644
--- a/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/BottomPanel/BottomPanelV.xaml
@@ -5,7 +5,7 @@
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
Height="350"
Visibility="{Binding BottomPanel_Visibility}">
-
+
-
-
+
+
+
+
+
+
-
+
+
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj
index 3eceb3e9..fe932610 100644
--- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj
+++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj
@@ -159,6 +159,10 @@
+
+ BlockedWndV.xaml
+
+ BTLDataV.xaml
@@ -348,6 +352,10 @@
MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
diff --git a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
index b745dab5..427bf2c1 100644
--- a/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/LeftPanel/LeftPanelV.xaml
@@ -47,6 +47,12 @@
+