diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
index 39263179..093e9401 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/InstrumentPanelV.xaml
@@ -45,19 +45,21 @@
-
+
-
+
diff --git a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
index 4ab07367..c930c58e 100644
--- a/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/InstrumentPanel/MyInstrumentPanelVM.vb
@@ -97,6 +97,17 @@ Public Class MyInstrumentPanelVM
NotifyPropertyChanged(NameOf(Statistics_IsChecked))
End Sub
+ Private m_VisStatistics_IsChecked As Boolean = False
+ Public Property VisStatistics_IsChecked As Boolean
+ Get
+ Return m_VisStatistics_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_VisStatistics_IsChecked = value
+ NotifyPropertyChanged(NameOf(VisStatistics_IsChecked))
+ End Set
+ End Property
+
Private m_VisStatistic_IsEnabled As Boolean = True
Public Property VisStatistic_IsEnabled As Boolean
Get
@@ -107,34 +118,6 @@ Public Class MyInstrumentPanelVM
End Set
End Property
- Private m_VisStatistic_IsChecked As Boolean = False
- Public Property VisStatistic_IsChecked As Boolean
- Get
- Return m_VisStatistic_IsChecked
- End Get
- Set(value As Boolean)
- m_VisStatistic_IsChecked = value
- m_OtStatistic_IsChecked = False
- If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
- If value Then
- ' salvo pagina precedente
- m_PrevBottomPanelPage = Map.refBottomPanelVM.SelPartFeatureTab
- ' aggiorno valori totali
- Map.refProjectVM.BTLStructureVM.CalcGlobalUpdate()
- ' seleziono pagina Statistics
- Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STATISTICS)
- Else
- ' seleziono pagina precedente
- Map.refBottomPanelVM.SetSelPartFeatureTab(m_PrevBottomPanelPage)
- End If
- End If
- End Set
- End Property
- Friend Sub SetVisStatistic_IsChecked(value As Boolean)
- m_VisStatistic_IsChecked = value
- NotifyPropertyChanged(NameOf(VisStatistic_IsChecked))
- End Sub
-
Private m_OtStatistic_IsEnabled As Boolean = True
Public Property OtStatistic_IsEnabled As Boolean
Get
@@ -145,33 +128,17 @@ Public Class MyInstrumentPanelVM
End Set
End Property
- Private m_OtStatistic_IsChecked As Boolean = False
- Public Property OtStatistic_IsChecked As Boolean
+ Private m_OtStatistics_IsChecked As Boolean = False
+ Public Property OtStatistics_IsChecked As Boolean
Get
- Return m_OtStatistic_IsChecked
+ Return m_OtStatistics_IsChecked
End Get
Set(value As Boolean)
- m_OtStatistic_IsChecked = value
- m_VisStatistic_IsChecked = False
- If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
- If value Then
- ' aggiorno valori totali
- If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
- ' aggiorno conto materiali usati
- If Not IsNothing(ProjectManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
- ' seleziono pagina Statistics
- Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.STATISTICS)
- Else
- ' seleziono pagina precedente
- Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.OPTIMIZATION)
- End If
- End If
+ m_OtStatistics_IsChecked = value
+ NotifyPropertyChanged(NameOf(OtStatistics_IsChecked))
End Set
End Property
- Friend Sub SetOtStatistic_IsChecked(value As Boolean)
- m_OtStatistic_IsChecked = value
- NotifyPropertyChanged(NameOf(OtStatistic_IsChecked))
- End Sub
+
' Definizione comandi
Private m_cmdData As ICommand
@@ -412,8 +379,8 @@ Public Class MyInstrumentPanelVM
''' Execute the Open. This method is invoked by the OpenCommand.
'''
Friend Sub Optimizer()
- Dim StatisticsWndV As New OptimizerStatisticsWndV(Application.Current.MainWindow, New StatisticsVM())
- StatisticsWndV.ShowDialog()
+ Dim OptimizerStatisticsWndV As New OptimizerStatisticsWndV(Application.Current.MainWindow, New StatisticsVM())
+ OptimizerStatisticsWndV.ShowDialog()
End Sub
#End Region ' Visualization
diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb
index c43a3cbf..3fe43b3b 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/PDFHelper.vb
@@ -49,10 +49,10 @@ Module PDFHelper
' document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics"
'End Select
- If ActivePage = Pages.VIEW OrElse ActivePage = Pages.ONLYPRODPAGE Then
+ If ActivePage = Pages.VIEW OrElse (ActivePage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.VisStatistics_IsChecked) Then
Project = ProjectManagerVM.CurrProj
document.Info.Title = Project.sProjId & " - " & Project.BTLFileName_Msg & " - Statistics"
- ElseIf ActivePage = Pages.MACHINING OrElse ActivePage = Pages.ONLYPRODPAGE Then
+ ElseIf ActivePage = Pages.MACHINING OrElse (ActivePage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.OtStatistics_IsChecked) Then
Project = ProjectManagerVM.CurrProd
document.Info.Title = Project.sProdId & " - " & Project.ListName_Msg & " - Statistics"
End If
@@ -72,10 +72,10 @@ Module PDFHelper
' DefineRawPartPictures(document)
' End If
'End Select
- If ActivePage = Pages.VIEW OrElse ActivePage = Pages.ONLYPRODPAGE Then
+ If ActivePage = Pages.VIEW OrElse (ActivePage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.VisStatistics_IsChecked) Then
DefinePartTotals(document)
DefineItemList(document, ListTypes.PART)
- ElseIf ActivePage = Pages.MACHINING OrElse ActivePage = Pages.ONLYPRODPAGE Then
+ ElseIf ActivePage = Pages.MACHINING OrElse (ActivePage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.OtStatistics_IsChecked) Then
DefineMachGroupTotals(document)
DefineItemList(document, ListTypes.MACHGROUP)
DefineItemList(document, ListTypes.RAWPART)
diff --git a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
index 0db6f6ec..61b9ce55 100644
--- a/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/Statistics/StatisticsVM.vb
@@ -358,20 +358,13 @@ Public Class StatisticsVM
' PrevSelect()
'End Select
- If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
- If Not IsNothing(Map.refProjManagerVM) Then
- sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf"
- Else
- sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "StatisticsOnlyProdPage.pdf"
- End If
- ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
- If Not IsNothing(Map.refProdManagerVM) Then
- sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf"
- PrevSelect()
- Else
- sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "StatisticsOnlyProdPage.pdf"
- PrevSelect()
- End If
+ If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.VisStatistics_IsChecked) Then
+ sFileName = ProjectManagerVM.CurrProj.sProjDirPath & "\" & "Statistics.pdf"
+ Map.refInstrumentPanelVM.VisStatistics_IsChecked = False
+ ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refInstrumentPanelVM.OtStatistics_IsChecked) Then
+ sFileName = ProjectManagerVM.CurrProd.sProdDirPath & "\" & ProjectManagerVM.CurrProd.sProdId & " - " & "Statistics.pdf"
+ PrevSelect()
+ Map.refInstrumentPanelVM.OtStatistics_IsChecked = False
End If
renderer.PdfDocument.Save(sFileName)
diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml.vb
index 97564222..4983f9d2 100644
--- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/OptimizerStatisticsWndV.xaml.vb
@@ -15,6 +15,7 @@
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_StatisticsVM.m_CloseWindow
Me.DialogResult = bDialogResult
+ Map.refInstrumentPanelVM.OtStatistics_IsChecked = False
End Sub
End Class
diff --git a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml.vb
index cf214b49..edfa031b 100644
--- a/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml.vb
+++ b/EgtBEAMWALL.ViewerOptimizer/StatisticsWnd/StatisticsWndV.xaml.vb
@@ -15,6 +15,7 @@
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_StatisticsVM.m_CloseWindow
Me.DialogResult = bDialogResult
+ Map.refInstrumentPanelVM.VisStatistics_IsChecked = False
End Sub
End Class